问:
Having issue with container class in bootstrap?
Here is the link https://vkacademy.in/newm.html

When I create a container for every section I am getting space in between for every container, how to avoid the space for each container.

When you see the output I am getting space for each container that I highlighted. how to avoid the space?

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">

Bootstrap Tutorial

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.

Bootstrap Tutorial

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.

```

答:
The space you see is indeed on the paragraphs, but removing that isn't the right approach. Instead, use the overflow-hidden class to make the containers surround that space.

Note that I've removed the outer container wrapper. That's not necessary and not in line with Bootstrap's documentation for layout. Containers shouldn't be directly nested, and rarely should be nested in any fashion.

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">

Bootstrap Tutorial

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.

Bootstrap Tutorial

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.

```
</div>
</div>
</p>
<p>A better solution is to use Bootstrap's layout structure as intended, with row and column elements. This handles overflow automatically, without extra classes. Notice how only one container is needed.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">

<div class="container">
  <div class="row bg-danger">
    <div class="col">
      <h1>Bootstrap Tutorial</h1>
      <p>Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.</p>
    </div>
  </div>

  <div class="row bg-success">
    <div class="col">
      <h1>Bootstrap Tutorial</h1>
      <p>Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.</p>
    </div>
  </div>
</div></code>```

Body:
The space you see is indeed on the paragraphs, but removing that isn't the right approach. Instead, use the overflow-hidden class to make the containers surround that space.

Note that I've removed the outer container wrapper. That's not necessary and not in line with Bootstrap's documentation for layout. Containers shouldn't be directly nested, and rarely should be nested in any fashion.

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">

<div class="container bg-danger overflow-hidden">
  <h1>Bootstrap Tutorial</h1>
  <p>Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.</p>
</div>

<div class="container bg-success overflow-hidden">
  <h1>Bootstrap Tutorial</h1>
  <p>Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.</p>
</div>

A better solution is to use Bootstrap's layout structure as intended, with row and column elements. This handles overflow automatically, without extra classes. Notice how only one container is needed.

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">

<div class="container">
  <div class="row bg-danger">
    <div class="col">
      <h1>Bootstrap Tutorial</h1>
      <p>Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.</p>
    </div>
  </div>

  <div class="row bg-success">
    <div class="col">
      <h1>Bootstrap Tutorial</h1>
      <p>Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web.</p>
    </div>
  </div>
</div>


来源: stackexchange

问:
View is not rerendering, not sure why
I have a ScoreView that keeps track of the current score, but I am having trouble getting it to re-render when a model attribute changes.
Here is what the view looks like:

```<code>  var ScoreView = Backbone.View.extend({

    initialize: function() {
      _.bindAll(this, 'render');

      this.model.bind("change", function() {
        if (this.hasChanged("score")) {
          alert("score has changed");
          this.render;
        }
      });
    },

    render: function() {
      alert("drawing new score");
      return this.model.get("score");
    },

  });
</code>```

When the score changes, the view does not re-render. I do get the alert, "score has changed", when the score changes. When I print out the contents of "this.render", the console says that the function is undefined. I think that the code thinks that the "this" in this context is the model, but I want the context to be the view. How would I fix this?

答:
```<code>this.model.bind("change", function(model) {
    if (model.hasChanged("score")) {
      alert("score has changed");
      this.render();
    }
}, this);
</code>```

ContentLicense: CC BY-SA 3.0

Title: View is not rerendering, not sure why

Body:
I have a ScoreView that keeps track of the current score, but I am having trouble getting it to re-render when a model attribute changes.
Here is what the view looks like:

  var ScoreView = Backbone.View.extend({

    initialize: function() {
      _.bindAll(this, 'render');

      this.model.bind("change", function() {
        if (this.hasChanged("score")) {
          alert("score has changed");
          this.render;
        }
      });
    },

    render: function() {
      alert("drawing new score");
      return this.model.get("score");
    },

  });

When the score changes, the view does not re-render. I do get the alert, "score has changed", when the score changes. When I print out the contents of "this.render", the console says that the function is undefined. I think that the code thinks that the "this" in this context is the model, but I want the context to be the view. How would I fix this?


问:
Flutter can't recognize android sdk
I'm running Ubuntu 20 and trying to setup flutter enironment without android studio. Installed android sdk manually && it's path is $HOME/android.

here's a log of the directory

$ ls
# cmdline-tools  licenses
$ ls cmdline-tools/
# latest  tools
ls cmdline-tools/latest
bin  lib  NOTICE.txt  package.xml  source.properties
```
<p>And here's sys vars which are in <code>~/.bashrc</code></p>
<pre class="lang-sh prettyprint-override"><code>export ANDROID_SDK_ROOT="$HOME/android"
export ANDROID_HOME="$ANDROID_SDK_ROOT"
export PATH="$PATH:$ANDROID_SDK_ROOT"
export PATH="$PATH:$ANDROID_SDK_ROOT/cmdline-tools/tools"
export PATH="$PATH:$ANDROID_SDK_ROOT/cmdline-tools/tools/bin"
export PATH="$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin"
export PATH="$PATH:$ANDROID_SDK_ROOT/cmdline-tools/tools/platform-tools"
export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools"
export PATH="$PATH:$ANDROID_SDK_ROOT/build-tools"
</code>```

And here's flutter doctor - v log

[!] Android toolchain - develop for Android devices
    • Android SDK at /home/aybak3k/android/
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

    • ANDROID_HOME = /home/aybak3k/android/
    • ANDROID_SDK_ROOT = /home/aybak3k/android
    ✗ Android SDK file not found: adb.
    • Try re-installing or updating your Android SDK,
      visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions.
```

答:
Probably because is missing /sdk

Try to change export ANDROID_SDK_ROOT="$HOME/android"

to export ANDROID_SDK_ROOT="$HOME/android/sdk"

if not work, try to check the full path to platform-tools

run which adb

$HOME/android/sdk/platform-tools/adb

ContentLicense: CC BY-SA 4.0

Title: Flutter can't recognize android sdk

Body:
I'm running Ubuntu 20 and trying to setup flutter enironment without android studio. Installed android sdk manually && it's path is $HOME/android.

here's a log of the directory

$ ls
# cmdline-tools  licenses
$ ls cmdline-tools/
# latest  tools
ls cmdline-tools/latest
bin  lib  NOTICE.txt  package.xml  source.properties

And here's sys vars which are in ~/.bashrc

export ANDROID_SDK_ROOT="$HOME/android"
export ANDROID_HOME="$ANDROID_SDK_ROOT"
export PATH="$PATH:$ANDROID_SDK_ROOT"
export PATH="$PATH:$ANDROID_SDK_ROOT/cmdline-tools/tools"
export PATH="$PATH:$ANDROID_SDK_ROOT/cmdline-tools/tools/bin"
export PATH="$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin"
export PATH="$PATH:$ANDROID_SDK_ROOT/cmdline-tools/tools/platform-tools"
export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools"
export PATH="$PATH:$ANDROID_SDK_ROOT/build-tools"

And here's flutter doctor - v log

[!] Android toolchain - develop for Android devices
    • Android SDK at /home/aybak3k/android/
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

    • ANDROID_HOME = /home/aybak3k/android/
    • ANDROID_SDK_ROOT = /home/aybak3k/android
    ✗ Android SDK file not found: adb.
    • Try re-installing or updating your Android SDK,
      visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions.


问:
Internet Explorer Rendering issue
hi i have issue with internet exploerer rendering , i have a aspx page in which i have a table and i set its backgrounnd image of size 800 x 700 px, and my table size is 800 x 550. but in internet explorer 2 table are rendering as shown in image

html for this page :

<

