text:
Q: Multi-Pole System - Why is there no bandwidth extension if loop gain is reduced? [Design of Analog CMOS Integrated Circuits by Behzad Razavi]

The author explains that if the feedback (beta) is made weaker, the plot shifts down and hence, we hit the GX earlier now, thereby improving phase margin.
My question is, by decreasing the feedback factor (hence decreasing loop gain), the position of the closed loop pole should push out to a higher frequency and give us the 'bandwidth extension' property of closed-loop feedback systems. Why doesn't that happen here?

A: To understand this, consider the open loop gain plot and the 1/beta plots as separate plots on the same frequency/magnitude plot.
I expect you are familiar with the typical shape of the open loop gain plot and then add to this the horizontal plot of the 1/beta plot.
Now if we consider the 1/beta plot to be approximately equal to a closed loop gain plot bearing in mind that the closed loop gain plot will gradually reduce as frequency increases until it reaches the open loop gain plot where it will be -3 dB down and it will then follow the open loop gain plot downwards.
Now if we reduce beta (to improve stability) we are actually moving the 1/beta plot upwards on the graph and as a result the closed loop gain is also increasing.
This has the effect that the closed loop gain plot will meet the open loop gain plot at a lower frequency.
By reducing beta we have increased the closed loop gain, moving the closed loop pole down in frequency reducing bandwidth in the process.


text:
Q: Grouping SQL Result I have table like this:
id | Name  | Buy
---+-------+-----
 1 | Alice | Apple
 2 | Alice | Banana
 3 | Alice | Apple
 4 | Bob   | Apple

How to write one line SQL command that showing result like below?
Name  | Apple | Banana
------+-------+-------
Alice |     2 |      1
Bob   |     1 |      0

A: use case when
select Name,sum(case when Buy='Apple' then 1 else0 end) as Apple,
sum(case when Buy='Banana' then 1 else 0 end) as Banana
from yourtable
group by Name

http://sqlfiddle.com/#!9/5ab22a/2
Name    Apple   Banana
Alice   2        1
Bob     1        0

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to pass list to method and insert element? I am beginner learning Java and trying to create a method for list to add elements in the list and return the list. But getting this error:

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
language cannot be resolved at karl_language.language(karl_language.java:14) at karl_language.main(karl_language.java:33)

public class karl_language {

    public boolean isEmpty(List<String> language) {
        if(language.isEmpty())
            return true;
        return false;
    }

    public List<String> language(String languages){
        language.add(languages);

    }

    public static void main(String[] args) {
        karl_language lan = new karl_language();
        List<String> language = new ArrayList<String>();
        Scanner input1 = new Scanner(System.in);
        System.out.println("Enter the number of languages : ");
        int n = input1.nextInt();
        System.out.println("Enter the language : ");
        for(int i=0;i<n;i++){
            language.add(input1.next());
        }
        System.out.println(language);
        System.out.println("Is List Empty? : "+lan.isEmpty(language));
        System.out.println("Enter the number of languages need to be added :");
        int n1 = input1.nextInt();
        for(int i =0 ; i<n1 ;i++) {
            lan.language(input1.next());
        }

    }
}

A: Got the answer..Previously i didnt define the method properly [ addlanguage ].Thanks for your help!!
public class karl_language {

    public boolean isEmpty(List<String> language) {
        if(language.isEmpty())
            return true;
        return false;
    }

    public void addlanguage(String languages,List<String> language){
        language.add(languages);

    }

    public static void main(String[] args) {
        karl_language lan = new karl_language();
        List<String> language = new ArrayList<String>();
        Scanner input1 = new Scanner(System.in);
        System.out.println("Enter the number of languages : ");
        int n = input1.nextInt();
        System.out.println("Enter the language : ");
        for(int i=0;i<n;i++){
            language.add(input1.next());
        }
        System.out.println(language);
        System.out.println("Is List Empty? : "+lan.isEmpty(language));
        System.out.println("Enter the number of languages need to be added :");
        int n1 = input1.nextInt();
        for(int i =0 ; i<n1 ;i++) {
            lan.addlanguage(input1.next(),language);
        }
        System.out.println(language);
        input1.close();
    }
}


text:
Q: Magento list-inconsistencies command gets killed My inventory command gets killed evey time, even with php -d memory_limit=-1.
The only log I found has 'unknown script' in it.
Is there a way to debug this? or help the command to finish running?
There are about 30K reservations in my database.
Here's the command:
php /var/www/html/eshop/prod.shop.smart.be/bin/magento inventory:reservation:list-inconsistencies -r


text:
Q: Fading a nav and making it fixed on scroll down, fade on scroll up I'm trying to get my navigation to fade out the changes that were faded in (ul li color, and background color). I want the nav to fade back to its original state but I'm having trouble with the animation fading out.
I tried animating the removal of the class but that messes everything up!
fiddle: http://jsfiddle.net/vp7chr47/1/
HTML

link

link

link

JS
$(window).scroll(function () {
    var scroll_top = $(this).scrollTop();
    if (scroll_top >= 1) {
        $("#nav").addClass("nav-float");
    } else {
        setTimeout(function(){
            $("#nav").removeClass("nav-float");
        }, 1000 ).fadeOut("slow");
    }
});

CSS
body {
    background: #000;
    padding: 0;
    margin: 0;
    color: #00ff00;
}
#nav {
    width: 100%;
    height: 80px;
    border: 1px solid #ff0000;
}
#nav ul li {
    display: inline;
}
.nav-float {
    position: fixed;
    background: #fff;
    transition: all 0.3s ease-in-out 0s;
    -moz-transition: all 0.3s ease-in-out 0s;
    -webkit-transition: all 0.3s ease-in-out 0s;
}
.nav-float ul li {
    color: #ff0000;
    transition: all 0.3s ease-in-out 0s;
    -moz-transition: all 0.3s ease-in-out 0s;
    -webkit-transition: all 0.3s ease-in-out 0s;
}

A: You could move the css transition from the .nav-float classes to the #nav classes. Then you can simply just add or remove the class:
$(window).scroll(function () {
    var scroll_top = $(this).scrollTop();
    if (scroll_top >= 1) {
        $("#nav").addClass("nav-float");
    } else {
        $("#nav").removeClass("nav-float");
    }
});

Working fiddle is here


text:
Q: how to show the picture to repeat if its empty? Im trying to create this thing that if its get nothing from a array it would bring up a default picture but its not working out the way i want it to. It using every array but i want to separate each away.
    $result = mysql_query("SELECT * FROM `im_album` WHERE username = '".$user_data['username']."'  ");
$d_name = array();
$d_amount = array();
$d_cover = array();
while(($row =  mysql_fetch_assoc($result))) {
    $d_name[] = $row['name'];

    $d_mode[] = $row['mode'];
    $d_amount[] = $row['amount'];
    $d_cover[]= $row['cover'];
 }
$p_cover = implode($d_cover) ;
  if ( $p_cover == "") {
  $p_cover = "cpages/img/default_pic.jpg";
  }
  else
  {
  $p_cover= "userdata/".$user_data['username']."/profilepic/".$p_cover;
  }
<img  style="margin:2pt" src="<?php echo $p_cover ?>"  height="250" width="200"  />

A: $result = mysql_query("SELECT * FROM `im_album` WHERE username = '".$user_data['username']."'  ");
while ($row =  mysql_fetch_assoc($result)) {
  $d_name = $row['name'];
  $d_mode = $row['mode'];
  $d_amount = $row['amount'];
  $d_cover = $row['cover'];
  if ( $d_cover == "") {
  $p_cover = "cpages/img/default_pic.jpg";
  }
  else
  {
  $p_cover= "userdata/".$user_data['username']."/profilepic/".$d_cover;
  }
  echo '';
}


text:
Q: How do I make independent Update Panels? As far as I understand UpdatePanels, they should be invalidated separately, i.e. triggerring one UpdatePanel should not touch the controls of the other panel. It does work so for controls outside of any UpdatePanels, however those which are inside ANY UpdatePanel are touched by triggering ANY UpdatePanel:
    <form id="form1" runat="server">
<asp:ScriptManager ID="SM1" runat="server"/>

    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
    <asp:UpdatePanel ID="update1" runat="server">
        <ContentTemplate>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="update2" runat="server">
        <ContentTemplate>
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            <asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>

</form>

Code behind:
        protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        TextBox1.Text = "Clicked 1";
        TextBox2.Text = "Shouldn't appear";
        TextBox3.Text = "Neither should this";
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        TextBox2.Text = "Clicked 2";
        TextBox1.Text = "Shouldn't appear";
        TextBox3.Text = "Neither should this";
    }

