Logistic Regression Coefficient Interpretation for more than 2 dummy variables

Question: I'm not too sure how to interpret the coefficients of a variable that has more than 2 levels. Please note that my model contains explanatory variables that are  numeric, binary, and with multiple category
Given that my response variable $$0 = \text{no late debt payment} , 1 = \text{has late debt payment}$$ and one of my x variables in the model is education level given by:
$$
1 = \text{no high school diploma/GED} \\
2 = \text{has high school diploma/GED}\\
3 = \text{some college education}\\
4 = \text{College education.}
$$
So, in the R glm output (family = "binomial), the coefficients for the dummy variables are:
$$
 \text{EDCL2}= 0.48430 \\
 \text{EDCL3}= 0.89571 \\
 \text{EDCL4}= 0.45851 \\
...
$$
After exponentiating them, they are :
$$
 \text{EDCL2}= 1.56 \\
 \text{EDCL3}= 2.36 \\
 \text{EDCL4}= 1.38 \\
...
$$
So my interpretation is as follows:
EDCL2: Implies that a respondent that has completed high school education is about 1.56 times as likely to have a late debt payment as a respondent that has NOT completed high school.
EDCL3: Implies that a respondent that has some college education is about 2.69 times as likely to have a late debt payment as a respondent that has NOT completed high school.
EDCL3: Implies that a respondent that has some college education is about 1.38 times as likely to have a late debt payment as a respondent that has NOT completed high school.
Is this interpretation correct? I know that it may be more complex than that and what would be the right way to interpret this data? Any help is appreciated. THANK YOU!
Answer: The original coefficients are additive on the log-odds scale, so the exponentiated coefficients ARE multiplicative, but on the odds scale. "... (T)imes as likely" is not accurate.
For example, the odds that a six-sided die will come up "1" on the next roll is 1:5 or 0.2, whereas the odds that it will come up either "1" or "2" is 2:4 or 0.5 -- more than doubled.
For another example, lets say the prevalence of a rare disease is 1 in 1 million people. Then the odds a person has the disease is 1:999,999. If someone's odds were increased by a factor of 10, due to some condition, then their odds would be 10:999,999 and their chances would be 10 in 1,000,009, which is nearly ten times, but not quite.
These two examples show that the intercept makes a difference here; these coefficients alone don't allow us to say how much more likely late debt payment is in groups 2 through 4 than group 1. It would be valid to say that the estimated log-odds are 0.48 larger in group 2 than group 1 and (equivalently) that the estimated odds are 1.56 times larger in group 2 than group 1.


Criando e Consumindo uma REST API

Question: Bom dia, estou tentando criar uma API, para fazer uma validação de usuario e senha, para utilizar no xamarin. Mas eu estou com duvidas, se eu quiser buscar um usuario x e uma senha x no banco de dados eu devo, passar todos os usuarios e senhas para um site ou existe alguma forma de realizar apenas a consulta de usuario x e essa senha x e apenas retornar esses dados de forma dinamica ? Desculpa se a pergunta ficou meio vaga, mas minha duvida está na logica, não estou entendendo muito bem com a API vai se comunicar de forma dinamica com o banco de dados.
Comment: Não acho seguro transmitir usuário e senha pela web. [Eis uma alternativa que acredito ser mais segura](https://docs.microsoft.com/pt-br/xamarin/xamarin-forms/data-cloud/authentication/oauth)
Answer: Olá, minha sugestão é que você crie uma api Rest Full, aplique algumas regras de segurança como criptografar os dados enviados guardando as chaves no app e no server REST, sobre a segurança se a API restfull for bem desenvolvida é seguro sim. Atualmente é uma das melhores formas de comunicar aplicativos com DBs.
Answer: Utilizando uma API:

Mobile:envia os dados da tentativa de login (login e senha) para a API
API: realiza a consulta no banco de dados para verificar se existe uma entrada para usuário e senha informados (SELECT * FROM user u WHERE u.login = '[login enviado]' AND u.senha='[senha digitada]' . Retornará o resultado da consulta (se houve ou não resultado)
Mobile: exibe o resultado da tentativa (se existe ou não o usuário com a senha no banco)

Criando e Consumindo uma REST API


Notification of new comments for author and comment writers

Question: I'm trying to implement a rule (in D7) that will automatically (no check box or opting out):

send an email to the author of node if new comments
send email to all users who have commented on that node
not send email to author of own comment

I did find instructions for one of the above, but not for all of them in the same rules. And this is where I failed.
Any help?
Comment: You don't need to use the conditional rules module for this. Loop the comment authors and send each one and the current author to the component. Then have a condition that they're different.
Comment: use conditional rules module, check each 1,2,3 conditions, make loops where needed, it will a long rule, but it will work
Comment: There is two way to do it either write two action on comment action or you can write your custom rule as per your requirement.
Comment: Sorry @NiallMurphy ... I disagree with you ... though I couldn't explain why in only 600 chars (= max size of a comment "here") ... So I decided to just post an actual answer ... Of course, by using Rules Components (also), one can avoid Conditional Rules (but that seems to not fit with "in the same rules", as in the question).
Answer: Have a look at this rule (in Rules export format), which does what you're asking for:
{ "rules_notify_users_about_new_comment" : {
    "LABEL" : "Notify users about new comment",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "rules_conditional", "comment" ],
    "ON" : { "comment_insert" : [] },
    "DO" : [
      { "variable_add" : {
          "USING" : { "type" : "list\u003Cuser\u003E" },
          "PROVIDE" : { "variable_added" : { "users_to_notify" : "Users to notify" } }
        }
      },
      { "LOOP" : {
          "USING" : { "list" : [ "comment:node:comments" ] },
          "ITEM" : { "current_comment_item" : "Current comment item" },
          "DO" : [
            { "CONDITIONAL" : [
                {
                  "IF" : { "NOT data_is" : {
                      "data" : [ "current-comment-item:author" ],
                      "value" : [ "comment:author" ]
                    }
                  },
                  "DO" : [
                    { "list_add" : {
                        "list" : [ "users-to-notify" ],
                        "item" : [ "current-comment-item:author" ],
                        "unique" : "1"
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      { "CONDITIONAL" : [
          {
            "IF" : { "NOT data_is" : { "data" : [ "comment:author" ], "value" : [ "comment:node:author" ] } },
            "DO" : [
              { "list_add" : {
                  "list" : [ "users-to-notify" ],
                  "item" : [ "comment:node:author" ],
                  "unique" : "1"
                }
              }
            ]
          }
        ]
      },
      { "LOOP" : {
          "USING" : { "list" : [ "users-to-notify" ] },
          "ITEM" : { "current_user_to_notify" : "Current user to notify" },
          "DO" : [
            { "mail" : {
                "to" : [ "current-user-to-notify:mail" ],
                "subject" : "New comment to node with id [comment:node:nid]",
                "message" : "There is a new comment added to the node with id [comment:node:nid]",
                "language" : [ "" ]
              }
            }
          ]
        }
      }
    ]
  }
}

I translate the "... in the same rules ..."-part of your question like "I want it to be a single (monolitic) rule". For that you'll need an additional module, i.e. the Conditional Rules module, while the above rule does use a few of the more advanced techniques available in the Rules module.
If you're familiar with reading/digesting Rules in Rules export format, I'd hope the rule is self explaining. If not here is a summary of the above rule:

Rules Event: obvious ... After saving a new comment.
Rules Conditions: feel free to add whatever fits (eg limit to selected content types only).
Rules Actions:

Add a variable "users_to_notify" (= a list of users).
Loop over all existing comments, and for each comment author, check that it is not the user who just created the comment (which you can check if you have the Conditional Rules module enabled). If that's the case, then add that user to the list of users (= users_to_notify).
If the comment author differs from the node author (which you can check if you have the Conditional Rules module enabled), then also add the node author to the list of users (= users_to_notify).
Loop over the list of users (= users_to_notify) ... again, which we just created and populated). And for each user in that list, do your thing, in this case "send an eMail". The "To" value is crucial here, the body, the from, the title, etc is up to your own imagination.

If you don't want to use the Conditional Rules module, you could also rework the Rules Actions that require this module to performing Rules Components (in which you add the appropriate Rules Conditions), so that you don't need this extra module (for more details on that, refer to the answer to "What's the alternative to using the Conditional Rules module?").
If you want, just import the above rule in your own site (using the Rules UI, which should be enabled to do so), but only after you enabled the Conditional Rules module.
That's really all it takes ... a Rules variable, Rules lists and loops, and Conditional Rules.
Note that the above rule does actually more as compared to what is asked here:

As per the "unique" in Rules Action nr 2, it will not create duplicates in that list of users, to avoid the same user would receive duplicate eMails (i.e. if a user commented multiple times).
As per the "unique" in Rules Action nr 3, it will not create duplicates in that list of users, to avoid the node author would get duplicate eMails (i.e. if the node author also commented already).
This rule will NOT send an eMail if the comment was posted by ... the node author (which seems to me like a contradiction in item 1. and 3. of the question ...). If you disagree on that (i.e. that it should send an eMail anyway: just delete Rules Action nr 3.

Unit testing the rule
If you want to (unit) test the above rule, you may want to add another Rules Action within Rules Action nr 4. I.e. add some sort of "Show a message on the site" (located within Rules group "System"), to produce a message for each user included the list of users (= users_to_notify).
That way, if for some reason your site has not been correctly configured yet to send eMails, those messages will help you confirm that the rule itself is not the cause of that.
Video tutorials
For anybody not familiar (enough/yet) with Rules, checkout the 32 (!!!) great, and free, video tutorials Learn the Rules framework, organized in 7 chapters. Especially these tutorials, which are related to subject of this question:

Notify author of comments.
Notify of comments replies.
Comment: I have no doubt that your proposition is excellent. But don't ask me why, I could not implement it (well... I'm not that good with Rules). So I did more research and found this : 1) https://drupalize.me/videos/notify-author-comments?p=1157 and this: 2) https://drupalize.me/videos/notify-comment-reply?p=1157.
Comment: @Anne why could you not implement it? Please explain what the problem is? Did you not succeed in importing this rule? Or is there some issue with the eMails being produced? Also, those links look extremely familiar (check my updated answer).
Comment: Well... your instructions seemed rather overwhelming.


Can we understand subdominant/dominant chord functions in terms of them being tonics of other keys?

Question: Does anyone know a textbook or some music theorist explaining subdominant/dominant chord functions in terms of the two chords being the tonics in subdominant/dominant keys?
Background: I was thinking on how a person can reach to an idea similar to tonic/subdominant/dominant (i.e. the three categories of chords which have different degrees of unstableness) just by interval/key relationships, not by historical theories.
My current idea follows like this:

Harmonic series convince us that major chords are more consonant than minor chords or diminished chords because major chords appear as the 4/5/6th overtones.
A major diatonic scale (e.g. C major scale) can build three major triads, three minor triads, and one diminished triad. By major triads being more consonant, we can ignore less important parts (minor triads and diminished triad) and are interested in how the remaining three major triads relate to each other.
Among the three major triads, "triad whose root is the major scale's first note" (e.g. C major chord in the case of C major key) sounds most stable, given that the first note in the major scale is the most stable note. As a result, tonic chord is now considered as the most stable chord.
Then, we can observe that the remaining two major chords, one starting from the 4th note and the other from the 5th note, are also the tonic chord of other keys (e.g. F major key and G major key). The two chords are "the most stable" in those keys, but because we're currently thinking in a different key (e.g. C major key), they are currently used in an "unstable" way. Like in the middle of modulation or something.
Since we can't consider the two major chords as having the same quality (one being the right of the tonic chord in the circle of fifth, and the other being the left), we name it differently based on the names of keys: subdominant chord and dominant chord.

The reason I'm thinking about this is because I'm guessing thinking in tonic/subdominant/dominant keys in parallel may lead me understand some non-traditional chord progression, like IV-I-IV-I, better (IV-I-IV-I in tonic key is V-I-V-I in subdominant key) and may work as a more handy way to think when I compose a song.
Comment: "IV-I-IV-I in tonic key is V-I-V-I in subdominant key" – no. It is I-V-I-V in subdominant key. But you are not free to choose the key in which you interpret music. Tonal center resolves tension, and very often can be identified ambiguously. You seem to be skipping the aspect of tension entirely.
Comment: I don't understand the question. It sounds like you're describing the theory of modulation.
Comment: Sorry my explanation may not be clear. I think what I was asking is if there is any textbook explaining subdominant/dominant functions by different keys.

Those two concepts often suddenly appear without any justification (such as why not mentioning ii, iii, iv chords or why V are more unstable than IV), and I'd like to see if others introduce subdominant/dominant functions with respect to other keys. @Aaron does this make sense, or is my question still unclear?
Comment: I think you just need a better music theory textbook. V is more unstable than IV, because it contains the leading tone, and scale degrees 2 and 7 are more dissonant with the tonic than are 4 and 6. ii, iii, and iv are all mentioned, but usually in later chapters, because their principal functions are derived from the dominant and subdominant functions.
Comment: It's very difficut to find exactly what you're asking here. The relationship between I and IV is the same as that between V and I, in different keys, for example, but I don't think many composers refer directly to theory while they're writing. It may be used as a technical guide.
Comment: @Tim and Aaron thanks for your comments. It seems I should have organized my question better before I ask. I'll keep this question up for a few more days and will delete if others also find it difficult to answer.
Answer: Let me first confirm your question. You want to think of a chord or chords in more than one key at a time. Or, in other words, you want to keep track of what one progression would be from the perspective of other keys.  To clarify, you want to use the exact same chords from one key in another key.
This is a good skill to have and aspects of this come up quite strongly in Gottfried Weber's music theory.  He describes this phenomenon as "multiple meaning."  You may want to check out his work.  You certainly raise a good and valid question, please do not remove your post from the forum.
Comment: Indeed, his "Theory of Musical Composition" exactly answered my question. The book not only answered my question but also expanded the idea of multiple interpretations to notes, intervals, or chord symbols. Super educative. Thanks for sharing an inspirational resource!


Strange behaviour in browser when accessing IIS sites on intranet

Question: Developer confused by intranets =P
So I've got a dev IIS server running on the local network with a fixed IP. I've got a few applications setup in IIS bound to different ports.
I get the strangest behavior: If I load a page via IP address & port, it writes the correct response (as seen in my debugging proxy) but hangs with a white page for a long time while chrome says "waiting for" and it's an incorrect IP address unrelated to the server or application.
The browser actually tries to make a second request to a wrong IP, and it somehow manages to hold up the display of the page. Happens in FF and Chrome as indicated by Fiddler.
It does this for several different apps on different ports, and each one does the same thing but with a different incorrect IP for each one. It waits to connect to wrong local intranet IP. I pinged one, and it's not even an assigned IP on the network.
I can repeat this on a machine without a debugging proxy, and none of the incorrect IPs show up anywhere in the projects.
I'm not sure we even have a DNS server configured. We are a small company with no IT services. What I did was fix the IP address on the adapter of the server.
If I deploy the same apps to an external facing server with proper domains/DNS they work fine.
Answer: If you don't have crazy redirects happening on the site, it sounds like the client browser might be trying to use a proxy to get somewhere else.
This suggests you're either using a badly-constructed PAC (/WPAD) file, or the proxy settings aren't appropriate for the task.
Turn off all proxy settings in the browser, reopen the browser, and see if the symptom's the same.
If your browser supports network capturing (IE9 with F12 dev tools, Fiddler, etc) you might see the source of the problem that way.
(assuming Wireshark + reading that capture is not immediately intuitive for you).
Comment: No redirects. I just don't understand where the second request is coming from. It actually loads all the external CSS and JS files-- it just gets blocked by the random request, which I do see in fiddler.
Comment: You don't think its the actual hosts file on the server itself? Er, wait, I guess IIS sets that binding...
Comment: Can reproduce without proxy.
Comment: What's the request for? (and arguably more importantly, can you see an earlier server response which includes the URL the client's trying to access?)
Comment: So, with more inspecting, I request a page at say 10.0.1.115:2020/register.aspx which returns some HTML. I then get 302 redirects for the linked CSS files to some random IP 10.0.1.75 and without filename (so not 10.0.1.75/style.css) just the IP. weird, right? and all this works fine on the actual server.


Localisation is extenstion by scalars

Question: Let $R$ be a ring, $S \subset R$ a multiplicatively closed subset and $M$ and $R$-module.
There is a bilinear map $S^{-1}R \times M \to S^{-1}M$ given by $(\frac{r}{s}, m) \mapsto \frac{rm}{s}$ giving rise to an $R$-linear map
$$f: S^{-1}R \otimes_R M \to S^{-1}M$$
defined by $\frac{r}{s} \otimes m \mapsto \frac{rm}{s}$. To show that localisation is an example of an extension of scalars, I would like to show that $f$ is an isomorphism.
For surjectivity just take $r=1$.

I don't know how to show that this map is injective. Let $\frac{r}{s} \otimes m \in \ker f$. Then $\frac{rm}{s} = \frac{0}{1}$ and there exists $s' \in S$ such that $rms'=0$, but now what?

Doesn't $f$ actually just tell us about the structure of both sets as $R$-modules? I believe that to show they are isomorphic as $S^{-1}R$-modules we would need to check that the action of $S^{-1}R$ is the same on both sides? Perhaps this is trivial and omitted.
Comment: For 1. use the defining property of $S$ and consider that $0\notin S.$
Answer: For 1) You observed that $r/s \otimes m \in \ker{f}$ implies $s'rm = 0$ for some $s' \in S$.  Then use the defining laws of tensor products to manipulate the expression $r/s \otimes m$. We have $r/s \otimes m = 1/s \otimes rm = \frac{s'}{ss'} \otimes rm = \frac{1}{ss'} \otimes s'rm = \frac{1}{ss'} \otimes 0 = 0$, as desired.
For 2)  Suppose that two $S^{-1}R$ modules $M, N$ are isomorphic as $R$-modules.  So we have an $R$-linear map $f: M \rightarrow N$ that is an isomorphism.  In fact, $f$ is necessarily also $S^{-1}R$ linear.  To see this, consider the expression $r/s f(m) - f(rm/s)$.  Multiply by $s$ and use $R$-linearity of $f$ to see that this expression is $0$ in $N$.   So actually $f: M \rightarrow N$ is an isomorphism of $S^{-1}R$ modules! In conclusion, if two $S^{-1}R$ modules $M, N$ are isomorphic as $R$-modules, then they are isomorphic as $S^{-1}R$-modules.
PS)  Perhaps it's worth noting that the argument in 2) generalizes from localizations to epimorphisms of rings, i.e. if $R \rightarrow T$ is an epimorphism of commutative rings, and $M, N$ are two $T$-modules, then an $R$-linear map $f: M \rightarrow N$ is already $T$-linear, hence $M, N$ are isomorphic as $T$ modules if they are isomorphic as $R$-modules.

Localisation is extenstion by scalars


Decomposing a multi seasonal time series using tbats in R

Question: Can I decompose a time series with multiple seasonalities (an msts object) using tbats (in the forecast package for R) and get the random component of it? Just as getting the random component using the decompose function for ts objects?
Answer: You can use the function tbats.components on a tbats model fit. It will yield a matrix of time series containing the level, the slope and the season of the fitted model, as well as the actual observations. You can then simply subtract the components from the observations to obtain the residuals:
> library(forecast)
> fit <- tbats(USAccDeaths)

> foo <- tbats.components(fit)

> head(foo)
     observed    level     slope     season
[1,]     9007 9538.066 -43.81329  -823.6141
[2,]     8106 9590.489 -47.90006 -1548.1921
[3,]     8928 9642.926 -52.03042  -781.2602
[4,]     9137 9636.436 -52.12401  -528.4124
[5,]    10017 9661.657 -54.41414   304.7762
[6,]    10826 9848.610 -67.92587   815.5472

> foo[,"observed"]-foo[,"level"]-foo[,"slope"]-foo[,"season"]
              Jan          Feb          Mar          Apr          May
1973  336.3616979  111.6033706  118.3650491   81.1007939  104.9810786
1974 -222.9725629 -120.0746460   65.3314214   84.8823480 -199.9296274
1975   88.0935771  -12.2533927   20.1954758 -210.2334112  194.5652535
1976   91.6890807  225.6898321 -108.3721742 -104.6956780 -128.2708712
1977   18.9462879  -59.0440990  -48.6638245    9.8410292  -38.2662635
1978  -43.2497726 -132.1089133  -25.8376148   29.8293887   34.8255629
              Jun          Jul          Aug          Sep          Oct
1973  229.7689357    9.7833829   97.6213834  114.7690243   61.5528845
1974   23.6012054 -100.8973484   99.0247537   33.6304182   37.2522537
1975  -59.5136479 -162.8834589   -5.6052057 -131.8664155 -149.6577923
1976 -168.0888948   16.7956107 -130.6105420 -127.4818202  -48.5429559
1977  -81.8158991  155.2481713 -232.3853212  -95.3328947   18.0666666
1978  -82.3539729   38.3254629    8.2383295  149.0925592  -93.5561732
              Nov          Dec
1973  -24.4337637 -201.9057433
1974   70.8572386 -105.5657300
1975    5.6164054 -211.3018369
1976  -94.9396877  127.1735861
1977  -34.9677557   65.1114921
1978    0.1845764  136.0468109

Comment: Thank you very much sir. I want to guess the number of AR and MA terms  of this time series based on the ACF and PACF of the residual series. But the x axis of those plots ranges from 0.000 - 0.005. Please advice me how to initially guess the AR and MA terms of a time series with multiple seasonalities
Comment: [TBATS is not an ARIMA model - it's a type of exponential smoothing.](http://www.tandfonline.com/doi/abs/10.1198/jasa.2011.tm09771)


Como excluir um ramo(branch) do Git local e remoto?

Question: Eu quero apagar um branch local e no meu projeto remoto no GitHub.
Answer: Para apagar o branch localmente:
git branch -D <nome do branch>

Para apagar o branch remotamente:
git push <nome do origin> <nome do branch> --delete

Comment: Usei o comando para deletar o repositório remoto e deu erro falando que não há nenhum branch. Eu só criei o repositório, mas está vasio. git push   --delete O nome do origin é o que? No meu caso, coloquei o nome do repositório Teste. E o branch?
Answer: Você pode utilizar o seguinte comando:
git push origin :nome_do_branch

Atentando para os : na frente do nome do branch, pois ele quem fará que o branch seja deletado, caso contrário você estaria atualizando o branch remoto.
Comment: A resposta do Juarez Lustosa por algum motivo vem sendo negativada e ainda tem um comentário dizendo que "ele quer deletar branch, não para subir os commits dele". Porém é uma resposta válida, usada para excluir branchs remotos, e mais simples do que as outras citadas. **antes de `nome_do_branch` tem dois pontos (`:`) e é isso que faz deletar o branch e não fazer o push.**
Comment: Ele quer deletar branch, não subir os commits dele!
Comment: Obrigado Rafael Macedo!!! É exatamente isso.
Answer: Para remover branch local:
 git branch -d nome-do-branch

E para remover branch remoto acrescente o flag "-r":
 git branch -dr origin/nome-do-branch

Comment: git branch -dr origin/nome-do-branch Sobre este comando, onde coloco o nome do meu repositório que chamei de Teste? Criei um repositório, mas não criei branch, não commitei, não fiz nada. Não estou conseguindo apagar o repo Teste. Obs, só tenho remoto, não clonei. Só quero aprender a deletar este projeto.
Comment: Não sei, André. Esse comando aí é apenas para remover branches mesmo, não repositórios.
Comment: @AndréNascimento você pode acessar esse tutorial para aprender a deletar um repositório do GitHub
https://help.github.com/articles/deleting-a-repository/


Abrir modal de botão dinâmico carregado via ajax

Question: Estou com dificuldades para abrir um modal por meio de um botão carregado dinamicamente via ajax.
O seguinte código jquery abaixo abre o modal normalmente, considerando que o botão a ser clicado não foi carregado dinamicamente.
$('#idDivModal5').on('click', '.btn-cancelar-contrato', function(){

// codigo aqui

});

Uma vez que eu gerei os botões via ajax, enviando-os para a minha div resultado, os botões já não mais funcionaram.
Código HTML:

Inclui a div resultado no jquery, conforme mostrado abaixo, mas não funcionou:
$('#resultado#idDivModal5').on('click', '.btn-cancelar-contrato', function()
{

// codigo aqui

});

Segue abaixo o codigo atual:
 $('[data-load-remote]').on('click',function(e) {
   e.preventDefault();
   var $this = $(this);
   var remote = $this.data('load-remote');
   if(remote) {
    $($this.data('remote-target')).load(remote);
    }
 });

Requisição ajax:
$.ajax({
              type  : "POST",
              url   : "envia-buscar-contrato",
              data  : {var_radio:var_radio,var_valor:var_valor},
              datatype : 'html',
              success: function(data) {

                    $("#form-buscar :input").prop("disabled", false);
                    $('.bloquear2').hide();
                    $('#resultado').show();
                    $("#resultado").slideDown();
                    $("#resultado").html(data);
              }
            });

 });

Esqueleto da modal idDivModal5:

Botão retornado via ajax:

<a class="botao-form" href='#idDivModal5' role='button'
data-toggle='modal'
data-load-remote='cancelar-contrato/<?php echo $codigo_contrato;?>'
 data-remote-target='#idDivModal5 .modal-content'
aria-hidden='true'>Cancelar contrato

Lembrando que, quando o botão acima não é carregado via ajax, o mesmo abre a modal idDivmodal5 normalmente. A partir do momento em que eu retorno o botão via ajax, ele não abre. Onde estou errando?
Comment: Posta o teu código fonte por favor.
Comment: Vou postar o codigo.
Comment: o botão precisa ser carregado dentro do `$(document)`, pro código ter certeza que o trecho existe.
Comment: Como que ficaria Wilian?
Comment: Obrigado Wiliam. Substitui o  $('[data-load-remote]').on('click',function(e) { pelo $(document).on('click', '[data-load-remote]', function(e) {
e funcionou =D.
Answer: Como o @Gabriel Rodrigues mencionou, seu botão não está no DOM
uma alternativa é:
$(document).on('click', 'classDoBotão', function(){
    // codigo aqui
});

Explicando de forma simples, o jquery agora vai procurar na página todos os botões com a classe ou id que você passar dentro do segundo parâmetro, e executar a sua função
Comment: tive mesmo problemas recentemente no trabalho e esta solução funcionou
Answer: Seu problema é que o button não foi carregado no dom no momento em que você foi criar o seletor, então ele ainda não existe, para contornar este problema você pode utilizar a documentação do bootstrap.
Em Modal você pode utilizar o evento show.bs.modal que é quando os elementos da modal já foram carregados.
Um Exemplo disto seria:
$('#idDivModal5').on('show.bs.modal', function () {
  $(".btn-cancelar-contrato").on('click',function(){
       // Modal disponivel e com click funcionando.
   });
})

Da para fazer um callback do evento load que vai funcionar tbm.


Mining survey data to discover high and low performing cohorts

Question: I'm analyzing datasets of users that range in size from 5,000 users up beyond 150,000 users, and each of these users have at least 32 data-points (sometimes more, sometimes a few less) with (about) 5 possible responses for each point. Each of these users have a single value that evaluates how they contribute as a high or low performing user.
I'd like to programmatically identify cohorts, defined by some combination of data-points and responses, which are in the 90th and 10th percentiles by performance and sample size. All the methods I've explored end up taking way too much time (3+ hours for a small set of ~7,000 users) to complete at a depth of 3 dimensions (and throwing out all 1 and 2 dimensional cohort definitions), which will not scale.
Are there any algorithms or statistical/mathematical principals I can look at/read about and/or experiment with to try to identify these cohorts more efficiently and faster?
The methods I've attempted thus far have all involve iterating over each user's responses and building a list of the 3-dimensional cohort definitions that the user could fit in, then incrementing counts for each of the cohorts the user fits within which corresponds with how well the user performs. I've tried different methods to prune down the dimensions that yield less reliable results (as defined by a low incidence rate/number of users in the cohort). I've tried different optimization strategies to optimize the amount of loops I have to execute over each user, with little performance increase.
I can't help but think there's some statistical mathematics rule or theory that will help analyze this data set more efficiently.
Any information, advice, or suggestions are very much welcomed and appreciated. Thanks!
Edit 7/20/13
To answer some questions about objectives and the data and format:
The objective here is to identify the most interesting clusters of people (say the 90% percentile of clusters, ranked by NPS score) without really knowing where to start. For any given data set it could be any cluster.
The data is stored as a map of QuestionID => ResponseID entries for each user. There are some caveats to that, sometimes the ResponseID value is list of responses that the user has selected for that question (in the case of multi-response questions), and sometimes the ResponseID value is another map of SubQuestionID => ResponseID values for that question. The data structure doesn't next any further than that, though. The data is serialized into a JSON object and written to a file, and I'm loading the data out of that file.
I've also flattened the data structure down to a 1 dimensional map of QuestionID[.SubQuestionID] => ResponseIDs, where ResponseIDs are represented as a map of ResponseID => True (in an effort to optimize the speed in which I could check the users' response).
I put an example record at the bottom of this post to help visualize/communicate the data format.
To address some of the questions regarding what the data tells us, it's (just) survey response data. As you'll see from the data structure below, there are specific responses to each question. The data we collect from users is mostly the same across all data-sets, but there are filters that are executed to only include users we know we're looking for, based on some other metrics that aren't included in the data file. This is done to limit the working set to something more manageable than the larger set (which is orders of magnitude larger).
To address the specific question about the NPS value, yes we have the 0-10 values stored, but in the NPS algorithm/methodology the actual values don't matter and are mostly a psychological representation of the responses for the survey taker, so we just map the response values to the group they fall in to.
All of the responses are stored categorically (if I'm understanding the definition of a categorical response correctly), though some of the questions' responses have a progressive order to the responses. Eg, one of the questions is regarding the highest education a user has completed, and the responses are something like "Some high school", "High school", "Some College", "Associates Degree", etc, and so on. Even age is put into a bucket so we're not dealing with 50 different responses for a single question (age).
Peter Ellis asked if it "would be good enough to have a predicted performance for each individual given their values on the 32 categories? You could easily enough identify the risk (positive and negative) levels of each of the variables."
I think that question is leading into the direction of probabilistically determining which clusters are going to perform the best and only using computation cycles to calculate the performance of those clusters. I think the answer here is yes. If there was a reasonable method of calculating, or knowing, what the performance gain/reduction (risk, I guess?) implications were of some cluster definition, without having to test and calculate all users, that would be a method that we could put to use.
As stated above, the objective is to find top/bottom performing clusters. We don't have to match all of the top/bottom performers 100%, but if we were reasonably certain (like 80%+ certain, or something) that the clusters we uncovered were in the top 90% or bottom 10%, that would be good enough.
I hope that helps clear things up. I am not sure where to go from here, so I'm hoping y'all can at least show me the right direction that I need to go in, or some possible routes to get me to where I want to be.
Thanks Again!

The data. This is for a single user record, all the other user records look largely similar. If a larger set would be significantly more beneficial, I can pull some together. I've been focusing on the user-data solely because it's a known set; I think that if I used the definition of the questions/responses to iterate through my users, I'd waste much more CPU cycles generating/evaluating cluster definitions which my data-set doesn't have any representation of.
The un-flattened version:
{
   "NPS":"promoter",
   "11279":[13204,13205,13206,13207,13209,13210],
   "2":12,
   "3":17,
   "4":19,
   "23":148,
   "11303":{
      "1":13418,
      "2":13419,
      "3":13419,
      "4":13424,
      "5":13424,
      "6":13424,
      "7":13418,
      "8":13424,
      "9":13418,
      "10":13424,
      "11":13424,
      "12":13420,
      "21":13419
   },
   "11305":{
      "19":13435,
      "20":13434
   },
   "11304":{
      "13":13425,
      "14":13427,
      "15":13426,
      "16":13426,
      "17":13429,
      "18":13433,
      "22":13433,
      "23":13433,
      "24":13433
   },
   "11306":[13448],
   "11307":[13450,13453],
   "11309":13473,
   "11308":[13459,13460,13461,13466,13469],
   "11999":[17031],
   "12111":18235,
   "age":"55-64",
   "gender":"f"
}

and, the flattened version:
{
   "2":{"12":true},
   "3":{"17":true},
   "4":{"19":true},
   "23":{"148":true},
   "11279":{"13204":true,"13205":true,"13206":true,"13207":true,"13209":true,"13210":true},
   "11303.10":{"13424":true},
   "11303.1":{"13418":true},
   "11303.11":{"13424":true},
   "11303.12":{"13420":true},
   "11303.2":{"13419":true},
   "11303.21":{"13419":true},
   "11303.3":{"13419":true},
   "11303.4":{"13424":true},
   "11303.5":{"13424":true},
   "11303.6":{"13424":true},
   "11303.7":{"13418":true},
   "11303.8":{"13424":true},
   "11303.9":{"13418":true},
   "11304.13":{"13425":true},
   "11304.14":{"13427":true},
   "11304.15":{"13426":true},
   "11304.16":{"13426":true},
   "11304.17":{"13429":true},
   "11304.18":{"13433":true},
   "11304.22":{"13433":true},
   "11304.23":{"13433":true},
   "11304.24":{"13433":true},
   "11305.19":{"13435":true},
   "11305.20":{"13434":true},
   "age":{"55-64":true},
   "gender":{"f":true},
   "11306":{"13448":true},
   "11307":{"13450":true,"13453":true},
   "11308":{"13459":true,"13460":true,"13461":true,"13466":true,"13469":true},
   "11309":{"13473":true},
   "11999":{"17031":true},
   "12111":{"18235":true}
}

Comment: Thanks.  That "performance" I would call an ordered categorical variable.  I don't think there's a solution as you have the problem posed - there are just too many possible cohorts (in the order of 10^22 combinations of variables to look at).  Would it be good enough to have a predicted performance for each individual given their values on the 32 categories?  You could easily enough identify the risk (positive and negative) levels of each of the variables.
Comment: Thanks for all the precisions, I am sorry I cannot be more helpful but I am still somewhat puzzled and share @PeterEllis's view on all this. In any case, if you actually need/want to do some clustering, there are many approaches out there that can easily deal with dozens of variables and thousands of observations, there is really no need to roll out your own or be concerned about the number of combinations.
Comment: Is performance a continuous variable?  How is it distributed?  And are the other 32 data points you refer to what a statistician would call 32 categorical variables with five legitimate values for each variable like "African", "Asian", "European"?  If so is there natural ordering in those five levels?  And are the five levels the same for each of the up to 32 variables?
Comment: I'm not sure how to answer the first 2 questions. The performance variable is what kind of user the user is (Promoter, Neutral, Detractor (NPS)). I would guess that *is* continuous? the 32 data-points are categorical, though the responses for each question are not the same (for some the categories are the same, buy for the majority, they're not). There's not exactly 5 responses for each question, that's more of an average. Some have 7 or so, some have 2 or 3. As for the ordering, I'm not sure how to answer.
Comment: Also, I'm not concerned with combinations of responses for any question. Eg; I don't particularly need to account for any questions that can have more than one response associated, treating each as a single response question is good enough at this point.
Comment: What is your objective? Predict if future users are likely to be promoter/detractors based on these 32 or so variables? Understand how these variables relate to the performance and how promoter differ from distractors? Are these "cohorts" (a more typical name would probably be "cluster") defined by the performance or are you just interested in grouping users in some meaningful but unspecified way?
Comment: On a more practical level, have you got the original 10-point are-you-likely-to-recommend-us ratings or only the 3 NPS categories? Regarding the other 32 data-points, can you explain in plain English what those are? Counts of things people did, answers to questions (and in this case, what was the response format)? You can perhaps show us a few lines from one of your data sets or few example questions. That would allow us to decide if they are best treated as categorical variables or something else.
Comment: @GaëlLaurans and PeterEllis, I've added some more information and tried to answer y'alls questions as best I can. It's a long edit, sorry - I was just trying to be thorough. I appreciate y'alls help and I'm really excited to see what your thoughts are!
Comment: @PeterEllis The possibility of using a more probabilistic based approach is definitely something we'd be able to evaluate. I think that's what your question was getting at? I'm just really not sure how to evaluate the probability (or risk) for this data. I'm pretty much trekking through unfamiliar territory, trying to find the best solution. Thanks for your help!
Comment: The way you describe your problem is very different from the way statisticians usually think about things so that's it's difficult for me to make sense of it. For example, the details of the data structures really do not matter so much at this stage, it's the meaning and nature of the variables I was after and these numbers still do not mean anything to me.
Comment: I am still not sure I understand what you want to do. You have the NPS score; if you want the "90% percentile", you just need to order this variable and see what score separates the top 10% from the bottom 90% (because the variable is discrete, there is probably a lot of ties and some niceties in the definition of a percentile but that's the basic idea). If you only have the category (promoter, neutral, etc.), there is not much more you can do than state x% of the users are promoters and so on.
Comment: Now if you want to predict if a user is likely to be a promoter or a detractor based on the rest of the data, it would usually be approached as a regression problem (predict a score) or perhaps as a classification problem (classify users as either "promoter", "neutral" or "detractor"). Typically, you would not be concerned about defining groups of users or working explicitly with clusters to do that. Does that make sense to you?
Comment: Note that 5000 users/observations is actually quite small and 150000 is still not very large and certainly below the point where you need to consider fancy "big data" techniques. If I had to work with such data, I think I would extract it in a table format, fire my usual statistical package and start by trying some canned routines, without having to worry about implementation, data structures, computation cycles and the like.
Comment: @GaëlLaurans the ultimate goal here is to discover clusters of users defined by some number of questions and response combinations (currently, i'm fixated on 3 dimensions due to worrying about sample size within the clusters when you get much more granular). I thought you were interested in what the data structure looked like, which is why i threw it up there. The questions themselves are some fairly traditional market research questions like Household Income, Education, Number of children, etc. It gets more in depth than that, but that is the nature of the questions.
Comment: Each user record represents a user that has rated a brand in a specific way, and is either a detractor, promoter, or passive user to that brand. The goal is to identify which clusters for each brand have a high NPS score. As an example, you could probably guess that men aged 45-55 are really big promoters of the brand Budweiser, and women aged 27-40 with 1+ kids are big promoters of Pinterest. These might be fairly obvious, but finding them in the data is a little less obvious.
Comment: The problem here seems like it's more in the realm of Machine Learning, but obviously ML is deeply seated in statistics. I agree that 5k or even 150k, or even 1M users is a decidedly small data set, but the problem is the # of permutations of the question/response iterations based only on the users in a 6k user set, ignoring the full scope of questions/responses exceeds 1 million unique combinations, each user having well over 100k each.
Comment: Also, I'm admittedly not a statistician. I lack the vocabulary and basic principal knowledge that an actual statistician has at their disposal. I'm looking for advice from a statistician that will help me understand some new strategies, or some suggested reading or ideas on how I can accomplish the goal I'm looking for. I'm sorry if what I've explained is unclear, I'm trying to be as clear as I can be.
Answer: OK, time to try to answer this as the comments section is getting a bit out of control and not really helping us clarify things.
First, I would suggest you put aside all questions of finding cohorts and clusters, and all the machine learning terminology, and buy yourself a text book on basic statistics and surveys and their analysis.
Second you should go back to your actual business problem.  I simply don't believe that it is to find clusters of respondents defined by a combination of six variables out of 32.  Your real business problem is probably one of:

"given the various characteristics of a new individual against up to 32 variables, what will be their attitude towards each of my products?"  This makes it an individual prediction problem; OR
"which demographics should I market each of my products to?"  This makes it a problem of identifying the most important factors in explaining the NPS score.

In either of those cases, the basic toolkit is going to be a statistical model with attitude to each product as the response variable, and the up to 32 other variables as explanatory variables.
As you have the underlying data that has been summarised in the NPS score, you should use that as your response variable - it has much more information in it that the simple NPS score, and in this situation you want to use all the information you can get.
Unfortunately the strategy for determining the best model is difficult and fraught with conceptual pitfalls for the inexperienced, and the type of model you need is not taught in a basic stats course.  I would recommend Harrell's Regression Modeling Strategies as a guide, but you will need to get some more basic stats before you are ready for this.  Frankly, you are probably best off getting a statistician to do the work for you.
On the positive side, the numerical and computational problems are all solved and the problems you started with - length of time to the computations etc - will all vanish.
If you really want to go the self learning route, then look for articles on ordinal regression.  The free open source stats environment R has an implementation.
Comment: Thanks for all the advice, do you have any specific statistics/surveys analysis books?
Comment: There are some good lists elsewhere on this site for books on basic statistics.  In addition to a general book off one of those lists, I would think you might find Bruno Falissard's Analysis of Questionnaire Data with R particularly useful; then one of the numerous books introducing regression; then Harrell's book mentioned in my answer.


Manter layout de banner na tela, entre um iPhone 4 e um iPhone 5

Question: Estou com um problema ao desenvolver o layout do app. No storyboard, eu adicionei um UIImageView para exibir algumas imagens enquanto o app estiver funcionando. Esta imagen fica na parte de baixo da tela, como um rodapé. Porém quando simulo em um iPhone de tela menor, no caso o iPhone 4 o banner some, pois fica na diferença de área das telas entre o iPhone 4 e iPhone 5.
Gostaria de saber se há um modo de manter esse layout, que o UIImageView seja alocado um pouco mais para cima, quando a tela do app for menor e possa aparecer.
Comment: Olá Tiago, você está usando o `AutoLayout`?
Comment: Tiago Amaral, desabilita o AutoLayout e testa.
Comment: Ok Vou testar! Mas acredito que terei que fazer mais configurações...
Answer: Tiago,
1 - Desative o autolayout
Autolayout off http://imagizer.imageshack.us/v2/450x400q90/674/ARs4F9.png
2 - Alinhe para baixo usando o Autosizing
Autolayout off http://imagizer.imageshack.us/v2/450x400q90/907/dgaqDY.png
Assim ele vai se adaptar sempre que a tela mudar de tamanho, pois a imagem, ou qualquer outro elemento, estará alinhado com a parte inferior da tela.


What does "stochastic" mean in RBM networks?

Question: I am learning about restricted Boltzmann machines (RBM). It is still unclear to me why it is a stochastic algorithm. I was wondering if some one can explain it with comparison to deterministic ones (like autoencoders).
For example, here says RBM shares a similar idea, but it uses stochastic units with particular distribution instead of deterministic distribution.
Comment: Regular autoencoders are deterministic because, once you have trained them, for a given input you always get the same output. RBM, on the contrary, have stochastic units that are sampled each time you ask for an output, hence they are stochastic (they are in fact a generative model).
Answer: An autoencoder is a deterministic function which maps input $x$ to output $\hat x = f(x; \theta)$ -- $\theta$ being the network parameters.
An RBM is a pair of sets of random variables $(v,h)$, whose joint distribution takes a "quadratic" form -- $\frac{1}{Z} \exp \left( v^T Wh + a^Tv + b^Th\right)$.
Curiously, $p(h_i|v) = \sigma(b+W^Tv)_i$, and all $h_i$ are independent conditioned on $v$. This closely mimics the computation of a neural network -- however I would be extremely cautious of thinking of an RBM as a type of feedforward neural network -- this is likely to lead to confusion. The tutorial you linked isn't particularly good. This may help.


Search arrays then echo with conditionals?

Question: I'm trying to do somthing like this:
<code>  $random = array("apple","celery","banana");

  $define_fruits = array("apple","banana","pears","mango");
  $define_vegetables = array("celery","lettuce","carrots","cucumber");

  if($random contains only fruits){
    echo fruits;
  }elseif($random contains only vegetables){
    echo vegetables;
  }elseif($random contains both fruits and vegetables){
    echo both;
  }
</code>
SOLVED:
<code>$in_fruits = sizeof(array_intersect($random,$define_fruits));
$in_vegetables = sizeof(array_intersect($random,$define_vegetables));

      if($in_fruits >= 1 && $in_vegetables >= 1){
          echo "in_fruits and in_vegetables ";
        }elseif($in_fruits === 0 && $in_vegetables >= 1){
          echo "in_fruits ";
        }elseif($in_fruits >= 1 && $in_vegetables === 0){
          echo "in_fruits";
        }
</code>
Progression:
<code>$in_fruits = count(array_intersect($random,$define_fruits));
$in_vegetables = count(array_intersect($random,$define_vegetables));

if( $in_fruits ){
  if( $in_vegetables )
    echo "both";
  else
    echo "fruits";
}elseif( $in_vegetables ){
  echo "veggies";
}else{
  echo "neither ";
</code>
Answer: You probably want to look at array_intersect:
http://php.net/manual/en/function.array-intersect.php
Answer: This could probably done more efficiently, but this is a simple way:
<code>$random = array("apple","celery","banana");

$define_fruits = array("apple","banana","pears","mango");
$define_vegetables = array("celery","lettuce","carrots","cucumber");

if( count(array_intersect($define_fruits,$random)) ){
  if( count(array_intersect($define_vegetables,$random)) )
    echo "both";
  else
    echo "fruit";
} elseif( count(array_intersect($define_vegetables,$random)) ){
  echo "vegetables";
} else {
  echo "neither";
}
</code>
Comment: How is this more efficient? It is using array_intersect 3 times. My solve is using it twice.
Comment: I used your structure with the cached vars. Thanks
Comment: If you follow the logic, array_intersect is always called twice, never 3 times. Also my code only has 2 comparisons. Your progression looks good. The only other tweak is there might be a better way to check other then count(), the PHP docs weren't clear, but you can probably just do a check for NULL, instead of having count iterate through the array if one is returned.
Answer: The simplest solution would be:
<code>if ( in_array($define_fruits, $random) && ! in_array($define_vegetables, $random) ) {
   // Only fruits
}elseif ( ! in_array($define_fruits, $random) && in_array($define_vegetables, $random) ) {
   // Only Vegetables
}elseif ( in_array($define_fruits, $random) && in_array($define_vegetables, $random) ) {
   // Both fruits and vegetables
}
</code>
Comment: When you use [in_array](http://php.net/manual/en/function.in-array.php#example-4177) with an array as the needle it will look within the array for an array that is identical.


The mathematical and technical approach to a limit of a sum of a sequence

Question: In Calculus, what is the most preferred mathematical and technical way to approach a limit of a sum of a sequence?
Take for example:
$$ \lim_{n \to \infty} {\frac{1}{n} \sum_{k=1}^{n} {\ln(1 + \frac{k}{n})}} $$
Is it a Riemann sum? or is it related to convergence? And what does the limit represent? As a student of Computer Science, I (intuitively) think it represents the actual sum of the sequence, and please do correct me if I am wrong.
Comment: "I (intuitively) think it represents the actual sum of the sequence..." What sequence?
Comment: $a_k = ln(1+ \frac{k}{n})$ is not considered a sequence, my bad.
Comment: $a_k=\log(1+(k/n))$ is a perfectly good sequence, but $\lim_{n\to\infty}(1/n)\sum a_k$ does not represent $\sum a_k$.
Comment: I understand, thank you!
Answer: Well , it is the upper Riemann sum with even spaced subintervals --
sample points :$(1+\frac1 {n}) ,(1+\frac2{n}),...,2$ being taken at the right-end because $\ln(x)$ is increasing -- $(1/n)$ being the length of each subinterval.
By continuity of $ \ln(x)$ , as $n\to \infty$ these sums must converge to the integral of $\ln(x)$ over $[1,2] $, which may be computed as follows:
$$I =\int_{1}^{2}  \ln(x) \,\mathrm dx = [x \ln x-x] \Big\vert_{x=1}^{2}=\ln 4-1$$
Comment: i hope it is clear for the OP now , i may further clarify any confusing point..
Comment: Why is the $\frac{k}{n}$ our $x$ and we took the $\frac{1}{n}$ as our $\Delta{x_k}$?
Comment: 1+(k/n) is our $x^*_k$ which  is in the k-th subinterval in our even spaced partition P.To calculate the integral , you could  choose arbitrary sample points in the subintervals and in the limit you get the same integral value.1/n is the length of the subintervals which is generally used for simplicity but we don't have to of course..
Answer: More explicitly,
as $k$ goes from
$1$ to $n$,
$\frac{k}{n}$
goes from $0$ to $1$.
Also,
if $x = \frac{k}{n}$,
the spacing between consecutive values of $x$
is $\frac1{n}$,
so the sum, in the limit,
is $\int_0^1 \ln(1+x) dx$,
with $dx$ being $\frac1{n}$.
So this is a Riemann sum
with equally spaced points.
Evaluating this integral,
as Halil Duru did,
$\int_0^1 \ln(1+x) dx
= \int_1^2 \ln(x) dx
= (x \ln x - x)|_1^2
= (2 \ln 2 - 2)-(1 \ln 1 - 1)
= \ln 4 - 1
$.
Comment: Because that was the sum in the problem. Your more general form will, as a Riemann sum, also converge as a Riemann integral to the value given.
Comment: I feel like your explanation for the Riemann sum needs to be slightly better made - for example, why are we summing the values of $\ln(1+\frac{k}{n})$ rather than $\ln(1+x)$ for some $ x \in [\frac{k-1}{n},\frac{k}{n}]$?


Text about connections between complex analysis and partition theory?

Question: I hope this is enough about maths to ask here. As part of my degree I need to do a project consisting of a 7,000-word report on some area of maths (quite a general guideline). I've noticed in studying complex analysis that quite frequently, studying a function's residues winds up giving you an expression for an infinite sum or a generating function for some partition. For instance, there's a well-documented example of using elliptic functions to prove Jacobi's Triple Product.
I also know a little bit about partitions, having read the book Integer Partitions by Andrews and Eriksson and done a previous report summarising a large part of it. So I'd like this project to combine the two areas, and I know -- mostly from casual references -- that it's generally agreed that complex analysis and additive number theory are 'closely related'. The two subjects also seem well-adapted for combining because doing the working out in complex analysis is elegant, but the final answer might not be very exciting, while it's the other way round in number theory, where the working out can be very painful but the final answer pretty neat.
Can you recommend any online source that explores connections between complex analysis and partition theory? If there's an especially good textbook, that would be welcome too. I've noticed Complex Analysis in Number Theory by Anatoly A. Karatsuba, but it doesn't seem like the right fit based on the Amazon description.
EDIT: And if there's a source that links general number theory results with complex analysis, that's cool too. It doesn't have to be partitions. I'm offering a bounty for this now because responses have been extremely scant and it would be really helpful to find a good source.
EDIT 2: I should emphasise that this is a project for my final year of an undergraduate degree. Also, I've found a potentially useful source in the textbook Complex Analysis by Eberhard Freitag and Rolf Busam. Chapter 8 is all about additive number theory. But I'll leave the question open in case there are more sources out there.
Comment: See https://mathoverflow.net/a/43467/532
Comment: That looks like a good goal to work towards, definitely.
Answer: There's a relatively new body of work authored by M. Merca and myself on so-termed Lambert series factorization theorems which ties the multiplicative functions involved in Lambert series generating functions (an application of analysis is definitely implied here) and the partition function $p(n)$ and restricted partition functions. See the following links for papers (all but one of them is still being reviewed):

Factorization Theorems for Generalized Lambert Series and Applications

Generating Special Arithmetic Functions by Lambert Series Factorizations

New Factor Pairs for Factorizations of Lambert Series Generating Functions

Factorization Theorems for Hadamard Products and Higher-Order Derivatives of Lambert Series Generating Functions

Additionally, you can read about our joint work connecting the Euler totient function and the Moebius function with restricted partitions and $p(n)$ (both with Lambert series expansions) here and here, respectively (to be) published this year in the American Mathematical Monthly and the Ramanujan Journal. Additionally, you can check out my recent publication in Acta Arithmetica connecting partitions and general Lambert series expansions here.
Between all of these links, you should be able to come up with something plausible for your maths project. I'm also going to be giving a talk at the upcoming George Andrews 80th Birthday conference about these new, more recent connections between additive partition functions and classical multiplicative functions in number theory. If this doesn't do it for you, feel free to email me or post a follow up comment and I will see what else I can come up with in the way of references for your project.
Comment: In particular, you can apply complex contour integrals to the known closed-form Lambert series generating functions for many classical special functions in number theory to obtain the coefficients of these series -- and then compare with our results for these coefficients in the above references. I hope that helps. Sounds like an interesting (Masters?) project.
Comment: I can also put you in touch with a friend who has used the circle method to obtain asymptotic estimates for statistics of special partition functions.
Comment: Thank you for these pointers. At a glance they look a little too advanced for me -- I should have pointed out that this is a fourth-year undergraduate project -- but I'll look at them more carefully in the near future.
Comment: Have you looked at Hardy and Wright's book? It has many sections on computing asymptotic formulas for average order sums of various arithmetic functions.
Comment: I haven't yet, but I'm interested in proving the asymptotic formula mentioned here: mathoverflow.net/a/43467/532. I'll check out Hardy & Wright, thanks.
Comment: I would look up Rademacher's theorem on the partition function for that proof. There's quite a bit else you can do with Rademacher-like expansions for other partition functions like q(n) too. The end of my article [here](https://arxiv.org/abs/1705.03488) has some references to expansions for other partition functions.
Comment: You can also look up probabilistic methods for finding the expectation for the partition function to add some more content to your write-up.


Does iOS really disable JavaScript in mail attachment?

Question: If an iOS device, say iPhone or iPad, receives an HTML file as an attachment by email,
does the iOS system automatically removes from the HTML attachment all the JavaScript scripts?
Answer: Starting iOS 13 the JavaScript is disabled on the email client Html preview app.
We experienced the same problem with customer devices on iOS 13. On previous versions of iOS release, this was working fine.
I think the main problem with the enabled JS was a good amount of spam getting through emails that used it to force images to load automatically.


Have there been any comprehensive studies on the language of mathematics?

Question: Update: When I asked this question I hadn't considered that most mathematical texts (in the Western tradition) were written in Latin from the [14th?] century until the [19th?] century. This probably influenced the development of the "modern" (post 1850s-ish?) language of proof-writing. Additionally, the use of symbolic logic, particularly quantifiers, is a product of the late 19th/early 20th century, so the development of rules for inserting and manipulating logical formulae in text probably occurred around then.
While a study of the historical development of the language of mathematics isn't a study of the language itself, it is likely to provide important information. As such, this is now also a question about math history.
Also, I found this:
The language of mathematics computational, linguistic and logical aspects. Sprache und Datenverarbeitung.
So if there isn't a definitive "Compendium Linguae Mathematicae", at least I there's a good starting point for further research.

I've decided to wear my anthropologist hat today, and it has come to my attention that, from a linguistic standpoint, the language used to write proofs (in English) is not English. Though it shares a high degree of mutual intelligibility with English, the dialect - though I would argue that it is a distinct pidgin language - which mathematicians use has several features which distinguish it from the English language.
For instance, there are distinct grammatical moods which are used in mathematical writing that are not present in English. In the language of mathematics, it is incorrect to introduce a new subject using the declarative, as in "$x$ is..." (actually "$x$ is..." can be used only if $x$ names a kind of thing rather than a specific thing, but this usage distinguishes it from the declarative mood, anyway.) Instead, there is a grammatical mood which superficially resembles the English imperative which must be used to declare a subject prior to its use in a declarative sentence, as in "let $x$ be..." and "suppose that $x$ is...." I say "superficially" because although the English sentence "Let $x$ be [object]." is imperative, the mathematical sentence of the same form does not relay an instruction to the listener; a response of "No, I don't think I will" is nonsensical in mathematics - this is not the case for the corresponding English sentence.
There are many other more-than-just-jargon examples of of mathematics deviating from the English language. There are even features of mathematical language that more closely resemble those of a typed programming language than any natural language, as evidenced by the rules governing the use of keywords like "fix," "choose," "by," and "at."
So, if mathematical English is not English, what is it?
Are there any books, articles, preprints, documentaries, or Reddit threads that discuss the language of mathematics in detail (without assuming prior fluency in mathematics)?
My initial search has turned up shockingly few results, none of them peer-reviewed, and all of them based on an underlying assumption that the language of mathematics is just English with some additional technical vocabulary (though a few webpages highlight that there are syntactic differences without ever addressing them in a systematic way.) If this were true, then native English speakers would be able to pick up proof writing given a week's time with a vocabulary list. Clearly this is not the case; it seems to take students 1 to 2 years to become fluent in mathematics, which is about the length of time that I would expect for a native English speaker to learn Krio.
About the tags: I'm not sure what to tag this with. Strictly speaking, this is a question about linguistics, not mathematics; but the context is so narrow (there are no people whose primary language spoken at home is proof-writing) that it is only relevant within the mathematics community. This might be relevant to mathematics education, since educators (or at the very least, textbook authors) [seemingly] assume that the language of mathematics is inherently understood by native English speakers without introduction; but then I'm not much of an educator. All I know is that within my limited experience as a tutor many students in introductory classes attempt to write proofs in English, only to be told that they "can't say it that way" with little or no explanation. In fact, I only came to the realization that mathematics is a separate language from English when I noticed an ESL student inserting formulae into English sentences in a way that was consistent with the grammar of Mandarin (and grammatically correct, albeit unusual, in English), but mathematically "wrong" in a way that I could not explain at the time.
Comment: One thing to consider: mathematicians also use a purely symbolic language, a language so "pure" that computers can understand it. We do occasionally say those symbols out loud ("for all", "there exists", "consider x member of") and so on, but that's not really friendly to non-English speakers.
Comment: @barrycarter I had thought about that. In some cases, such as quantifiers, there are distinct grammatical roles played by the English and symbolic expressions of the same kind (it is incorrect to say "It follows that $x$ is at most $5$, $\forall x$."), while in others they can be used intergangeably ("It follows that $x\le 3\delta$" is equivalent to "It follows that $x$ is less than or equal to $3\delta$".)
Comment: translating English to Spanish I dont see some strange thing in the mathematical texts. It means that if for English-speaking persons there is something strange in the way that mathematics is written probably it must be because the used expressions are closer to Latin. And this can be explained because it was common to use Latin to write anything in the middle age, despite the fact the writer was German, English or Swiss
Answer: The reason mathematics is difficult for the untrained to understand is obviously not because of the language but because of the logical reasoning involved. One must have a sufficiently good grasp of basic FOL (semantics and deductive rules) in order to be able to follow mathematical arguments with ease. Ultimately, that dependency on FOL is what makes mathematical writings (especially more rigorous ones) look more like formal languages rather than natural language!
Many educators themselves are woefully ignorant about the issues. For instance, they say "can't say it that way" instead of "it is not logically permissible" because they do not even know what precisely is logically permissible. And most people cannot figure this out on their own; one needs to be taught a deductive system for FOL such as this one. (The situation is the same as with programming; most people cannot construct a programming language all by themselves without knowing any existing programming language.) It also does not help that many educators and mathematicians alike use misleading words like "let" for creating a ∀-subcontext when there actually are appropriate words with the correct meaning like "given [any]" / "take any" (for more explanation see this post).
Comment: @R.Burton: Oh, I thought you *were* focused on why native English speakers cannot quickly pick up mathematical language with just a vocabulary list, and the answer is that vocabulary obviously fails to cover the quantifier structure in proofs. However, if your focus is about how to actually describe mathematical language, then you could post your own answer about Naproche. But I would warn you not to have too much hope that such projects would actually work on the bulk of *actual mathematical writings*, because mathematicians don't have a closed language. =)
Comment: I'm not sure that the distinction between "language" and "logic" is a meaningful one. The identification of meaning in any language is a process of identifying when it is permissible to replace a given string with another - a process which is indistinguishable from the application of inference rules in a deductive system. To say that "'the sky is blue' means 'the colour of the sky is blue'" is to say that either can be inferred from the other.
Comment: Given the inherent difficulty in translating informal proofs to formal ones, I would think that this suggests, if anything, that the *logic* of natural language mathematics is not the same as that of formal FOL to begin with.
Comment: @R.Burton: That's incorrect. Any logician has no trouble translating any sufficiently rigorous proof into a formal one in a reasonably **practical** deductive system. One cannot blame FOL for difficulty of usage if one does not even know a Fitch-style system.
Comment: I'm not sure what you mean. I make a habit of trying to write Fitch-style proofs where I can. Even simple theorems can have proofs spanning hundreds of lines, and the process of disambiguating a few English sentences can take hours, especially as the number of available terms increases (think "supremum," "topological vector space," "product of finitely many," etc.). If the process of creating formal proofs from informal ones were a straightforward matter of transcription, I would write a program to do it for me! (or, more realistically, someone else would have done it ~40 years ago.)
Comment: @R.Burton: Based on your comments, I am pretty sure you have never actually asked any logician and found that they "can take hours [to] disambiguate a few English sentences". It's impossible for a **rigorous** proof to give a logician any difficulty in formalization other than boredom. Firstly, I think you are unfamiliar with all the components that a practical deductive system for FOL requires. This includes definitorial expansion.
Comment: Secondly, formalization is not magic; it cannot turn wishful thinking or unsound handwaving into valid reasoning. You won't be able to point to any part of any rigorous text (e.g. Rautenberg's "Concise Introduction", Jech's "Set Theory") that cannot be easily formalized. Taking hours for one sentence is a clear symptom of some problem either in the original source (i.e. not really valid reasoning) or in the person attempting the formalization (i.e. unfamiliar with a practical full foundational system).
Comment: Thirdly, even non-rigorous mathematics retains a shadow of FOL reasoning, which explains the programming-style structure to mathematical writings. The disconnect between non-rigorous mathematics and formalized versions in FOL-based foundational systems does **not** imply that mathematical language isn't heavily influenced by FOL reasoning. On the contrary, FOL is inextricably linked to mathematical thought and writing at least from the 19th century onwards.
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/137831/discussion-between-r-burton-and-user21820).
Comment: @R.Burton: Um, you didn't respond to my replies in chat (which pinged you). So, do you still have a problem?
Comment: Apologies. I think the Naproche project as a whole is what I am looking for. It is true that mathematical writing contains elements of FOL and of natural language, but "a mixture of FOL and English" is far from complete description of mathematical language.
Comment: In any case, the answer provided here does not address the original question, which is a request for studies of the language that mathematicians actually use, not a search for the cause of students' difficulties with proof writing or an explanation of the elements of formal languages which mathematicians could use but don't.


How do I integrate exponential functions including $e^{x^2}$?

Question: I am trying to prove the following equality:
$$\lambda\int^\infty_{-\infty}\frac{\mathrm df}{\sqrt{2\pi}}\exp\left(i2\pi f(x-a)\right)\exp\left(\frac{-i\pi\lambda tf^2}{n}\right)=\frac{1}{\sqrt{\frac{2\pi it}{n\lambda}}}\exp\left(\frac{i\pi n(x-a)^2}{\lambda t}\right)$$
but am struggling to work out which method to use. I assume somewhere in this I need to use
$$\int^\infty_{-\infty}e^{-f^2}\,\mathrm df=\sqrt{\pi}$$
but I haven't currently got much further than that, can anyone advise on this?
Comment: Write the exponent as a quadratic function in $f$ and complete the square. Then by a shift of the variable you will get to the desired result.
Comment: This is literally written in the most cumbersome way possible
Comment: Following the suggestion by @YvesDaoust it boils down to $$\int_{\mathbb R} \exp\left(-i \pi c \left(\left(f+\frac{d}{2c}\right)^2-\frac{d^2}{4c^2}\right)\right)\,\mathrm df,$$ where $c=\frac{\lambda t}n$ and $d=2a-2x$ which is easy
Answer: Hint:
$$\int_{-\infty}^\infty e^{ax^2+bx+c}\,dx=\int_{-\infty}^\infty e^{a(x-b/2a)^2+c-b^2/4a}\,dx=e^{c-b^2/4a}\int_{-\infty}^\infty e^{ax^2}\,dx.$$


Express $\cos(5t)$ with the help of Euler formula

Question: I can't figure out, how to express $\cos(5t)$ in the form $e^{j\omega t}$. I don't even know the right answer. How would you deal with this task?
Answer: Because
$$e^{ix} = \cos x + i\sin x$$
$$e^{-ix} = \cos x - i\sin x$$
it follows that
$$\cos x = \frac{e^{ix}+e^{-ix}}{2}$$
and therefore
$$\cos (5t) = \frac{e^{5it}+e^{-5it}}{2}$$
Answer: Just use that $\text{Re}(z)=\dfrac{z+\bar{z}}{2}$


how to show multiple groups in add-ins?

Question: My add-ins contains multiple controls,I want to arrage controls in multiple Groups rather an in only one group.
I created multiple Groups,but doesn't work.
How can I do it?
Api Reference
<code>          <Group id="Contoso.Tab1.Group1">
            <!--Label for your group. resid must point to a ShortString resource -->
            <Label resid="Contoso.Tab1.GroupLabel" />
            <Icon>
              <!-- Sample Todo: Each size needs its own icon resource or it will look distorted when resized -->
              <!--Icons. Required sizes 16,31,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX -->
              <!--Use PNG icons and remember that all URLs on the resources section must use HTTPS -->
              <bt:Image size="16" resid="Contoso.TaskpaneButton.Icon" />
              <bt:Image size="32" resid="Contoso.TaskpaneButton.Icon" />
              <bt:Image size="80" resid="Contoso.TaskpaneButton.Icon" />
            </Icon>

            <!--Control. It can be of type "Button" or "Menu" -->
            <Control xsi:type="Button" id="Contoso.FunctionButton">
              <!--Label for your button. resid must point to a ShortString resource -->
              <Label resid="Contoso.FunctionButton.Label" />
              <Supertip>
                <!--ToolTip title. resid must point to a ShortString resource -->
                <Title resid="Contoso.FunctionButton.Label" />
                <!--ToolTip description. resid must point to a LongString resource -->
                <Description resid="Contoso.FunctionButton.Tooltip" />
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="Contoso.FunctionButton.Icon" />
                <bt:Image size="32" resid="Contoso.FunctionButton.Icon" />
                <bt:Image size="80" resid="Contoso.FunctionButton.Icon" />
              </Icon>
              <!--This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFuncion or ShowTaskpane-->
              <!--Look at the FunctionFile.html page for reference on how to implement the function -->
              <Action xsi:type="ExecuteFunction">
                <!--Name of the function to call. This function needs to exist in the global DOM namespace of the function file-->
                <FunctionName>writeText</FunctionName>
              </Action>
            </Control>

          <!-- ....... -->
          </Group>
</code>
Comment: You need to provide more on what exactly doesn't work, other than saying it doesn't work. Provide entire manifest file, other than (...). There is some error inside those dots. The common mistake is usually during copy&past ppl forget to change id's of the elements. They must be unique.
Answer: Currently it's only possible to create multiple groups if you use your own new add-in tab. You cannot create multiple groups on an existing tab.

how to show multiple groups in add-ins?


What can be done if we want to update a record locked by other program or application in RPGLE

Question: Suppose I want to update a record , but that record is being locked by some other application or program , what can be done to make sure that I can update that record in the next iteration?
Comment: You're a very frequent poster lately and I get the impression you're abusing Stackoverflow helpers to do your homework instead you taking your time and learn system and SQL basics from the actual documentation provided by IBM. Stack Exchange is meant as a last resort, and not a free Q&A game. There is a reason that a question should include some proof that you tried to resolve the issue on your own but got stuck.
Answer: If this program was running in batch and it was critical that the record in question gets updated, you could use the (E) extender on your Chain and monitor for the %Error. Something like this:
// This record MUST be updated
Dou %Error = *Off;
  Chain(E) (FileKey) CriticalFile
Enddo;

// At this point, we've gotten past the file lock
If %Found(CriticalFile);
  Update CriticalFileRec;
Endif;

The Do-Until will continuously loop until a successful chain is achieved.
Answer: Nothing. A lock is issued by another application and that application needs to free it.
Answer: The rule to follow is that record locks should never be retained during key think time. That is the job should have no record locks when it runs the exfmt statement to write the display format and wait for the user to press the enter key.  This includes any updates which have not yet been committed when running under commitment control. Always run SQL COMMIT before a blocking DSPF read.


Inner product of $i \partial \bar{\partial}$ against Kähler form equals laplacian

Question: I want to show that if $(M, g, \omega)$ is a Kähler manifold, then the following formula holds:
$$  (*)  \qquad  \qquad \big\langle  i\partial \bar{\partial}\varphi, \omega \big\rangle =\Delta\varphi=-g^{j, \bar{k}}\frac{\partial^2\varphi}{\partial z^j\partial\bar{z}^k} . $$
Here, $\langle\cdot, \cdot\rangle $ is the induced inner product on forms, $\varphi$ is a real function (let's say, at least $C^2$) and $\Delta \varphi:=(\bar{\partial}\bar{\partial}^*+\bar{\partial}^*\bar{\partial})\varphi$ is the usual $\bar{\partial}$-laplacian. I've encountered this identity in the context of a short seminar on complex Monge–Ampère  equations, but they simply use it as a plain known and "trivial" fact.
In fact, I already know that $\Delta\varphi=-g^{j, \bar{k}}\frac{\partial^2\varphi}{\partial z^j\partial\bar{z}^k}$, but the lecturer said that the identity $(*)$ gives it a proof on its own (he didn't know a proof neither, he just told me not to be bothered by it because it is just a "geometry thing")
Can you provide me any hints or insights on why this formula holds? It looks like a quite nice identity on its own.
Answer: $$   \big\langle  i\partial \bar{\partial}\varphi, \omega \big\rangle =
 \big\langle i\varphi_{i\bar j}\,dz^i\wedge d\bar z^j, i g_{j \bar{k}} d z^{j} \wedge d \bar{z}^{k}\big\rangle=\pm\varphi_{i\bar j}g^{i \bar{j}},$$
since $\big\langle dz^i, d\bar z^j\big\rangle=g^{i \bar{j}}$.


Spectrum of a real number

Question: Whilst reading Concrete Mathematics, the authors mention something which they refer to as the "spectrum" of a real number (pg. 77):

We define the spectrum of a real number $\alpha$ to be an infinite multiset of integers, $$\operatorname{Spec}{(\alpha)}=\{\left\lfloor\alpha\right\rfloor, \left\lfloor2\alpha\right\rfloor,\left\lfloor3\alpha\right\rfloor,\cdots\}.$$

It then goes on to describe interesting properties of these "spectra", such as the inequality of any two spectra, i.e. given some $\alpha\in\mathbb{R},\space\not\exists\beta\in\mathbb{R}\setminus\{\alpha\}:\operatorname{Spec}{(\alpha)}=\operatorname{Spec}{(\beta)}$.
It also gives a proof regarding the partitioning of the set $\mathbb{N}$ into two spectra, $\operatorname{Spec}{(\sqrt{2})}$ and $\operatorname{Spec}{(\sqrt{2}+2)}$.
These properties intrigued me, so I wondered if there were any other properties of these multisets, however; a google search for "spectrum of a real number" doesn't appear to yield any relevant results, so I wondered if there was any research into these objects, and if there is whether "spectrum" is a non-standard name (if it is, I'd appreciate the common name for these objects).
Thanks in advance!
Answer: This is non-standard (and does not agree well with any of the other meanings of "spectrum" in mathematics so I would not use it). The standard name is Beatty sequence (at least when $\alpha$ is irrational).
Comment: Ahh thank you! This is exactly what I was looking for!
Comment: @Qiaochu : oddly, the book does not use the term "Beatty sequence", and there is an exercise which is essentially to prove Rayleigh's Theorem, and the term "Rayleigh's Theorem" is not mentioned.  It is strange that this excellent book would use the overworked word "spectrum" for something that already had a name.
Comment: @Qiaochu: come to think of it, maybe they did have a reason.  Wikipedia, at least, defines a Beatty sequence as, well, a sequence, and maybe the authors of "Concrete Mathematics" had a good reason why they wanted to use a multiset rather than a sequence (it seems to me that they are not equivalent concepts, because the order of elements in a multiset should not matter).  Even if they had a good reason, using the overworked word "spectrum" is questionable.
Answer: According to WolframMathWorld:
Spectrum Sequence
A spectrum sequence is a sequence formed by successive multiples of a real number 'a' rounded down to the nearest integer s(n)=floor(n a). If a is irrational, the spectrum is called a Beatty sequence.
EDIT
Here is the Beatty sequence for e

Spectrum of a real number


Finding general solution of first order

Question: Given $\frac{\mathrm{d}y}{\mathrm{d}x}=xe^{-2y}$, find a general solution that satisfies $y(0)=2$. My steps are:
$$
\int\frac{\mathrm{d}y}{e^{-2y}}=\int x \mathrm{d}x \implies \ln e^{2y}=x^2 + C \implies y= \frac{\ln(x^2 + C)}{2}.
$$
Then $y(0)=2$ gives
$$
4 = \ln(0 + C) \implies e^4 = C,
$$
so that
$$
y=\frac{\ln{(x^2+e^4)}}{2}.
$$
Is this right?
Comment: Your integrating step needs fixing.
Comment: A few comments: you start off well (the second line is OK) but do not get the right result. A useful though simple tip for the future, if you want to know if you are right just check if your solution indeed verifies the initial equation. Last, there are a few corrections you can make as regards MathJax (use " \ln " instead of plain " ln "). You alse forgot an $x$ in your third line.
Comment: Hmmm... after looking over the rest of your problem, it could be just that you made some type-os.
Answer: $\int \frac{1}{e^{-2y}} dy =\int x dx$
$\int e^{2y} dy=\int x dx$
$\frac{1}{2} e^{2y}=\frac{x^2}{2}+C$
Comment: thankyou for the answer :D
Answer: Yes that's correct
$$\int\frac{dy}{e^{-2y}}=\int x dx \implies \int{e^{2y}}dy=\int x dx$$
$$\frac {e^{2y}}2=\frac {x^2}2+K \implies e^{2y}=x^2+C$$
$$ y(0)=2 \implies C=e^4$$
$$y(x)=\frac {\ln |x^2+e^4|}2$$
Comment: isnt your answer the same with mine??
Comment: Yes @vik  thats right sorry I corrected my answer I upvoted your answer

Finding general solution of first order


What does monodromy theorem tells about log z and $z^{1/2}$

Question: This question was asked in my complex analysis assignment and I am confused on how to attempt it.

What does monodromy theorem tells about log z and $z^{1/2}$?

I have to choose a Domain D and then define it on a subdomain$D_0$ and then think if it can be analytically continued on D , but defining it on subdomain for log z it equals ${z-1} - (z-1)^2 /2 + (z-1)^3/3-...$ defined for 0<x<1 but it can't be extended for x=0. So, I think there doesn't exists a single valued function f(z) which equalslog z on 0<x<1 and is analytic on whole $\mathbb{C}$.
For $(z)^{1/2}$  it is not analytic at z=0 ( using it's taylor series expansion ) so I think the same can be said about it.
Am I right? If wrong can you please tell what are the right observations about these functions?
Comment: Thank you for mentioning the origin of the problem and showing your work , it is refreshing to see quality questions like this .
Answer: Both have a branch point at $0$, they are not the same when continued analytically along the unit circle, for $f(z)=\log z, |z-1|<1/2$ the analytic continuation sends $f(z)$ to $f(z)+2i\pi$, for $g(z)=z^{1/2}$ it is $g(z)\to -g(z)$. Thus clearly neither of them can be extended to an analytic function on $0<|z|<2$.


how to create a apply button in view table result ?

Question: I have created a view with display format as table
I want to create a button in the last column for every row
So that when user click on that button form then form open.
So how can I create that button for every row
Comment: Would you explain for what purpose the button should be?
Comment: Apply for job. as list job their in table format I want another column with this button on every job row
Answer: 1) On the left side of the Views admin screen, click the "Add" button next to Fields to add a new field
2) Search for "custom field" and select Custom Field
3) For Create a Label, enter: Apply for Job
4) For Text, enter:
Apply for Job

(class="button" is what makes the link look like a button)
5) Replace /link/to/destination above with the location of where they can apply for the job. If you need to use replacements in the URL like the node ID number, add the NID field to the view, and replace the URL with something like /node/[nid]/apply
View attached screenshot for what it should look like.
Comment: yes exactly like this. Could you please tell me how I can attach node so that the value with that button goes into my form. I am using global php content.
Comment: I'd use a "Custom Field" field instead of a PHP global content field. You can set the destination of the link to something like node/[nid]/edit, and make sure the NID field is present in the view prior to the custom field so that you can use it as a replacement. But if you have to use a Views PHP field, you can do the same, except the link will look something like node/nid; ?>/edit, or wherever the destination of the button needs to go.
Answer: In field type create a field for nid and do not expose it display.The use Global Php for creating button and add nid with the link to buttonUse that nid to fetch that details and fill that form For any clarification please ask after researching so much Now I can ans this question.
Answer: Take a look at Views accordion module.

Features

Works with field grouping and relationships.
Option to use the field
  grouping headers as the headers for the accordion items. (yay!)
Configure settings for jQuery UI Accordion through the views
  interface.

Have a look at this is quick demo video.
Comment: But how it will help me to add button. Please provide some more help link
Answer: Add a Header Global: Text area (or Footer) and add your HTML to render a submit button.


Software to analyze tempo over time of a record

Question: I am searching for a tool to analyze the tempo of a recording of my drum sessions. I found a lot of tools online that would tell me the BPM of the record (which is an average value for live records).
But i am looking for something that displays a chart with a curve that shows the tempo over time.
The Android app "Live BPM" basically does what i need, but as the name suggests i need to playback the whole track for the software to analyze it. What i like to have is a software to throw in a wav or mp3 file and get back a chart as described above.
Does anyone know about something like this?
Comment: Might also want to try posting this at http://softwarerecs.stackexchange.com/
Answer: I'm sure most DAWs are capable of doing this, at least Cubase is.
The procedure to create a tempo track from an audio file is:

Import Audio Track, set tempo track start tempo to something near the start tempo of the audio/drum track, turn on click, listen to track with click - it will be out of sync
Open the Audio event editor by double clicking the audio event with the pointer tool
Adjust the grid with the warp tool so bars match the transients in your audio track
A tempo track will be created containing the tempo changes (curve you wanted) that happen in your audio file

You can then further use this tempo track.
Answer: Riffstation will do this. It's aimed at guitarists but is equally useful for anyone trying to learn by ear/transcribe. There's a free trial for it.
Answer: really, unless you record with a click or metronome, it is just too much hassle to mark out points and stretch or warp, or so on.
such painstaking work.
if you use digital/electronic gear, this will not be an issue. just type in the beats per minute and the grid will be pretty much pefect.
if you have to adjust it, you need only do it once for the whole recorded track.
on the other hand, if you are not using digital/electronic gear, but for example an electric or acoustic guitar you really need to have a click (this is really what is called a metronome) to keep you in time as you will save so much time by dong so for yourself, and everyone else involved.
a free piece of software which will count bpm for you very accurately if needed is called Mixmeister, and the free version allows highly acurate bpm count.
though, again, unless you have a perfect ear for time and can play like an electronic device you will still need to mark out and warp each section of the piece. (HASSLE)
likewise traktor 2 and other pro dj gear will count the bpm accurately for you. but you'll still have the same issue unless you use a form of metronome to keep you in perfect clock ticking beat.
i know many musicians slag this "mechanical" timing off, but really, it makes a hell of a difference to your work and work time, makes life easier for you and workmates.


$M =\mathbb{C}[x]/(x^2)$ is not a free module over $\mathbb{C}[x]$

Question: I'm trying to understand this example:
$M= \mathbb{C}[x]/(x^2)$ is a module over $\mathbb{C}[x]$, (since if R is any ring and I is any ideal of R, then R/I is always an R-module.)
Then
(i) $M$ is cyclic
(ii) $M$ is not a free module over $\mathbb{C}[x].$
I understand the first claim. $M$ is cyclic because the element $1 \in \mathbb{C}[x]$ generates $M:$ $\mathbb{C}[x]/(x^2)= \mathbb{C}[x]\cdot 1$.
In class, the explanation given for why $M$ is not a free module is that $x^2\cdot1= 0,$ and $x^2 \neq 0,$ so the module can't be free.
I understand that for a module to be free, it must have a basis. So if $X$ were a basis, and $1\in X,$ then the above statement would make sense. But why is $1$ necessarily in the basis? What am i missing?
Comment: $M$ is shown to have a torsion element. SInce every free module is torsion-free, $M$ cannot be free.
Answer: Note that if $M$ would be free then it would be isomorphic to $\mathbb{C}[x]$ since it is cyclic. But this is not the case since in $\mathbb{C}[x]$, any nonzero element has trivial annihilator whereas in $M$, $1$ has $x^2$ in its annihilator.
Comment: If $I=(0)$ or $I=R$ then the quotient is free. If not, the quotient is not free because of the same reason (I assume that $R$ is a commutative ring with unity).
Comment: "Note that if M would be free then it would be isomorphic to C[x] since it is cyclic. " Is this because a free module $M$ is isomorphic to the direct sum of $R$, so if it is cyclic, then $M$ will be isomorphic to $R$ itself?
Comment: @Ari Yes, you are right.
Comment: So can we conclude in general that if $R$ is a ring and $I$ is a nontrivial ideal of $R$, then $R/I$ is not a free module over $R$?
Answer: Yet another proof: any free $\mathbb C[x]$-module is an infinite dimensional $\mathbb C$-vector space, but your module has dimension two, which is finite.
Answer: Consider a commutative ring $R$ and an ideal $I$. Then $R/I$ projective implies $I$ is a direct summand of $R$, hence of the form $eR$, for $e$ an idempotent element.
Also the converse is true, because a direct summand of a projective module (in particular, free) is projective.
Since $\mathbb{C}[x]$ is a domain, it has no nontrivial idempotents, so for no proper and nonzero ideal $I$, $\mathbb{C}[x]/I$ is projective and, a fortiori, free.
Answer: A free $R$ module is isomorphic to $\oplus_{i\in I}R_i$ where $R_i$ is isomorphic to $R$, since $\mathbb{C}[X]$ does not have torsion element, a free $\mathbb{C}[X]$ module cannot have nilpotent elements.
Comment: I don't understand this argument. How can a module have a nilpotent element? What do you mean by a nilpotent element?
Comment: $p.(x_1+...+x_n)=0$ implies that $px_i=0$.