Only content controls are allowed directly in a content page that contains content controls

Question: only content controls are allowed directly in a content page that contains content
and it is showing  red color error..

i am getting the  above error after publish the  web site in iis  in source code it is not showing any error but in iis  it is giving the error.
and one more thing is  in local server(iis) and  source code no problem but in client  iis the above problem is comming
i have  25  forms  out of 25  forms   only 3  are giving the same problem ...
i am getting  master page  from each form..
Can u plz give me any suggesions..
plz..
Answer: It seems that you have written Script tag or some other contents outside the  tags. Remove it from outside and put it inside the tags. Your error could be gone.
Thanks.
Comment: hi Monika can u plz have a look on below link  i added  my code in notepad http://www.megafileupload.com/en/file/469114/leave-txt.html plz give me suggestions
Comment: @SrinivasRachumallu this file is perfect can u also check other 3 files which gives error.
Comment: hi monika thanks for your reply..http://www.megafileupload.com/en/file/469117/profile-txt.html actually  previous links i given na that  form also  giving the error this is  another form design code  this form also giving the same error can u plz check it
Comment: Remove

 from your page as you are using master page. Try out. Keep only  tag.
Comment: http://www.megafileupload.com/en/file/469123/APPRO-txt.html this is my last form  i think  same problem  like above what u given suggestion but plz have a look on above code..
Comment: From here also remove the same thing as i told in previous comment
Answer: <%@ Page Language="VB" MasterPageFile="~/MasterPage1.master" AutoEventWireup="false"
    CodeFile="App_form.aspx.vb" Inherits="App_form" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">

    <asp:LinkButton ID="LinkButton4" runat="server" Style="z-index: 100; left: 757px;
        position: absolute; top: 434px; height: 15px; width: 77px;" Font-Bold="True"
        Font-Names="Times New Roman" Font-Size="Medium" Visible="false">LogOut</asp:LinkButton>
    <asp:Label ID="Label11" runat="server" Font-Bold="True"
    Font-Names="Cambria" Font-Size="Large"
        Style="z-index: 102; left: 0px; position: absolute; top: -1px; width: 1125px;
        text-align: center; height: 25px;" Text="Appraisal Form" BorderColor="#8CB1DA"
        ForeColor="Black" BackColor="#666666"></asp:Label>

    <asp:Panel ID="Panel1" runat="server" Font-Bold="False" Style="top: 57px; z-index: 103;
        left: 9px; position: absolute; height: 275px; width: 1111px;">

        <asp:Label ID="Label1" runat="server" Font-Bold="False" Font-Names="Cambria" ForeColor="Black"
            Style="z-index: 100; left: 10px; position: absolute; top: 38px; width: 107px;"
            Text="Employee Code" Font-Size="Medium"></asp:Label>
        <asp:TextBox ID="txtDepartment" runat="server" Font-Bold="True" Font-Names="Cambria"
            ForeColor="#0000C0" Style="z-index: 101; left: 348px; position: absolute; top: 63px;
            width: 135px; bottom: 193px;"></asp:TextBox>
        <asp:TextBox ID="txtDesignation" runat="server" Font-Bold="True" Font-Names="Cambria"
            ForeColor="#0000C0" Style="z-index: 101; left: 119px; position: absolute; top: 63px;
            width: 134px;"></asp:TextBox>
        <asp:TextBox ID="txtemp" runat="server" Font-Bold="True" Font-Names="Cambria"
            ForeColor="#0000C0" Style="z-index: 101; left: 120px; position: absolute; top: 37px;
            width: 133px;"></asp:TextBox>
        <asp:Label ID="Label2" runat="server" Font-Bold="False" Font-Names="Cambria" ForeColor="Black"
            Style="z-index: 102; left: 264px; position: absolute; top: 37px; width: 66px;"
            Text="Name" Font-Size="Medium"></asp:Label>
        <asp:TextBox ID="txtname" runat="server" Font-Bold="True" Font-Names="Cambria"
            ForeColor="#0000C0" Style="z-index: 103; left: 349px; position: absolute; top: 37px;
            width: 135px;"></asp:TextBox>
        <asp:Label ID="Label3" runat="server" Font-Bold="False" Font-Names="Cambria" ForeColor="Black"
            Style="z-index: 104; left: 8px; position: absolute; top: 89px; height: 20px;
            bottom: 166px;" Text="Date of Join" Width="107px" Font-Size="Medium"></asp:Label>
        <asp:TextBox ID="txtdt" runat="server" Font-Bold="True" Font-Names="Cambria"
            ForeColor="#0000C0" Style="z-index: 105; left: 119px; position: absolute; top: 89px;
            width: 135px;"></asp:TextBox>
        <asp:Label ID="Label4" runat="server" Font-Bold="False" Font-Names="Cambria" ForeColor="Black"
            Style="z-index: 106; left: 492px; position: absolute; top: 38px; width: 81px;"
            Text="Designation" Font-Size="Medium"></asp:Label>
        <asp:TextBox ID="txtpos" runat="server" Font-Bold="True" Font-Names="Cambria"
            ForeColor="#0000C0" Style="z-index: 107; left: 575px; position: absolute; top: 37px;
            width: 135px;"></asp:TextBox>

        <asp:Label ID="lblReviewer" runat="server" Font-Bold="False" Font-Names="Cambria"
            Font-Size="Medium" ForeColor="Black" Style="z-index: 100; left: 493px; position: absolute;
            top: 89px; width: 77px;" Text="Reviewer"></asp:Label>
        <asp:Label ID="lblLocation" runat="server" Font-Bold="False" Font-Names="Cambria"
            Font-Size="Medium" ForeColor="Black" Style="z-index: 100; left: 264px; position: absolute;
            top: 87px; width: 72px;" Text="Location"></asp:Label>
        <asp:Label ID="lblDepartment" runat="server" Font-Bold="False" Font-Names="Cambria"
            Font-Size="Medium" ForeColor="Black" Style="z-index: 100; left: 262px; position: absolute;
            top: 60px; width: 81px;" Text="Department"></asp:Label>
        <asp:Label ID="lblManager" runat="server" Font-Bold="False" Font-Names="Cambria"
            Font-Size="Medium" ForeColor="Black" Style="z-index: 100; left: 10px; position: absolute;
            top: 65px" Text="Manager" Width="107px"></asp:Label>

        <asp:Label ID="Label5" runat="server" Font-Bold="False" Font-Names="Cambria" ForeColor="Black"
            Style="z-index: 109; left: 494px; position: absolute; top: 62px; width: 47px;"
            Text="Grade" Font-Size="Medium"></asp:Label>

        <asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True" Font-Bold="True"
            Font-Names="Cambria" ForeColor="#0000C0" Style="z-index: 110; left: 119px;
            position: absolute; top: -30px; width: 130px;">
        </asp:DropDownList>
        <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
            Font-Bold="True" Font-Names="Cambria" ForeColor="#0000C0" Style="z-index: 110; left: 574px;
            position: absolute; top: 62px; width: 136px; height: 19px;">
        </asp:DropDownList>

            <asp:Label ID="Label19" runat="server" Font-Bold="True" Font-Names="Cambria"
                Font-Size="Medium" ForeColor="Black" Style="z-index: 103; left: 265px; position: absolute;
                top: -32px; height: 29px; width: 446px;"></asp:Label>
            <asp:Label ID="Label18" runat="server" Font-Bold="True"
                Font-Names="Cambria" Font-Size="Medium" ForeColor="Black" Style="z-index: 103; left: 7px; position: absolute;
                top: -32px; height: 29px; width: 104px;" Text="Document No"></asp:Label>
            <asp:Label ID="Label17" runat="server" Font-Bold="True"
                Font-Names="Cambria" Font-Size="Medium" ForeColor="Black" Style="z-index: 103; left: 11px; position: absolute;
                top: 5px; height: 29px; width: 92px;" Text="From Month"></asp:Label>
            <asp:Label ID="Label15" runat="server" Font-Bold="True" Font-Names="Cambria"
                Font-Size="Medium" ForeColor="Black" Style="z-index: 103; left: 323px; position: absolute;
                top: 5px; height: 29px; width: 84px;" Text="To Month"></asp:Label>
            <asp:TextBox ID="txttyear" runat="server" AutoPostBack="True" Font-Bold="True" Font-Names="Cambria"
                ForeColor="#0000C0" Style="z-index: 108; left: 528px; position: absolute; top: 5px;
                width: 61px; right: 126px; height: 19px;" TabIndex="5"></asp:TextBox>
            <asp:TextBox ID="txtfyear" runat="server" AutoPostBack="True" Font-Bold="True" Font-Names="Cambria"
                ForeColor="#0000C0" Style="z-index: 108; left: 253px; position: absolute; top: 7px;
                width: 61px; right: 797px;" TabIndex="5"></asp:TextBox>
            <asp:TextBox ID="txttmonth" runat="server" AutoPostBack="True" Font-Bold="True" Font-Names="Cambria"
                ForeColor="#0000C0" Style="z-index: 108; left: 401px; position: absolute; top: 7px;
                width: 55px; right: 259px;" TabIndex="5"></asp:TextBox>
            <asp:Label ID="lblFrmYear" runat="server" Font-Bold="True" Font-Names="Cambria"
                Font-Size="Medium" ForeColor="Black" Style="z-index: 102; left: 167px; position: absolute;
                top: 6px; right: 864px; width: 80px; height: 22px;" Text="From Year"></asp:Label>
            <asp:Label ID="Label16" runat="server" Font-Bold="True" Font-Names="Cambria"
                Font-Size="Medium" ForeColor="Black" Style="z-index: 103; left: 467px; position: absolute;
                top: 5px; height: 21px; width: 83px;" Text="To Year"></asp:Label>
            <asp:GridView ID="Gridview1" runat="server" ShowFooter="True" AutoGenerateColumns="False"
            OnRowDeleting="OnRowDeleting"
                Height="28px" Width="705px" BackColor="#666666" BorderColor="#666666"
                CellPadding="2" ForeColor="Black" GridLines="None" Font-Names="Cambria"
                Font-Size="Small">
                <Columns>
                    <asp:BoundField DataField="RowNumber" HeaderText="S.No" />
                    <asp:TemplateField HeaderText="Key Results Area">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="KPI">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox9" runat="server" TextMode="MultiLine"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Target">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Weightage(%)">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Target Achieved (Self-Assessment)">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                            <%-- <asp:DropDownList ID="TextBox4" runat="server" Width="150" AppendDataBoundItems="true" Enabled="false">
                            <asp:ListItem Text="-- Select --" Value="-1" />
                            <asp:ListItem Text="Needs Improvements" Value="Needs Improvements" />
                            <asp:ListItem Text="Party Meets Expectation" Value="Party Meets Expectation" />
                            <asp:ListItem Text="Meets Expectation" Value="Meets Expectation" />
                            <asp:ListItem Text="Sometime Exceeds Expected" Value="Sometime Exceeds Expected" />
                            <asp:ListItem Text="OutStandaing" Value="OutStandaing" />
                            </asp:DropDownList>--%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Remarks">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox5" runat="server" Enabled="false"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Target Achieved (Appraiser)">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox6" runat="server" Enabled="false"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Final Achievement.">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox7" runat="server" Enabled="false"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Reviewer's Comment">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox8" runat="server" Enabled="false"></asp:TextBox>
                        </ItemTemplate>
                        <FooterStyle HorizontalAlign="Right" />
                        <FooterTemplate>
                            <asp:Button ID="ButtonAdd" runat="server" Text="Add New Row" OnClick="ButtonAdd_Click" />
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:ButtonField ButtonType="Button" CommandName="Delete" HeaderText="Delete"
                        ShowHeader="True" Text="Delete"  />
                </Columns>
                <FooterStyle BackColor="#666666" />
                <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                <HeaderStyle BackColor="#666666" Font-Bold="True" />
            </asp:GridView>

        <asp:TextBox ID="txtfmonth" runat="server" AutoPostBack="True" Font-Bold="True" Font-Names="Times New Roman"
            ForeColor="#0000C0" Style="z-index: 120; left: 108px; position: absolute; top: 7px;
            height: 19px; width: 51px;" TabIndex="4"></asp:TextBox>
        <asp:TextBox ID="txtReviewer" runat="server" Font-Bold="True" Font-Names="Cambria"
            ForeColor="#0000C0" Style="z-index: 101; left: 574px; position: absolute; top: 90px;
            width: 135px;"></asp:TextBox>
        <asp:TextBox ID="txtLocation" runat="server" Font-Bold="True" Font-Names="Cambria"
            ForeColor="#0000C0" Style="z-index: 101; left: 348px; position: absolute; top: 89px;
            width: 135px;"></asp:TextBox>

        <asp:Button ID="btnProcess" runat="server" Font-Bold="True" Font-Names="Cambria"
            Font-Size="10pt" ForeColor="White" Style="z-index: 111; left: 611px; position: absolute;
            top: 4px; height: 22px; width: 96px;" Text="Process" ValidationGroup="add"
            BackColor="#666666" BorderColor="Blue" BorderStyle="Solid" />
        <asp:Button ID="add" runat="server" Font-Bold="True" Font-Names="Cambria"
            Font-Size="10pt" ForeColor="White" Style="z-index: 111; left: 557px; position: absolute;
            top: 400px; height: 26px; width: 66px;" Text="Submit"
            ValidationGroup="add" BackColor="#666666" BorderColor="Blue"
            BorderStyle="Solid" />
        <asp:Button ID="cancel" runat="server" Font-Bold="True" Font-Names="Times New Roman"
            Font-Size="10pt" ForeColor="White" Style="z-index: 113; left: 628px; position: absolute;
            top: 400px; height: 26px; width: 66px;" Text="Cancel" BackColor="#666666"
            BorderColor="Blue" BorderStyle="Solid" />

        <asp:ImageButton ID="ImageButton1" runat="server" AlternateText="Add" BorderStyle="None"
            ImageUrl="~/Images/btn.jpeg" Style="z-index: 114; left: 661px; position: absolute;
            top: 96px; height: 17px; width: 50px;" Visible="False" />
        <asp:TextBox ID="txtAppraiser0" runat="server" Style="z-index: 170; left: 201px;
            position: absolute; top: 360px; width: 493px; height: 32px;"
            TextMode="MultiLine" Font-Names="Cambria"></asp:TextBox>
        <asp:TextBox ID="txtAppraiser" runat="server" Style="z-index: 170; left: 201px; position: absolute;
            top: 323px; width: 493px; height: 31px;" TextMode="MultiLine"
            Font-Names="Cambria"></asp:TextBox>
        <asp:TextBox ID="txtTraining" runat="server" Style="z-index: 170; left: 201px; position: absolute;
            top: 287px; width: 493px; height: 30px;" TextMode="MultiLine"
            Font-Names="Cambria"></asp:TextBox>
        <asp:Label ID="Label14" runat="server" Font-Bold="False" Font-Names="Cambria" Font-Size="Medium"
            ForeColor="Black" Style="z-index: 109; left: 13px; position: absolute; top: 362px;
            width: 179px; height: 24px;" Text="Final Comments - Reviewer"></asp:Label>
        <asp:Label ID="Label13" runat="server" Font-Bold="False" Font-Names="Cambria" Font-Size="Medium"
            ForeColor="Black" Style="z-index: 109; left: 12px; position: absolute; top: 326px;
            width: 189px; height: 25px;" Text="Final Comments - Appraiser"></asp:Label>
        <asp:Label ID="Label12" runat="server" Font-Bold="False" Font-Names="Cambria" Font-Size="Medium"
            ForeColor="Black" Style="z-index: 109; left: 14px; position: absolute; top: 290px;
            width: 131px; height: 21px;" Text="Training Needs"></asp:Label>
        <asp:GridView ID="gvApprList" runat="server" AutoGenerateColumns="False" BackColor="#DEBA84"
            BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2"
            Height="174px" Width="729px" DataKeyNames="DocEntry">
            <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
            <Columns>
                <asp:ButtonField ButtonType="Link" Text="Select" CommandName="SLK" HeaderText="Select"
                    ItemStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Center" ItemStyle-ForeColor="DarkBlue" />
                <asp:BoundField DataField="DocEntry" HeaderText="Doc Entry" ItemStyle-Font-Bold="true"
                    ItemStyle-HorizontalAlign="Center" Visible="false"/>

                <asp:BoundField DataField="U_NAME" HeaderText="Employee Name" ItemStyle-Font-Bold="true"
                    ItemStyle-HorizontalAlign="Center" />
                <asp:BoundField DataField="U_DSIG" HeaderText="Designation" ItemStyle-Font-Bold="true"
                    ItemStyle-HorizontalAlign="Center" />
                <asp:BoundField DataField="U_FrmMth" HeaderText="From Month" ItemStyle-Font-Bold="true"
                    ItemStyle-HorizontalAlign="Center" />
                <asp:BoundField DataField="U_FrmYer" HeaderText="From Year" ItemStyle-Font-Bold="true"
                    ItemStyle-HorizontalAlign="Center" />
                <asp:BoundField DataField="U_ToMth" HeaderText="To Month" ItemStyle-Font-Bold="true"
                    ItemStyle-HorizontalAlign="Center" />
                <asp:BoundField DataField="U_ToYer" HeaderText="To Year" ItemStyle-Font-Bold="true"
                    ItemStyle-HorizontalAlign="Center" />
            </Columns>
            <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
            <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
    </asp:Panel>