"Neither should this" does not appear, however "Shouldn't appear" appears :(. Can anybody help me understand what causes this behavior?

A: Now I see it, I forgot to put the UpdateMode="Conditional" attribute to the UpdatePanels.
Working code:
    <form id="form1" runat="server">
<asp:ScriptManager ID="SM1" runat="server"/>

    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
    <asp:UpdatePanel ID="update1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="update2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            <asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>

</form>


text:
Q: IntelliJ: Paste content of a file to hastebin.com I'm searching for a simple way to paste the content of a file directly from IntelliJ into hastebin.
But I didn't find any plugin for IntelliJ.
I'm running IntelliJ on Xubuntu 14.12.
Thank you in advance

A: Hi we used the following solution provided here: https://github.com/seejohnrun/haste-client
By using a simple Bash Script and External Tools in Intellij.
Bash Script:
#!/bin/bash
hastepost() { a=$(cat); curl -X POST -s -d "$a" hastebin.com/documents | awk -F '"' '{print "hastebin.com/"$4}'; }

url=$(cat $1 | hastepost)
echo $url
xdg-open $url

If you do not need to open the browser when execution is finished just remove the last line of the bash script.
Then create a new External Tool in Intellij with the following parameters:

Where /home/user/Dev/TOOLS/hastebin/hastebin.sh is the path to your bash script.


text:
Q: function on a smooth manifold Consider a function $f:M\rightarrow\mathbb{R}$, where $M$ is a $C^{\infty}$ manifold. Recall that a function f is smooth if $\forall$ $p$ $\in M$, $\exists$ a smooth chart $(U,\phi)$ that contains $p$ such that $f o \phi^{-1}$ is a smooth map from $\phi(U)$ to $\mathbb{R}$.
Suppose now I set $M=\mathbb{R}^{n}$. Does there exist a function $f$ and a smooth atlas for $M$ such that the function $f$ is smooth in the sense that I have just defined, but it is not smooth in the sense of ordinary calculus (Note: smooth in the sense of ordinary calculus means that the function has continuous partial derivative of all order)?

A: It is very easy to change the smooth structure on $\mathbb{R}^n$: simply push forward the usual smooth structure using a non-smooth homeomorphism.
For example, consider the following homeomorphism which is not a diffeomorphism
$$h(x) = g(|x|) \cdot x
$$
where $g : [0,\infty) \to [0,\infty)$ is some terrible homeomorphism, maybe non differentiable at a dense set and its inverse is similarly terrible. The push forward atlas under $h$ is the set of all $(U,\phi)$ such that $U$ is an open set, $\phi : U \to V$ is a homeomorphism onto some open subset $V \subset \mathbb{R}^n$, and $\phi \circ h^{-1} : h(U) \to V$ is a diffeomorphism.
A function $f : \mathbb{R}^n \to \mathbb{R}$ is smooth with respect to this push forward atlas if and only if $f \circ h^{-1}$ is smooth in the usual old atlas. But for almost any example $f$ you choose (such as projection onto a coordinate axis), if $f \circ h^{-1}$ is smooth then $f$ is not.

A: It sounds like you're asking for exotic $\mathbb{R}^n$s: differential structures on $\mathbb{R}^n$ that are not equivalent to the usual one. No such manifolds exist for $n\not = 4$: any manifold homeomorphic to $\mathbb{R}^n$ (in particular, one that's just $\mathbb{R}^n$ with a different underlying differential structure) is actually diffeomorphic to it. For $n = 4$, there are actually infinitely many such $\mathbb{R}^n$, no two of which are diffeomorphic. Their construction, and even a proof of their existence, is nontrivial. The one-sentence answer is that both phenomena above are controlled by the $h$-cobordism theorem, but that's sweeping quite a bit of math under the rug. A great reference for exotic $\mathbb{R}^4$ is Scorpan's "Wild World of $4$-manifolds", but it assumes a significant familiarity with algebraic and differential topology (say, at the level of Hatcher's and Lee's books, plus a background on characteristic classes).


text:
Q: Java + XSLT performing slow when XML contains large number of lines Application is composing an XML structure and then processing it with an XSLT file which results in a transformed XML (in memory) suitable for a client. The problem is that while composing takes about less than a second (number of lines is about 10 000), transforming takes about 30 seconds.
Here is the java method:
StringWriter parsedOutStringWriter = new StringWriter();
StringWriter xmlStringWriter = new StringWriter();
File xsltFile = new File(xslFileProperties.getLocation() + xslFileForProcessing);

JAXBContext jaxbContext = JAXBContext.newInstance(Report.class);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxbMarshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
jaxbMarshaller.marshal(report, xmlStringWriter);

TransformerFactory transformerFactory = new net.sf.saxon.TransformerFactoryImpl();
Source xsltSource = new StreamSource(xsltFile);
Transformer transformer = transformerFactory.newTransformer(xsltSource);
transformer.setParameter("versionParam", "2.0");
transformer.setParameter("clientType", clientType);
transformer.setParameter("cardType", cardTypeValue);

Source source = new StreamSource(new StringReader(xmlStringWriter.getBuffer().toString()));
Result resultXmlWithFormat = new StreamResult(parsedOutStringWriter);
transformer.transform(source, resultXmlWithFormat);