```<code>%@ Page Language="C#" MasterPageFile="~/mftpmasterpage.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="FtpWebInterface.Home" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server" >

    <div   >
    <table align="center" border="0" style=" width:800px;height:520px;background-image:url(Images/formbg.jpg); border: 5px outset  #2B60DE;border-radius: 5px;box-shadow: 0px 0px 20px #000;    -webkit-border-radius: 5px;-moz-border-radius: 5px; ">
<tr>
<td align="left" colspan="3" >
 </td>

</tr>
<tr>
<td align="right" colspan="3"  height="10%" valign="top" align="left">
    <asp:LinkButton ID="lnksignout" runat="server" CausesValidation="False"
        onclick="lnksignout_Click" Font-Size="11px">Sign out</asp:LinkButton>
 </td>
</tr>
<tr>
<td colspan="2"  height="10%" valign="bottom" align="left">
    <asp:UpdatePanel ID="uplblCurdir" runat="server">
     <Triggers>
              <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" />
          </Triggers>
          <ContentTemplate>

          </ContentTemplate>
    </asp:UpdatePanel>
</td>

<td valign="bottom" align="left" >
    <asp:UpdatePanel ID="upUploadbtn" runat="server">
     <Triggers>
            <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" />
         </Triggers>
         <ContentTemplate>

         </ContentTemplate>
    </asp:UpdatePanel>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>

<tr>
<td height="80%" width="15%" border="1"  valign="top" align="left">
       <div style="height: 300px;width: 180px;overflow:auto; background-color:#e4f1fb; border: 1px solid  #2B60DE;border-radius: 3px;box-shadow: 0px 0px 10px #000; -webkit-border-radius: 3px;-moz-border-radius: 3px; ">

                 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
             <Triggers>
                 <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" />
              </Triggers>
                 <ContentTemplate>

                  </ContentTemplate>
             </asp:UpdatePanel>

        </div>

</td >
<td width="70%" valign="top" align="left">
  <asp:UpdatePanel ID="Updatepanel2" runat="server" UpdateMode="Always">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" />
                        </Triggers>
                        <ContentTemplate>

                   </ContentTemplate>
                   </asp:UpdatePanel>

                   </td >

                   </tr>

                 <tr>
                   <td style="display:none;" colspan="3" >
                   <input id="hdnuser" type="hidden" runat="server"/><asp:Button ID="refreshbtn" runat="server"  onclick="refreshbtn_Click" CausesValidation="False" /></td>
                  </tr>

                 </table>
                     </ContentTemplate>
                     </asp:UpdatePanel>

           </td>
</td>
<td width="15%"  valign="top" align="left">
       <table align="left" valign="top" width="100%">
          <tr>
            <td>
                <asp:Button ID="btncreatefolder" runat="server" Text="Create Folder"
                    onclick="btncreatefolder_Click" CausesValidation="False" class="submit"
                    onclientclick="popup('CreateFolder.aspx','CreateFolder')" /></td>
          </tr>
          <tr>
           <td><asp:Button ID="btnuploadfolder" runat="server" Text="Upload Folder"
                   onclick="btnuploadfolder_Click" CausesValidation="False"
                   class="submit" Enabled="False" /></td>
          </tr>

         </tr>
         <tr>
            <td><asp:Button ID="btndeltefolder" runat="server" Text="Delete Folder" OnClientClick="popup('DeleteFolder.aspx','DeleteFolder')"
                    class="submit" onclick="btndeltefolder_Click" CausesValidation="False" /></td>
          </tr>
      </table>
</div>
--------------------------------------Body End-----------------------------------------------
-----------------------------The Divs below this are hidden, there display property s bydefault hidden and they are used in modal poup--------------------------

    <!-----Upload Div------------------------>
   <div id="div_to_popup" class="popup_block" align="center">
         <img id="btn_close" alt="" src="images/Close.png" align="right" onclick="HideModalPopup('div_to_popup'); return false;" class="btn_close"/><table width="100%" style="background-image:url(Images/loginbg.jpg);">
       <tr>
       <td align="center" style="">
           <asp:UpdatePanel ID="UpdatePanel6" runat="server">
           <Triggers >
           <asp:AsyncPostBackTrigger ControlID="btnupload" EventName="Click"/>
           </Triggers>
           <ContentTemplate>
           <asp:Label ID="lblDirectory" runat="server" CssClass="label" ></asp:Label>
           </ContentTemplate>
            </asp:UpdatePanel>
       </td>
       </tr>
       <tr>
       <td></td>
       </tr>
           <tr>
           <td align="center" style="">
              <asp:Label ID="Label3" runat="server" Text="Select file to upload." CssClass="label"></asp:Label><br />
           </td>
           </tr>
           <tr>
           <td colspan="2"></td>
           </tr>
            <tr>
           <td align="center">
            <center>
             <asp:Panel ID="Panel3" runat="server" Height="58px" Width="282px">
             <br />
            <center>
              <asp:FileUpload ID="file" runat="server" /><br />
                <asp:Label ID="lblfilereq" runat="server" CssClass="label"></asp:Label>
              <input id="hdnfilename" type="hidden" runat="server"/></center>
            </asp:Panel>
           </center>
           </td>
           </tr>
        <tr>
        <td></td>
        </tr>

           <tr>
           <td  align="center" >
               <asp:Button ID="btnuploadok" runat="server" Text="Upload" CausesValidation="false"
                   onclick="btnuploadok_Click"
                   class="submit" />

               <asp:Button ID="btnuploadCancel" runat="server" Text="Cancel" CausesValidation="false"
                    class="submit"  OnClientClick="HideModalPopup('div_to_popup');"/>
           </td>
           </tr>

           <tr>
           <td>
               <asp:Panel ID="pnlstatus" runat="server"  Height="31px" Visible="false">
               <center><asp:Label ID="lblstatus" runat="server" ForeColor="Black" Text="" Font-Size="14px" Font-Bold="true"></asp:Label></center>
               </asp:Panel>
           </td>
           </tr>
           </table>

     </div>
<!------End upload Div------------------->

<!---------Loading Div -------------->
<div id="div_to_folder" class="popup_block">
       <img id="Img1" alt="" src="images/Close.png" align="right" onclick="HideModalPopup('div_to_folder');return false;" class="btn_close"/><asp:Panel ID="Panel4" runat="server" BackImageUrl="~/Images/loginbg.jpg">
         <asp:Label ID="lblloading" runat="server" Text="Preparing Download...."  CssClass="label"></asp:Label>
         <center><img alt="" src="Images/ajax-loader.gif" style="width: 215px" /></center>
        </asp:Panel>

</div>
<!--------End Loading Div------------>

<!------ Send File Div ---------------->
  <div id="div_send_file" class="popup_block" >
            <img id="Img2" alt="" src="images/Close.png"  align="right" onclick="HideModalPopup('div_send_file'); return false;" class="btn_close"/></asp:Timer><asp:UpdatePanel ID="UpdateDivSendFile" runat="server"><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /></Triggers><ContentTemplate>
           <asp:Panel ID="pnlSendmail" runat="server" Height="408px" Width="576px"  ScrollBars="Auto" BackColor="White">
              <center>
                  <asp:Label ID="Label1" runat="server" Text="Send File" CssClass="heading"></asp:Label></center>
           <table align="center">

        <tr>
          <td  align="left">
            <asp:Label ID="lblto" runat="server" Text="To :" CssClass="label"></asp:Label>
          </td>
          <td>
          <table>
          <tr>
          <td><asp:TextBox ID="txtto" runat="server" Width="451px" Height="32px"
                  TextMode="MultiLine"></asp:TextBox>
          </td>
          <td>  <asp:RequiredFieldValidator ID="reqfilename" runat="server" BorderStyle="None"
            ControlToValidate="txtto" ErrorMessage="*"></asp:RequiredFieldValidator>  </td>
          </tr>

          </table>

          </td>
       </tr>
        <tr>
          <td  align="left">
           <asp:Label ID="lblsubject" runat="server" Text="Subject" CssClass="label"></asp:Label>
          </td>
          <td>
          <table>
          <tr>
          <td> <asp:TextBox ID="txtSubject" ForeColor="Black" runat="server" Height="32px" Width="451px"></asp:TextBox></td>
          <td></td>
          </tr>
          </table>

          </td>
       </tr>
       <tr>
          <td   align="left">
           <asp:Label ID="lblattachment" runat="server"  Text="Attached File" CssClass="label"></asp:Label>
          </td>
          <td  align="left">
           <asp:Image ID="imgattachment" runat="server" />
           <asp:Label ID="linkAttachedFile" runat="server" CssClass="label"></asp:Label>
          </td>

       </tr>
       </table>
       <table  align="center">
       <tr>

          <td  align="center">
            <asp:TextBox ID="txtmsg" runat="server" Height="118px" Width="560px"></asp:TextBox>
          </td>
       <tr>
        <td >
          <asp:Panel ID="pnalStatus" runat="server" Height="32px"
                Visible="false">
             <center><asp:Label ID="lblStausCode"  runat="server" CssClass="label"></asp:Label></center>
          </asp:Panel>
        </td>
       </tr>
       <tr>
          <td  align="center" >
            <asp:Button ID="btnSend" runat="server" Text="Send"
             class="submit" onclick="btnSend_Click"  />
            <asp:Button ID="btnSendFileCancel" runat="server" CausesValidation="False" Text="Cancel" OnClientClick="HideModalPopup('div_send_file'); return false;" class="submit"/>
          </td>

          </tr>
        </table>
        </asp:Panel>
      </ContentTemplate>
     </asp:UpdatePanel>
  </div>

</asp:Content>
</code>```

in firefox chorome and safari only above table is rendered butin IE two tables are rendering kindly any one help me what is the issue and how i fix this isue thanks.