</asp:Content>

Put this code.
Comment: OK  GIVE ME SOME TIME I WILL  MAKE CHANGES  AND  I WILL TEST IT HERE THANK YOU I WILL CHECK IT..
Comment: hi monica  the above code  i tried ... local iis working fine but  client server  not working same error is comming like previoushttp://www.megafileupload.com/en/file/469130/Errror-JPG.html have a look on above  image
Comment: hi any body help me ..Actually  what is the problem.. is there any iis  problem in client..


Why is there no continuous log function on $\mathbb{C}\setminus\{0\}$?

Question: Over the years, I've often heard that there is no logarithm function which is continuous on $\mathbb{C}\setminus\{0\}$.
The usual explanation is usually some handwavey argument about following such a function around the unit circle, and getting a contradiction at $e^{2\pi i}$ or something.
I've been a little unsatisfied with these. What is a more formal, rigorous proof that there is no continuous log function on $\mathbb{C}\setminus\{0\}$ that is understandable to a nonexpert? Thanks.
Comment: Very closely related: http://math.stackexchange.com/questions/91131/why-there-is-no-continuous-argument-function-on-mathbbc-setminus-0
Answer: If a holomorphic function $f(z)$ on a domain $D\subset \mathbb C$ has a primitive $F(z)$ on $D$ , that is $F'(z)=f(z) $, then its integral over any piecewise differentiable  loop $\gamma$ in $D$ is zero :  $\int _\gamma f(z)dz=0$.
If $\log (z)$ existed on $\mathbb C^*$, it would be a primitive of  $1/z$  [ to  get $\log'(z)=1/z$ just differentiate $\exp(\log(z))=z$ ]. Hence for the circle $\gamma (t)= e^{2i\pi t} \; (0\leq t \leq 1)$ we would have $\int _\gamma\frac{1}{z} dz=0$.
However a trivial calculation shows that $\int _\gamma\frac{1}{z} dz=2i\pi$.
Comment: I am  giving this alternative proof, bypassing coverings, for users more happy with complex analysis.
Answer: Such a logarithm would be a continuous section of the covering space $exp:\mathbb C\to \mathbb C^*$, hence would be a homeomorphism.   But $\mathbb C$ and $\mathbb C^*$ are not homeomorphic .
Comment: -1, not nearly "understandable to a nonexpert"
Comment: I don't think it's bad to have lots of answers at different levels.
Comment: Dear @Ricky, yours is a perfectly legitimate  opinion, but I consider that the elementary  theory of coverings is  part of the  basic training of a  mathematician. Many institutions provide such a course at an undergraduate level. Anyway the point of view that you have to be an expert (in what?) to know about coverings strikes me as unusual.
Comment: I don't agree with the downvoting, largely because I think that the "Accept" feature is a good enough way to identify which answer is most helpful to the OP, as distinguished from the answer with the widest appeal.  But if it led to a third good answer to this question, it can't be all bad.
Comment: ...and @Jonas (I split the sentence because the software prevents me from notifying two users in one comment)
Comment: Thanks, but I'm afraid this is over my head at this point.
Comment: Dear @Hallyu, I have added another answer based on complex functions that might be more to your liking.
Comment: Thanks for your point of view, @Dylan...
Answer: Consider the logarithm of $e^{it}$ where $t$ is a real number.
$\ln(e^{it}) = it + 2\pi i k$ where $k$ is some integer.  Since for each $t$ this choice of $k$ is a discrete choice, if your logarithm is continuous, $k$ would have to be constant.
So $\ln(e^{it}) = it + 2 \pi i k$ but this is not the same for $t=0$ and $t=2\pi$, so $\ln$ is not well-defined.
So there's one continuity argument I haven't filled in, regarding $k$ having to be constant.  But that's not too tricky.  I suppose the easiest way to show $k$ is constant is to look at the difference $\ln(e^{it}) - it$, differentiate it and notice that's zero.
Comment: Ok, lets make it more formal. Suppose by contradiction ln is continuous. Define a new function $g: R \rightarrow C$ by $g(t)= \ln(e^{it})-it$. This function is continuous on reals. Also, if $\ln(e^{it})=z$ it follows that $e^{z}=e^{it}$ and thus $e^{z-it}= 1$. This shows that $z-it$ is of the form $2k \pi i$. But since $z=\ln(e^{it})$, we just proved that this function only takes values of that type. Now, using the continuity of $g$, it follows that $g$ is constant... Thus, we proved that $\ln(e^{it})-it$ is constant which implies that $\ln(e^{i0})=\ln(e^{2 \pi i})-2 \pi i$. COntradiction
Comment: Here is a simpler way to look at this argument: Suppose that $\ln$ is defined on $C \0$. Then $\ln$ is continuous there, but so is $it$. It follows from here that the function $\ln*z-it$ is continuous and takes only values of the type $\{2 \pi ki\}$. But any such function must be constant...
Comment: Oh I see. Also, in differentiating $\ln(e^{it})-it$, does that assume $\ln$ is already differentiable? Is that is a problem if one is trying to show no such continuous function exists?
Comment: Thank you Professor. Plugging in, $\ln(e^{i0})=0$ and $\ln(e^{i2\pi})=2\pi i+2\pi i k$. This implies $(2\pi i)(k+1)=0$, but what if $k=-1$? Does a further case of $t=4\pi$ need to be added to see that $4\pi i+2\pi i k=(2\pi i)(2+k)=0$ to see that $\ln$ is not well defined, or am I missing something?
Comment: $\ln(e^{i0}) = 2\pi i k$, not zero, well, it depends on your choice of $k$.
Comment: Well there is no need to differentiate, is you are familiar with the notion of connected sets. Or if you know which are the only open and closed subsets of $C - 0$... The point is that the point $2 \pi ki$ is closed, but you can also put a small ball around it so it meets no other point of this type.... And then the preimage has to be both open and closed...
Comment: @N.S. Thanks, I understand then why $\ln*z-it$ is continuous, but why would it only take values of type $\{2\pi ki\}$? I know it has that form for inputs of from $e^{it}$, but why should the outputs be of that form for all nonzero complex numbers?
Comment: That any continuous logarithm function has to be differentiable, this comes from the inverse function theorem (multi-variable calculus).
Comment: That any two values of log differ by an integer multiple of $2\pi i$, this comes from thinking about what the exponential map does -- write $e^{x+iy}$ in polar coordinates, for example.
Comment: They shouldn't be. $\:$ $\operatorname{ln}(\operatorname{exp}(i\cdot (-\pi)))$ and $\operatorname{ln}(\operatorname{exp}(i\cdot \pi))$ will be of that form with different values of $k$. $\:\:$ By the contrapositive of the intermediate value theorem, $\: t\mapsto (\operatorname{ln}(\operatorname{exp}(i\cdot t))+(-(i\cdot t))) \:$ is not continuous. $\:\:$ Therefore $\operatorname{ln}$ is not continuous. $\:\:\:$
Comment: The contradiction being the fact that $e^{i0}=e^{2 \pi i}$.
Comment: Dear @N.S., I very much like your formal comment, thank you. Do you mind giving a quick explanation of why continuity of $g$ implies $g$ is constant here?
Comment: If $g$ takes two different values, when you multiply it by $i$, you get a continuous function from $R$ to $R$ whose image is only points of the type $2k \pi$. Now, if this function takes two different values, by the IVT it takes all the values in between (hence values not of the form $2 k \pi$.)


Show that there exist $f_1 \in L^{p_1}$ and $f_2 \in L^{p_2}$ such that $f = f_1 +f_2$.

Question: Let $1 \le p_1 < p \le p_2 \le \infty$ and let $f\in L^p$. Show that there exist $f_1 \in L^{p_1}$ and $f_2 \in L^{p_2}$ such that $f = f_1 +f_2$.
Just for clarify, we consider the $L^p$-spaces on $\mathbb{R}^n$.
How can I start this exercise?
Answer: Let $A:=\{ |f|>1\}$ and $g:=f_1\chi_A$, where $\chi_A$ is the characteristic function of the set $A$ and $f_2:=f-f_1$. Obviously $f=f_1+f_2$.
Also since $|f(x)|^{p_1}< |f(x)|^p$, for every $x\in A$,
$$\| f_1\|_{p_1}^{p_1}=\int_{\mathbb{R}^n} |f_1|^{p_1} = \int_{\mathbb{R}^n} |f\chi_A|^{p_1}= \int_A |f|^{p_1} < \int_A |f|^{p} < \int_{\mathbb{R}^n} |f|^{p} = \| f\|_{p}^{p}< \infty$$
Now using pretty much the same reasoning (observe that $f_2=f\chi_{\mathbb{R}^n \setminus A}$), we can show that
$$\| f_2\|_{p_2}^{p_2} < \| f\|_{p}^p<\infty$$
Thus, $f_1 \in L^{p_1}$ and $f_2 \in L^{p_2}$.
Comment: I can't get the conclusions very well, can I ask you to be more precise?
Comment: I edited my answer. Is it better now?
Answer: There are many ways to partition an function $f\in L_p$ as an element of $L_{p_1}+L_{p_2}$. The construction of Marcinkiewcz described below, allows also to add different "weights" to components in $L_{p1}$ or $L_{p_2}$.
Fixed $\lambda>0$. If $f\in L_p$ then $$\mu(|f|>\lambda)=\mu(|f|^p>\lambda^p)\leq\frac{1}{\lambda^p}\|f\|^p_p$$
Let $g_\lambda=f\mathbb{1}_{\{|f|>\lambda\}}$ and $h_\lambda=f-g_\lambda=f\mathbb{1}_{\{|f|\leq\lambda\}}$.
Notice that $|f|^{p_1}\in L_{p/p_1}$, and $\mathbb{1}_{\{|f|>\lambda\}}\in L_{p/(p-p_1)}$. An application of Höler's inequality leads to
\begin{aligned}
\int |g_\lambda|^{p_1}\,d\mu&=\int |f|^{p_1}\mathbb{1}_{\{|f|>\lambda\}}\,d\mu\leq \Big(\int |f|^p\,d\mu\Big)^{\tfrac{p_1}{p}}\Big(\int \mathbb{1}_{\{|f|>\lambda\}}\,d\mu\Big)^{1-\tfrac{p_1}{p}}\\
&\leq \|f\|^{p_1}_p\Big(\lambda^{-p}\|f\|^p_p\big)^{\tfrac{p-p_1}{p}}=\frac{1}{\lambda^{p-p_1}}\|f\|^p_p<\infty
\end{aligned}
That is, $g_\lambda\in L_{p_1}$.
For $h_\lambda$ we have that $|h_\lambda|\leq \lambda$ and so
$$|h|^{p_2} =|h_\lambda|^{p_2-p}|h_\lambda|^p\leq \lambda^{p_2-p}|h_\lambda|^p$$
which implies
$$
\int|h_\lambda|^{p_2}\,d\mu\leq \lambda^{p_2-p}\int_{|f|\leq\lambda}|f|^p\,d\mu\leq \lambda^{p_2-p}\int|f|^p\,d\mu=\lambda^{p_2-p}\|f\|^p_p<\infty$$
That is, $h_\lambda\in L_{p_2}$.
Comment: I just changed the "accepted" answer here because of the completness of this answer. Thank you


Docker: Error response from daemon: attaching to network failed

Question: I have production docker swarm instalation
Im my CI I have regular launch of
docker run --network prod_default ...

Sometimes it fails with error
docker: Error response from daemon: attaching to network failed, make
sure your network options are correct and check manager logs: context
deadline exceeded.

Any ideas about reason ? or how to fix it?
Comment: You should first check if your network prod_default is attachable.

```docker inspect --format='{{.Attachable}}' prod_default```.
Answer: set your all nodes to active state:
docker node update --availability active node02

see more here
Answer: I might be a bit late but make sure the ENGINE VERSION is the same for both of your nodes
You can check the version with:
sudo docker node ls


Samba 4 not working correcty as dns for internal (LAN) addresses

Question: [Edit]
We tried to use samba_internal dns and also bind9_dlz on the server where samba is installed, but both cause problems when trying to access internal addresses even by IP. So we use our DNS, which is a different server. This causes, sometime, problems with authentication, GPO's loading ...
I just want to know how can I fix this strange behavior since it solves external (internet) names/addresses.
I have a Debian Wheezy fully updated with Samba 4.1.17 as and AD. I've been updating/upgrading for months. Years ago the server lost some HDD and the configura was corrupted. in that time trying to solve thing quickly my boss used samba 4 alpha version, if I am not mistaken. He created the new domain, create user by user and group by group again then created the shares and so on.
Some times we had problems with login, solved by rejoin the domain. Things like GPO were not working correctly (most of the time wasn't even working).
Summarizing I did upgrade samba to a stable version and kept upgrading until 4.1.17. Until today even correcting many things with upgrades and changing settings, redoing settings I couldn't solve an annoying DNS problem.
We use samba internal DNS but recently I've tested even with bind9 but the problem to resolve internal names like intranet.enterprise.org. Every internal system we have the same problem. It points to our internal DNS server.
I've even created many times a new server with various samba versions and none presented the same problem. All the tests worked correctly.
All the necessary ports are open.
Can anyone enlighten me?
Comment: Your question is a bit chaotic to read, please do some restructuring. From what I gather, you have a separate Samba DNS and "internal DNS". Is the "internal DNS" configured to relay requests to your Samba domain to the Samba server? Can you post some `dig` output that illustrates the problem?
Answer: All machines here use our internal DNS (bind9) to access internet. It serves internal addresses, external and forwards all to our "provider", the University.
Samba AD works with those as the DNSes but sometimes we can't even join a machine to the domain if we don't change the DNSes to domain's IP. But I was having problems when doing that with some internal addresses, that were not being resolved by Bind9 or Samba internal DNS even when implemented a secondary DC to act as DNS for the AD and to sync configurations. Implementing the second server, as backup, worked for a week correctly, but something in the old server, which can be considered legacy, started to cause problems and the backup started to have the same problems with internal DNS resolution. Don't now why and waste too much time.
So solved using DNSMASQ as described here http://edoceo.com/howto/samba4.
Now everything (!!) is working fine.


Modifying html/javascript code with httr

Question: I'm trying to make a script which checks if someone has been to this school, using their alumni directory. (You can use the name Francois Hollande (current French president) to see how it behaves)
As far as I can tell (for the "name" ("nom") button) I need to access this part of the HTML code :

  Nom

      Derez

    <input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-3" id="s2id_autogen3" tabindex="0">

  <input type="hidden" name="PersonneNom" id="PersonneNom" class="autocomplete" style="min-width: 0px; display: none;" data-placeholder="Saisir un nom" data-multiple="" data-libelle="" value="Hollande" data-limit="" tabindex="-1" title="">

and in the last <input> tag, change the value attribute to the name I want to check.
Then I'll have to "click" somehow on the afficher les résultats (translation : show results) on the right. Relevant HTML code :

      Afficher les résultats

And then I'll have to get to the
 tag and retrieve the  tags :

                        Hollande  François

D Service Public Promo 1974

                    Voir le profil

Here is my code so far :
library(XML)
library(httr)
library(foreach)

url        <- "http://www.sciences-po.asso.fr/gene/main.php?base=1244"
response   <- GET(url)
doc        <- content(response, type="text/html", encoding = 'ISO-8859-1')
parseddoc  <- htmlParse(doc)

# i have to modify the content of this
xpathApply(parseddoc, "//*[@id='PersonneNom']/@value")
# then make sure it is sent to the server, retrieve the code sent back, etcaetera...

Thanks for any help you can give.
Answer: In case anyone would stumble upon this question, I found two other packages to crawl websites : rvest and RSelenium. I went with RSelenium as it seemed to be the most straight forward : it opens your browser and you can see live what you're code is doing on the webpage.
Moreover, here are two links that I found very useful, the second one being a good intro to RSelenium :
http://ikkyle.com/webscraping_with_r.html
https://www.datacamp.com/community/tutorials/scraping-javascript-generated-data-with-r


how to use authconfig for ssh through LDAP connection

Question: I'm newbies on Centos7. The ssh connection is working for all user which is the /etc/passwd. That's meaning I can connect to my server with this kind of users I added
The other users which are present in the LDAP 've got this error in the /var/log/secure file :
Nov  3 16:58:59 ghost sshd[7853]: pam_sss(sshd:account): Access denied for user user1: 6 (Permission denied)
Nov  3 16:58:59 ghost sshd[7853]: fatal: Access denied for user user1 by PAM account configuration [preauth]
Nov  3 16:59:25 ghost su: pam_unix(su-l:session): session opened for user user1 by system(uid=0)
Nov  3 16:59:28 ghost su: pam_unix(su-l:session): session closed for user user1

The id users1 is working and the su - users1 is working too.
The command authconfig --test shows me the line :
pam_pwquality is enabled (try_first_pass local_users_only retry=3 authtok_type=)

local_users_only is disturbing me but may wrong
What's the right option to give at the authconfig command
Thanks for your help
Answer: PAM saves it configurations per daemon in directory /etc/pam.d/. You should check the sshd configuration in that directory.
Answer: I then edited /etc/ssh/sshd_config changing:
UsePAM yes

to
UsePAM no

That's working the ldapuser and the local can connect on the server


form:errors not displaying errors on JSP in Spring

Question: I want to create simple form which will display errors if input is not proper means if validation fails. I am using spring 3.0 annotations.
I did following things
1 : Created JSP
2 : Created Controller
3 : Created DTO
4 : Created org.springframework.validation.Validator
    (write an implementation the necessary methods)
int error = bindingResult.getErrorCount() returning the error count and even my page is not being submitted which is expected but my JSP is not showing error messages
I have write  on JSP.
Please guide me how to do this.
If i miss on something please let me know i will paste it.
Comment: How about pasting your source code, jsp, controller, and config files
Answer: Have a look at this answer for the structure of the controller. The important think is to have a paramter BindingResult and if this binding result contains an error you must return the same view (not redirect) again.
In the jsp code you can use the spring errors tag.
@see Spring Reference chapter 188.8.131.52 The errors tag -- there is an example
Answer: I have solved this i have just mentioned dto object name in @ModelAttribute
public void myMethod(@Valid @ModelAttribute**("myDto")** MyDTO myDTO,
        BindingResult bindingResult, ActionResponse response,
        SessionStatus sessionStatus)


Determining $A$ such that $\lim \limits_{x \to\infty }(\sqrt{Ax^2+2x}−5x)$ exists and is finite

Question:
Determine the value of the real number $A$ so that a finite limit exists, and then compute the limit:
$$\lim \limits_{x \to \infty}(\sqrt{Ax^2+2x}−5x)$$

Where would I start with this? I thought I could factor the highest degree variable from each term but that lets any real A work with it.
Comment: Pull out $\sqrt A x$ and see what happens.
Comment: The $2x$ term would be of little consequence in the convergence of the limit, so to find $A$, you can discard the $2x$ term.
Comment: Hint: $$
\sqrt {Ax^2  + 2x}  - 5x = \frac{{(A - 25)x^2  + 2x}}{{\sqrt {Ax^2  + 2x}  + 5x}}  \;\left( { \sim \frac{{(A - 25)x + 2}}{{\sqrt A  + 5}}} \right)
$$
Comment: $A=25{}{}{}{}{}$
Answer: $\begin{aligned} \sqrt{Ax^2+2x}-5x &= (\sqrt{Ax^2+2x}-5x)\frac{\sqrt{Ax^2+2x}+5x}{\sqrt{Ax^2+2x}+5x}\\ &= \frac{Ax^2+2x-25x^2}{\sqrt{Ax^2+2x}+5x}\\ &= \frac{(A-25)x+2}{\sqrt{A+\frac{2}{x}}+5} \end{aligned}$
Notice that, as $x$ goes to $\infty$, the denominator goes to $\sqrt{A}+5$ and the numerator goes to

$+\infty$ if $A>25$
$-\infty$ if $A<25$
$2$ if $A = 25$

so $A=25$ is our only hope to obtain a finite result, which would be
$$\frac{2}{\sqrt{25}+5} = \frac{1}{5}$$


Show that a set of positive semidefinite (PSD) matrices is a convex set

Question:
How would you show that the set $$P=\bigg\{\begin{pmatrix} x\\y\\z \end{pmatrix} \in \mathbb{R}^3 : \det \begin{pmatrix} x&z\\z&y \end{pmatrix} \geq 0 \text{ , } x\geq 0, \text{ }y\geq 0\bigg\}$$ is convex?

My attempt is as follows (using the definition of positve semidefinite):
$v^t\begin{pmatrix} x&z\\z&y \end{pmatrix} v \geq 0 :\forall v \in \mathbb{R}^3$
Then the following should hold as well:
$v^t\bigg((1-t)\begin{pmatrix} x_1&z_1\\z_1&y_1 \end{pmatrix}+t\begin{pmatrix} x_2&z_2\\z_2&y_2 \end{pmatrix}\bigg) v \geq 0 :t\in[0,1] \text{ , }\forall v \in \mathbb{R}^3$
As in my mind, the scaling of a PSD matrix with a $t\in[0,1]$ should return a another PSD matrix. Or am I wrong in my thinking? I'm an undergraduate, apologies for my possibly gross ignorance.
Comment: smells more like geometric mean vs. arithmetic mean. (the set $P$ is the epigraph of $(x,y)\mapsto \sqrt(x\cdot y)$)
Answer: The determinant being nonnegative does not imply that a $2 \times 2$ matrix is PSD.
You also need the diagonal elements to be nonnegative.  Your set $P$ is not convex.
For example, $(10, 10, 1)^T$ and $(-10, -10, 1)^T$ are in $P$ but $\frac{1}{2}
(10, 10, 1)^T + \frac{1}{2} (-10, -10, 1)^T$ is not.
Comment: My bad. The diagonal elements are nonnegative. I'm given the inequalities $x \geq 0$, $y \geq 0$ and $xy-z^2 \geq 0$ which I used to rewrite in a polyhedron form. I edited the rewritten polyhedron P. Is P still not convex?
Comment: The set of PSD matrices is indeed convex, and your "attempt" proves it.
Comment: Thank you Robert. Much appreciated.


which server should I use for mostly XP network

Question: I have a network with the vast majority of the PC running windows xp but a couple of machines running Win7. This will probably be the case for the next year or 2. Should I still use server 2008 as the DC or will 2003 work better with the XP machines?
Answer: You will be just fine with a Server 2008 server in the office with XP machines. Better, in fact, since 2008 will continue to be updated for longer than 2003. Also, Server 2008 has better features that will aid you in managing printers and files. Active Directory (assuming you'lll be using AD) supports XP machines great.
Answer: All the snazzy new Microsoft communication/social products such as OCS (Office Communication Server "Lync") and the new Sharepoint 2010 require AD schema extensions that are much easier to manage with 2008 based servers rather than 2003 (or a mixture).
Go with the new server OS and save yourself work down the line.  The administration differences between 2008 and 2003 is not large enough (beyond re-learning where they placed all the configuration options) to warrant sticking with the old operating system at this point.
Answer: Either version will work well.  If you are building from scratch, use the latest version - 2008 R2 if you can do it.


Getting next valid date from Android Calendar

Question: I'm trying to get sequence of date for an Android app. The quest is to traverse from one date to n days after. but I need to validate if the date + 1 day is a valid date. ie, if my starting date is 02-28-2014, is there an method from some Interface that gets automatically the next valid date? I know that I can build a mechanism to do this validation, I was just wondering if exists some integrated method on the Android API or the Java API.
I have three class properties which I set like this:
final Calendar c = Calendar.getInstance();
this.mYear = c.get(Calendar.YEAR);
this.mMonth = c.get(Calendar.MONTH);
this.mDay = c.get(Calendar.DAY_OF_MONTH);

Answer: since you are already using Calendar, I use this:
c.add(Calendar.DAY_OF_YEAR, number_of_days_to_add);

Your Calendar will then be set and you can request the date using new Date(c.getTime())


A função main e seus argumentos. Como ela consegue atribuir aos seus argumentos argc e *argv[] os parâmetros passados via terminal?

Question: Para a minha pergunta ficar mais clara. Suponha que o meu programa, chamado main, precise receber uma quantidade qualquer de parâmetros do console.
Para tanto, eu teria que fazer isso.

int main( int argc, char *argv[] ){
    ...
   return 0;
}

Correto?
Em seguida eu compilo e executo passando os seus parâmetros.

$ gcc main.c -o main

$ ./main par1 par2 ... parn

Eu gostaria de saber como a função main consegue pegar a quantidade de parâmetros passados (que pode ser arbitrária) e jogar na variável argc e jogar todos eles dentro do array *argv[]?
Mais ainda, tem como reproduzir esse comportamento em uma função ordinária? Caso sim, Como? Poderia me fornecer um exemplo.
Faço essa pergunta por que eu estou estudando C e quero entender esse comportamento.
Answer: Primeiro leia Qual a diferença entre parâmetro e argumento?.
É um pouco complicado explicar isso sem escrever um livro falando de sistema operacional e como uma um executável funciona e gerenciamento de memória.
E não precisa ser passado exatamente por um terminal.
Os argumentos são passados pelo sistema operacional, é problema dele pegar aqueles valores na linha de comando que chama o executável e colocar na memória para que o executável possa ler. Obviamente que ele faz isso de uma forma padronizada que todo executável que siga esse padrão consiga pegar essa informação, mas não tem muito segredo.
Pela assinatura da função já sabemos que haverá duas informações, uma dela é um inteiro que diz quantos argumentos estão disponíveis, ou seja, qual é o tamanho do array que virá a seguir. E depois vem um array de ponteiros. Novamente, o sistema operacional é que coloca esses números em algum lugar da memória que já vou falar.
Além disso é colocado na memória os argumentos em si, ou seja, vem os textos que foram digitados todos terminados com um nulo como toda string do padrão do C deve ser. Sim, o sistema operacional segue o que foi determinado pelo C. Qualquer outra linguagem tem que funcionar da mesma forma, pelo menos a prática é assim, nada impediria ser diferente. O endereço onde cada texto foi colocado são os endereços que vão lá no array de ponteiros.
Esses dados todos são colocados em uma área que irá pertencer ao executável, isso já é cuidado pelo sistema de gerenciamento de memória do sistema operacional, é função dele controlar tudo isso. Os dados que você vê diretamente na assinatura da função irão em uma área especial que podemos chamar informalmente de pré-stack (pilha da execução). Embora isso seja detalhes de implementação, não precisa ser exatamente assim. Você como programador, se não está criando todo mecanismo de runtime da linguagem não tem que saber de nada disso.
Mas entenda que main() não tem nada de uma muito especial, além disso, ela pega os valores recebidos nos parâmetros da mesma forma que qualquer outra função, esses parâmetros nada mais são que variáveis locais da função.
Essa é uma função ordinária. A única diferença dela é que é chamada pelo sistema operacional. E se quer saber se pode fazer isso, não, não pode, nem faz sentido.
Se não entendeu alguma coisa provavelmente pulou alguma etapa e está querendo aprender algo mais avançado que falta conhecimento fundamental.
Leia:

Qual a forma correta de declarar uma função main()?
Acesso a ponteiro na main
O entry point de um executavel é o endereço da memória da função main?
Retorno da função main
Answer: A resposta curta é sim.
Você pode fazer isso. E como deve imaginar é uma necessidade muito comum.
Por coincidência postei um programa ontem nesse site que faz exatamente isso, e o link é esse: para o post em C
No entanto o exemplo mostra o caso para um vetor int.**
Eu até vi uma resposta aqui bem contrária, dizendo que "não só você não pode como não faz sentido", mas acho que não entendi ou não sei o que dizer.
Então vou te mostrar um programa e explicar a mecânica desse troço, porque, repito, é uma necessidade comum e eu por exemplo já expliquei isso incontáveis vezes. E não sou instrutor nem nada disso. Ou eu não entendi nada e vou postar um programa a toa.
Porque isso é comum:
Se encaixa em um grande número de abstrações, como

criar e percorrer um vetor de estruturas depois de ler de algum lugar o total de estruturas
"subir" um arquivo para a memória em um char**linha com linha[i]correspondendo claro à linha i do arquivo o disco. Um editor de texto por exemplo
carregar registros de um arquivo CSV, aqueles onde tem um registro por linha e os campos são separados por vírgulas. CSV na verdade é char** ** mas seria outro tópico
carregar algo como uma planilha (workbook) para a memória como texto. Isso seria no fundo um assustador char** ** ** mas voltamos ao tópico
para um aluno, começar boa parte daqueles programas de estruturas de dados, carregando os Nodes de sei lá o que para a memória antes ou para montar a estrutura

O Programa exemplo
O programa vai preparar os argumentos e chamar uma função declarada
int nova_main(int, char**);

com essa implementação BEM FAMILIAR
int nova_main(int argc, char** argv)
{
    printf("\n\tEm \"main\": %d argumentos\n\n", argc);
    for (int i = 0; i < argc; i += 1)
        printf("%2d\t'%s'\n", i, argv[i]);
    return 0;
};  // nova_main()

Bem familiar porque é o protótipo de main(). Vamos até montar argv[0] como "nome do programa".
O programa usa essa estrutura
typedef struct
{
    int     argc;
    char**  argv;
}   Bloco;

Só para você entender que pode declarar um vetor delas e preparar um número arbitrário de listas de argumentos. E também para você não ter que ficar procurando declarações pelo programa, apesar de que é minúsculo.
Para manter o programa compacto e auto-contido a entrada vai ser um vetor
    const int   n_parm = 12;
    const char* teste[12] =
    {
        "criando", "um", "bloco", "de",
        "parametros", "como", "o", "sistema",
        "prepara", "para", "main()", "..."
    };

Eu tinha usado um arquivo mas achei melhor deixar aqui tudo junto. Afinal não faz diferença alguma: São apenas strings, como seriam os argumentos na linha de comando.
A alocação de memória para os argumentos
A lógica é bem ingênua mas muito eficiente: a memória é alocada em blocos de ponteiros a partir dessa constante
#define _TAMANHO_ 4

Conforme o bloco se esgota ele é estendido em idêntico tamanho e vida segue. Ao final dos argumentos o eventual excesso é liberado e o bloco é passado para a função nova_main(). Só para ficar mais meigo, ao final os parâmetros são liberados em main() antes de encerrar o programa.
Num programa sério você ajusta com extremo cuidado o tamanho do bloco de alocação, porque se for pequeno vai realocar toda hora e pode ficar lento. E se for muito grande vai ser um desperdício afinal. Ou aloca em páginas e usa uma lista ligada de páginas, brincando de sistema operacional.
Eis a saída de uma execução do programa
Realocado bloco para 8 ponteiros
Realocado bloco para 12 ponteiros
Realocado bloco para 16 ponteiros
        13 strings no vetor de argumentos:
                1 de 13: 'nome do programa'
                2 de 13: 'criando'
                3 de 13: 'um'
                4 de 13: 'bloco'
                5 de 13: 'de'
                6 de 13: 'parametros'
                7 de 13: 'como'
                8 de 13: 'o'
                9 de 13: 'sistema'
                10 de 13: 'prepara'
                11 de 13: 'para'
                12 de 13: 'main()'
                13 de 13: '...'
        Alocados 16 ponteiros
        Lidos 13 argumentos
        3 ponteiros a liberar
        Bloco reduzido para 13 ponteiros
        Chamando nova_main() com esses argumentos

        Em "main": 13 argumentos

       0        'nome do programa'
       1        'criando'
       2        'um'
       3        'bloco'
       4        'de'
       5        'parametros'
       6        'como'
       7        'o'
       8        'sistema'
       9        'prepara'
      10        'para'
      11        'main()'
      12        '...'

        "main()" retornou 0
        Agora apaga o bloco todo e encerra

Fim

Eis o programa
#define _TAMANHO_ 4

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct
{
    int     argc;
    char**  argv;
}   Bloco;

int nova_main(int, char**);

int main(void)
{
    const int   n_parm = 12;
    const char* teste[12] =
    {
        "criando", "um", "bloco", "de",
        "parametros", "como", "o", "sistema",
        "prepara", "para", "main()", "..."
    };

    // a memoria vai ser alocada em blocos de _TAMANHO_
    // a cada vez que faltar memoria um novo bloco
    // eh acrescentado. Ao final um trim() no bloco
    // para retornar o exato tamanho utilizado.
    // Ex: para 12 strings vai alocar para _TAMANHO_ 5
    // 5 + 5 + 5 e ao final libera 3 das 15 e retorna
    // argc = 12 e os 12 ponteiros, como esperado
    //
    // o primeiro argumento e o nome do progama
    // pura frescura, eh um exemplo apenas

    Bloco ex; // exemplo
    int N = _TAMANHO_; // primeiro bloco
    ex.argc = 0;
    ex.argv = (char**) malloc(sizeof(char*) * _TAMANHO_);
    const char* programa = "nome do programa";
    ex.argv[ex.argc] = (char*)malloc(1 + strlen(programa));
    strcpy(ex.argv[ex.argc], programa);
    ex.argc += 1;

    for (int i = 0; i < n_parm; i += 1)
    {   // carrega cada string
        if (ex.argc >= N)
        {   // acabou a memoria
            N = N + _TAMANHO_;
            char* novo = realloc(ex.argv, (N * sizeof(char*)) );
            printf("Realocado bloco para %d ponteiros\n", N);
            ex.argv = (char**)novo;
        };
        ex.argv[ex.argc] = (char*)malloc(1 + strlen(teste[i]));
        strcpy(ex.argv[ex.argc], teste[i]);
        ex.argc += 1;
    };  // for()
    printf("\t%d strings no vetor de argumentos:\n", ex.argc);
    for (int i = 0; i < ex.argc; i += 1)
    {
        printf("\t\t%d de %d: '%s'\n", 1+i, ex.argc, ex.argv[i]);
    };
    // agora acerta o final, liberando os ponteiros que
    // podem estar sobrando no bloco
    // foram alocados N ponteiros. Foram usados argc
    printf("\tAlocados %d ponteiros\n", N);
    printf("\tLidos %d argumentos\n", ex.argc);
    if (N == ex.argc)
        printf("\tNada a liberar\n");
    else
    {
        printf("\t%d ponteiros a liberar\n", N - ex.argc);
        char* novo = realloc(ex.argv, (ex.argc * sizeof(char*)));
        printf("\tBloco reduzido para %d ponteiros\n", ex.argc);
        ex.argv = (char**)novo;
    };
    printf("\tChamando nova_main() com esses argumentos\n");
    int res = nova_main(ex.argc, ex.argv);
    printf("\n\n\t\"main()\" retornou %d\n", res);
    printf("\tAgora apaga o bloco todo e encerra\n");
    for (int i = 0; i < ex.argc; i += 1)
        free(ex.argv[i]);
    free(ex.argv);
    printf("\n\nFim\n");
    return 0;
};

int nova_main(int argc, char** argv)
{
    printf("\n\tEm \"main\": %d argumentos\n\n", argc);
    for (int i = 0; i < argc; i += 1)
        printf("%8d\t'%s'\n", i, argv[i]);
    return 0;
};  // nova_main()

Sem entrar em discussões religiosas aqui, compilei apenas em CL 19.27 e rodei no terminal do Windows. É o mais disponível para mim.
Answer: Basicamente, o compilador dá parse pelo carater de espaço vazio " ". Conta assim o número de argumentos (não esquecendo que main em "./main" é o primeiro argumento do programa). Assim se precisar de escrever um argumento com espaços têm que colocar entre aspas (Por exemplo se quiser passar o nome José Barros tem de escrever "José Barros", caso contrário vai contar como 2 argumentos por causa do espaço entre os nomes). Sabendo o nº de argumentos sinmplesmente cria um array de apontadores para carateres, em que cada apontador corresponde a um dos argumentos passados.
Acho que com esta informação já fica mais simples de criar uma função que faça o mesmo. Uma função útil para dar parse é strtok.


50/50 Joker of "Who wants to be a Millionaire" - A "Monty Hall Problem" variation?

Question: So the Monty Hall Problem itself is widely known and understood.
Nonetheless, a friend of mine and I were wondering whether the the same strategy could affectively be applied by a participant of Who wants to be a Millionaire? when using the 50/50 Joker.
Let's imagine the following scenario:
The participant P has no clue about the correct answer $ x \in \{A,B,C,D\} $ and wants to use the 50/50 Joker (eliminating two wrong answers). But instead of immediately going for it he first "preselects" one of the answers in his mind. There is no need to tell Quizmaster Q about his "imaginary preselection". Now P tells Q that he wants to use his joker and Q lets the computer eliminate two wrong answers.
(1) In case  the answer P had preselected is eliminated he has no choice but to choose between the remaining two answers, effectively leaving him with a 50% chance of success - no magic happening here.   (2) But what about the other case  when the answer P had preselected survives the elimination? According to the Monty Hall Problemit seems as if changing the selection (i.e. choosing the other remaining option P had not preseleted) seems to give him a 0.75 chance of success.
Nevertheless, I find it hard to believe that this actually holds true, since the so called 50/50 (!) Joker would then not be p(success) = 0.5 after all. Additionally it seems unlikely that making an "imaginary preselection", no one else is told about, actually increases your odds.
I know this problem is not exactly the same as Monty Hall since the the quizmaster does not always eliminate answers only from the ones the participant had not "preselected", meaning that the preselection itself could be eliminated, too, as it happens in (1). Still the second case seems to actually be a just variation of it.
So are we right and making a preselection and then going for the other remaining option is a valid strategy that increases the participant's odds of winning? If not, please help us understand our misconception.
Comment: Funny you should ask, I was wondering just the same myself last I watched the show. I think the essential difference is that (1) in Monty Hall the contestant never has knowledge whether his initial guess is right or wrong - it's just a random pick not informed by subject knowledge (2) the joker process in WWTBAM is (in theory) unaware of his initial guess.
Answer: Monty Hall does not give you information about your preselection. Therefore the probability that your first choice is right given that it is still available after the intervention, is not changed. The 50/50 Joker does give information about it (esp. when it gets eliminated). Note that many of the misunderstandings of the Monty Hall problem arise from the missing assumption that the host always willfully opens a goat-door other than the preselected door. If you modify the Monti Hall problem so that the host opens any not preselected door at random, the general misconception that both remaining doors are "equal" becomes correct.
Answer: If the contestant has no clue about the correct answer, then the "preselection" can change nothing.  On the other hand, if the contestant has information about the probabilities of the four answers, then depending upon which answers are shown the player may gain considerable information.
For example, suppose the player estimates the probabilities at 10%, 20%, 30%, and 40%.  If after two answers are eliminated, those that remain are the ones the contestant thought was most likely (the worst case), the more likely of the remaining answers will be correct 4/7 of the time.  If the remaining answers are those the contestant thought were the most likely and the least likely (the best case), the more likely of the remaining answers will be correct 4/5 of the time.  Other combinations of eliminated answers will yield intermediate probabilities.
BTW, from watching the show, I suspect the best strategy, if one can do it convincingly, would be to pretend that one was dithering between two answers which one believed to be most likely.  It appears that the "50/50" doesn't select randomly, but tries to include the wrong answer the contestant favors most highly.  Thus, a contestant who convincingly claimed to believe that a low-probability answer was correct might be able to coax the 50/50 into offering up one of the most favorable scenarios.
Answer: No. I don't believe applying the Monty Hall strategy to this problem should increase the probability of winning.
Let's assume that the computer chooses an incorrect answer to eliminate at random (i.e. each wrong answer is equally likely to survive with probability 1/3).
By switching, there are 2 cases in which you can win:

Your choice is wrong AND survives the elimination. (E1)
Your choice is wrong AND it doesn't survive AND you guess correctly. (E2)

$$P(win) = P(E1) + P(E2)$$
$$= P(wrong \, \cap \, survives) + P(wrong \, \cap \, eliminated \, \cap correct \, guess)$$
$$=P(wrong)*P(survives \, | \, wrong) + P(wrong)*P(eliminated \,| \,wrong)*P(correct \, guess | eliminated \, \cap \, wrong)$$
$$=\frac{3}{4}\frac{1}{3} + \frac{3}{4}\frac{2}{3}\frac{1}{2} $$
$$=\frac{1}{4} + \frac{1}{4} = 0.5 $$
Thus, making a choice in your head then switching if it survives the elimination will NOT increase your chances of winning.


AWS Cloudwatch unable to retrieve Billing data

Question: I was setting up the cloudwatch to monitor the Billing information. However, after the preference option is enabled, no data is retrieved and displayed on CloudWatch.
What has been done:

the "Receive Billing Alerts" option is enabled in Billing Preference.
change endpoint to "US East N.Virginia" for cloudwatch to check metrics.

Result:
no data
Questions:

the "Receive Billing Alerts" option is showing a little bit grey out and "weaken" when comparing with other options in the same page. I am not sure if it is normal or something broken?
the "Receive Billing Alerts" option cannot be unticked. nothing is happened no matter how many times I clicked on the option;
0 is displayed in the Alarm Preview when I was trying create alarm. I believe that is because no data was retrieved.

It is quite frustrated especially when you expected that should be very simple task. But, it is just not working! It would be very appreciated if anyone could shed the light for me.
Answer: the problem magically resolved itself after one night sleep. I guess that the cloudwatch only retrieve Billing data once per day and I just need to wait. However, since there is nowhere mentioned about that in AWS docunmentation, I assume that should be more frequently. Anyway, problem solved.


Buscar elementos com uma determinada distância de tempo (informando apenas o tempo)

Question: Detalhe sqlserver(2008)
Boa noite, estou com seguinte problema. Tentei procurar o dia todo e não encontrei nada.
-Preciso buscar elementos em uma mesma tabela que tenham a mesma data(dia, hora ...) e uma distancia de tempo de no máximo 40 segundos de um para o outro.
Exemplo:
ID --- data
1      09-11-2018 19:01:10
2      09-11-2018 19:01:30
3      09-11-2018 19:01:40
----------------------------------------
4      09-11-2018 19:02:00  <--exemplo de dado que nao deveria entrar

OBS: Quero que a query busque os dados, com essa distancia de tempo de acordo com a tabela sem informar dado algum a não ser os segundos.
Tentei da seguinte forma abaixo:
mas sem sucesso, no resultado alguns dados se repetem e outros não coincidem com o esperado.
select *
from TABELA t join
     TABELA tnext
     on
     datepart(DAY,  t.Data) = datepart(DAY, tnext.Data) and
     datepart(HOUR,  t.Data) = datepart(HOUR, tnext.Data) and
     datepart(minute,  t.Data) = datepart(minute, tnext.Data) and
     datediff(second,  t.Data, tnext.Data) < 40

Comment: `LAG()` + `DATEDIFF(Second,..)`
Answer: Você pode usar a função LAG () se estiver trabalhando na versão 2012+ ao lado da função DATEDIFF()
CREATE TABLE T(
  ID INT,
  Data DATETIME
);

INSERT INTO T VALUES
(1, '09-11-2018 19:01:10'),
(2, '09-11-2018 19:01:30'),
(3, '09-11-2018 19:01:40'),
(4, '09-11-2018 19:02:20'); --Você tem dados errados aqui não é 40 segundos

WITH C AS
(
SELECT ID,
       Data,
       CASE WHEN LAG(Data, 1, 0) OVER (ORDER BY ID) = '01/01/1900 00:00:00' THEN
        NULL
        ELSE
        LAG(Data, 1, 0) OVER (ORDER BY ID)
       END PrevDate
FROM T
)
SELECT *
FROM C
WHERE DATEDIFF(Second, PrevDate, Data) = 40;

Retorna:
+----+---------------------+---------------------+
| ID |        Data         |      PrevDate       |
+----+---------------------+---------------------+
|  4 | 11/09/2018 19:02:20 | 11/09/2018 19:01:40 |
+----+---------------------+---------------------+

Answer: Para cada linha da tabela pode existir um subconjunto de linhas que estejam no intervalo de 40 segundos. Uma mesma linha pode participar de mais de um subconjunto.
-- código #1
SELECT T1.ID, T1.Data, T2.Data
  from tabela as T1
       inner join tabela as T2 on T2.Data > T1.Data
                                  and T2.Data < dateadd (second, +40, T1.Data)
  order by T1.ID, T2.Data;

No resultado do código #1 todas as linhas com mesmo valor de ID formam um subconjunto.
Outra solução:
-- código #2
SELECT T1.ID, T1.Data, T2.Data
  from tabela as T1
       cross join tabela as T2
  where T2.Data > T1.Data
        and T2.Data < dateadd (second, +40, T1.Data)
  order by T1.ID, T2.Data;

Comment: Deu certo para mim a primeira opção, muito obrigado amigo. Deus abençoe


Number of tried for a favorable result

Question: I am new to statistics so I apologize for the simplicity of my question.
I have a bag with 27 numbers inside; I will pull one number out until I get number 17. THe numbers will be returned to the bag after every try so the prob of success will always be 1/27.
I am trying to determine on average how many pulls I will need.
Answer: On average, you need 27 tries.
Comment: It would be interesting to expand that response a little bit, especially to show how you get this result.
Comment: @chl: Yessir! The OP asks for $E(N)$ where $N\ge1$ is the date of the first success in a series of independent trials, each with probability $p=1/27$ of success. The event $[N\ge n+1]$ corresponds to the $n$ first trials being unsuccessful, hence (by independence) $P(N\ge n+1)=(1-p)^n$. Now, for every nonnegative integer valued $N$, $E(N)$ is the sum of $P(N\ge n+1)$ from $n=0$ to $+\infty$. For every complex number $a$ such that $|a|<1$, the sum of $a^n$ from $n=0$ to $+\infty$ is $1/(1-a)$. For $a=1-p$, one gets $E(N)=1/p=27$.
Answer: It is easier to think backwards. What is the chance of NOT choosing 17? That chance is 26/27. What is the chance of not choosing 17 twice in a row? The answer is (26/27)(26/27). How about three times in a row?  The answer is (26/27)(26/27) *(26/27). More generally, the answer is (26/27)^K, where K is the number of times you try and "^" means "to the power of". You can compute that probability for various values of K, and find a value of K that gives an answer close to 0.50.
Answer: Harvey explained the logic.  But the name of the distribution you're interested in is the geometric distribution.
Comment: Thanks. That's what I started with. But was using an old edition of Walpole which did not have much information on it.
Answer: Edit: I made a presumption before where after 27 tries it would then stop searching thus giving a bias on the results
<code># Number of repeats
iters = 10000
results = rep(0,iters)
# Ball to search for
searchNumber = 27

for(i in 1:iters) {
    # A random permutation:
    balls = sample(1:27,iters, replace=T)

    # Number of times picking a ball
    tries = 1

    while(tries<iters) {
        if(balls[tries] == searchNumber) {
            results[i] = tries
            break
        }
        tries = tries + 1
    }
}

hist(results, breaks=100, col="blue")
mean(results)
</code>
Edit: with a mean / average of around 27
Edit: In my example we are looking for 27 but the results are the same, it could be any number between 1-27
Comment: Why limit tries to 27?
Comment: I was thinking that there had to be some kind of limit and that after checking 27 times that you would stop. But thats a presumption that I probably should not have made.. What would you suggest?

Number of tried for a favorable result


How to show titles as plain text on rendered entity reference

Question: By default the titles are showed as links to there node if you choose to display format rendred entity (full).
I want the titles as plain text and not links
Answer: If you have display suite. You will need to do this no in the rendered part, you have to do this in the view mode of the content type that you are rendering for instance. I have installed display suite and that helps me to have more control over the layout

profile product --> rendering entity from news product displayed as teaser
news product --> In news product in the teaser view mode or full mode in your case, in manage display choose the title and select no link.

You need to have applyed a column layout in display suite to see it.
Answer: You might try looking in the template of whatever node type you are rendering by entity reference. So if your entity reference points to a content type of "type1", edit the tpl.php file that themes the "type1" content type (this will be different based on whatever version of Drupal you are using). My guess is, that template is probably where the title is being displayed as a link. I usually render my entities via more complex php in the template and using node_load(), though.
Answer: you can create template for your particular content type node--your_content_type_name.tpl.php
1) In this template file you will receive variables for your particular node content like for your title $title
<code> * Available variables:
 * - $title: the (sanitized) title of the node.

    then you can use strip_tags() function for removing link and print this variable where you want.
</code>
2) you can create view for particular content type listing and where you can easily change you title link to plain text when you all fields for listing.
Answer: Hi create new view for that particular content type,in that view edit content title then you will find Link this field to the original piece of content un check that check box,if you need theme that template file.
Answer: Just an FYI for Drupal 8 and the comments above,
When an entity relation field displays options via a view the view
fields are not used, instead it is the entity label https://www.drupal.org/node/2174633 this is still being worked on, a fix is slated for 8.5 so in this case the only way is to disable the link is with the twig files.


Add a checkbox on registration page for subscription newsletter with Simplenews

Question: I'd like to add a checkbox for subscription to a newsletter on the user registration page.
I'm using Simplenews.
How could I do that?
Answer: After you have created a Newsletter category, go to admin/config/services/simplenews and click on edit newsletter category next to your newsletter category.
You'll see subscription settings. Select "Default On" or "Default Off" to display a checkbox on user registration form.
see image below for detailed explanation of setting mentioned above


setRequestProperty in java

Question: The documentation here says that setRequestProperty sets the general request property.
So suppose I have the following code snippet showing the usage of setRequestProperty as follows:
        URL url = new URL(requestUrl);
        URLConnection urlConn = url.openConnection();
        urlConn.setRequestProperty("accept", "application/json");
        urlConn.setRequestProperty("datetime", dateTimeString);
        urlConn.setRequestProperty("authorization", authorization);
        urlConn.setUseCaches(false);
        urlConn.setDoInput(true); // Triggers POST

Q1: Does accept need to have an uppercase A here? Similarly, for authorization, does it need to have an uppercase A as well? The reason I am asking this is because I have seen many post where people have been using authorization as say for example conn.setRequestProperty ("Authorization", "Basic " + encodedString);. This is shown here.
Q2. Since I have lot of setRequestProperty property defined above, does this means that, a URL contains all of these properties? Are there any other properties that exists besides the one I have used above?
Comment: setDoInput(true) does not trigger POST.
Comment: @EJP But it's required for `POST`, am I right?
Answer: A1: HTTP header fields, which include general-header (section 4.5), request-header (section 5.3), response-header (section 6.2), and entity-header (section 7.1) fields, follow the same generic format as that given in Section 3.1 of RFC 822 [9]. Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive.
A2: These variables will be in the HTTP request header. If you want URL contains these parameters, you need to append them on the URL:
http://www.google.com?bar=far&boo=foo

setRequestProperty in java


Spark Multiple Output Paths result in Multiple Input Reads

Question: First, apologies for the title, I wasn't sure how to eloquently describe this succinctly.
I have a spark job that parses logs into JSON, and then using spark-sql converts specific columns into ORC and writes to various paths. For example:
val logs = sc.textFile("s3://raw/logs")
val jsonRows = logs.mapPartitions(partition => {
  partition.map(log => {
    logToJson.parse(log)
  }
}

jsonRows.foreach(r => {
  val contentPath = "s3://content/events/"
  val userPath = "s3://users/events/"
  val contentDf = sqlSession.read.schema(contentSchema).json(r)
  val userDf = sqlSession.read.schema(userSchema).json(r)
  val userDfFiltered = userDf.select("*").where(userDf("type").isin("users")
  // Save Data
  val contentWriter = contentDf.write.mode("append").format("orc")
  eventWriter.save(contentPath)
  val userWriter = userDf.write.mode("append").format("orc")
  userWriter.save(userPath)

When I wrote this I expected that the parsing would occur one time, and then it would write to the respective locations afterward. However, it seems that it is executing all of the code in the file twice - once for content and once for users. Is this expected? I would prefer that I don't end up transferring the data from S3 and parsing twice, as that is the largest bottleneck. I am attaching an image from the Spark UI to show the duplication of tasks for a single Streaming Window. Thanks for any help you can provide!
Answer: Okay, this kind of nested DFs is a no go. DataFrames are meant to be a data structure for big datasets that won't fit into normal data structures (like Seq or List) and that needs to be processed in a distributed way. It is not just another kind of array. What you are attempting to do here is to create a DataFrame per log line, which makes little sense.
As far as I can tell from the (incomplete) code you have posted here, you want to create two new DataFrames from your original input (the logs) which you then want to store in two different locations. Something like this:
val logs = sc.textFile("s3://raw/logs")
val contentPath = "s3://content/events/"
val userPath = "s3://users/events/"

val jsonRows = logs
  .mapPartitions(partition => {
    partition.map(log => logToJson.parse(log))
  }
  .toDF()
  .cache() // Or use persist() if dataset is larger than will fit in memory

jsonRows
  .write
  .format("orc")
  .save(contentPath)

jsonRows
  .filter(col("type").isin("users"))
  .write
  .format("orc")
  .save(userPath)

Hope this helps.


IIS server farm with ARR: Why does HTTP_X_FORWARDED_FOR have a port number?

Question: I've got a server farm set up in IIS 8.5. When I inspect the HTTP_X_FORWARDED_FOR header in my application code, it gives me the correct IP address but it contains a colon and a port number.
E.g.
HTTP_X_FORWARDED_FOR    127.0.0.1:64031

I know that HTTP_X_FORWARDED_FOR can contain a comma-separated list of IPs, but I've never heard of it containing port numbers.
I've not explicitly configured 64031 to be a port number anywhere in my setup. Also, the number seems to change randomly which leads me to believe it's some kind of internal port number selected by IIS to communicate between the web farm "front-end" proxy and the back-end physical website.
I've not seen this documented anywhere on the web. Is this standard behaviour? Is it Microsoft Magic? Is it something peculiar to my setup? What exactly is that port number all about?
Answer: One possibility is that IIS is implementing RFC 7239, the RFC which finally ratified/created a Forwarded HTTP header, to replace the X-Forwarded-For (and X-Forwarded-Proto, etc) functionality.
I say this because RFC 7239, Section 5.3 defines the format of the forwarded host data; that section, in turn, directs the reader to RFC 7230, Section 5.4, which defines the syntax/format for the Host header.  And what's notable there is the ABNF syntax for Host:
Host = uri-host [ ":" port ] ;

Notice that optional syntax for the port number?  It says that having the port number is allowed, although as you rightly point out, it's very uncommon.
So this may not exactly be "standard" behavior, but per RFCs, it's legal behavior.  Maybe it's something specific to Microsoft right now?  But the above RFCs are the first places I've seen mention of a format for the X-Forwarded-For header (indirectly via the format for the Forwarded header) that has the port number as well as the IP address.
Hope this helps!


OpenVPN goes straight to systray

Question: I have OpenVPN set up and running fine. I have had an issue, not really a problem, but more of a confusion issue with my end users. When you open OpenVPN it sends the icon straight to the systray. Is there anyway to have that just automatically pop up the OpenVPN GUI after you double click on it? Thanks.
Answer: Nope. The GUI is fundamentally quite simple and functional. The only UI (as such) is the right click menu found from the systray icon.
If it's confusing your users then you could create a shortcut which launches the GUI with the argument <code>--connect <connection>.ovpn</code>. This will auto-spawn the specified connection and display a baloon dialog when connected.
They would still need to get their heads around the menu if they wish to disconnect though.

OpenVPN goes straight to systray


non-Borel set with Tonelli like property

Question: I am looking for an example of a non-Borel set $C \subseteq \mathbb{R}^2$ such that :
i) $C_x = \{y: (x,y) \in C \} \in \mathcal{B} (R)$ and $C^y= \{ x : (x,y) \in C \} \in \mathcal{B}(R)$ for all $x,y \in \mathbb{R}$
ii) The functions $x \mapsto \lambda (C_x)  $ and $y \mapsto \lambda (C^y) $ are Borel measurables and
$\int \lambda (C_x) d\lambda(x) = \int \lambda(C^y) d \lambda(y)$
I tried the area under the graph of the Cantor function but does not work.
Comment: $\{(x,x): x\in A\}$ where $A$ is a non-Borel set on $\mathbb R$.
Comment: I have posted a detailed answer to your question. Please, let me know if you have any question regarding my answer. If my answer provides relevant / helpful information regarding your question, please,  upvote it. If my answer actualy answers your question, accept it too, please. To upvote, click the triangle **pointing upward above the number** (of votes) in front of the question. To accept the answer, click on the check mark beside the answer to toggle it from greyed out to filled in.
Comment: It was very useful. I upvoted but forgot to accept. Thanks a lot.
Answer: Consider the function $f: \mathbb{R} \rightarrow \mathbb{R}^2$ defined by $f(x)=(x,x)$.
It is immediate that $f$ is continuous and so Borel-measurable.
Let $E\subseteq \mathbb{R}$ be a non-Borel subset of $\mathbb{R}$. Define $C=\{(x,x)\in \mathbb{R}^2 : x \in E \}$.

Claim: $C$ is a non-Borel subset of $\mathbb{R}^2$.

Proof: Suppose $C$ is a Borel  subset of $\mathbb{R}^2$. Since $f$ is Borel-measurable, and $E=f^{-1}(C)$, we have that $E$ is a Borel subset of $\mathbb{R}$. Contradiction. $\square$
Now, note that, for all $x,y \in \mathbb{R}$, $C_x = \{y: (x,y) \in C \} =\{ x \}\in \mathcal{B} (R)$ and $C^y= \{ x : (x,y) \in C \} = \{ y \} \in \mathcal{B}(R)$.
Moreover, The functions $x \mapsto \lambda (C_x)=0  $ and $y \mapsto \lambda (C^y)=0 $ are are Borel measurables and
$$\int \lambda (C_x) d\lambda(x) = 0 = \int \lambda(C^y) d \lambda(y)$$


Violin notation: what does this little note mean?

Question: In the score for the first piece of "That the night come" from Dennehy I found this violin notation:

I am not a violinist so I have no idea what does it mean; cannot find anything on the internet; there is no performance indication about this on the score. Any ideA?
Answer: They are actually natural harmonics.

(natural harmonics)   Harmonics are overtones of the string and produce
soft flutelike sounds when the string is lightly touched at specific
fractional divisions (nodal points). Natural harmonics are produced on
open strings, and artificial or stopped harmonics are produced on
stopped strings. Composers often indicate which string should be used
for the harmonic by notating above or below the note markings such as
sul D, D string, or III (meaning, play the harmonic on the D string,
the third string on the violin).
Natural harmonics are indicated in two ways: by a small "o" written
above the note to be lightly touched, and by a small diamond shape at
a specific point on the string where the finger should be lightly
placed.
source

You can also get a list of all natural harmonics for violin from this site.
Comment: This answer is incorrect. Except for the downvoted one at the bottom, all of these answers are incorrect. The notation in question is very clearly what is called a touch-4th artificial harmonic. This is performed by stopping the string at the position indicated by the normal notehead (probably with the index finger), and lightly touching the string at the position indicated by the diamond notehead (probably with the pinky). The sounding pitch will be 2 octaves above the normal notehead. That is what this notation means and it is unambiguous. (source: 'The Study of Orchestration' by Adler.)
Comment: A likely cause for confusion in this particular case is that the normal notehead is on D4, which can be played on the open D string, so this same harmonic could be produced as a natural harmonic by touching a 4th above D. But given how it's notated, this should be played as an artificial harmonic on the G string.
Comment: @ibonyun What makes you think this is an artificial harmonic? How do you think this would be notated as a natural harmonic?
Comment: @KilianFoth Because it is notated like an artificial harmonic. There is only one way to notate an artificial harmonic AFAIK, and this is it.  There is more than one way to notate a natural harmonic, but none of them look like this.  Here's a link which corroborates: https://www.violinonline.com/additionalskills.html
Answer: It is an artificial harmonic.

To produce an artificial harmonic, a stringed instrument player holds down a note on the neck with one finger of the non-dominant hand (thereby shortening the vibrational length of the string) and uses another finger to lightly touch a point on the string that is an integer divisor of its vibrational length, and plucks or bows the side of the string that is closer to the bridge. This technique is used to produce harmonic tones that are otherwise inaccessible on the instrument.
  ...
  The round note (below) is pressed with one finger, and the square note is lightly touched with another one.

From Wikipedia https://en.wikipedia.org/wiki/Artificial_harmonic
Comment: Another source to corroborate this answer is Samuel Adler's 'The Study of Orchestration'.
Comment: and another: https://www.violinonline.com/additionalskills.html
Answer: I consider that notation problematic, but it almost certainly means you should play a D6 as the fourth harmonic of the open D-string. That mode can be obtained as a flageolett-stopped note with the finger on the D-string at the spot where you would normally play G4, hence the little diamond-shaped G note. But the correct way to notate this, IMO, is actually to just write the pitch that should sound, i.e.
<code>X:1
L:1/4
M:
K:C
V:2 clef=treble
!0!d'3"sul D"
%
</code>
Comment: Without seeing more context, there is no reason why it *has* to be played on the open D string. An artificial harmonic on the G string might be more appropriate.
Comment: Yeah having the notation the same for both natural and artificial harmonics leads to issues in execution.
Answer: As always,  dolmetsch has this covered.  That's my go-to page for nearly all notation questions.
quoting (same answers as above, but for completeness),

[o]  in string parts: written over or under the note-head, meaning:
  play a natural harmonic referring to percussion notation the
  Percussion Information Homepage - Problems page author writes: "one
  very annoying side effect of different setups, is the fact the most
  method books that indicate which hand to use for a certain passage,
  are difficult to use for players who are learning the other way! So,
  my advice to publishers and writers: Never indicate hands. And if you
  have to, use symbols like an open and closed small circle or square
  above the notes. In that way we just have to change the definition of
  the symbols and explain that to the student. But it is very unnatural
  to have to play a note with your L-hand when there is a big R above or
  below it. Especially when these very letters mean the same hands in
  another language!"
[diamond]     in string parts: written over or under
  the note-head, meaning: play a natural harmonic. Note: the position of
  the diamond-shaped notehead indicates where the finger in placed, and
  not the sounding note. If the sounding note is also given it would be
  placed above the diamond-shaped notehead, in cue size and in
  parentheses. See also 'artificial harmonics'
Answer: This notation indicates a harmonic. Harmonics are played by lightly touching a string at one of several specific points along its length, preventing its fundamental tone from sounding while allowing certain overtones to vibrate. Which overtones vibrate, and hence what pitch is produced, depend on the fractional point, referred to as a node, at which the string is touched.
There's a distinction between natural and artificial harmonics. Natural harmonics are played on an open string. Artificial harmonics are played on a stopped string, typically stopping with the first finger and touching a node with the fourth finger.
There isn't a standard way to distinguish between natural and artificial harmonics in notation. Some harmonics can only be achieved by stopping the string, while others, such as the one in the question, could be played either way. The example could be played as a natural harmonic, by touching the open D half way along its length, or as an artificial harmonic, by playing in fourth position on the G string. Where there's a choice, it must be made based on the musical context.
Without more context than the single bar of music posted, it's impossible to say which choice is correct here. What's coming next? If the next change of note is, for example to a harmonic one tone higher, maybe it makes more sense to play the D in fourth position then shift up. Maybe there's a glissando coming. Maybe vibrato is appropriate, in which case an artificial harmonic is needed, since you can't vibrate a natural one.
Answer: The lower note,the open D would be played with second finger on the G string in third position, and the G diamond note would be played with first finger on the D string in third position. The violinist would have two fingers down on the fingerboard, however the diamond shape note is not pressed all the way down to the fingerboard.


Login using fingerprint only ? Is it possible?

Question: Is it possible to store users fingerprints in a cloud? Im thinking about an app that needs onyl fingerprint to log in. Is it possible ?
Comment: Because of security reasons you cannot access the fingerprint of the user directly - I for one wouldn't like apps storing my fingerprint in some closed-source cloud. But you may hash values using the fingerprint provided by the user. For that read the documentation.
Comment: You're asking two different questions. _Can you have a login functionality that depends only on fingerprint authentication?_ Yes, you can. _Is it possible to store the users' fingerprints in the cloud?_ No, it is not, because you don't have access to the actual fingerprints or any derivates thereof.
Answer: Yes it is possible to login using finger prints only.

A serialized scanned fingerprint object is output as a byteArrayOutputStream using ObjectOutputStream.
The output is then encoded to base64 and sent as HTTP port to a
provided server URL().
To serialize an object means a Java object is represented as a
sequence of bytes that includes the object's data as well as
information about the object's type and the types of data stored in
the object.
The server endpoint receives the base64 bytearray, decodes it into a
plain byteArray and then casts it to a libfprint object using
objectinputStream.
This libfprint object is then compared to existing instances stored
in the database in your cloud.
DURING matching, the libfprint object is compared with the
finger already stored. If any of the three binary data
(stored prints) has an integer value above the set threshold (70),
the user is identified and thus is considered a true match,
otherwise the bozorth matching algorithm assumes the finger does not
exist in the database and hence prompts for a new enrollment.
Bozorth    is a fingerprint matching algorithm which is minutiae
based, It does    both one-to-one and one-to-many matching
operations.
The recommended bozorth threshold is an integer of 40, however in my
tests with the threshold at 40 oftenly produced false positives. A
false positive happens when a user is wrongly identified as the
owner of the fingerprint. We settled on the approach to enroll the
same finger three times during new registration and increase the
matching threshold to 70.
Verification algorithm compares the currently captured fingerprint image to each users three instances stored in the database. The user is identified positively if any of the three instances return a match value of more than 70.


Prove that EFZY is a cyclic quadrilateral

Question: The incircle of $\Delta ABC$ touches $BC$, $CA$, and $AB$ at $D$, $E$, and $F$ respectively. $X$ is a point inside $\Delta ABC$ such that the incircle of $\Delta XBC$ touches $BC$ at $D$ also, and touches $CX$ and $XB$ at $Y$ and $Z$, respectively. Prove that $EFZY$ is a cyclic quadrilateral.
In this question, I can follow up to the point $P$, $Z$, $Y$ are declared collinear.
But after that , how does $$PF\cdot PE=PZ\cdot PY$$ confirm that $EFZY$ is a cyclic quadrilateral?
Comment: The points $P,E,F$ are on a line, and the points $P,Z,Y$ are on a line. The relation $PE\cdot PF= PY\cdot PZ$ is a known relation when $EFZY$ is cyclic, the key-word is the power of a point w.r.t. a circle. Here we need the other direction. It is enough to reverse the proof for the power of a point w.r.t. a circle being constant. This is done in the answer below. Please consider accepting the answer, if it satisfies the needs, else please tell us what is not clear. (It is a good policy to accept answers, so that unanswered issues are not surviving without reason on the site.)
Answer:
In the figure, $PE \cdot PF = PZ \cdot PY \implies \Delta PEY \sim \Delta PZF$
Hence $\angle PEY = \angle PZF $
and $EFZY$ is a cyclic quadrilateral.
Comment: Thank you for the answer


Entire function is zero.

Question: Let $a\in\mathbb{R}$, $f$ be an entire function on $\mathbb{C}$ and the inequality $$\int\limits_0^{2\pi} |f(re^{i\theta})|\text{d}\theta\le r^a$$holds for all $r>0$.
Can we prove that $f\equiv0$?
By Cauchy integral formula, $f(0)=\frac{1}{2\pi}\int\limits_0^{2\pi} f(re^{i\theta})\text{d}\theta,\forall r>0$. So $|f(0)|\le \frac{1}{2\pi}\int\limits_0^{2\pi} |f(re^{i\theta})|\text{d}\theta\le\frac{r^a}{2\pi},\forall r>0$.
Theorem. Let $G$ be a connected open set and let $f:G\rightarrow \mathbb{C}$ be an analytic function. Then the following are equivalent statements:
$(1)f\equiv0$
$(2)$there is a point $s$ in $G$ such that $f^{(n)}(s)=0,\forall n\ge 0$
$(3) \{z\in G:f(z)=0\}$ has a limit point in $G$
To prove that $f\equiv0$, it suffices to show that $f^{(n)}(0)=0,\forall n\ge 0$, but I don't know how to prove it. If we can find a limit point in $\{z\in G:f(z)=0\}$, we can also prove the statement, but I can't find it.
By Liouville theorem, if we can prove that $f$ is bounded, then it's easy to prove the statement. Maybe Cauchy integral formula is helpful to solve this problem.
I'm stuck on this for a while and I'll very much appreciate the help!
Answer: Pick $|z|=r$ and let $R=2r$; by Cauchy one has $2\pi if(z)=\oint_{|w|=R}\frac{f(w)dw}{w-z}$, so using that $|dw|=Rd\theta, |w-z| \ge R/2$, one gets that $2\pi |f(z)| \le 2\int\limits_0^{2\pi} |f(Re^{i\theta})|\text{d}\theta\le 2R^a \le 2^{a+1}r^a$ since $R=2r$
This means $|f(z)| \le C|z|^a$ which implies by the usual manipulations that $f$ is zero if $a<0$ and $f$ is a polynomial of degree at most $m=[a]$ if $a \ge 0$, with a zero of order at least $m$ at zero; so $f(z)=Az^m$, but then $\int\limits_0^{2\pi} |f(Re^{i\theta})|\text{d}\theta=2\pi |A|R^m$ and since $a=m+c, 0 \le c<1$, one gets $2\pi A \le R^c, R >0$ which is obviously not true for $0<c<1, A \ne 0$ by letting $R \to 0$. However one clearly can have $f(z)=Az^m, 2\pi |A| \le 1$ for $a=m$ integral.
So the complete answer is that $f=0$ if $a$ is not (nonnegative) integral, but $f$ can be non zero $Az^a, 2\pi |A| \le 1$ if $a$ non negative integral

Entire function is zero.