This is the XML structure which results from jaxbMarshaller marshalling of Report.class (there are usually about 10000 <transaction> elements:
   <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<report>
    <reportObject>
        <object>TEST</object>
        <objectValue>111111</objectValue>
    </reportObject>
    <reportContent>
        <reportInterval>
            <startDate>2014-07-01T00:00:00+03:00</startDate>
            <endDate>2016-09-30T23:59:59.999+03:00</endDate>
        </reportInterval>
        <client>
            <clientId>1111</clientId>
            <clientName>Some Client Name</clientName>
            <clientTown>-</clientTown>
            <clientAddress>-</clientAddress>
        </client>
        <transaction>
            <transactionId>1111111</transactionId>
            <transactionBatchId>2016091201111111</transactionBatchId>
            <transactionCode>1111111111111111</transactionCode>
            <transactionDate>2016-09-12T11:38:49+03:00</transactionDate>
            <transactionMain>111</transactionMain>
            <transactionAmount>199</transactionAmount>
            <transactionACode>      </transactionACode>
            <transactionBatch>111</transactionBatch>
            <transactionBatchDate>2016-09-12T11:40:27+03:00</transactionBatchDate>
            <transactionServiceFee>0</transactionServiceFee>
            <transactionType>1</transactionType>
            <transactionCType>AAAAA</transactionCType>
            <transactionCurrency>111</transactionCurrency>
            <transactionTerminal>11111111 111</transactionTerminal>
            <transactionTId>AA11111</transactionTId>
            <transactionClientId>111111</transactionClientId>
            <transactionClientName>SOME Client</transactionClientName>
            <transactionNetAmount>199</transactionNetAmount>
        </transaction>
    </reportContent>
</report>

This is the transforming XSLT file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                exclude-result-prefixes="fo">
    <xsl:output omit-xml-declaration="yes" indent="yes"/>
    <!--<xsl:strip-space elements="*"/>-->
    <xsl:decimal-format name="english" decimal-separator="." grouping-separator="," />
    <xsl:param name="clientType" />
    <xsl:param name="cType" />
    <xsl:param name="Interval" />

    <xsl:template match="/report">

        <report>
            <reportObject>
                <object>
                    <xsl:value-of select="reportObject/object"/>
                </object>
                <objectValue>
                    <xsl:value-of select="reportObject/objectValue" />
                </objectValue>
            </reportObject>
            <reportContent>
                <client>
                    <clientId>
                        <xsl:attribute name="type"><xsl:value-of select="$clientType"/></xsl:attribute>
                        <xsl:value-of select="reportContent/client/clientId"/>
                    </clientId>
                    <clientName>
                        <xsl:value-of select="reportContent/client/clientName" />
                    </clientName>
                    <clientTown>
                        <xsl:value-of select="reportContent/client/clientTown" />
                        <xsl:if test="reportContent/client/clientTown = ''">-</xsl:if>
                    </clientTown>
                    <clientAddress>
                        <xsl:value-of select="reportContent/client/clientAddress" />
                        <xsl:if test="reportContent/client/clientAddress = ''">-</xsl:if>
                    </clientAddress>
                </client>
                <reportInterval>
                    <startDate>
                        <xsl:value-of select="format-dateTime(reportContent/reportInterval/startDate, '[D01].[M01].[Y0001]')"/>
                    </startDate>
                    <endDate>
                        <xsl:value-of select="format-dateTime(reportContent/reportInterval/endDate, '[D01].[M01].[Y0001]')"/>
                    </endDate>
                </reportInterval>
                <cardTypes>
                    <cardType>
                        <xsl:value-of select="$cType"/>
                    </cardType>
                </cardTypes>
                <xsl:for-each-group select="reportContent/transaction" group-by="transactionBatchId">
                    <xsl:sort select="transactionClientName" />
                    <xsl:sort select="transactionBatchDate" />
                    <xsl:sort select="transactionBatch" />
                    <batch>
                        <batchDetails>
                            <batchId>
                                <xsl:value-of select="transactionBatchId"/>
                            </batchId>
                            <batchClientId>
                                <xsl:value-of select="transactionClientId"/>
                            </batchClientId>
                            <batchClientName>
                                <xsl:value-of select="transactionClientName"/>
                            </batchClientName>
                            <batchTransactionTerminal>
                                <xsl:value-of select="transactionTerminal"/>
                            </batchTransactionTerminal>
                            <batchNumber>
                                <xsl:value-of select="transactionBatch"/>
                            </batchNumber>
                            <batchDate>
                                <xsl:value-of select="format-dateTime(transactionBatchDate,'[D01].[M01].[Y0001]')"/>
                            </batchDate>
                        </batchDetails>
                        <transactionList>
                            <xsl:for-each select="current-group()">
                                <xsl:sort select="transactionDate" />
                                <transaction>
                                    <transactionBatchId>
                                        <xsl:value-of select="transactionBatchId"/>
                                    </transactionBatchId>
                                    <transactionCode>
                                        <xsl:value-of select="transactionCode"/>
                                    </transactionCode>
                                    <transactionDate>
                                        <xsl:value-of select="format-dateTime(transactionDate,'[D01].[M01].[Y0001] [H01]:[m01]:[s01]')" />
                                    </transactionDate>
                                    <transactionMain>
                                        <xsl:value-of select="transactionMain" />
                                        <xsl:if test="transactionMain = ''">-</xsl:if>
                                    </transactionMain>
                                    <transactionACode>
                                        <xsl:value-of select="transactionACode" />
                                        <xsl:if test="transactionACode = ''">-</xsl:if>
                                    </transactionACode>
                                    <transactionAmount>
                                        <xsl:value-of select="format-number(transactionAmount div 100, '#,##0.00', 'english')" />
                                    </transactionAmount>
                                    <transactionServiceFee>
                                        <xsl:value-of select="format-number(transactionServiceFee div 100, '#,##0.00', 'english')" />
                                    </transactionServiceFee>
                                    <transactionNetAmount>
                                        <xsl:value-of select="format-number(transactionNetAmount div 100, '#,##0.00', 'english')" />
                                    </transactionNetAmount >
                                    <transactionCurrency>
                                        <xsl:value-of select="transactionCurrency" />
                                        <xsl:if test="transactionCurrency = ''">-</xsl:if>
                                    </transactionCurrency>
                                    <transactionClientId>
                                        <xsl:value-of select="transactionClientId" />
                                    </transactionClientId>
                                    <transactionBatch>
                                        <xsl:value-of select="transactionBatch" />
                                    </transactionBatch>
                                    <transactionBatchDate>
                                        <xsl:value-of select="format-dateTime(transactionBatchDate,'[D01].[M01].[Y0001]')" />
                                    </transactionBatchDate>
                                    <transactionType>
                                        <xsl:value-of select="transactionType" />
                                    </transactionType>
                                    <transactionCType>
                                        <xsl:value-of select="transactionCType" />
                                    </transactionCType>
                                </transaction>
                            </xsl:for-each>
                        </transactionList>
                        <!-- batch total -->
                        <batchTotalItems>
                            <xsl:value-of select="count(current-group()/transactionAmount)"/>
                        </batchTotalItems>
                        <batchTotalAmount>
                            <xsl:value-of select="format-number(sum(current-group()/transactionAmount) div 100, '#,##0.00', 'english')"/>
                        </batchTotalAmount>
                        <batchTotalServiceFee>
                            <xsl:value-of select="format-number(sum(current-group()/transactionServiceFee) div 100, '#,##0.00', 'english')"/>
                        </batchTotalServiceFee>
                        <batchTotalNetAmount>
                            <xsl:value-of select="format-number(sum(current-group()/transactionNetAmount) div 100, '#,##0.00', 'english')"/>
                        </batchTotalNetAmount>
                    </batch>
                </xsl:for-each-group>
                <!-- overall total -->
                <totalItems>
                    <xsl:value-of select="count(/report/reportContent/transaction/transactionAmount)"/>
                </totalItems>
                <totalAmount>
                    <xsl:value-of select="format-number(sum(/report/reportContent/transaction/transactionAmount) div 100, '#,##0.00', 'english')"/>
                </totalAmount>
                <totalFee>
                    <xsl:value-of select="format-number(sum(/report/reportContent/transaction/transactionServiceFee) div 100, '#,##0.00', 'english')"/>
                </totalFee>
                <totalNetAmount>
                    <xsl:value-of select="format-number(sum(/report/reportContent/transaction/transactionNetAmount) div 100, '#,##0.00', 'english')"/>
                </totalNetAmount>
            </reportContent>
        </report>
    </xsl:template>
</xsl:stylesheet>

And this is how the transformed XML looks like (there are usually about 10000 <transaction> elements and quite a few <batch> elements:
<report>
   <reportObject>
      <object>TEST</object>
      <objectValue>111111</objectValue>
   </reportObject>
   <reportContent>
      <client>
         <clientId type="">111</clientId>
         <clientName>Client Name</clientName>
         <clientTown>-</clientTown>
         <clientAddress>-</clientAddress>
      </client>
      <reportInterval>
         <startDate>01.07.2014</startDate>
         <endDate>30.09.2016</endDate>
      </reportInterval>
      <cardTypes>
         <cardType/>
      </cardTypes>
      <batch>
         <batchDetails>
            <batchId>2016091201111111</batchId>
            <batchClientId>1111111</batchClientId>
            <batchClientName>Some Client Name</batchClientName>
            <batchTransactionTerminal>11111111A11</batchTransactionTerminal>
            <batchNumber>89</batchNumber>
            <batchDate>14.04.2016</batchDate>
         </batchDetails>
         <transactionList>
            <transaction>
               <transactionBatchId>2016091201111111</transactionBatchId>
               <transactionCode>1111111111111111</transactionCode>
               <transactionDate>12.09.2016 09:33:52</transactionDate>
               <transactionMain>111</transactionMain>
               <transactionACode></transactionACode>
               <transactionAmount>1.99</transactionAmount>
               <transactionServiceFee>0.00</transactionServiceFee>
               <transactionNetAmount>1.99</transactionNetAmount>
               <transactionCurrency>111</transactionCurrency>
               <transactionClientId>1111111</transactionClientId>
               <transactionBatch>111</transactionBatch>
               <transactionBatchDate>14.04.2016</transactionBatchDate>
               <transactionType>1</transactionType>
               <transactionCType>AAAAA</transactionCType>
            </transaction>
         </transactionList>
       </batch>
    <reportContent>
</report>

Is there any way I can improve this XSLT performance wise? Or maybe the problem is in the java code? Note: template caching has been tested and doesn't help much.


text:
Q: How to Merge the two arrays as keys and values into an object with keys having more than one value? My input is the following:
Input: keys = ['username', 'first-name', 'last-name', 'age', 'username'] and  values = ['johndoe', 'John', 'Doe', 35, 'johnny']

And I want my output to look like this:
Output: {username: ['johndoe', 'johnny'], firstName: 'John', lastName: 'Doe', age: 35}

This is my code so far, which I know is not exactly solving the username having 'johndoe' and 'johnny' issue:

function mergeArrays(keys, values) {
  var obj = {};
  if (keys.length != values.length)
    return null;
  for (var index in keys)
    obj[keys[index]] = values[index];
  return obj;
}

A: The "forEach" function could be useful.

var keys = ['username', 'first-name', 'last-name', 'age', 'username']
var values = ['johndoe', 'John', 'Doe', 35, 'johnny']

var result = {}
keys.forEach(function(x, i) {
  if (result[x]) {
    if (typeof result[x] == 'Array') {result[x].push(values[i])}
    else result[x] = [result[x],values[i]]
  }
  else result[x] = values[i]

})

console.log(result)

A: Using concat()

function mergeArrays(keys, values) {
  var obj = {};
  if (keys.length != values.length)
    return null;
  for (var index in keys) {
    if (obj[keys[index]]) {
      obj[keys[index]] = [].concat(obj[keys[index]], values[index])
    } else {
      obj[keys[index]] = values[index];
    }
  }
  return obj;
}

var res = mergeArrays(['username', 'first-name', 'last-name', 'age', 'username'], ['johndoe', 'John', 'Doe', 35, 'johnny'])

console.log(res)

A: const keys = ['username', 'first-name', 'last-name', 'age', 'username'];
const values = ['johndoe', 'John', 'Doe', 35, 'johnny'];
const result = {};

keys.forEach((val, key) => {
  if (!result[val]) {
    result[val] = values[key];
  } else if (Array.isArray(result[val])) {
    result[val].push(values[key]);
  } else {
    result[val] = [result[val], values[key]];
  }
});

console.log(result);

A:

let keys = ['username', 'first-name', 'last-name', 'age', 'username'];
let values = ['johndoe', 'John', 'Doe', 35, 'johnny'];

let transformedData = keys.reduce((result,item,index)=>{
     if (index>=values.length-1) return result;
     result[item]= index===0 ? [values[0],values[values.length-1]] : values[index];
     return result;
},{});

console.log(transformedData);

A: Fixing your code first. The values are always getting overriden by new onces. You need to check if the value exists for that key and then do some manipulation. Here is the fixed code for the same:

keys = ['username', 'first-name', 'last-name', 'age', 'username']
values = ['johndoe', 'John', 'Doe', 35, 'johnny']

function mergeArrays(keys, values) {
  var obj = {};
  if (keys.length != values.length)
    return null;
  for (var index in keys) {
    if (Array.isArray(obj[keys[index]])) {
      obj[keys[index]].push(values[index])
    } else if (obj[keys[index]]) {
      obj[keys[index]] = [obj[keys[index]], values[index]]
    } else {
      obj[keys[index]] = values[index]
    }
  }
  return obj;
}

console.log(mergeArrays(keys, values))

However, for..in approach is generally discouraged. Read more here: Why is using "for...in" with array iteration a bad idea?

You can also use reduce function for the same. The same code using reduce:

keys = ['username', 'first-name', 'last-name', 'age', 'username']
values = ['johndoe', 'John', 'Doe', 35, 'johnny']

result = keys.reduce((acc, value, i) => {
  if (Array.isArray(acc[value])) {
    acc[value].push(values[i])
  } else if (acc[value]) {
    acc[value] = [acc[value], values[i]]
  } else
    acc[value] = values[i]
  return acc
}, {})

console.log(result)

Hope it helps. Revert for any doubts/clarifications.


text:
Q: Wireless on an Atheros AR9285 is slow and disconnects I installed Ubuntu on my notebook yesterday. All right except wi-fi connection.
I found wi-fi network (based on D-link dir-300) and connected. But it works too slow and disconnect every 1-3 minutes. You can say that maybe problem is in connection but on my notebook i have windows 7 and ubuntu 10.10 and in windows i have no such problem. Windows works well with wi-fi. But Ubuntu...
I have:

DSL internet connection. modem is
connected to router. Router connected
with desktop by wire and with notebook
samsung R528 by wifi. Router - D-link
DIR-300.

Rusult of lspci -k is:
Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
    Subsystem: Foxconn International, Inc. Device e025
    Kernel driver in use: ath9k
    Kernel modules: ath9k

Thanks for any help!
P.S.

I wrote this message from Windows 7. I
edited this message from Ubuntu but i
see that internet works more slower
than in Windows 7.
Firefox on Winddows 7 loads this page in ~ 2-3 seconds
Firefox on Ubuntu 10.10 loads this page in ~ 20 seconds

A: Kernel 2.6.39 completely fixed the issues with the ath9x driver for me in 11.04 (Natty). I can do high-load transfers without issue. Comment #8 on "wlan (AR928X, ath9k) slow since upgrade to natty" contains instructions on how to get this kernel from a PPA. I did an apt-get install rather than a dist-upgrade, but either one should get you the new kernel. Here's what I did:
sudo add-apt-repository ppa:kernel-ppa/ppa
sudo apt-get update && sudo apt-get install linux-generic-pae

If you're using a 64-bit kernel, I think the package to install is just "linux-generic". Or just follow the instructions right in the bug (use apt-get dist-upgrade -y).
Also possibly related:

*

*UNR Ath9K unstable connection
After upgrading to linux 2.6.39, changing the ath9k driver config (as suggested in Why is my internet so slow with an Atheros wireless card?) is not necessary.
Hope this helps!

A: I have been having this issue with Atheros for a long, long time. I have even given up on Ubuntu for some time (my Windows connection worked fine), but I found out that switching from Unity to Gnome was enough to solve the problem. I don't know how to explain why this is so (new user), but it just works.
Maybe you want to check the question I opened myself about this some months ago: Is the wireless driver from Live USB different from the standard install?
Best of luck.


text:
Q: Data Not Inserted To The Server Due to BackgroundFallback initVivoBgFallback I am trying to insert data into mysql through my android phone but it's not inserted or not throw any error at runtime. I have Debug the code and found Error as under.
here is my code
My JavaFile
 package com.example.digitalrukhivalmikisamaj;
 import androidx.appcompat.app.AppCompatActivity;
 import android.os.Bundle;
 import android.app.ProgressDialog;
 import android.view.View;
 import android.widget.Toast;
 import android.widget.EditText;
 import android.widget.Button;

 import java.util.HashMap;
 import java.util.Map;

 import com.android.volley.Request;
 import com.android.volley.RequestQueue;
 import com.android.volley.Response;
 import com.android.volley.RetryPolicy;
 import com.android.volley.VolleyError;
 import com.android.volley.toolbox.StringRequest;
 import com.android.volley.toolbox.Volley;

 public class applicationform extends AppCompatActivity {

 // Creating EditText.
 EditText FirstName, LastName ;

 // Creating button;
 Button InsertButton;

 // Creating Volley RequestQueue.
 RequestQueue requestQueue;

 // Create string variable to hold the EditText Value.
 String FirstNameHolder, LastNameHolder;

 // Creating Progress dialog.
 ProgressDialog progressDialog;

 // Storing server url into String variable.
 String HttpUrl = "https://192.168.1.100/dbeng/get_data1.php";

 @Override
 protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_applicationform);

    // Assigning ID's to EditText.
    FirstName = (EditText) findViewById(R.id.name);
    LastName = (EditText) findViewById(R.id.fname);

    // Assigning ID's to Button.
    InsertButton = (Button) findViewById(R.id.btn1);

    // Creating Volley newRequestQueue .
    requestQueue = Volley.newRequestQueue(applicationform.this);

    progressDialog = new ProgressDialog(applicationform.this);

    // Adding click listener to button.
    InsertButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

            // Showing progress dialog at user registration time.
   progressDialog.setMessage("Please Wait, We are Inserting Your Data on
   Server");
            progressDialog.show();

            // Calling method to get value from EditText.
            GetValueFromEditText();

            // Creating string request with post method.
            StringRequest stringRequest = new
 StringRequest(Request.Method.POST, HttpUrl,
                    new Response.Listener<String>() {
                        @Override
                        public void onResponse(String ServerResponse) {

          // Hiding the progress dialog after all task complete.
                            progressDialog.dismiss();

                            // Showing response message coming from server.
                            Toast.makeText(applicationform.this,
 ServerResponse, Toast.LENGTH_LONG).show();
                        }
                    },
                    new Response.ErrorListener() {
                        @Override
                        public void onErrorResponse(VolleyError volleyError)
 {

                // Hiding the progress dialog after all task complete.
                            progressDialog.dismiss();

                    // Showing error message if something goes wrong.
                            Toast.makeText(applicationform.this,
 volleyError.toString(), Toast.LENGTH_LONG).show();
                        }
                    }) {
                @Override
                protected Map<String, String> getParams() {

                    // Creating Map String Params.
            Map<String, String> params = new HashMap<String, String> ();

                    // Adding All values to Params.
                    params.put("first_name", FirstNameHolder);
                    params.put("last_name", LastNameHolder);

                    return params;
                }

            };

            // Creating RequestQueue.
            RequestQueue requestQueue =
 Volley.newRequestQueue(applicationform.this);

            // Adding the StringRequest object into requestQueue.
            requestQueue.add(stringRequest);

        }
    });

}