答:
Have you checked the source? Is it actually another table?

My first thoughts were that it was the background repeating. You dont specify no-repeat in the style attribute:

Change:

To:

See what that gives you.

Title: Internet Explorer Rendering issue

Body:
hi i have issue with internet exploerer rendering , i have a aspx page in which i have a table and i set its backgrounnd image of size 800 x 700 px, and my table size is 800 x 550. but in internet explorer 2 table are rendering as shown in image

html for this page :

<

%@ Page Language="C#" MasterPageFile="~/mftpmasterpage.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="FtpWebInterface.Home" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server" >

    <asp:LinkButton ID="lnksignout" runat="server" CausesValidation="False"
        onclick="lnksignout_Click" Font-Size="11px">Sign out</asp:LinkButton>

    <asp:UpdatePanel ID="uplblCurdir" runat="server">
     <Triggers>
              <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" />
          </Triggers>
          <ContentTemplate>

          </ContentTemplate>
    </asp:UpdatePanel>

    <asp:UpdatePanel ID="upUploadbtn" runat="server">
     <Triggers>
            <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" />
         </Triggers>
         <ContentTemplate>

         </ContentTemplate>
    </asp:UpdatePanel>

                 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
             <Triggers>
                 <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" />
              </Triggers>
                 <ContentTemplate>

                  </ContentTemplate>
             </asp:UpdatePanel>

  <asp:UpdatePanel ID="Updatepanel2" runat="server" UpdateMode="Always">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" />
                        </Triggers>
                        <ContentTemplate>

                   </ContentTemplate>
                   </asp:UpdatePanel>

                   <input id="hdnuser" type="hidden" runat="server"/><asp:Button ID="refreshbtn" runat="server"  onclick="refreshbtn_Click" CausesValidation="False" />

                     </ContentTemplate>
                     </asp:UpdatePanel>

                <asp:Button ID="btncreatefolder" runat="server" Text="Create Folder"
                    onclick="btncreatefolder_Click" CausesValidation="False" class="submit"
                    onclientclick="popup('CreateFolder.aspx','CreateFolder')" />

           <asp:Button ID="btnuploadfolder" runat="server" Text="Upload Folder"
                   onclick="btnuploadfolder_Click" CausesValidation="False"
                   class="submit" Enabled="False" />

            <asp:Button ID="btndeltefolder" runat="server" Text="Delete Folder" OnClientClick="popup('DeleteFolder.aspx','DeleteFolder')"
                    class="submit" onclick="btndeltefolder_Click" CausesValidation="False" />

--------------------------------------Body End-----------------------------------------------
-----------------------------The Divs below this are hidden, there display property s bydefault hidden and they are used in modal poup--------------------------

           <asp:UpdatePanel ID="UpdatePanel6" runat="server">
           <Triggers >
           <asp:AsyncPostBackTrigger ControlID="btnupload" EventName="Click"/>
           </Triggers>
           <ContentTemplate>
           <asp:Label ID="lblDirectory" runat="server" CssClass="label" ></asp:Label>
           </ContentTemplate>
            </asp:UpdatePanel>

              <asp:Label ID="Label3" runat="server" Text="Select file to upload." CssClass="label"></asp:Label>

             <asp:Panel ID="Panel3" runat="server" Height="58px" Width="282px">

              <asp:FileUpload ID="file" runat="server" />

                <asp:Label ID="lblfilereq" runat="server" CssClass="label"></asp:Label>
              <input id="hdnfilename" type="hidden" runat="server"/>
            </asp:Panel>

               <asp:Button ID="btnuploadok" runat="server" Text="Upload" CausesValidation="false"
                   onclick="btnuploadok_Click"
                   class="submit" />

               <asp:Button ID="btnuploadCancel" runat="server" Text="Cancel" CausesValidation="false"
                    class="submit"  OnClientClick="HideModalPopup('div_to_popup');"/>

               <asp:Panel ID="pnlstatus" runat="server"  Height="31px" Visible="false">
               <asp:Label ID="lblstatus" runat="server" ForeColor="Black" Text="" Font-Size="14px" Font-Bold="true"></asp:Label>
               </asp:Panel>

       <asp:Panel ID="Panel4" runat="server" BackImageUrl="~/Images/loginbg.jpg">
         <asp:Label ID="lblloading" runat="server" Text="Preparing Download...."  CssClass="label"></asp:Label>

        </asp:Panel>

            </asp:Timer><asp:UpdatePanel ID="UpdateDivSendFile" runat="server"><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /></Triggers><ContentTemplate>
           <asp:Panel ID="pnlSendmail" runat="server" Height="408px" Width="576px"  ScrollBars="Auto" BackColor="White">

                  <asp:Label ID="Label1" runat="server" Text="Send File" CssClass="heading"></asp:Label>

            <asp:Label ID="lblto" runat="server" Text="To :" CssClass="label"></asp:Label>

          <asp:TextBox ID="txtto" runat="server" Width="451px" Height="32px"
                  TextMode="MultiLine"></asp:TextBox>

            <asp:RequiredFieldValidator ID="reqfilename" runat="server" BorderStyle="None"
            ControlToValidate="txtto" ErrorMessage="*"></asp:RequiredFieldValidator>

           <asp:Label ID="lblsubject" runat="server" Text="Subject" CssClass="label"></asp:Label>

           <asp:TextBox ID="txtSubject" ForeColor="Black" runat="server" Height="32px" Width="451px"></asp:TextBox>

           <asp:Label ID="lblattachment" runat="server"  Text="Attached File" CssClass="label"></asp:Label>

           <asp:Image ID="imgattachment" runat="server" />
           <asp:Label ID="linkAttachedFile" runat="server" CssClass="label"></asp:Label>

            <asp:TextBox ID="txtmsg" runat="server" Height="118px" Width="560px"></asp:TextBox>

          <asp:Panel ID="pnalStatus" runat="server" Height="32px"
                Visible="false">
             <asp:Label ID="lblStausCode"  runat="server" CssClass="label"></asp:Label>
          </asp:Panel>

            <asp:Button ID="btnSend" runat="server" Text="Send"
             class="submit" onclick="btnSend_Click"  />
            <asp:Button ID="btnSendFileCancel" runat="server" CausesValidation="False" Text="Cancel" OnClientClick="HideModalPopup('div_send_file'); return false;" class="submit"/>

        </asp:Panel>
      </ContentTemplate>
     </asp:UpdatePanel>

</asp:Content>

in firefox chorome and safari only above table is rendered butin IE two tables are rendering kindly any one help me what is the issue and how i fix this isue thanks.

Body:
Have you checked the source? Is it actually another table?

My first thoughts were that it was the background repeating. You dont specify no-repeat in the style attribute:

Change:
<table align="center" border="0" style=" width:800px;height:520px;background-image:url(Images/formbg.jpg); ... >

To:
<table align="center" border="0" style=" width:800px;height:520px;background:transparent url(Images/formbg.jpg) top left no-repeat; ... >

See what that gives you.


问:
Android App not connecting to internet on emulator
The app does not connect to the internet. I have

```<code><uses-permission android:name="android.permission.INTERNET" />
</code>```

in my manifest and I checked the other applications on the emulator for example youtube and google search works but the application isn't able to load the page. This is my main java file.

```<code>import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        WebView myWebview ;
        myWebview  = (WebView) this.findViewById(R.id.webz);

        myWebview.loadUrl("https://en.wikipedia.org/");

    }

}
</code>```

and this is my main activity

```<code><?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.hoda.myapplication.MainActivity">

    <WebView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/webz"></WebView>
</android.support.constraint.ConstraintLayout>
</code>```

this is the error i get

```<code>[ERROR:gl_surface_egl.cc(289)] eglChooseConfig failed with error EGL_SUCCESS
</code>```

答:
Add activity in your AndroidManifest.xml

android:name="com.(your browser activity)"
android:screenOrientation="portrait">

Body:
The app does not connect to the internet. I have

<uses-permission android:name="android.permission.INTERNET" />

in my manifest and I checked the other applications on the emulator for example youtube and google search works but the application isn't able to load the page. This is my main java file.

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        WebView myWebview ;
        myWebview  = (WebView) this.findViewById(R.id.webz);

        myWebview.loadUrl("https://en.wikipedia.org/");

    }

}

and this is my main activity

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.hoda.myapplication.MainActivity">

    <WebView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/webz"></WebView>
</android.support.constraint.ConstraintLayout>

this is the error i get

[ERROR:gl_surface_egl.cc(289)] eglChooseConfig failed with error EGL_SUCCESS


问:
Writing a 'for' loop to create a new column and multiply values based on a specified formula in R
I am new to 'for' loops in R, and I'm trying to create a new column in the dataframe and pass a formula through it, with the output being a calculated value in each cell. Here is the data I am working with:

```<code>data <- data.frame(plot1=c(133,
                           134,
                           115,
                           135,
                           119,
                           41,
                           96,
                           147,
                           64,
                           18,
                           123,
                           198,
                           40,
                           142,
                           131,
                           175,
                           52,
                           7,
                           100,
                           30,
                           197,
                           200,
                           45,
                           149,
                           170,
                           87,
                           191,
                           90,
                           50,
                           168,
                           153,
                           70,
                           98,
                           76,
                           12,
                           83,
                           101,
                           26,
                           62,
                           96,
                           52,
                           97,
                           90,
                           65,
                           9,
                           146,
                           182,
                           174,
                           15,
                           78,
                           165,
                           29,
                           186,
                           132,
                           167,
                           6,
                           43,
                           135,
                           148,
                           49,
                           64,
                           102,
                           195,
                           103,
                           105,
                           75,
                           189,
                           28,
                           117,
                           112,
                           187,
                           13,
                           109,
                           123,
                           61,
                           13,
                           160,
                           172,
                           125,
                           34,
                           75,
                           89,
                           19,
                           121,
                           136,
                           3,
                           32,
                           161,
                           111,
                           158,
                           135,
                           78,
                           133,
                           7,
                           182,
                           159,
                           99,
                           155,
                           80,
                           186,
                           120,
                           74,
                           119,
                           105,
                           157,
                           187,
                           46,
                           92,
                           25,
                           48,
                           129,
                           156,
                           180,
                           106,
                           115,
                           188,
                           120,
                           133,
                           61,
                           152,
                           152,
                           31,
                           84,
                           8,
                           20,
                           40,
                           59,
                           136,
                           84,
                           111,
                           167,
                           53,
                           40,
                           121,
                           29,
                           127,
                           135,
                           177,
                           54,
                           103,
                           41,
                           15,
                           21,
                           108,
                           105,
                           139,
                           73,
                           126,
                           59,
                           165,
                           91,
                           56,
                           53,
                           126,
                           26,
                           124,
                           128,
                           86,
                           109,
                           50,
                           40,
                           8,
                           21,
                           177,
                           198,
                           128,
                           160,
                           97,
                           12,
                           128,
                           102,
                           57,
                           197,
                           167,
                           90,
                           33,
                           59,
                           79,
                           167,
                           5,
                           52,
                           58,
                           22,
                           200,
                           38,
                           163,
                           77,
                           188,
                           136,
                           26,
                           10,
                           37,
                           179,
                           98,
                           170,
                           35,
                           30,
                           144,
                           61,
                           58,
                           141,
                           165,
                           37,
                           98,
                           2,
                           103,
                           133,
                           88,
                           172,
                           114,
                           132,
                           89,
                           170,
                           62,
                           12,
                           27),
                   plot2=c(412,
                           303,
                           10,
                           45,
                           161,
                           181,
                           450,
                           647,
                           43,
                           407,
                           170,
                           470,
                           404,
                           505,
                           293,
                           173,
                           217,
                           238,
                           318,
                           443,
                           378,
                           317,
                           29,
                           64,
                           192,
                           249,
                           550,
                           328,
                           605,
                           552,
                           58,
                           226,
                           502,
                           193,
                           506,
                           589,
                           160,
                           261,
                           515,
                           563,
                           550,
                           645,
                           488,
                           547,
                           434,
                           652,
                           70,
                           573,
                           623,
                           351,
                           450,
                           384,
                           82,
                           315,
                           517,
                           626,
                           524,
                           650,
                           466,
                           8,
                           452,
                           624,
                           306,
                           431,
                           460,
                           587,
                           619,
                           139,
                           43,
                           124,
                           38,
                           394,
                           53,
                           436,
                           625,
                           173,
                           509,
                           32,
                           115,
                           156,
                           465,
                           656,
                           584,
                           636,
                           255,
                           212,
                           317,
                           154,
                           153,
                           111,
                           554,
                           653,
                           15,
                           32,
                           118,
                           532,
                           415,
                           615,
                           124,
                           416,
                           546,
                           51,
                           503,
                           448,
                           612,
                           551,
                           286,
                           347,
                           52,
                           435,
                           592,
                           138,
                           182,
                           622,
                           646,
                           5,
                           158,
                           473,
                           640,
                           500,
                           7,
                           578,
                           1,
                           644,
                           230,
                           374,
                           452,
                           307,
                           271,
                           462,
                           647,
                           648,
                           358,
                           262,
                           614,
                           79,
                           278,
                           534,
                           68,
                           359,
                           357,
                           106,
                           589,
                           575,
                           457,
                           555,
                           252,
                           418,
                           371,
                           654,
                           88,
                           609,
                           589,
                           215,
                           435,
                           82,
                           600,
                           266,
                           510,
                           307,
                           537,
                           148,
                           536,
                           290,
                           36,
                           301,
                           27,
                           129,
                           77,
                           595,
                           506,
                           431,
                           293,
                           232,
                           108,
                           246,
                           354,
                           347,
                           460,
                           384,
                           452,
                           261,
                           132,
                           499,
                           463,
                           187,
                           422,
                           319,
                           48,
                           284,
                           241,
                           151,
                           611,
                           496,
                           572,
                           501,
                           644,
                           387,
                           480,
                           221,
                           146,
                           39,
                           400,
                           361,
                           531,
                           69,
                           539,
                           295,
                           249,
                           638,
                           289,
                           83,
                           404,
                           289,
                           547,
                           324))
</code>```

The new column created is data$newCol, and I'm trying to calculate the area of a circle using the data in data$plot2 and then multiply that value by data$plot1. The result should be in the data$newCol column.

Here is what I have tried:

```<code>data$newCol <- for(i in data$newCol) {
  ((3.14(data$plot2^2)) * (data$plot1)
}
</code>```

However, I keep getting this error:

```<code>Error: attempt to apply non-function
</code>```

Can someone help me properly write this loop?

答:
If I understood you correctly you are looking for:

```<code>data$newCol <- pi*data$plot2^2 * data$plot1
</code>```

The above would give you a new column. In R, these operations are vectorised, thus, loops are not needed.

Body:
I am new to 'for' loops in R, and I'm trying to create a new column in the dataframe and pass a formula through it, with the output being a calculated value in each cell. Here is the data I am working with:

data <- data.frame(plot1=c(133,
                           134,
                           115,
                           135,
                           119,
                           41,
                           96,
                           147,
                           64,
                           18,
                           123,
                           198,
                           40,
                           142,
                           131,
                           175,
                           52,
                           7,
                           100,
                           30,
                           197,
                           200,
                           45,
                           149,
                           170,
                           87,
                           191,
                           90,
                           50,
                           168,
                           153,
                           70,
                           98,
                           76,
                           12,
                           83,
                           101,
                           26,
                           62,
                           96,
                           52,
                           97,
                           90,
                           65,
                           9,
                           146,
                           182,
                           174,
                           15,
                           78,
                           165,
                           29,
                           186,
                           132,
                           167,
                           6,
                           43,
                           135,
                           148,
                           49,
                           64,
                           102,
                           195,
                           103,
                           105,
                           75,
                           189,
                           28,
                           117,
                           112,
                           187,
                           13,
                           109,
                           123,
                           61,
                           13,
                           160,
                           172,
                           125,
                           34,
                           75,
                           89,
                           19,
                           121,
                           136,
                           3,
                           32,
                           161,
                           111,
                           158,
                           135,
                           78,
                           133,
                           7,
                           182,
                           159,
                           99,
                           155,
                           80,
                           186,
                           120,
                           74,
                           119,
                           105,
                           157,
                           187,
                           46,
                           92,
                           25,
                           48,
                           129,
                           156,
                           180,
                           106,
                           115,
                           188,
                           120,
                           133,
                           61,
                           152,
                           152,
                           31,
                           84,
                           8,
                           20,
                           40,
                           59,
                           136,
                           84,
                           111,
                           167,
                           53,
                           40,
                           121,
                           29,
                           127,
                           135,
                           177,
                           54,
                           103,
                           41,
                           15,
                           21,
                           108,
                           105,
                           139,
                           73,
                           126,
                           59,
                           165,
                           91,
                           56,
                           53,
                           126,
                           26,
                           124,
                           128,
                           86,
                           109,
                           50,
                           40,
                           8,
                           21,
                           177,
                           198,
                           128,
                           160,
                           97,
                           12,
                           128,
                           102,
                           57,
                           197,
                           167,
                           90,
                           33,
                           59,
                           79,
                           167,
                           5,
                           52,
                           58,
                           22,
                           200,
                           38,
                           163,
                           77,
                           188,
                           136,
                           26,
                           10,
                           37,
                           179,
                           98,
                           170,
                           35,
                           30,
                           144,
                           61,
                           58,
                           141,
                           165,
                           37,
                           98,
                           2,
                           103,
                           133,
                           88,
                           172,
                           114,
                           132,
                           89,
                           170,
                           62,
                           12,
                           27),
                   plot2=c(412,
                           303,
                           10,
                           45,
                           161,
                           181,
                           450,
                           647,
                           43,
                           407,
                           170,
                           470,
                           404,
                           505,
                           293,
                           173,
                           217,
                           238,
                           318,
                           443,
                           378,
                           317,
                           29,
                           64,
                           192,
                           249,
                           550,
                           328,
                           605,
                           552,
                           58,
                           226,
                           502,
                           193,
                           506,
                           589,
                           160,
                           261,
                           515,
                           563,
                           550,
                           645,
                           488,
                           547,
                           434,
                           652,
                           70,
                           573,
                           623,
                           351,
                           450,
                           384,
                           82,
                           315,
                           517,
                           626,
                           524,
                           650,
                           466,
                           8,
                           452,
                           624,
                           306,
                           431,
                           460,
                           587,
                           619,
                           139,
                           43,
                           124,
                           38,
                           394,
                           53,
                           436,
                           625,
                           173,
                           509,
                           32,
                           115,
                           156,
                           465,
                           656,
                           584,
                           636,
                           255,
                           212,
                           317,
                           154,
                           153,
                           111,
                           554,
                           653,
                           15,
                           32,
                           118,
                           532,
                           415,
                           615,
                           124,
                           416,
                           546,
                           51,
                           503,
                           448,
                           612,
                           551,
                           286,
                           347,
                           52,
                           435,
                           592,
                           138,
                           182,
                           622,
                           646,
                           5,
                           158,
                           473,
                           640,
                           500,
                           7,
                           578,
                           1,
                           644,
                           230,
                           374,
                           452,
                           307,
                           271,
                           462,
                           647,
                           648,
                           358,
                           262,
                           614,
                           79,
                           278,
                           534,
                           68,
                           359,
                           357,
                           106,
                           589,
                           575,
                           457,
                           555,
                           252,
                           418,
                           371,
                           654,
                           88,
                           609,
                           589,
                           215,
                           435,
                           82,
                           600,
                           266,
                           510,
                           307,
                           537,
                           148,
                           536,
                           290,
                           36,
                           301,
                           27,
                           129,
                           77,
                           595,
                           506,
                           431,
                           293,
                           232,
                           108,
                           246,
                           354,
                           347,
                           460,
                           384,
                           452,
                           261,
                           132,
                           499,
                           463,
                           187,
                           422,
                           319,
                           48,
                           284,
                           241,
                           151,
                           611,
                           496,
                           572,
                           501,
                           644,
                           387,
                           480,
                           221,
                           146,
                           39,
                           400,
                           361,
                           531,
                           69,
                           539,
                           295,
                           249,
                           638,
                           289,
                           83,
                           404,
                           289,
                           547,
                           324))

The new column created is data$newCol, and I'm trying to calculate the area of a circle using the data in data$plot2 and then multiply that value by data$plot1. The result should be in the data$newCol column.

Here is what I have tried:

data$newCol <- for(i in data$newCol) {
  ((3.14(data$plot2^2)) * (data$plot1)
}

However, I keep getting this error:

Error: attempt to apply non-function

Can someone help me properly write this loop?

Body:
If I understood you correctly you are looking for:

data$newCol <- pi*data$plot2^2 * data$plot1

The above would give you a new column. In R, these operations are vectorised, thus, loops are not needed.


问:
GCP Dataproc - Failed to construct kafka consumer, Failed to load SSL keystore dataproc.jks of type JKS
I'm trying to run a Structured Streaming program on GCP Dataproc, which accesses the data from Kafka and prints it.

Access to Kafka is using SSL, and the truststore and keystore files are stored in buckets.
I'm using Google Storage API to access the bucket, and store the file in the current working directory. The truststore and keystores are passed onto the Kafka Consumer/Producer.
However - i'm getting an error

Command :

```<code>gcloud dataproc jobs submit pyspark /Users/karanalang/Documents/Technology/gcp/DataProc/StructuredStreaming_Kafka_GCP-Batch-feb2-v2.py  --cluster dataproc-ss-poc  --properties spark.jars.packages=org.apache.spark:spark-sql-kafka-0-10_2.12:3.2.0 --region us-central1

</code>```

Code is shown below :

```<code>spark = SparkSession.builder.appName('StructuredStreaming_VersaSase').getOrCreate()

kafkaBrokers='<broker-ip>:9094'
topic = "versa-sase"
security_protocol="SSL"

# Google Storage API to access the keys in the buckets
client = storage.Client()
bucket = client.get_bucket('ssl-certs-karan')

blob_ssl_truststore = bucket.get_blob('cap12.jks')
ssl_truststore_location = '{}/{}'.format(os.getcwd(), blob_ssl_truststore.name)
blob_ssl_truststore.download_to_filename(ssl_truststore_location)

ssl_truststore_password="<ssl_truststore_password>"

blob_ssl_keystore = bucket.get_blob('dataproc-versa-sase-p12-1.jks')
ssl_keystore_location = '{}/{}'.format(os.getcwd(), blob_ssl_keystore.name)
blob_ssl_keystore.download_to_filename(ssl_keystore_location)

ssl_keystore_password="<ssl_keystore_password>"
consumerGroupId = "versa-sase-grp"
checkpoint = "gs://ss-checkpoint/"

print(" SPARK.SPARKCONTEXT -> ", spark.sparkContext)

df = spark.read.format('kafka')\
    .option("kafka.bootstrap.servers",kafkaBrokers)\
    .option("kafka.security.protocol","SSL") \
    .option("kafka.ssl.truststore.location",ssl_truststore_location) \
    .option("kafka.ssl.truststore.password",ssl_truststore_password) \
    .option("kafka.ssl.keystore.location", ssl_keystore_location)\
    .option("kafka.ssl.keystore.password", ssl_keystore_password)\
    .option("subscribe", topic) \
    .option("kafka.group.id", consumerGroupId)\
    .option("startingOffsets", "earliest") \
    .load()

   print(" df -> ", df)
   query = df.selectExpr("CAST(value AS STRING)", "CAST(key AS STRING)", "topic", "timestamp") \
    .write \
    .format("console") \
    .option("numRows",100)\
    .option("checkpointLocation", checkpoint) \
    .option("outputMode", "complete")\
    .option("truncate", "false") \
    .save("output")

</code>```

Error :

```<code>Traceback (most recent call last):
  File "/tmp/3e7304f8e27d4436a2f382280cebe7c5/StructuredStreaming_Kafka_GCP-Batch-feb2-v2.py", line 83, in <module>
    query = df.selectExpr("CAST(value AS STRING)", "CAST(key AS STRING)", "topic", "timestamp") \
  File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/readwriter.py", line 1109, in save
  File "/usr/lib/spark/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py", line 1304, in __call__
  File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/utils.py", line 111, in deco
  File "/usr/lib/spark/python/lib/py4j-0.10.9-src.zip/py4j/protocol.py", line 326, in get_return_value
py4j.protocol.Py4JJavaError22/02/02 23:11:08 DEBUG org.apache.hadoop.ipc.Client: IPC Client (1416219052) connection to dataproc-ss-poc-m/10.128.0.78:8030 from root sending #171 org.apache.hadoop.yarn.api.ApplicationMasterProtocolPB.allocate
22/02/02 23:11:08 DEBUG org.apache.hadoop.ipc.Client: IPC Client (1416219052) connection to dataproc-ss-poc-m/10.128.0.78:8030 from root got value #171
22/02/02 23:11:08 DEBUG org.apache.hadoop.ipc.ProtobufRpcEngine: Call: allocate took 2ms
: An error occurred while calling o84.save.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3) (dataproc-ss-poc-w-0.c.versa-kafka-poc.internal executor 1): org.apache.kafka.common.KafkaException: Failed to construct kafka consumer
    at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:823)
    at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:665)
    at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:613)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumer.createConsumer(KafkaDataConsumer.scala:124)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumer.<init>(KafkaDataConsumer.scala:61)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumerPool$ObjectFactory.create(InternalKafkaConsumerPool.scala:206)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumerPool$ObjectFactory.create(InternalKafkaConsumerPool.scala:201)
    at org.apache.commons.pool2.BaseKeyedPooledObjectFactory.makeObject(BaseKeyedPooledObjectFactory.java:60)
    at org.apache.commons.pool2.impl.GenericKeyedObjectPool.create(GenericKeyedObjectPool.java:1041)
    at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:342)
    at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:265)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumerPool.borrowObject(InternalKafkaConsumerPool.scala:84)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.retrieveConsumer(KafkaDataConsumer.scala:573)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.getOrRetrieveConsumer(KafkaDataConsumer.scala:558)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.$anonfun$getAvailableOffsetRange$1(KafkaDataConsumer.scala:359)
    at org.apache.spark.util.UninterruptibleThread.runUninterruptibly(UninterruptibleThread.scala:77)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.runUninterruptiblyIfPossible(KafkaDataConsumer.scala:618)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.getAvailableOffsetRange(KafkaDataConsumer.scala:358)
    at org.apache.spark.sql.kafka010.KafkaSourceRDD.resolveRange(KafkaSourceRDD.scala:123)
    at org.apache.spark.sql.kafka010.KafkaSourceRDD.compute(KafkaSourceRDD.scala:75)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:373)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:337)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:373)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:337)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:373)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:337)
...

Caused by: org.apache.kafka.common.KafkaException: Failed to load SSL keystore /tmp/3e7304f8e27d4436a2f382280cebe7c5/dataproc-versa-sase-p12-1.jks of type JKS
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory$FileBasedStore.load(DefaultSslEngineFactory.java:377)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory$FileBasedStore.<init>(DefaultSslEngineFactory.java:349)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory.createKeystore(DefaultSslEngineFactory.java:299)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory.configure(DefaultSslEngineFactory.java:161)
    at org.apache.kafka.common.security.ssl.SslFactory.instantiateSslEngineFactory(SslFactory.java:138)
    at org.apache.kafka.common.security.ssl.SslFactory.configure(SslFactory.java:95)
    at org.apache.kafka.common.network.SslChannelBuilder.configure(SslChannelBuilder.java:74)
    at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:192)
    at org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:81)
    at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:105)
    at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:737)
    ... 53 more
Caused by: java.nio.file.NoSuchFileException: /tmp/3e7304f8e27d4436a2f382280cebe7c5/dataproc-versa-sase-p12-1.jks
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
    at java.nio.file.Files.newByteChannel(Files.java:361)
    at java.nio.file.Files.newByteChannel(Files.java:407)
    at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
    at java.nio.file.Files.newInputStream(Files.java:152)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory$FileBasedStore.load(DefaultSslEngineFactory.java:370)

</code>```

From my mac, I'm using PKCS files (.p12) and am able to access the Kafka cluster in SSL mode. However, in Dataproc - it seems the expected file format is JKS.

here is the command i used to convert .p12 file to JKS format:

```<code>keytool -importkeystore -srckeystore dataproc-versa-sase.p12 -srcstoretype pkcs12 -srcalias versa-sase-user -destkeystore dataproc-versa-sase-p12-1.jks -deststoretype jks -deststorepass <password> -destalias versa-sase-user
</code>```

What needs to be done to fix this ?
it seems the JKS file is not accessible to the Spark program ?

tia!

答:
per note from @OneCricketer, i was able to get this working by using --files <gs://cert1>,<gs://cert2>.
Also, this works when using the cluster mode.

ClusterMode command

```<code>gcloud dataproc jobs submit pyspark /Users/karanalang/Documents/Technology/gcp/DataProc/StructuredStreaming_Kafka_GCP-Batch-feb2-v2.py  --cluster dataproc-ss-poc  --properties spark.jars.packages=org.apache.spark:spark-sql-kafka-0-10_2.12:3.1.2,spark.submit.deployMode=cluster --region us-central1
</code>```

Client Mode :

```<code>gcloud dataproc jobs submit pyspark /Users/karanalang/Documents/Technology/gcp/DataProc/StructuredStreaming_Kafka_GCP-Batch-feb2-v2.py  --cluster dataproc-ss-poc  --properties spark.jars.packages=org.apache.spark:spark-sql-kafka-0-10_2.12:3.1.2 --region us-central1
</code>```

Accessing the certs in the Driver:

```<code># access using the cert name
ssl_truststore_location="ca.p12"
ssl_keystore_location="dataproc-versa-sase.p12"

df_stream = spark.readStream.format('kafka') \
    .option("kafka.security.protocol", "SSL") \
    .option("kafka.ssl.truststore.location", ssl_truststore_location) \
    .option("kafka.ssl.truststore.password", ssl_truststore_password) \
    .option("kafka.ssl.keystore.location", ssl_keystore_location) \
    .option("kafka.ssl.keystore.password", ssl_keystore_password) \
    .option("kafka.bootstrap.servers",kafkaBrokers)\
    .option("subscribe", topic) \
    .option("kafka.group.id", consumerGroupId)\
    .option("startingOffsets", "earliest") \
    .option("failOnDataLoss", "false") \
    .option("maxOffsetsPerTrigger", 10) \
    .load()
</code>```

Body:
I'm trying to run a Structured Streaming program on GCP Dataproc, which accesses the data from Kafka and prints it.

Access to Kafka is using SSL, and the truststore and keystore files are stored in buckets.
I'm using Google Storage API to access the bucket, and store the file in the current working directory. The truststore and keystores are passed onto the Kafka Consumer/Producer.
However - i'm getting an error

Command :

gcloud dataproc jobs submit pyspark /Users/karanalang/Documents/Technology/gcp/DataProc/StructuredStreaming_Kafka_GCP-Batch-feb2-v2.py  --cluster dataproc-ss-poc  --properties spark.jars.packages=org.apache.spark:spark-sql-kafka-0-10_2.12:3.2.0 --region us-central1

Code is shown below :

spark = SparkSession.builder.appName('StructuredStreaming_VersaSase').getOrCreate()

kafkaBrokers='<broker-ip>:9094'
topic = "versa-sase"
security_protocol="SSL"

# Google Storage API to access the keys in the buckets
client = storage.Client()
bucket = client.get_bucket('ssl-certs-karan')

blob_ssl_truststore = bucket.get_blob('cap12.jks')
ssl_truststore_location = '{}/{}'.format(os.getcwd(), blob_ssl_truststore.name)
blob_ssl_truststore.download_to_filename(ssl_truststore_location)

ssl_truststore_password="<ssl_truststore_password>"

blob_ssl_keystore = bucket.get_blob('dataproc-versa-sase-p12-1.jks')
ssl_keystore_location = '{}/{}'.format(os.getcwd(), blob_ssl_keystore.name)
blob_ssl_keystore.download_to_filename(ssl_keystore_location)

ssl_keystore_password="<ssl_keystore_password>"
consumerGroupId = "versa-sase-grp"
checkpoint = "gs://ss-checkpoint/"

print(" SPARK.SPARKCONTEXT -> ", spark.sparkContext)

df = spark.read.format('kafka')\
    .option("kafka.bootstrap.servers",kafkaBrokers)\
    .option("kafka.security.protocol","SSL") \
    .option("kafka.ssl.truststore.location",ssl_truststore_location) \
    .option("kafka.ssl.truststore.password",ssl_truststore_password) \
    .option("kafka.ssl.keystore.location", ssl_keystore_location)\
    .option("kafka.ssl.keystore.password", ssl_keystore_password)\
    .option("subscribe", topic) \
    .option("kafka.group.id", consumerGroupId)\
    .option("startingOffsets", "earliest") \
    .load()

   print(" df -> ", df)
   query = df.selectExpr("CAST(value AS STRING)", "CAST(key AS STRING)", "topic", "timestamp") \
    .write \
    .format("console") \
    .option("numRows",100)\
    .option("checkpointLocation", checkpoint) \
    .option("outputMode", "complete")\
    .option("truncate", "false") \
    .save("output")

Error :

Traceback (most recent call last):
  File "/tmp/3e7304f8e27d4436a2f382280cebe7c5/StructuredStreaming_Kafka_GCP-Batch-feb2-v2.py", line 83, in <module>
    query = df.selectExpr("CAST(value AS STRING)", "CAST(key AS STRING)", "topic", "timestamp") \
  File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/readwriter.py", line 1109, in save
  File "/usr/lib/spark/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py", line 1304, in __call__
  File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/utils.py", line 111, in deco
  File "/usr/lib/spark/python/lib/py4j-0.10.9-src.zip/py4j/protocol.py", line 326, in get_return_value
py4j.protocol.Py4JJavaError22/02/02 23:11:08 DEBUG org.apache.hadoop.ipc.Client: IPC Client (1416219052) connection to dataproc-ss-poc-m/10.128.0.78:8030 from root sending #171 org.apache.hadoop.yarn.api.ApplicationMasterProtocolPB.allocate
22/02/02 23:11:08 DEBUG org.apache.hadoop.ipc.Client: IPC Client (1416219052) connection to dataproc-ss-poc-m/10.128.0.78:8030 from root got value #171
22/02/02 23:11:08 DEBUG org.apache.hadoop.ipc.ProtobufRpcEngine: Call: allocate took 2ms
: An error occurred while calling o84.save.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3) (dataproc-ss-poc-w-0.c.versa-kafka-poc.internal executor 1): org.apache.kafka.common.KafkaException: Failed to construct kafka consumer
    at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:823)
    at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:665)
    at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:613)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumer.createConsumer(KafkaDataConsumer.scala:124)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumer.<init>(KafkaDataConsumer.scala:61)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumerPool$ObjectFactory.create(InternalKafkaConsumerPool.scala:206)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumerPool$ObjectFactory.create(InternalKafkaConsumerPool.scala:201)
    at org.apache.commons.pool2.BaseKeyedPooledObjectFactory.makeObject(BaseKeyedPooledObjectFactory.java:60)
    at org.apache.commons.pool2.impl.GenericKeyedObjectPool.create(GenericKeyedObjectPool.java:1041)
    at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:342)
    at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:265)
    at org.apache.spark.sql.kafka010.consumer.InternalKafkaConsumerPool.borrowObject(InternalKafkaConsumerPool.scala:84)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.retrieveConsumer(KafkaDataConsumer.scala:573)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.getOrRetrieveConsumer(KafkaDataConsumer.scala:558)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.$anonfun$getAvailableOffsetRange$1(KafkaDataConsumer.scala:359)
    at org.apache.spark.util.UninterruptibleThread.runUninterruptibly(UninterruptibleThread.scala:77)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.runUninterruptiblyIfPossible(KafkaDataConsumer.scala:618)
    at org.apache.spark.sql.kafka010.consumer.KafkaDataConsumer.getAvailableOffsetRange(KafkaDataConsumer.scala:358)
    at org.apache.spark.sql.kafka010.KafkaSourceRDD.resolveRange(KafkaSourceRDD.scala:123)
    at org.apache.spark.sql.kafka010.KafkaSourceRDD.compute(KafkaSourceRDD.scala:75)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:373)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:337)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:373)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:337)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:373)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:337)