// Creating method to get value from EditText.
public void GetValueFromEditText(){

    FirstNameHolder = FirstName.getText().toString().trim();
    LastNameHolder = LastName.getText().toString().trim();

   }

 }

My Gradle File
 apply plugin: 'com.android.application'

 android {
 compileSdkVersion 29
 buildToolsVersion "29.0.2"
 defaultConfig {
    applicationId "com.example.digitalrukhivalmikisamaj"
    minSdkVersion 15
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-
optimize.txt'), 'proguard-rules.pro'
    }
 }
}

 dependencies {

 implementation fileTree(dir: 'libs', include: ['*.jar'])
 implementation 'androidx.appcompat:appcompat:1.0.2'
 implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
 testImplementation 'junit:junit:4.12'
 androidTestImplementation 'androidx.test.ext:junit:1.1.0'
 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

 implementation 'com.google.http-client:google-http-client-android:+'

 implementation 'com.google.api-client:google-api-client-android:+'

 implementation 'com.google.api-client:google-api-client-gson:+'

 implementation 'com.android.volley:volley:1.1.0'

 android{
    useLibrary  'org.apache.http.legacy'
 }

 android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }
  }

 }

DatabaseConfig File
 <?php

 //Define your host here.
 $HostName = "localhost";

 //Define your database username here.
 $HostUser = "root";

 //Define your database password here.
 $HostPass = "";

 //Define your database name here.
 $DatabaseName = "rukhivalmiki";

 ?>

My GetData PHP File
 <?php

 include 'DatabaseConfig.php' ;

 $con = mysqli_connect($HostName,$HostUser,$HostPass,$DatabaseName);

 $name = $_POST['name'];
 $fname = $_POST['fname'];

 $Sql_Query = "insert into appform (name,fname) values ('$name','$fname')";

 if(mysqli_query($con,$Sql_Query)){

 echo 'Data Submit Successfully';

 }
 else{

 echo 'Try Again';

 }
 mysqli_close($con);
 ?>

Debug Consol Error is here:
 11/25 13:57:40: Launching 'app' on vivo vivo 1806.
 $ adb shell am start -n
enter code here "com.example.digitalrukhivalmikisamaj/com.example.digitalrukhivalmikisamaj.MainA
 ctivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
 -D Waiting for application to come online:
 com.example.digitalrukhivalmikisamaj |
 com.example.digitalrukhivalmikisamaj.test
 Waiting for application to come online:
 com.example.digitalrukhivalmikisamaj |
 com.example.digitalrukhivalmikisamaj.test
 Connecting to com.example.digitalrukhivalmikisamaj
 Waiting for application to start debug server
 Waiting for application to come online:
 com.example.digitalrukhivalmikisamaj |
 com.example.digitalrukhivalmikisamaj.test
 Connecting to com.example.digitalrukhivalmikisamaj
 Capturing and displaying logcat messages from application. This behavior
 can be disabled in the "Logcat output" section of the "Debugger" settings
 page.
 I/System.out: Debugger has connected
 I/System.out: waiting for debugger to settle...
 Connected to the target VM, address: 'localhost:8600', transport: 'socket'
 I/System.out: waiting for debugger to settle...
 I/System.out: waiting for debugger to settle...
 I/System.out: waiting for debugger to settle...
 I/chatty: uid=10193(com.example.digitalrukhivalmikisamaj) identical 1 line
 I/System.out: waiting for debugger to settle...
 I/System.out: waiting for debugger to settle...
 I/System.out: debugger has settled (1413)
 I/FtBuild: getRomVersion mRomVer=9.0
 W/khivalmikisama: Accessing hidden method Landroid/view/View;-
 >computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z
 (light greylist, reflection)
 W/khivalmikisama: Accessing hidden method Landroid/view/ViewGroup;-
  >makeOptionalFitsSystemWindows()V (light greylist, reflection)
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 I/chatty: uid=10193(com.example.digitalrukhivalmikisamaj) identical 1 line
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 D/skia: SkJpegCodec::onGetPixels + (2004, 2004)
 SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 D/skia: SkJpegCodec::onGetPixels -
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 I/chatty: uid=10193(com.example.digitalrukhivalmikisamaj) identical 1 line
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 D/OpenGLRenderer: Skia GL Pipeline
 I/SurfaceFactory: [static] sSurfaceFactory =
 com.mediatek.view.impl.SurfaceFactoryImpl@4f88b56
 D/ViewRootImpl[MainActivity]: hardware acceleration = true ,
 fakeHwAccelerated = false, sRendererDisabled = false, forceHwAccelerated =
 false, sSystemRendererDisabled = false
 V/PhoneWindow: DecorView setVisiblity: visibility = 0, Parent =
 android.view.ViewRootImpl@a0fd3ad, this = DecorView@a06e2[MainActivity]
 V/PhoneWindow: DecorView setVisiblity: visibility = 4, Parent =
 android.view.ViewRootImpl@a0fd3ad, this = DecorView@a06e2[MainActivity]
 D/ViewRootImpl[MainActivity]: onDisplayChange oldDisplayState=1
 newDisplayState=2
 D/ViewRootImpl[MainActivity]: onDisplayChange oldDisplayState=2
 newDisplayState=2
 V/PhoneWindow: DecorView setVisiblity: visibility = 0, Parent =
 android.view.ViewRootImpl@a0fd3ad, this = DecorView@a06e2[MainActivity]
 D/Surface: Surface::allocateBuffers(this=0x78c0a4c000)
 I/ConfigStore:
 android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorD
 isplay retrieved: 0
 I/ConfigStore:
 android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay
 retrieved: 0
 I/OpenGLRenderer: Initialized EGL, version 1.4
 D/OpenGLRenderer: Swap behavior 2
 E/OpenGLRenderer: Device claims wide gamut support, cannot find matching
 config, error = EGL_SUCCESS
 D/Surface: Surface::connect(this=0x78c0a4c000,api=1)
 D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *,
 EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
 D/Surface: Surface::disconnect(this=0x78c0a4c000,api=1)
 D/Surface: Surface::connect(this=0x78c0a4c000,api=1)
 D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *,
 EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
 E/ion: ioctl c0044901 failed with code -1: Invalid argument
 W/ActivityThread: handleWindowVisibility: no activity for token
 android.os.BinderProxy@e3fd48c
 D/skia: SkJpegCodec::onGetPixels fEnTdshp 0 fISOSpeedRatings -1!
 I/khivalmikisama: Compiler allocated 4MB to compile void
 android.widget.TextView.<init>(android.content.Context,
 android.util.AttributeSet, int, int)
 V/PhoneWindow: DecorView setVisiblity: visibility = 4, Parent = null, this
  = DecorView@87e7050[]
 D/ViewRootImpl[applicationform]: hardware acceleration = true ,
 fakeHwAccelerated = false, sRendererDisabled = false, forceHwAccelerated =
  false, sSystemRendererDisabled = false
 V/PhoneWindow: DecorView setVisiblity: visibility = 0, Parent =
 android.view.ViewRootImpl@9f4506f, this =
 DecorView@87e7050[applicationform]
 D/Surface: Surface::allocateBuffers(this=0x78c09ce000)
 D/Surface: Surface::connect(this=0x78c09ce000,api=1)
 D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *,
 EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
 D/Surface: Surface::disconnect(this=0x78c0a4c000,api=1)
 V/PhoneWindow: DecorView setVisiblity: visibility = 4, Parent =
 android.view.ViewRootImpl@a0fd3ad, this = DecorView@a06e2[MainActivity]
 I/AssistStructure: Flattened final assist data: 8572 bytes, containing 1
 windows, 26 views
 E/BackgroundFallback: initVivoBgFallback
 callstackcom.android.internal.policy.DecorView.<init>:379
 com.android.internal.policy.PhoneWindow.generateDecor:2439
 com.android.internal.policy.PhoneWindow.installDecor:2817
 com.android.internal.policy.PhoneWindow.setContentView:451
 com.android.internal.app.AlertController.installContent:292
 android.app.AlertDialog.onCreate:444
 android.app.ProgressDialog.onCreate:272
 android.app.Dialog.dispatchOnCreate:442 android.app.Dialog.show:337
 com.example.digitalrukhivalmikisamaj.applicationform$1.onClick:68
 D/ViewRootImpl[applicationform]: hardware acceleration = true ,
 fakeHwAccelerated = false, sRendererDisabled = false, forceHwAccelerated =
 false, sSystemRendererDisabled = false
 I/khivalmikisama: The ClassLoaderContext is a special shared library.
 W/Thread-8: type=1400 audit(0.0:42798): avc: denied { read } for
 name="u:object_r:mtk_em_tel_log_prop:s0" dev="tmpfs" ino=13085
 scontext=u:r:untrusted_app:s0:c193,c256,c512,c768
 tcontext=u:object_r:mtk_em_tel_log_prop:s0 tclass=file permissive=0
 E/libc: Access denied finding property "persist.vendor.log.tel_dbg"
 D/NetworkSecurityConfig: No Network Security Config specified, using
 platform default
 W/System: ClassLoader referenced unknown path: system/framework/mediatek-
  cta.jar
 I/System.out: e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
 D/Linux: [Posix_connect Debug]Process com.example.digitalrukhivalmikisamaj
 :443
 W/System: ClassLoader referenced unknown path: system/framework/mediatek-
  cta.jar
 I/System.out: e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaHttp
 D/Linux: [Posix_connect Debug]Process com.example.digitalrukhivalmikisamaj
 :443
 I/Choreographer: Skipped 2904 frames!  The application may be doing too
 much work on its main thread.
 I/OpenGLRenderer: Davey! duration=48842ms; Flags=1,
 IntendedVsync=3208301042060, Vsync=3256887288164,
 OldestInputEvent=9223372036854775807, NewestInputEvent=0,
 HandleInputStart=3256901809884, AnimationStart=3256902370731,
 PerformTraversalsStart=3256911987884, DrawStart=3257135068115,
 SyncQueued=3257137194269, SyncStart=3257137387807,
 IssueDrawCommandsStart=3257137573115, SwapBuffers=3257141423500,
 FrameCompleted=3257143611269, DequeueBufferDuration=591000,
 QueueBufferDuration=925000,
 D/ViewRootImpl[MainActivity]: onDisplayChange oldDisplayState=2
 newDisplayState=1
 D/ViewRootImpl[applicationform]: onDisplayChange oldDisplayState=2
 newDisplayState=1
 D/ViewRootImpl[applicationform]: onDisplayChange oldDisplayState=2
 newDisplayState=1
 V/PhoneWindow: DecorView setVisiblity: visibility = 4, Parent =
 android.view.ViewRootImpl@9f4506f, this =
 DecorView@87e7050[applicationform]
 D/Surface: Surface::disconnect(this=0x78c09ce000,api=1)
 D/View: [Warning] assignParent to null: this =
 DecorView@95aa560[applicationform]
 V/Typeface: CurFontPath: /system/fonts/Roboto-Regular.ttf
 D/Typeface: switch to android orgin ttf
 D/ViewRootImpl[Toast]: hardware acceleration = true , fakeHwAccelerated =
 false, sRendererDisabled = false, forceHwAccelerated = false,
 sSystemRendererDisabled = false
 D/Surface: Surface::allocateBuffers(this=0x78c09ce000)
 D/Surface: Surface::connect(this=0x78c09ce000,api=1)
 D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *,
 EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
 D/Surface: Surface::disconnect(this=0x78c09ce000,api=1)
 D/View: [Warning] assignParent to null: this =
 android.widget.LinearLayout{7fd96ea V.E...... ......ID 0,0-610,88}
 D/ViewRootImpl[MainActivity]: onDisplayChange oldDisplayState=1
 newDisplayState=2
 D/ViewRootImpl[applicationform]: onDisplayChange oldDisplayState=1
 newDisplayState=2
 V/PhoneWindow: DecorView setVisiblity: visibility = 0, Parent =
 android.view.ViewRootImpl@9f4506f, this =
 DecorView@87e7050[applicationform]
 D/Surface: Surface::allocateBuffers(this=0x78c09ce000)
 D/Surface: Surface::connect(this=0x78c09ce000,api=1)
 D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *,
 EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
 Disconnected from the target VM, address: 'localhost:8600', transport:
 'socket'

I have tested PHP File its OK. Dont know whats wrong?.


text:
Q: how to affect an element's width by one child element but not others using CSS As the title describes, I would like find a CSS means of making one element's width affect its parent element's width, but force other children of that parent to fit within that width.
Here's the code I'm using:

And here is the relevant css (thus far):
    .toolbar a{
            display: inline-block;
            width: 20px;
            height: 20px;
            text-align: center;
            line-height: 24px;
            border-radius: 0.2em;
            padding: 3px;
            border: 1px solid #AAA;
    }

    .toolbar a.currentTool{
            box-shadow:-1px -1px 1px 1px rgba(0,0,0,0.5) inset, 1px 1px 1px 1px rgba(255, 255, 255, 0.8) inset;
            border: none;
    }

    #canvasHolder {
            background-color: #a0a0a0;
            border: 1px solid #777470;
    }

    #canvasHolder canvas{
            border: 1px solid #666;
            background: repeating-linear-gradient(
                    45deg,
                    #CCC,
                    #CCC 2px,
                    #CCC 4px,
                    #AAA 6px
            );
            display: inline-block;
            vertical-align: center;
    }

This of course is not doing what I want.  I would like the "canvasHolder" div to determine the size of that toolbar beyond a certain minimum, and for the anchors in the div below it to populate the area below, but without affecting the width of the "leftToolBar" div.
Is there some combination of CSS attributes I can apply here (aside from a hard-coded "max-width" number) that will give me that effect?

A:

Does this accomplish what you are looking for?

A: Unfortunately, no -- CSS does not have a parent selector. The best you can do is give #canvasHolder a min-width and max-width, or a percentage-based width.
You could target it with jQuery, and manipulate the parent CSS through there, using $("#canvasHolder").parent().css();, assuming you have access to jQuery.

A: Not sure if this is what you want, but take a look:

.toolbar a {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 24px;
    border-radius: 0.2em;
    padding: 3px;
    border: 1px solid #AAA;
}

.toolbar a.currentTool {
    box-shadow: -1px -1px 1px 1px rgba(0, 0, 0, 0.5) inset, 1px 1px 1px 1px rgba(255, 255, 255, 0.8) inset;
    border: none;
}