...

Caused by: org.apache.kafka.common.KafkaException: Failed to load SSL keystore /tmp/3e7304f8e27d4436a2f382280cebe7c5/dataproc-versa-sase-p12-1.jks of type JKS
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory$FileBasedStore.load(DefaultSslEngineFactory.java:377)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory$FileBasedStore.<init>(DefaultSslEngineFactory.java:349)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory.createKeystore(DefaultSslEngineFactory.java:299)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory.configure(DefaultSslEngineFactory.java:161)
    at org.apache.kafka.common.security.ssl.SslFactory.instantiateSslEngineFactory(SslFactory.java:138)
    at org.apache.kafka.common.security.ssl.SslFactory.configure(SslFactory.java:95)
    at org.apache.kafka.common.network.SslChannelBuilder.configure(SslChannelBuilder.java:74)
    at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:192)
    at org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:81)
    at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:105)
    at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:737)
    ... 53 more
Caused by: java.nio.file.NoSuchFileException: /tmp/3e7304f8e27d4436a2f382280cebe7c5/dataproc-versa-sase-p12-1.jks
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
    at java.nio.file.Files.newByteChannel(Files.java:361)
    at java.nio.file.Files.newByteChannel(Files.java:407)
    at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
    at java.nio.file.Files.newInputStream(Files.java:152)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory$FileBasedStore.load(DefaultSslEngineFactory.java:370)

From my mac, I'm using PKCS files (.p12) and am able to access the Kafka cluster in SSL mode. However, in Dataproc - it seems the expected file format is JKS.

here is the command i used to convert .p12 file to JKS format:

keytool -importkeystore -srckeystore dataproc-versa-sase.p12 -srcstoretype pkcs12 -srcalias versa-sase-user -destkeystore dataproc-versa-sase-p12-1.jks -deststoretype jks -deststorepass <password> -destalias versa-sase-user

What needs to be done to fix this ?
it seems the JKS file is not accessible to the Spark program ?

tia!

Body:
per note from @OneCricketer, i was able to get this working by using --files <gs://cert1>,<gs://cert2>.
Also, this works when using the cluster mode.

ClusterMode command

gcloud dataproc jobs submit pyspark /Users/karanalang/Documents/Technology/gcp/DataProc/StructuredStreaming_Kafka_GCP-Batch-feb2-v2.py  --cluster dataproc-ss-poc  --properties spark.jars.packages=org.apache.spark:spark-sql-kafka-0-10_2.12:3.1.2,spark.submit.deployMode=cluster --region us-central1

Client Mode :

gcloud dataproc jobs submit pyspark /Users/karanalang/Documents/Technology/gcp/DataProc/StructuredStreaming_Kafka_GCP-Batch-feb2-v2.py  --cluster dataproc-ss-poc  --properties spark.jars.packages=org.apache.spark:spark-sql-kafka-0-10_2.12:3.1.2 --region us-central1

Accessing the certs in the Driver:

# access using the cert name
ssl_truststore_location="ca.p12"
ssl_keystore_location="dataproc-versa-sase.p12"

df_stream = spark.readStream.format('kafka') \
    .option("kafka.security.protocol", "SSL") \
    .option("kafka.ssl.truststore.location", ssl_truststore_location) \
    .option("kafka.ssl.truststore.password", ssl_truststore_password) \
    .option("kafka.ssl.keystore.location", ssl_keystore_location) \
    .option("kafka.ssl.keystore.password", ssl_keystore_password) \
    .option("kafka.bootstrap.servers",kafkaBrokers)\
    .option("subscribe", topic) \
    .option("kafka.group.id", consumerGroupId)\
    .option("startingOffsets", "earliest") \
    .option("failOnDataLoss", "false") \
    .option("maxOffsetsPerTrigger", 10) \
    .load()


问:
Add Custom Properties to Application Insights Request Telemetry in WCF
I'm trying to get some additional information about the message we received (basically its application-level outcome) into the Application Insights RequestTelemetry object for a WCF service.

Application Insights is logging request telemetry already. I created an ITelemetryInitializer that is being run, but at the time it runs I have no way that I can find to access information about the request, much less application-specific data from the request's context.

Is there somewhere I can put data that will be accessible by the ITelemetryInitializer at the time it runs?

```<code>    public class WcfServiceTelemetryInitializer : ITelemetryInitializer
    {
        public void Initialize(ITelemetry telemetry)
        {
            if (telemetry is RequestTelemetry rTelemetry)
            {
                // HttpContext.Current is populated at this point, but doesn't seem to be available within my application code.
                // So is System.ServiceModel.OperationContext.Current
            }
        }
    }
</code>```

答:
In case it helps anyone, Application Insights automatically adds custom dimensions from data you store in System.Diagnostics.Activity.Current.AddBaggage(), or at least it does in asp.net 5. That might be available at the right place for you in WCF land.

e.g.

```<code>var currentActivity = System.Diagnostics.Activity.Current;
if (currentActivity != null)
{
    currentActivity.AddBaggage("MyPropertyName", someData);
}
</code>```

Body:
I'm trying to get some additional information about the message we received (basically its application-level outcome) into the Application Insights RequestTelemetry object for a WCF service.

Application Insights is logging request telemetry already. I created an ITelemetryInitializer that is being run, but at the time it runs I have no way that I can find to access information about the request, much less application-specific data from the request's context.

Is there somewhere I can put data that will be accessible by the ITelemetryInitializer at the time it runs?

    public class WcfServiceTelemetryInitializer : ITelemetryInitializer
    {
        public void Initialize(ITelemetry telemetry)
        {
            if (telemetry is RequestTelemetry rTelemetry)
            {
                // HttpContext.Current is populated at this point, but doesn't seem to be available within my application code.
                // So is System.ServiceModel.OperationContext.Current
            }
        }
    }

Body:
In case it helps anyone, Application Insights automatically adds custom dimensions from data you store in System.Diagnostics.Activity.Current.AddBaggage(), or at least it does in asp.net 5. That might be available at the right place for you in WCF land.

e.g.

var currentActivity = System.Diagnostics.Activity.Current;
if (currentActivity != null)
{
    currentActivity.AddBaggage("MyPropertyName", someData);
}


问:
Can I change the username in Google Earth Engine?
Does anybody know if the username in Google Earth Engine can be changed? I signed up for GEE a while ago and without knowing what I was doing, I assigned it a username which was more the name of a project rather than a user name for the GEE account. Now I am stuck with it and I can't find any information on how to change it. The only answer I found related to this issue is here:

https://gis.stackexchange.com/questions/362523/google-earth-engine-rename-assets