#canvasHolder {
    background-color: #a0a0a0;
    border: 1px solid #777470;
}

#canvasHolder canvas {
    border: 1px solid #666;
    background: repeating-linear-gradient( 45deg, #CCC, #CCC 2px, #CCC 4px, #AAA 6px);
    display: inline-block;
    vertical-align: center;
}

/** important part **/

.toolbar {
    /*background-color: red;*/
    width: auto;
    display: inline-block;
    position: relative;
}

#canvasHolder {
    min-width: 200px;
    height: 100px;
}

#canvasHolder + div {
    position: absolute;
    top: 100%;
    width: 100%;
}

If I understood what you are trying to do, the div with the links should be removed from the flow so that #canvasHolder can determine its parent width.
For this to be done we need to:

*

*Set .toolbar width to auto so its width is determined by its first child;

*Set position: absolute on the links container div, so it is removed from the current flow. Also set top: 100% to make it be placed always at the end of its parent and width: 100% to make it stretch with #canvasHolder;

*And set a min-width on #canvasHolder.

You can change the width of #canvasHolder to see the results.


text:
Q: Sed doubts when n occurrences are used I'm trying to replace the nth occurrence of a substring in a file. I tried to achieve this using sed but all attempts failed to give me the desired output. Some of the attempts are:
sed 's/old/new/g'
sed 's/old/new/3'
sed 's/old/new/3g'

A: The most common usage of sed is to perform a replacement such as
sed 's/foo/bar/' file

This will replace the first occurrence of the string foo by the string bar and it will do this for every line in file.
If you want to replace the 3rd occurrence of the string foo only, but do this for every line, then you can write:
sed 's/foo/bar/3' file.

Finally, if you want to replace all occurrences, then you use :
sed 's/foo/bar/g' file.

Any combination such as
sed 's/foo/bar/3g' file

results in unspecified behaviour.
If you want to replace the nth occurrence in a file than sed is not the right tool, but perl or awk might be better.

*

*If you know you have maximum one occurrence of "foo" per line, you can do
awk '/foo/{c++}(c==n){sub("foo","bar")}1' file

*If more than a single occurrence per line might appear it becomes a bit more tricky, various solutions are possible:
awk 'BEGIN{FS="foo";OFS="bar";n=5}
     (c<n) && (c+NF-1>=n) {
        for(i=1;i<NF;++i) printf $i ((++c==n) ? OFS : FS); print $NF; next
     }
     {c+=NF-1; print}' file


text:
Q: C# custom file extension filter I'm trying to read a list of documents in a directory. I understand how the filter modifiers work at a high level and have used them before. However, this time I need to filter something that doesn't have a standardized extension (i.e. "*.txt" or *.pdf").
I'm using the example as found on....
https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.filedialog.filter?view=net-5.0
 using System;

using System.Windows.Forms;

namespace COMS2412_Readin
{
    public partial class Form1 : Form
    {
        string Serial_num = null;
        string INI_file_dir_temp = null;
        string CONFIG_data = null;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //Allow user to enter serial number and load it for useage later.
            Serial_num = Serial_number_text.Text;
            try
            {
                using (OpenFileDialog COMS_file_dialog = new OpenFileDialog())
                {
                    COMS_file_dialog.InitialDirectory = "c:\\";
                    //Have dialog box filter out all files without the .INI extention.
                    COMS_file_dialog.Filter = "txt files (*.INI)|*.INI|All files (*.*)|*.*"; //Failed
                    //                    COMS_file_dialog.Filter = "*.INI"; //Failed
                    //                    COMS_file_dialog.Filter = "(*.INI)"; //Failed
                    //                    COMS_file_dialog.Filter = "(INI files | *.INI)"; //Failed
                    COMS_file_dialog.FilterIndex = 2;
                    COMS_file_dialog.RestoreDirectory = true;
                    if (COMS_file_dialog.ShowDialog() == DialogResult.OK)
                    {
                        //Check to make sure it was the correct file type.
                        INI_file_dir_temp = COMS_file_dialog.FileName;
                    }
                }
            }
            catch
            {
                //Sorry there was an error with opening the file. Please ensure the file is not currently open.
            }
        }
    }
}

The project I'm working on imports config files from an external piece of equipment. The problem is there are literally thousands of files, each with unusual file extensions. For example *.INI is one of the extensions I want to filter. I've tried just entering  `*.INI as the argument but it didn't work. What am I missing? Is there a way to alter...
openFileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";

to filter specific file extensions?

A: Finally, have something that works...
openFileDialog.Filter = "(*.INI)|*.INI";

This filters out everything that isn't of the .INI extension. For me specifically, I had to run VS as admin and ensure the files were not hidden.


text:
Q: What is Soldering temperature of STM32F303 IC chip 100-pin? I want to solder a 100-pin STM32F303 IC on a PCB. What is the recommended soldering temperature? I could not find it in the datasheet.

A: The soldering temperature (or heat profile) mostly depends on the solder being used. The chip (and other components) datasheet will usually give a maximum temperature and a maximum soldering time.
It may vary a depending of the components, like LED, Crystals, etc...
My experience in microcontroller is that the integrated crystal is the first to go off if it's over heated.

*

*Lead-Free solder (which is the one commonly used in electronics) will met around 240-250°C

*Leaded solder will melt around 200°C.

To do R&D and rework/repair, I usually use special low temperature solder with Bismuth that has a melting point around 130-160°C, this allows to be more "relax" doing the job and worrying less about burning the chip.
Note that as well as the temperature, the humidity is might cause damage while heating. Humidity can slowly get into the chip package and when you heat it up, it might crack the package. If the chip is not out of the package (usually sealed bag with these drying pearls) it is best to first cook the chip/board for a while at 80-90°C to remove the humidity.


text:
Q: Adding Encryption to Solr/lucene indexes I am currently using Solr to perform search services over some sensitive records.
As Solr/lucene provides fast searching by storing inverted indexes of the sensitive information in plain text on a disk there is a requirement to encrypt these index files so that unauthorized people can't have access to them by bypassing the system's security.
I found there are similar patches open on Apache JIRA  AES encrypted directory  and Codec for index-level encryption.
AES encrypted directory looks promising but this patch has been implemented for lucene 3.1 as I am using the newer version, I am not sure if this patch can be used with lucene version 5 or higher.
I was wondering if there is a way to implement a security measure that encrypts the indexes or if it is possible to write some custom plugin which can encrypt/decrypt the indexes on I/O level(i.e FsDirectory)?

A: The discussion in the comment section of LUCENE-6966 you have shared is really interesting. I would reason with this quote of Robert Muir that there is nothing baked into Solr and probably will never be.

More importantly, with file-level encryption, data would reside in an unencrypted form in memory which is not acceptable to our security team and, therefore, a non-starter for us.

This speaks volumes. You should fire your security team! You are wasting your time worrying about this: if you are using lucene, your data will be in memory, in plaintext, in ways you cannot control, and there is nothing you can do about that!
Trying to guarantee anything better than "at rest" is serious business, sounds like your team is over their head.

So you should consider to encrypt the storage Solr is using on OS level. This should be transparent for Solr. But if someone comes into your system, he should not be able to copy the Solr data.
This is also the conclusion the article Encrypting Solr/Lucene indexes from Erick Erickson of Lucidwors draws in the end

The short form is that this is one of those ideas that doesn't stand up to scrutiny. If you're concerned about security at this level, it's probably best to consider other options, from securing your communications channels to using an encrypting file system to physically divorcing your system from public networks. Of course, you should never, ever, let your working Solr installation be accessible directly from the outside world, just consider the following: http://server:port/solr/update?stream.body=<delete><query>*:*</query></delete>!


text:
Q: Syntax for linq query to List I am trying to do something like this...
public static List<string> GetAttachmentKeyList()
{
    DataClassesDataContext dc = new DataClassesDataContext();

    List<string> list = from a in dc.Attachments
        select a.Att_Key.ToString().ToList();

    return list;
}

Visual Studio is saying...
Cannot implicitly convert type 'System.Linq.IQueryable>' to 'System.Collections.Generic.List'.
An explicit conversion exists (are you missing a cast?)
What is the proper syntax???

A: Give this a try
public static List<string> GetAttachmentKeyList()
{
    DataClassesDataContext dc = new DataClassesDataContext();

    List<string> list = ( from a in dc.Attachments
                          select a.Att_Key.ToString() ).ToList();

    return list;
}

A: I guess it would something like below.
       List<string> list = (from a in dc.Attachments
                             select a.Att_Key.ToString()).ToList<string>();

Hope this helps!!

A: try this,
public static List<string> GetAttachmentKeyList()
{
    DataClassesDataContext dc = new DataClassesDataContext();

    return dc.Attachments.Select(a=>a.Att_Key).ToList();
}


text:
Q: How to avoid duplicate items in a drop down list to display? I would like to create a drop-down list and retrieve the elements from a webService.
My problem is that I would like to avoid displaying duplicate items because I have 9999 items.
Here is the JSON file.
enter image description here
Do you think it is possible to do this? Because, I have no idea how to program this?
The display method is this:
private getDropDownList(): void {
    this.service.getDropDownList().pipe(
      takeUntil(this.unsubscribe$)
    ).subscribe(res => {
      if (res.RETURNCODE === ApiResponseCodeEnum.Ok) {
        this.corporateLines = res.TITRE.map(
          corporateLine => {
            return {
             placelabel: corporateLine.PLACELABEL,
            }
          }
        );
      }
    });
  }

corporate.component.ts
export class CorporateComponent implements OnInit, OnDestroy {

  private unsubscribe$ = new Subject<void>();

  corporateLines: Corporate[] = [];

  constructor(private service: CorporateService, private router: Router) { }

  ngOnInit(): void {
    this.getDropDownList();
  }

  ngOnDestroy(): void {
    this.unsubscribe$.next();
    this.unsubscribe$.complete();
  }

  private getDropDownList(): void {
    this.service.getDropDownList().pipe(
      takeUntil(this.unsubscribe$)
    ).subscribe(res => {
      if (res.RETURNCODE === ApiResponseCodeEnum.Ok) {
        this.corporateLines = res.TITRE.map(
          corporateLine => {
            return {
              placelabel: corporateLine.PLACELABEL,

            }
          }
        );
      }
    });
  }

}

corporate.response.ts
import { ApiResponse } from "src/shared/types/api.response";

export interface CorporateResponse extends ApiResponse {
    TITRE: {
        PLACELABEL: string;
    }[];
}

corporate.ts
export interface Corporate {
    placelabel: string;
}

corporate.component.html

      Label

      <select>
         <option *ngFor="let line of corporateLines">{{line.placelabel }}</option>
      </select>

Thanks

A: Considering that all your data is contained in "TITRE" : [...] which is actually an array, you could use the solution from Delete duplicate elements from an array, which uses the filter function to return an array containing only unique elements.
For example, in your case you could do something like this :
var unique = res.TITRE.filter(function(elem, index, self) {
    return index === self.indexOf(elem);
})
this.corporateLines = unique.map(
      corporateLine => {
        return {
          placelabel: corporateLine.PLACELABEL,

        }
      }
    );

A: I think you could use the distinct operator like this:
private getDropDownList(): void {
    this.service.getDropDownList().pipe(distinct(),
      takeUntil(this.unsubscribe$)
    ).subscribe(res => {
      if (res.RETURNCODE === ApiResponseCodeEnum.Ok) {
        this.corporateLines = res.TITRE.map(
          corporateLine => {
            return {
             placelabel: corporateLine.PLACELABEL,
            }
          }
        );
      }
    });
  }


text:
Q: How to vertically aling div in table cell Does someone knows how can I vertically align a div inside a td ? I tried to use vertical-align:middle, but without any results.
There are already some other questions with the same problem, but they don't provide a solution for my case.
In my below example I need to vertically align the div with class thread inside the td. This need to be done without using magic numbers (fixed height or line-height values) and I couldn't find a solution for doing this...
JSFIDDLE
HTML:

          1

          thhhhhhhhhhhhhhrrrrrrrrrrrrrrrrrrr

CSS:
.positive_votes, .negative_votes {
  width: 15px;
  height: 15px;
  background-color:blue;
}
.rating {
  margin-right: 5px;
  float: left;
}
.thread {
  display:inline-block;
}

A: position: relative;
transform: translateY(-50%);
top: 50%;

A: Add display:inline-block; and vertical-align:middle; to both divs and remove float: left; from .rating:
.rating {
  margin-right: 5px;
  display:inline-block;
  vertical-align:middle;
}
.thread {
  display:inline-block;
  vertical-align:middle;
}

https://jsfiddle.net/zg9qtunk/3/


text:
Q: @Controller class instantiated twice with Spring AOP I am trying to use Spring AOP for profiling my Controllers, but as soon as I enable monitoringAdvisor in my servlet context xml my @Controller class constructor gets called twice with below mentioned stacks.
I assume it has something to do with CGLIB proxy which derives from by @Controller annotated class (PersonController in this case)
But if that's the case then isn't this against the Singleton concept of Spring (suppose I try to acquire a system wide resource in the singleton).
Please let me know how can I avoid this problem when using CGLIB proxying.
I am not using any ContextLoaderListener in web.xml,
my-servlet.xml
<bean id="monitoringInterceptor" class="org.javasimon.spring.MonitoringInterceptor" />
<bean id="monitoringAdvisor" class="org.springframework.aop.support.DefaultPointcutAdvisor">
    <property name="advice" ref="monitoringInterceptor" />
    <property name="pointcut">
        <bean class="org.javasimon.spring.MonitoredMeasuringPointcut" />
    </property>
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
</bean>
<context:component-scan base-package="org.mypackage" />

Java code
@Controller
public class PersonController {
PersonController()
    {

    }

    @Monitored // works well even when I remove this annotation
    @RequestMapping(value="/addPerson", method=RequestMethod.POST)
    public String addPerson(HttpServletRequest request) {
    }
}

Call stack when the org.mypackage.PersonController (class annotated with @Controller) constructor hit first
PersonController.<init>() line: 48
NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not available [native method]
NativeConstructorAccessorImpl.newInstance(Object[]) line: 57
DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 45
Constructor<T>.newInstance(Object...) line: 526
BeanUtils.instantiateClass(Constructor<T>, Object...) line: 148
CglibSubclassingInstantiationStrategy(SimpleInstantiationStrategy).instantiate(RootBeanDefinition, String, BeanFactory) line: 87
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).instantiateBean(String, RootBeanDefinition) line: 1000

Call stack when the breakpoint hits second time
PersonController$$EnhancerByCGLIB$$4ad0c197(PersonController).<init>() line: 48
PersonController$$EnhancerByCGLIB$$4ad0c197.<init>() line: not available
NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not available [native method]
NativeConstructorAccessorImpl.newInstance(Object[]) line: 57
DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 45
Constructor<T>.newInstance(Object...) line: 526
ReflectUtils.newInstance(Constructor, Object[]) line: 228
ReflectUtils.newInstance(Class, Class[], Object[]) line: 220
ReflectUtils.newInstance(Class) line: 216
Enhancer.createUsingReflection(Class) line: 643
Enhancer.firstInstance(Class) line: 538
Enhancer(AbstractClassGenerator).create(Object) line: 225
Enhancer.createHelper() line: 377
Enhancer.create() line: 285
CglibAopProxy.getProxy(ClassLoader) line: 205

A: Found the answer at http://nurkiewicz.blogspot.in/2011/10/spring-pitfalls-proxying.html
following paragraph
"Instead of subclassing and instantiating subclassed bean Spring first creates the original bean and then creates a subclass which wraps the original one (somewhat Decorator pattern) in one of the post processors"
Thats why the constructor is getting called twice, But there is actually one bean only. I tried @PostConstruct and that got called just once, which clarified my all doubts. So essentially there is only one bean. the other one is just a proxy.


text:
Q: Enabling connection pooling in apache camel Kafka component I have an apache camel route which is calling apache kafka topic (producer) just like below in my spring boot application (deployed on Tomcat server):
from("timer://foo?period=1000").to("kafka:myTopic?brokers=localhost:9092");
This spring boot app is a rest API that is supposed to get around 300 TPS.
Q1) I know that a single tomcat server thread serves each request coming to my spring boot app. Does the same thread will be used in the above line of code used by apache camel for invoking the myTopic? Or apache camel uses some connection pooling internally just like RestTemplate?
Q2) Because the TPS will be increasing to 500 TPS in near future, does it make any sense to introduce pooling for the above line of code? I believe if I use connection pooling, my application performance will increase. However, I am not able to find the code which I can use to enable connection pooling for the above line of code.
If anyone has any idea please let me know. Please note that I am not looking for parallel processing so seda or multicast in camel is not an option. I am only having a single call to kafka topic as shown above in the code so just looking for how to enable connection pooling in this line of code.
Thanks.


text:
Q: Как вывести текст до определенной строки? Хочу вывести все что идет до определенной строки.
Делаю так:
$content = stristr($text, '
Определенная строка 1', true);
$content = stristr($content, '
Определенная строка 2', true);

И есть в текст нет одной из строк - вообще ничего не выводит.
Как лучше это сделать?
Буду благодарен за помочь!

A: Если я правильно понял - то у вас ситуация:

*

*есть некоторый текст

*есть набор строк в тексте (или даже отсутствующие в тексте)

*надо выделить текст от начала до первой встреченной строки и если есть строки, которые отсутствуют в тексте - ничего не выделять

Если это так, то алгоритм должен быть такой (напишу псевдокодом):
// найти минимальную позицию строк в тексте
min_pos = len(text)

for (str_index = 0; str_index < str_amount; str_index++)
{
    local_pos = find_in_str(text, strings[str_index]);

    if (local_pos < min_pos)
        min_pos = local_pos;
}

// выделить текст до найденной позиции
if (min_pos > -1)
    content = text.substr(0, min_pos)
else
    content = "нифига"

на php (по памяти пишу, так что где-то мог и ошибиться)
// найти минимальную позицию строк в тексте
$min_pos = strlen($text);

foreach ($strings as &$str) {

    $local_pos = strpos($text, $str);

    if ($local_pos < $min_pos)
        $min_pos = $local_pos;
}

// выделить текст до найденной позиции
if (min_pos > 0)
    $content = substr($text, 0, $min_pos - 1);
else
    $content = "нифига";


text:
Q: 20.04.1, Application Folder Window Size In Ubuntu 20.04.1, GNOME, I have moved applications in the "show applications" window into my own categories.
I notice that in the application "folders", it only shows 4 across and 3 down. So, if you have more than 12 applications in a application folder, you have to scroll down.
Is there any way to either adjust the size of that sub folder window, or, a way to change the size of the huge icons in those sub folders windows so more would fit. I can't find a tuning value anywhere yet.

A: An easy way/manipulation would be to install the extension more-columns-in-applications-view and edit the extension.js file to replace the function setNbColumns(setting) content with below content.
//------------------------------------------------------------------------------

function setNbColumns(setting) {

    if (!injections['_init']) {
        injections['_init'] = injectToFunction(AppDisplay.BaseAppView.prototype, '_init', function(){
            this._grid._minColumns = setting;
        });
    }

    let appdisplayView = Main.overview.viewSelector.appDisplay._views;
    for (let i = 0; i < appdisplayView.length; i++) {
        appdisplayView[i].view._grid._minColumns = setting;
    }

    let folderIconsList = Main.overview.viewSelector.appDisplay._views[1].view.folderIcons;
    if (folderIconsList) {
        // Old GS versions only
        folderIconsList.forEach(function(i){
            i.view._grid._minColumns = setting;
        });
    }

}

//------------------------------------------------------------------------------

Please note that if you have ideas to use this extension for its original purpose, you may not achieve what you are looking for. This is just a workaround targeted for the Question only.


text:
Q: Time Capsule showing monitor icon in Finder sidebar Normally my Time Capsule is seen in the Finder sidebar under "Shared" with an icon of a disk drive by the name of the Time Capsule. Now it keeps showing a monitor icon by the name of the Time Capsule, and when I click on it, it will change back to the disk drive icon.
I don't see any problems when I open Airport Utility and check the Time Capsule setup.  Anyone know why this is happening?
I'm using Mavericks, and a 3rd-gen Time Capsule

A: Also I have this problem in OS 10.10 Yosemite and it's continues to give me the inconvenience, so I googled till I find the answer. Finally, I'm trying to do this: make sure that the TC is not mounted (or dismount it). Then
in finder menu use Go -> Connect to Server. Type AFP://TCnetworkname or IPaddress (replace with the real IP or real network name). When the computer finds the TC, you need to give a password (public for default) type in your password if you changed it or public if not, then save it in your keychain. That's it.

A: That's one of the bugs which Mavericks 10.9.4 has. So you can't do anything beside waiting and hoping, that apple will fix this issue in a future update. (by c0dev)


text:
Q: how to highlight a date & add message to that date when i drag the mouse on it in asp.net I have the java script code.But i want to add some thing more.
I would like to highlight a date & add message to that date when I drag the mouse on it.
the code is

  <title>DatePicker</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

  <link rel="stylesheet" href="/resources/demos/style.css" />

   <form id="form1" runat="server">

    <asp:TextBox ID="datepicker" runat="server"></asp:TextBox>

  </form>

I want it should display a message on the date. Ex:- We declared that 15th july is a holiday.When I hover the mouse on the 15th in the calender,a small message will display(ex:-today is holiday)when I remove the mouse the message will dis appear.

A: You should handle the hover event of the element you want to drag your cursor on. In the handler you can change the style of other elements, as you need.


text:
Q: Need help on program that uses facebook/instagram info A client wants to have information about public instagram/facebook profiles (photos/videos published, total likes/comments) from a period of time. How do I go about doing this?
I found out that some of that information is available in the website source code, but how do I use that information? Also is there any sites/services that does that already? The only ones I found only go as back as a few weeks, or only procress future posts.
I thought about automatizing the process with python, is it a good idea?
I'm new in programming, so any help is aprecciated.

A: As far as I know Instagram is trying to limit as much as possible bot activities, I'm not sure about Facebook though.
You can definitely try to webscrape (using python or other tools) the information you need but if things don't work, it may not be your fault.


text:
Q: Can AJAX update a button argument? Using AJAX, I'm able to extract a data value from a button click, but is it possible to ensure this value is passed on to an argument within another button on the same page?
test.html:
Activate
Fader

test.js:
function image_check() {
        var request = $.ajax({
                    url: "current_image.php",
                    type: "GET",
                    dataType: "html",
                    success: function(data) {
                    alert(data);
                    }
         });
}

The php file connects to the database and extracts the most recent image number - it works fine and the alert box displays the correct value. So what would be the next step to ensure the "image_number" argument is updated with this 'data' value?
Cheers.

A: make a global variable like
windows.image_number = 0;

for AJAX function.
function image_check() {
    var request = $.ajax({
        url: "current_image.php",
        type: "GET",
        dataType: "html",
        success: function(data) {
            //update the global variable
            windows.image_number = data;
        }
     });
}

A: Assuming that the image_number variable that you are passing to the function is a globally defined variable, you simply need to set the variable in your success callback:
function image_check() {
    var request = $.ajax({
                url: "current_image.php",
                type: "GET",
                dataType: "html",
                success: function(data) {
                    alert(data);

                    // Assuming data holds the image number you want to use for next click
                    image_number = data;
                }
     });
}


text:
Q: pyspark dataframes join by iterable column I would like to join two pyspark dataframes based on multiple columns.
tab1:
id      name(string , size=3)  val. (Long int)
6725    fnc                    5219
8576    fnc                    829
9192    sct                    72912
782     sct                   1022

tab2:
name (string, size=6).    Val. (Array of long int)
fnceda                    [11, 25, 5219]
fncytfd                   [71, 829, 320]
sctvbd                    [357, 72912, 508]
sctgsd                    [796, 52, 67]

I need to get a new table such that
  the "name" in "tab1"  match the first 3 letter in "name" of "tab2"
  and also the "val" in "tab1" appear in the "val" of "tab2".
  All other rows that do not satisfy the condition need to be removed.

id      name(string , size=3)  val. (Long int)
6725    fnc                    5219
8576    fnc                    829
9192    sct                    72912

My code:
 tab1.join(tab2,
                 tab1[''name"]==F.substring(tab2["name"], 1, 3),
                 & F.array_contains(tab2["val"], tab1["val"]),
                "inner"
              )

Got error:
     Column is not iterable

It seems that an array column cannot be used as a join condition?
Thanks

A: This can be accomplished in 3 steps.
Step 1: Create a new column in tab2 with by obtaining substring
from pyspark.sql.functions import substring, explode
tab2_df = tab2_df.withColumn('new_name', substring('name', 0, 3))

Step 2: Explode tab2.val so you have long values instead of array of long.
tab2_df = tab2_df.withColumn('value', explode('Val))

Step 3: Perform a join between tab1 and tab2 by comparing name w/ new_name, and val w/ value
tab3_df = tab1_df.join(tab2_df, [(tab1_df.name == tab2_df.new_name) & (tab1_df.val == tab2_df.value)], how="inner")
display(tab3_df)

A: You need to wrap your first condition in parentheses, then you'll be fine
df.join(df2, (df['name']==F.substring(df2['name'], 1, 3)) & F.array_contains(df2['val'], df['val']), 'inner').show()

+----+----+-----+-------+-----------------+
|  id|name|  val|   name|              val|
+----+----+-----+-------+-----------------+
|6725| fnc| 5219| fnceda|   [11, 25, 5219]|
|8576| fnc|  829|fncytfd|   [71, 829, 320]|
|9192| sct|72912| sctvbd|[357, 72912, 508]|
+----+----+-----+-------+-----------------+


text:
Q: Android listview produces black highlighting over text when scrolling. How to stop this? Duplicate:

Background ListView becomes black when scrolling
I have a listview within which each item contains black text on a white background. When testing on a Nexus One, when scrolling down to read through the text, a black highlight appears over the text and makes it unreadable.
I am trying to figure out what is this setting so I can turn it off. I do not want anything to get highlighted when scrolling down through the list. How can I accomplish this?
Thanks.

A: This may be a trick:
android:cacheColorHint="@android:color/transparent"

A: You probably want to set the cacheColorHint to the same color as your background.
So, when you're defining your layout, just add android:cacheColorHint='#fff' to your ListView:
<ListView android:id="@+id/list"
    android:cacheColorHint="#fff"
    android:background="#fff"
    ...etc />

A: Another solution would be to set the backgroundcolor of your list to transparent.

A: I had the same issue and setting the android:cacheColorHint to transparent seems to do the trick


text:
Q: Confusion between selection and arrangement in probability Hi I am a beginner in probability, I have been following Harvard course Stat 110 class taught by Joseph Blitzstein on Youtube.
I am having confusion with following problem.
Scenario 1
Consider there are k distinguishable items and n distinguishable boxes, What are the ways in which you can put these k items in n boxes
Answer: It's pretty straight forward = n^k
Question
1) In the answer stated above are we not considering the way items are arranged in each box?
2) What would be the answer if the order in the boxes is considered?
Scenario 2:
Same problem if we are to encode it in a slightly different way, k items represented as k distinguishable dots and n boxes represented as | indistinguishable separators (for n boxes we would be having n-1 separators), like this
...|..||. - 4 boxes and 6 items
Considering the order among the k items is not important, what are the ways in which we can have this encoded information represented ?
Answer:
There are k+n-1 total objects, the way in which you can arrange them is (k+n-1)!/((n-1)! * k!) (considering order of k items do not matter)
Question
3) Same problem is in scenario 1 is being represented a bit differently in scenario 2, How are the solutions different ? Though we are arranging in 2nd scenario we are not considering order of k items?
Please help correct my understanding


text:
Q: Include Database with the Application I am trying to make an engineering program using C# language, the program requires input from the user to substitute it in the equations but the equations needs lots of constants and coefficients, for example, a frictional coefficient that varies with temperature, so I have tabulated this data in an SQL database table.
So my question: is it possible to make this table included within the application so that the program can be easily published and used so that users do not need to install SQL or any database program.
If using a database is not the right call to create such application how to do this ?

A: You can use SQL Server Compact for file based databases up to 4GB.

A: I believe what you're looking for is Visual Studio's SQL Server Project:
http://msdn.microsoft.com/en-us/library/84b1se47%28v=vs.90%29.aspx
To use it for your scenario, you would script out the database WITH data:
Generate script in SQL Server Management Studio
It probably won't load in < 5 seconds, but you can also set the db project to just be there & not load every time the project is loaded, then a dev can just re-enable the db project, publish it & disable it again.