where it is suggested that in order to change the username we have to contact Google. Is that true?

Thank you!

答: After joining a GEE support group I learned that it is indeed not possible to change the username. This is something that needs to be requested directly to Google.</p>


问:
What's the point of blessed in Perl?
```<code>[root@ ~]$ perl -e "print 1 if blessed $a;"
1
[root@ ~]$ perl -e "print 1 if blessed $c;"
1
[root@ ~]$ perl -e "print 1 if blessed $cee;"
1
</code>```

It seems always true,the version is 5.8.8.

UPDATE

I'm not running as root, it's CHANGED by me for the sake of privacy:)

答:
As has been pointed out, you need to load the module before using the method. Also, if you had used perl -we instead of perl -e, you would probably not have asked this question.

For me, with perl -we, I get this warning:

```<code>Can't call method "blessed" without a package or object reference at -e line 1.
</code>```

Title: What's the point of blessed in Perl?

Body:
[root@ ~]$ perl -e "print 1 if blessed $a;"
1
[root@ ~]$ perl -e "print 1 if blessed $c;"
1
[root@ ~]$ perl -e "print 1 if blessed $cee;"
1

It seems always true,the version is 5.8.8.

UPDATE

I'm not running as root, it's CHANGED by me for the sake of privacy:)

Body:
As has been pointed out, you need to load the module before using the method. Also, if you had used perl -we instead of perl -e, you would probably not have asked this question.

For me, with perl -we, I get this warning:

Can't call method "blessed" without a package or object reference at -e line 1.


问:
How I can access and add value from the list which is nested in the hashmap and list in Java
I am trying to add value for the List which is stored in HashMap and that has one parent List.

When I try to do so I get "The method get in type is not compatible with the List"

I am trying the following code, logic is :

If I get the matching value of tID in the txnValue List I am just adding the "Values" List otherwise I am creating the new HashMap.

List < HashMap > txnvalues = new ArrayList < HashMap > ();
for (LinkedHashMap < String, Object > linkedHashMap: resultset) {

  HashMap data = new HashMap < > ();
  HashMap attrData = new HashMap < > ();
  List values = new ArrayList < > ();
  data.put("values", new ArrayList < > ());
  attrData.put("attrID", linkedHashMap.get("ID"));
  attrData.put("attrVal", linkedHashMap.get("VAL"));
  String txnID = linkedHashMap.get("T_ID").toString();
  if (!txnvalues.stream().anyMatch(list -> list.containsValue(txnID))) {
    data.put("tID", linkedHashMap.get("T_ID"));
    values.add(attrData);
    data.put("Values", values);
    txnvalues.add(data);
  } else {
    txnvalues.get("Values").add(attrData); // this Line throws error
  }

}```
</div>
</div>
</p>
<p>Example :</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>[{
"tID":123,
"Values":[{attrID:1,attrVal:123}]
}]

//Here If linkedHashmap.get("T_ID") = 123 which matches with tID then I want to add data in the Values

[{
"tID":123,
"Values":[{attrID:1,attrVal:123},{attrID:11,attrVal:467}]
}]

//If it doesn't match then I want to create new Hashmap and update txnValues Like this

[{
"tID":123,
"Values":[{attrID:1,attrVal:123},{attrID:2,attrVal:3435}]
},
{
"tID":456,
"Values":[{attrID:2,attrVal:233}]
}
]</code>```

答:
I decided to parameterize all of your various iterables. Below is the parameterized code.

```<code>List<HashMap<String, List<HashMap<String, Object>>>> txnvalues = new ArrayList<HashMap<String, List<HashMap<String, Object>>>>();
for (LinkedHashMap<String, Object> linkedHashMap : resultset) {//Error here

    HashMap<String, List<HashMap<String, Object>>> data = new HashMap<String, List<HashMap<String, Object>>>();
    HashMap<String, Object> attrData = new HashMap<String, Object>();
    List<HashMap<String, Object>> values = new ArrayList<HashMap<String, Object>>();
    data.put("values", new ArrayList<>());
    attrData.put("attrID", linkedHashMap.get("ID"));
    attrData.put("attrVal", linkedHashMap.get("VAL"));
    String txnID = linkedHashMap.get("T_ID").toString();
    if (!txnvalues.stream().anyMatch(list -> list.containsValue(txnID))) {
        data.put("tID", linkedHashMap.get("T_ID")); //Error here
        values.add(attrData);
        data.put("Values", values);
        txnvalues.add(data);
    } else {
        txnvalues.get("Values").add(attrData); //Error here
    }
}
</code>```

First, you have multiple errors in your code such as trying to put a String key and Object value into data, which is a HashMap that only takes a String key and a List(of HashMaps of Strings and Objects) value. Another such is trying to get an item from txnvalues by a String, when txnvalues is a List and therefore requires an integer index parameter.

Second, you have a variable here which is never defined: resultset. We don't know what it is or how it is used, since it's never referenced elsewhere.

Third, there are many many ways to handle nested sets. This >-> List<HashMap<String, List<HashMap<String, Object>>>> is simply horrible.

Please re-write your code in a way that is readable, parameterized, and can properly compile without errors. Just parameterizing will help you keep track of which iterables take which parameters and will help prevent the problem you had when you came here for help.

Body:
I am trying to add value for the List which is stored in HashMap and that has one parent List.

When I try to do so I get "The method get in type is not compatible with the List"

I am trying the following code, logic is :

If I get the matching value of tID in the txnValue List I am just adding the "Values" List otherwise I am creating the new HashMap.

List < HashMap > txnvalues = new ArrayList < HashMap > ();
for (LinkedHashMap < String, Object > linkedHashMap: resultset) {

  HashMap data = new HashMap < > ();
  HashMap attrData = new HashMap < > ();
  List values = new ArrayList < > ();
  data.put("values", new ArrayList < > ());
  attrData.put("attrID", linkedHashMap.get("ID"));
  attrData.put("attrVal", linkedHashMap.get("VAL"));
  String txnID = linkedHashMap.get("T_ID").toString();
  if (!txnvalues.stream().anyMatch(list -> list.containsValue(txnID))) {
    data.put("tID", linkedHashMap.get("T_ID"));
    values.add(attrData);
    data.put("Values", values);
    txnvalues.add(data);
  } else {
    txnvalues.get("Values").add(attrData); // this Line throws error
  }

}

Example :

[{
"tID":123,
"Values":[{attrID:1,attrVal:123}]
}]

//Here If linkedHashmap.get("T_ID") = 123 which matches with tID then I want to add data in the Values

[{
"tID":123,
"Values":[{attrID:1,attrVal:123},{attrID:11,attrVal:467}]
}]

//If it doesn't match then I want to create new Hashmap and update txnValues Like this

[{
"tID":123,
"Values":[{attrID:1,attrVal:123},{attrID:2,attrVal:3435}]
},
{
"tID":456,
"Values":[{attrID:2,attrVal:233}]
}
]

Body:
I decided to parameterize all of your various iterables. Below is the parameterized code.

List<HashMap<String, List<HashMap<String, Object>>>> txnvalues = new ArrayList<HashMap<String, List<HashMap<String, Object>>>>();
for (LinkedHashMap<String, Object> linkedHashMap : resultset) {//Error here

    HashMap<String, List<HashMap<String, Object>>> data = new HashMap<String, List<HashMap<String, Object>>>();
    HashMap<String, Object> attrData = new HashMap<String, Object>();
    List<HashMap<String, Object>> values = new ArrayList<HashMap<String, Object>>();
    data.put("values", new ArrayList<>());
    attrData.put("attrID", linkedHashMap.get("ID"));
    attrData.put("attrVal", linkedHashMap.get("VAL"));
    String txnID = linkedHashMap.get("T_ID").toString();
    if (!txnvalues.stream().anyMatch(list -> list.containsValue(txnID))) {
        data.put("tID", linkedHashMap.get("T_ID")); //Error here
        values.add(attrData);
        data.put("Values", values);
        txnvalues.add(data);
    } else {
        txnvalues.get("Values").add(attrData); //Error here
    }
}

First, you have multiple errors in your code such as trying to put a String key and Object value into data, which is a HashMap that only takes a String key and a List(of HashMaps of Strings and Objects) value. Another such is trying to get an item from txnvalues by a String, when txnvalues is a List and therefore requires an integer index parameter.

Second, you have a variable here which is never defined: resultset. We don't know what it is or how it is used, since it's never referenced elsewhere.

Third, there are many many ways to handle nested sets. This >-> List<HashMap<String, List<HashMap<String, Object>>>> is simply horrible.

Please re-write your code in a way that is readable, parameterized, and can properly compile without errors. Just parameterizing will help you keep track of which iterables take which parameters and will help prevent the problem you had when you came here for help.