问:
redirect url with query string to ca certain page
i have URLs which look like this: https://domain.de/immobilien?bis-kaltmiete&info-message=test&vermarktungsart=miete&von-kaltmiete&callback=confirm_searchagent&confirm=1aa46e80c4d57ef40a6ddab59cf5aebd#flash-message

Now i want to redirect URLs with the certain query "callback=confirm_searchagent". I tryed to do this via .htaccess and used the following code

```<code> RewriteCond %{QUERY_STRING} ^callback=(.*)$
 RewriteRule ^(.*)$ /immobilien/ [R=301,L]
</code>```

The code did not change anything, no redirection, no errors.

i hope somebody can help me with this?

答:
You can use this :

```<code> RewriteCond %{QUERY_STRING} callback=(.*)
 RewriteRule ^(.*)$ /immobilien/? [R=301,L]
</code>```

I removed the ^ from your condition regex as it was looking for a query string that starts with this spacific key. Also I added a ? at the end of the rule to remove query strings from the new redirected URL. You can remove this ? if you want query string appended.

Body:
i have URLs which look like this: https://domain.de/immobilien?bis-kaltmiete&info-message=test&vermarktungsart=miete&von-kaltmiete&callback=confirm_searchagent&confirm=1aa46e80c4d57ef40a6ddab59cf5aebd#flash-message

Now i want to redirect URLs with the certain query "callback=confirm_searchagent". I tryed to do this via .htaccess and used the following code

 RewriteCond %{QUERY_STRING} ^callback=(.*)$
 RewriteRule ^(.*)$ /immobilien/ [R=301,L]

The code did not change anything, no redirection, no errors.

i hope somebody can help me with this?

Body:
You can use this :

 RewriteCond %{QUERY_STRING} callback=(.*)
 RewriteRule ^(.*)$ /immobilien/? [R=301,L]

I removed the ^ from your condition regex as it was looking for a query string that starts with this spacific key. Also I added a ? at the end of the rule to remove query strings from the new redirected URL. You can remove this ? if you want query string appended.


来源: stackexchange

问:
How to refresh the same page after select option changes in another component using ionic?
I'm new to ionic. I'm trying to refresh the same page after user selects an option from dropdown. but the my dropdown is in another component(somehow like partial view) and I used this in other components.
I tried navigating but it didn't refresh the page. I want when user selects an option that component will refresh.
the ngOnInit method works fine btw.
This is my partial view component:

```<code> navigateTo(path: string) {
localStorage.setItem('selectedapp', this.appId);
this.router.navigate([path]);
 }
</code>```

this is the html of this component:

```<code>  <ion-item *ngIf="!isPrivate">
  <ion-label>فروشگاه های من</ion-label>
  <ion-select [(ngModel)]="appId" (ionChange)="navigateTo(model[0].url)" ok-text="تایید" cancel-text="کنسل" [value]="00000000-0000-0000-0000-000000000000">
    <ion-select-option value="00000000-0000-0000-0000-000000000000">همه</ion-select-option>
    <ion-select-option value="{{item.applicationId}}" *ngFor="let item of model">{{item.applicationTitle}}</ion-select-option>
    </ion-select>
</ion-item>
</code>```

This is where I used above component's tag in another html page:

```<code> <app-user-applications returnUrl="prizePackages"></app-user-applications>
</code>```

in this case I want to refresh the prizePackages page.
what should I do?

答:
The first thing I recommend in Ionic with Agular is that you change the local-storage implementation to the one suggested by ionic, since the browser's local storage doesn't work (it uses @ionic/storage).

To make changes between components I recommend that you use RxJS, through Angular services, another implementation that tends to be used is Redux, which I do not like very much, as a last option that I do not recommend, use promises in the services to connect the components, this can bring many problems.

I hope my answer works for you!

ContentLicense: CC BY-SA 4.0

Body:
I'm new to ionic. I'm trying to refresh the same page after user selects an option from dropdown. but the my dropdown is in another component(somehow like partial view) and I used this in other components.
I tried navigating but it didn't refresh the page. I want when user selects an option that component will refresh.
the ngOnInit method works fine btw.
This is my partial view component:

 navigateTo(path: string) {
localStorage.setItem('selectedapp', this.appId);
this.router.navigate([path]);
 }

this is the html of this component:

  <ion-item *ngIf="!isPrivate">
  <ion-label>فروشگاه های من</ion-label>
  <ion-select [(ngModel)]="appId" (ionChange)="navigateTo(model[0].url)" ok-text="تایید" cancel-text="کنسل" [value]="00000000-0000-0000-0000-000000000000">
    <ion-select-option value="00000000-0000-0000-0000-000000000000">همه</ion-select-option>
    <ion-select-option value="{{item.applicationId}}" *ngFor="let item of model">{{item.applicationTitle}}</ion-select-option>
    </ion-select>
</ion-item>

This is where I used above component's tag in another html page:

 <app-user-applications returnUrl="prizePackages"></app-user-applications>

in this case I want to refresh the prizePackages page.
what should I do?


问:
Is there a quick lookup for url-to-controller mapping when @RequestMapping is used?
Given a web app that completely uses @RequestMapping to tie urls to a controller, I was wondering if there is a way or plug-in that would produce the web app's complete url-to-controller mappings?

Similar to struts.xml where you have all the urls mapping to an action hence you can see these information in a central place?

Otherwise, what happens is given a url from the screen, I end up doing a java file search each time I want to lookup that url's controller.

答:
You can always wire the DefaultAnnotationHandlerMapping and extract all mappings. Something like:

```<code>@Autowired
// org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
private DefaultAnnotationHandlerMapping defaultAnnotationHandlerMapping;

public void outputMappings() {
for (Map.Entry<String, Object> entry :
    defaultAnnotationHandlerMapping.getHandlerMap().entrySet()) {
        System.out.println(entry.getKey() + "->" +
                           entry.getValue().getClass().getName());
    }

}
</code>```

See AbstractUrlHandlerMapping.getHandlerMap() and DefaultAnnotationHandlerMapping

ContentLicense: CC BY-SA 3.0

Body:
You can always wire the DefaultAnnotationHandlerMapping and extract all mappings. Something like:

@Autowired
// org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
private DefaultAnnotationHandlerMapping defaultAnnotationHandlerMapping;

public void outputMappings() {
for (Map.Entry<String, Object> entry :
    defaultAnnotationHandlerMapping.getHandlerMap().entrySet()) {
        System.out.println(entry.getKey() + "->" +
                           entry.getValue().getClass().getName());
    }

}

See AbstractUrlHandlerMapping.getHandlerMap() and DefaultAnnotationHandlerMapping


问:
Issues with JTextField size behavior using JGoodies.FormLayout
I'm trying to lay out a basic JPanel using JGoodies.FormLayout and I'm running into an issue where the JTextField components I place remain at minimum size regardless of anything I do to attempt to resolve the issue. Without further ado,

Program.java:

```<code>package example;

import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JTabbedPane;
import example.gui.*;

public class Program {

    private static JTabbedPane tabbedViewControl;
    private static TabPanel someTabPanel;

    private static void createAndShowGUI() {
        JFrame mainFrame = new JFrame("Stack Overflow Example");
        mainFrame.setResizable(true);
        mainFrame.setSize(1200, 800);
        mainFrame.setTitle("Example");
        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        mainFrame.getContentPane().setLayout(new GridLayout(1, 1, 0, 0));
        tabbedViewControl = new JTabbedPane(JTabbedPane.TOP);
        someTabPanel = new TabPanel();
        tabbedViewControl.addTab("Example Tab", someTabPanel);
        mainFrame.getContentPane().add(tabbedViewControl);

        //Display the window.
        mainFrame.setVisible(true);
    }

    public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(() -> {
            createAndShowGUI();
        });
    }
}
</code>```

example.gui.TabPanel.java:

```<code>package example.gui;

import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import com.jgoodies.forms.builder.PanelBuilder;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;

public class TabPanel extends JPanel {

    private static Border       textFieldBorderStyle;
    private static ButtonGroup  userChoiceButtonGroup;
    private static PanelBuilder builder;
    private static FormLayout   layout;
    private static JLabel       descriptionLabel;
    private static JLabel       userChoiceLabel;
    private static JLabel       nameLabel;
    private static JLabel       data2Label;
    private static JLabel       data1Label;
    private static JRadioButton userChoice1RadioButton;
    private static JRadioButton userChoice3RadioButton;
    private static JRadioButton userChoice4RadioButton;
    private static JRadioButton userChoice2RadioButton;
    private static JRadioButton userChoice5RadioButton;
    private static JTextArea    descriptionField;
    private static JTextField   nameField;
    private static JTextField   data2Field;
    private static JTextField   data1Field;
    private static JPanel       subPanel;

    public TabPanel() {
        super(new GridBagLayout());
        initComponents();
    }

    private void initComponents() {
        nameLabel               = new JLabel("Name");
        nameField               = new JTextField();
        descriptionLabel        = new JLabel("Description");
        descriptionField        = new JTextArea("");
        data1Label             = new JLabel("Data No. 1");
        data1Field             = new JTextField();
        data2Label           = new JLabel("Data No. 2");
        data2Field           = new JTextField();
        userChoiceLabel        = new JLabel("User choices");
        userChoiceButtonGroup  = new ButtonGroup();
        userChoice1RadioButton     = new JRadioButton("Choice I");
        userChoice3RadioButton     = new JRadioButton("Choice II");
        userChoice4RadioButton     = new JRadioButton("Choice III");
        userChoice2RadioButton = new JRadioButton("Choice IV");
        userChoice5RadioButton = new JRadioButton("Choice V");

        subPanel = constructPanel();
        this.add(subPanel);
    }

    private JPanel constructPanel() {
        layout = new FormLayout(
            "r:p, 3dlu, l:max(1in;p), 7dlu, r:p, 3dlu, l:p, 3dlu, l:p, 3dlu, l:p",
            "p, 3dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"
        );
        builder = new PanelBuilder(layout);
        CellConstraints cc = new CellConstraints();

        textFieldBorderStyle = nameField.getBorder();
        descriptionField.setBorder(textFieldBorderStyle);

        userChoiceButtonGroup.add(userChoice1RadioButton);
        userChoiceButtonGroup.add(userChoice3RadioButton);
        userChoiceButtonGroup.add(userChoice4RadioButton);
        userChoiceButtonGroup.add(userChoice2RadioButton);
        userChoiceButtonGroup.add(userChoice5RadioButton);

        builder.addSeparator("Name & Description", cc.xyw(1, 1, 3));
        builder.add(nameLabel,        cc.xy  (1, 3));
        builder.add(nameField,        cc.xy  (3, 3));
        builder.add(descriptionLabel, cc.xy  (1, 5));
        builder.add(descriptionField, cc.xywh(3, 5, 1, 4));
        builder.addSeparator("Other Data for the User to Enter", cc.xyw(5, 1, 5));
        builder.add(data1Label,             cc.xy(5,  3));
        builder.add(data1Field,             cc.xy(7,  3));
        builder.add(data2Label,           cc.xy(5,  5));
        builder.add(data2Field,           cc.xy(7,  5));
        builder.add(userChoiceLabel,        cc.xy(5,  7));
        builder.add(userChoice2RadioButton, cc.xy(7,  7));
        builder.add(userChoice5RadioButton, cc.xy(7,  9));
        builder.add(userChoice3RadioButton,     cc.xy(7, 11));
        builder.add(userChoice4RadioButton,     cc.xy(9,  7));
        builder.add(userChoice1RadioButton,     cc.xy(9,  9));

        return builder.getPanel();
    }
}
</code>```

The following is the result:

Ideally, I'd like for three things to occur, rather than above:

The JPanel returned from PanelBuilder to occupy the full dimensions of its parent

The JTextFields and JTextArea to be of reasonable width (and not resize*)

The two aspects to be more proportional - I'm not expecting 50%/50%, but I don't want the right side to squash the left side up against the border

I've done a fair amount of homework on this, but mostly came up with the following non-results:

Attempting to search on SO mainly yields issues with "native" AWT layout systems

Going through the JGoodies Forms whitepaper, while giving me the use of max(constantSize;preferredSize), only assisted in the resizing of the separator, and did nothing re: the JTextFields

So, in short, is there a way to force JTextFields to occupy the given width of their column in a FormLayout?

答:
here is the thing, it is better to use borders to put components in,

```<code>//create title border so later on you can set it to your panel
TitledBorder topBorder = BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.black), "Title message To the border");// you can use more or border type in BorderFactory.class
</code>```

then you put

```<code>// initialize the frame layout
frame.setLayout(new BorderLayout(20, 30));
</code>```

and foreach borders you can define as.

```<code>//create panel and set panel layout depend on whatever you want to choose
//then set panels border to that TitledBorder you have created before
JPanel topPanel= new JPanel();
topPanel.setLayout(new GridLayout(2, 3, 10, 10)); // grid layout can be managed easier and better
topPanel.setBorder(topBorder); // you have defined topBorder before
</code>```

and finally

```<code>// initialize textfiled and add it to toppanel
JTextField yourFiled = new JTextField();
topPanel.add(messageLabel);
</code>```

you can define all the properties to the fields in JTextFiled that you want as well as you can skip first step to create TitledBorder but i always do bcause it is better and more organized

Body:
I'm trying to lay out a basic JPanel using JGoodies.FormLayout and I'm running into an issue where the JTextField components I place remain at minimum size regardless of anything I do to attempt to resolve the issue. Without further ado,

Program.java:

package example;

import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JTabbedPane;
import example.gui.*;

public class Program {

    private static JTabbedPane tabbedViewControl;
    private static TabPanel someTabPanel;

    private static void createAndShowGUI() {
        JFrame mainFrame = new JFrame("Stack Overflow Example");
        mainFrame.setResizable(true);
        mainFrame.setSize(1200, 800);
        mainFrame.setTitle("Example");
        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        mainFrame.getContentPane().setLayout(new GridLayout(1, 1, 0, 0));
        tabbedViewControl = new JTabbedPane(JTabbedPane.TOP);
        someTabPanel = new TabPanel();
        tabbedViewControl.addTab("Example Tab", someTabPanel);
        mainFrame.getContentPane().add(tabbedViewControl);

        //Display the window.
        mainFrame.setVisible(true);
    }

    public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(() -> {
            createAndShowGUI();
        });
    }
}

example.gui.TabPanel.java:

package example.gui;

import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import com.jgoodies.forms.builder.PanelBuilder;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;

public class TabPanel extends JPanel {

    private static Border       textFieldBorderStyle;
    private static ButtonGroup  userChoiceButtonGroup;
    private static PanelBuilder builder;
    private static FormLayout   layout;
    private static JLabel       descriptionLabel;
    private static JLabel       userChoiceLabel;
    private static JLabel       nameLabel;
    private static JLabel       data2Label;
    private static JLabel       data1Label;
    private static JRadioButton userChoice1RadioButton;
    private static JRadioButton userChoice3RadioButton;
    private static JRadioButton userChoice4RadioButton;
    private static JRadioButton userChoice2RadioButton;
    private static JRadioButton userChoice5RadioButton;
    private static JTextArea    descriptionField;
    private static JTextField   nameField;
    private static JTextField   data2Field;
    private static JTextField   data1Field;
    private static JPanel       subPanel;

    public TabPanel() {
        super(new GridBagLayout());
        initComponents();
    }

    private void initComponents() {
        nameLabel               = new JLabel("Name");
        nameField               = new JTextField();
        descriptionLabel        = new JLabel("Description");
        descriptionField        = new JTextArea("");
        data1Label             = new JLabel("Data No. 1");
        data1Field             = new JTextField();
        data2Label           = new JLabel("Data No. 2");
        data2Field           = new JTextField();
        userChoiceLabel        = new JLabel("User choices");
        userChoiceButtonGroup  = new ButtonGroup();
        userChoice1RadioButton     = new JRadioButton("Choice I");
        userChoice3RadioButton     = new JRadioButton("Choice II");
        userChoice4RadioButton     = new JRadioButton("Choice III");
        userChoice2RadioButton = new JRadioButton("Choice IV");
        userChoice5RadioButton = new JRadioButton("Choice V");

        subPanel = constructPanel();
        this.add(subPanel);
    }

    private JPanel constructPanel() {
        layout = new FormLayout(
            "r:p, 3dlu, l:max(1in;p), 7dlu, r:p, 3dlu, l:p, 3dlu, l:p, 3dlu, l:p",
            "p, 3dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"
        );
        builder = new PanelBuilder(layout);
        CellConstraints cc = new CellConstraints();

        textFieldBorderStyle = nameField.getBorder();
        descriptionField.setBorder(textFieldBorderStyle);

        userChoiceButtonGroup.add(userChoice1RadioButton);
        userChoiceButtonGroup.add(userChoice3RadioButton);
        userChoiceButtonGroup.add(userChoice4RadioButton);
        userChoiceButtonGroup.add(userChoice2RadioButton);
        userChoiceButtonGroup.add(userChoice5RadioButton);

        builder.addSeparator("Name & Description", cc.xyw(1, 1, 3));
        builder.add(nameLabel,        cc.xy  (1, 3));
        builder.add(nameField,        cc.xy  (3, 3));
        builder.add(descriptionLabel, cc.xy  (1, 5));
        builder.add(descriptionField, cc.xywh(3, 5, 1, 4));
        builder.addSeparator("Other Data for the User to Enter", cc.xyw(5, 1, 5));
        builder.add(data1Label,             cc.xy(5,  3));
        builder.add(data1Field,             cc.xy(7,  3));
        builder.add(data2Label,           cc.xy(5,  5));
        builder.add(data2Field,           cc.xy(7,  5));
        builder.add(userChoiceLabel,        cc.xy(5,  7));
        builder.add(userChoice2RadioButton, cc.xy(7,  7));
        builder.add(userChoice5RadioButton, cc.xy(7,  9));
        builder.add(userChoice3RadioButton,     cc.xy(7, 11));
        builder.add(userChoice4RadioButton,     cc.xy(9,  7));
        builder.add(userChoice1RadioButton,     cc.xy(9,  9));

        return builder.getPanel();
    }
}

The following is the result:

Ideally, I'd like for three things to occur, rather than above:

The JPanel returned from PanelBuilder to occupy the full dimensions of its parent

The JTextFields and JTextArea to be of reasonable width (and not resize*)

The two aspects to be more proportional - I'm not expecting 50%/50%, but I don't want the right side to squash the left side up against the border

I've done a fair amount of homework on this, but mostly came up with the following non-results:

Attempting to search on SO mainly yields issues with "native" AWT layout systems

Going through the JGoodies Forms whitepaper, while giving me the use of max(constantSize;preferredSize), only assisted in the resizing of the separator, and did nothing re: the JTextFields

So, in short, is there a way to force JTextFields to occupy the given width of their column in a FormLayout?

Body:
here is the thing, it is better to use borders to put components in,

//create title border so later on you can set it to your panel
TitledBorder topBorder = BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.black), "Title message To the border");// you can use more or border type in BorderFactory.class

then you put

// initialize the frame layout
frame.setLayout(new BorderLayout(20, 30));

and foreach borders you can define as.

//create panel and set panel layout depend on whatever you want to choose
//then set panels border to that TitledBorder you have created before
JPanel topPanel= new JPanel();
topPanel.setLayout(new GridLayout(2, 3, 10, 10)); // grid layout can be managed easier and better
topPanel.setBorder(topBorder); // you have defined topBorder before

and finally

// initialize textfiled and add it to toppanel
JTextField yourFiled = new JTextField();
topPanel.add(messageLabel);

you can define all the properties to the fields in JTextFiled that you want as well as you can skip first step to create TitledBorder but i always do bcause it is better and more organized


问:
i try rowspan in table which is not working
hey i tried rowspan in a table to get desired result but result i different from what i want i have also include desired result img and code.. please have a look on code..
thanks

desired result image

            A
            B

            C

            D
            E

            F
            G
            H

            I
            J

            K
            L

           M

```

答:
I've created a table for you, this will work as expected.

https://codesandbox.io/s/rough-river-19qh2?file=/index.html

.tg {
  border-collapse: collapse;
  border-spacing: 0;
}

.tg td {
  border-color: black;
  border-style: solid;
  border-width: 1px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  overflow: hidden;
  padding: 10px 5px;
  word-break: normal;
}

.tg th {
  border-color: black;
  border-style: solid;
  border-width: 1px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: normal;
  overflow: hidden;
  padding: 10px 5px;
  word-break: normal;
}

.tg .tg-73oq {
  border-color: #000000;
  text-align: left;
  vertical-align: top;
}

.tg-addcolspan {
  height: 40px;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><table class="tg">
  <tbody>
    <tr>
      <td class="tg-73oq" colspan="2" rowspan="2">
        sdfsf<br /><br />SDFSF
      </td>
      <td class="tg-73oq" colspan="3">sdfdsf</td>
    </tr>
    <tr>
      <td class="tg-73oq" colspan="3">sdfdsfs</td>
    </tr>
    <tr>
      <td class="tg-73oq">sdsdff</td>
      <td class="tg-73oq">ssdfsfds</td>
      <td class="tg-73oq" rowspan="3">sdfsfsd</td>
      <td class="tg-73oq" rowspan="2">sdfsfsdfs</td>
      <td class="tg-73oq">sdfdsfsdfs</td>
    </tr>
    <tr>
      <td class="tg-73oq" colspan="2" rowspan="3">sdfsfsdfds</td>
      <td class="tg-73oq">sdfsfs</td>
    </tr>
    <tr class="tg-addcolspan">
      <td class="tg-73oq" rowspan="2">dfdfdf</td>
      <td class="tg-73oq" rowspan="2">dsfsdfsd</td>
    </tr>
    <tr>
      <td class="tg-73oq">sdfsfs</td>
    </tr>
  </tbody>
</table></code>```

Body:
I've created a table for you, this will work as expected.

https://codesandbox.io/s/rough-river-19qh2?file=/index.html

.tg {
  border-collapse: collapse;
  border-spacing: 0;
}

.tg td {
  border-color: black;
  border-style: solid;
  border-width: 1px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  overflow: hidden;
  padding: 10px 5px;
  word-break: normal;
}

.tg th {
  border-color: black;
  border-style: solid;
  border-width: 1px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: normal;
  overflow: hidden;
  padding: 10px 5px;
  word-break: normal;
}

.tg .tg-73oq {
  border-color: #000000;
  text-align: left;
  vertical-align: top;
}

.tg-addcolspan {
  height: 40px;
}

<table class="tg">
  <tbody>
    <tr>
      <td class="tg-73oq" colspan="2" rowspan="2">
        sdfsf<br /><br />SDFSF
      </td>
      <td class="tg-73oq" colspan="3">sdfdsf</td>
    </tr>
    <tr>
      <td class="tg-73oq" colspan="3">sdfdsfs</td>
    </tr>
    <tr>
      <td class="tg-73oq">sdsdff</td>
      <td class="tg-73oq">ssdfsfds</td>
      <td class="tg-73oq" rowspan="3">sdfsfsd</td>
      <td class="tg-73oq" rowspan="2">sdfsfsdfs</td>
      <td class="tg-73oq">sdfdsfsdfs</td>
    </tr>
    <tr>
      <td class="tg-73oq" colspan="2" rowspan="3">sdfsfsdfds</td>
      <td class="tg-73oq">sdfsfs</td>
    </tr>
    <tr class="tg-addcolspan">
      <td class="tg-73oq" rowspan="2">dfdfdf</td>
      <td class="tg-73oq" rowspan="2">dsfsdfsd</td>
    </tr>
    <tr>
      <td class="tg-73oq">sdfsfs</td>
    </tr>
  </tbody>
</table>


问:
Apache Ignite Data load in Table format
Can you please assist me on below query. Am loading RDBMS data (dynamic tables) into Ignite cache using below API methods and its loading into cache in JSON format but i would like data in TABLE format as like my source(RDBMS).

API Used:
org.apache.ignite.binary.BinaryObject;
org.apache.ignite.binary.BinaryObjectBuilder;

答:
You should define SQL tables for your caches. You can do it either by specifying queryable fields for existing caches or creating your tables using DDL, in that case, a backed cache will be created automatically.

There is no notion of JSON or other data representation. Ignite stores all data in binary format. It's up to you how to extract or store the values.

I'm not sure why do you use BinaryObjectBuilder, well, it allows you to store values without specifying objects' schema. In most cases, it's totally fine to rely on Apache Ignite internals and allow it to do this binary serialization automatically.

Title: Apache Ignite Data load in Table format


问:
Image taking up lots of space in NavigationView
This is my View:

My Image is taking up all the space. Can I add something to the Image which will make it the same height as the navigation bar (and than the Image should be a small square)? Please no fixed frame solutions, I would expect SwiftUI can be smart enough to figure out how large the Image should be.

This is my code:

```<code>.navigationBarTitleDisplayMode(.inline)
.toolbar {
    // Directly putting a navigation link here does not work: https://stackoverflow.com/questions/63602263/swiftui-toolbaritem-doesnt-present-a-view-from-a-navigationlink
    ToolbarItem(placement: .principal) {
        Button(conversation.title) {
            showConversationDetail = true
        }
        .buttonStyle(.plain)
    }
}
.toolbar {
    ToolbarItem(placement: .navigationBarLeading) {
        Image(...)
            .resizable()
    }
}
</code>```

答:
You can use it like this :</p>
```<code>.navigationBarTitleDisplayMode(.inline)
.toolbar {
    // Directly putting a navigation link here does not work:
https://stackoverflow.com/questions/63602263/swiftui-toolbaritem-doesnt-
present-a-view-from-a-navigationlink
    ToolbarItem(placement: .principal) {
        Button(conversation.title) {
            showConversationDetail = true
        }
        .buttonStyle(.plain)
    }
}
.toolbar {
    ToolbarItem(placement: .navigationBarLeading) {
        Image(...)
            .resizable()
            // .frame(width: 15, height: 15)
            .imageScale(.medium) // or you can use .small or .large accordingly
            .padding(20)
    }
}
</code>```

Body:
This is my View:

My Image is taking up all the space. Can I add something to the Image which will make it the same height as the navigation bar (and than the Image should be a small square)? Please no fixed frame solutions, I would expect SwiftUI can be smart enough to figure out how large the Image should be.

This is my code:

.navigationBarTitleDisplayMode(.inline)
.toolbar {
    // Directly putting a navigation link here does not work: https://stackoverflow.com/questions/63602263/swiftui-toolbaritem-doesnt-present-a-view-from-a-navigationlink
    ToolbarItem(placement: .principal) {
        Button(conversation.title) {
            showConversationDetail = true
        }
        .buttonStyle(.plain)
    }
}
.toolbar {
    ToolbarItem(placement: .navigationBarLeading) {
        Image(...)
            .resizable()
    }
}

Body:
You can use it like this :

.navigationBarTitleDisplayMode(.inline)
.toolbar {
    // Directly putting a navigation link here does not work:
https://stackoverflow.com/questions/63602263/swiftui-toolbaritem-doesnt-
present-a-view-from-a-navigationlink
    ToolbarItem(placement: .principal) {
        Button(conversation.title) {
            showConversationDetail = true
        }
        .buttonStyle(.plain)
    }
}
.toolbar {
    ToolbarItem(placement: .navigationBarLeading) {
        Image(...)
            .resizable()
            // .frame(width: 15, height: 15)
            .imageScale(.medium) // or you can use .small or .large accordingly
            .padding(20)
    }
}


问:
Create an array of object properties for each item that has the same key
I'm merging two objects together to create a filter object. However I want to group the merged objects property values where the keys are the same.

So...

```<code>[{category: 'furniture'}, {category: 'mirrors'}, {availability: 'in_stock'}]
</code>```

becomes

```<code>[{category: ['furniture', 'mirrors']}, {availability: 'in_stock'}]
</code>```

any ideas?

答:
A generic implementation could achieve a merger of any kind of objects regardless of amount and kind of an(y) object's property names.

Since the result of such an implementation is an object, one needs additional treatment in order to cover the OP's requirement(s).

function mergeAndCollectItemEntries(result, item) {
  // return the programmatically aggregated merger/result.
  return Object
    // get an item's entry array.
    .entries(item)
    // for each key-value pair ...
    .reduce((merger, [key, value]) => {

      // ... access and/or create a `key` specific array ...
      // ... and push `value` into this array.
      (merger[key] ??= []).push(value);

      // return the programmatically aggregated merger/result.
      return merger;

    }, result);
}

const sampleData = [
  { category: 'furniture' },
  { category: 'mirrors' },
  { availability: 'in_stock' },
];
const mergedData = sampleData
  .reduce(mergeAndCollectItemEntries, {});

const mergedDataList = Object
  .entries(
    sampleData
      .reduce(mergeAndCollectItemEntries, {})
  )
  .map(entry => Object.fromEntries([entry]));
//.map(([key, value]) => ({ [key]: value }));

console.log({
  sampleData,
  mergedData,
  mergedDataList,
});
console.log(
  Object
    .entries([
        { category: 'furniture', foo: 'baz' },
        { category: 'mirrors', bar: 'bizz' },
        { availability: 'in_stock', bar: 'buzz' },
      ].reduce(
        mergeAndCollectItemEntries, {}
      )
    ).map(
      ([key, value]) => ({ [key]: value })
    //entry => Object.fromEntries([entry])
    )
);```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.as-console-wrapper { min-height: 100%!important; top: 0; }</code>```

Body:
I'm merging two objects together to create a filter object. However I want to group the merged objects property values where the keys are the same.

So...

[{category: 'furniture'}, {category: 'mirrors'}, {availability: 'in_stock'}]

becomes

[{category: ['furniture', 'mirrors']}, {availability: 'in_stock'}]

any ideas?

Body:
A generic implementation could achieve a merger of any kind of objects regardless of amount and kind of an(y) object's property names.

Since the result of such an implementation is an object, one needs additional treatment in order to cover the OP's requirement(s).

function mergeAndCollectItemEntries(result, item) {
  // return the programmatically aggregated merger/result.
  return Object
    // get an item's entry array.
    .entries(item)
    // for each key-value pair ...
    .reduce((merger, [key, value]) => {

      // ... access and/or create a `key` specific array ...
      // ... and push `value` into this array.
      (merger[key] ??= []).push(value);

      // return the programmatically aggregated merger/result.
      return merger;

    }, result);
}

const sampleData = [
  { category: 'furniture' },
  { category: 'mirrors' },
  { availability: 'in_stock' },
];
const mergedData = sampleData
  .reduce(mergeAndCollectItemEntries, {});

const mergedDataList = Object
  .entries(
    sampleData
      .reduce(mergeAndCollectItemEntries, {})
  )
  .map(entry => Object.fromEntries([entry]));
//.map(([key, value]) => ({ [key]: value }));

console.log({
  sampleData,
  mergedData,
  mergedDataList,
});
console.log(
  Object
    .entries([
        { category: 'furniture', foo: 'baz' },
        { category: 'mirrors', bar: 'bizz' },
        { availability: 'in_stock', bar: 'buzz' },
      ].reduce(
        mergeAndCollectItemEntries, {}
      )
    ).map(
      ([key, value]) => ({ [key]: value })
    //entry => Object.fromEntries([entry])
    )
);

.as-console-wrapper { min-height: 100%!important; top: 0; }


问:
Populating js array in blade template
I'm trying to build a javascript array of data for use in flot from the result of a php DB query.

When I'm outputting numbers ($lic->Users) it's fine, but whenever I try to output a string I get a completely blank page in the browser.

I've tried:

{{ $lic->CompanyName }}

"<?php echo $lic->CompanyName; ?>"

{{{ $lic->CompanyName }}}

'"'+ <?php echo $lic->CompanyName; ?> +'"'

But when I hard-code it (to say, 'CompanyName'), it builds the bar graph (& displays the page) just fine.

```<code>var data =
[
    @foreach($licdata as $lic)
    {
    'label': "{{ $lic->CompanyName }}",
    'data': [
                ["{{ $lic->CompanyName }}", {{ $lic->Users }}],
                ["{{ $lic->CompanyName }}", {{ $lic->Emps }}]
            ]
    },
    @endforeach
];
</code>```

I think it must be something to do with quoting/escaping the string in js, but I can't work out what, does anyone know what the correct syntax is?

答:
Easyway https://laravel.com/docs/8.x/blade#rendering-json</p>
```<code><script>
     var app = {{ Js::from($array) }};
</script>
</code>```

Title: Populating js array in blade template

Body:
I'm trying to build a javascript array of data for use in flot from the result of a php DB query.

When I'm outputting numbers ($lic->Users) it's fine, but whenever I try to output a string I get a completely blank page in the browser.

I've tried:

{{ $lic->CompanyName }}

"<?php echo $lic->CompanyName; ?>"

{{{ $lic->CompanyName }}}

'"'+ <?php echo $lic->CompanyName; ?> +'"'

But when I hard-code it (to say, 'CompanyName'), it builds the bar graph (& displays the page) just fine.

var data =
[
    @foreach($licdata as $lic)
    {
    'label': "{{ $lic->CompanyName }}",
    'data': [
                ["{{ $lic->CompanyName }}", {{ $lic->Users }}],
                ["{{ $lic->CompanyName }}", {{ $lic->Emps }}]
            ]
    },
    @endforeach
];

I think it must be something to do with quoting/escaping the string in js, but I can't work out what, does anyone know what the correct syntax is?

Body:
Easyway https://laravel.com/docs/8.x/blade#rendering-json

<script>
     var app = {{ Js::from($array) }};
</script>


问:
Facebook OAuth "The domain of this URL isn't included in the app's domain"
Let me first start with saying I've searched for an answer to this question for quite some time...

I'm trying to setup Facebook OAuth to work with my application that is being developed locally on my machine.  Everything was working perfect with Facebook authorization UNTIL I moved from using localhost to another domain name (still local to my machine.)  Now I'm getting the following error.

Can't Load URL: The domain of this URL isn't included in the app's
domains. To be able to load this URL, add all domains and subdomains
of your app to the App Domains field in your app settings.

My hosts file contains 127.0.0.1   domain.dev  (works perfect)

My redirect in my app (using Socialite) is http://domain.dev/auth/facebook/callback

In my Facebook App Settings...

my App Domain is domain.dev

my Site URL is http://domain.dev/

my Valid OAuth redirect URIs is
http://domain.dev/auth/facebook/callback

The URL at the time of the error message is..

https://www.facebook.com/v2.5/dialog/oauth?client_id=XXXXXXXXXXXXXXX&redirect_uri=http%3A%2F%2Fdomain.dev%2Fauth%2Ffacebook%2Fcallback&scope=email&response_type=code&state=0ztcKhmWwFLtj72TWE8uOKTcf65JmePtG95MZLDD

I'm at a loss of what the problem is...

Screen Shot 1

Screen Shot 2

答: The Meta for Developers interface currently provides two places where you can enter the domains for your app: the Basic settings under "App domains", and the Advanced settings under "Domain Manager". The SDK might not recognize your domain if it is listed in just the Domain Manager.</p>


问:
munmap_chunk(): invalid pointer, memcpy() modifies source pointer?
I am writing a program that extracts a submatrix block (half of source) from a bigger matrix.

The idea is to loop on rows, and copy each row from source matrix with memcpy.

Only problem is when I do  a free() on the initial source matrix I get munmap_chunk() error. I know this happens when I free a pointer that was not allocated by malloc. But this makes no sense here! my mat[i] that I try to free was allocated by malloc. And it was only used as source in memcpy. Is memcpy modifying the source?!

My code looks like this:

```<code>void print(int ** data, size_t m,size_t n)
{

    int i,j;

    printf("\n");
    for(i=0;i<m;i++)
    {    for(j=0;j<n;j++)
        {
            printf("%d ",data[i][j]);
        }
    printf("\n");
    }
}

void init(int** tab, int n,int m ){
    const int size_s = 8;
    int mat[size_s][size_s] = {
        { 1, 2, 3, 4, 5, 6, 7, 8},
        { 9,10,11,12,13,14,15,16},
        {17,18,19,20,21,22,23,24},
        {25,26,27,28,29,30,31,32},
        {33,34,35,36,37,38,39,40},
        {41,42,43,44,45,46,47,48},
        {49,50,51,52,53,54,55,56},
        {57,58,59,60,61,62,63,64}
    };

    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
            tab[i][j]= mat[i][j];
        }
    }
}
</code>```

--Main function

```<code>int main (void){
    const int n = 8;
    int sub_mtrx_size = n/2;
    int ** mat =  malloc(sizeof(int*) * n);
    int ** submat =  malloc(sizeof(int*) * n/2);
    for (int k = 0; k < n; k++) {
        mat[k] =  malloc(sizeof(int) * n);
        if ( k < n/2){
            submat[k] =  malloc(sizeof(int) * (n/2));
        }

    }
    init (mat,n,n);
    // start problem: when doing memcpy this issue happen, commenting this leads to no errors
    memcpy( submat[0] , mat[0], sub_mtrx_size* sizeof(&submat) );
    memcpy( submat[1] , mat[1], sub_mtrx_size* sizeof(&submat) );
    memcpy( submat[2] , mat[2], sub_mtrx_size* sizeof(&submat) );
    memcpy( submat[3] , mat[3], sub_mtrx_size* sizeof(&submat) );
    // end problem

    print(submat,4,4);

      for (int i = 0; i < n; i++)
    {
        // free(mat[i]); // this line creates the problem !
        if ( i < n/2){
            free(submat[i]);
        }
    }
    free (mat);
    free (submat);
    return 0;
}
</code>```

How do I avoid this issue and free the memory properly?

Thanks

答:
Calls of memcpy like this

```<code>memcpy( submat[0] , mat[0], sub_mtrx_size* sizeof(&submat) );
</code>```

is incorrect. The expression sizeof(&submat) gives the size of a pointer of the type int ***.

You need to write

```<code>memcpy( submat[0] , mat[0], sub_mtrx_size* sizeof( int) );
</code>```

or

```<code>memcpy( submat[0] , mat[0], sub_mtrx_size * sizeof( *submat[0] ) );
</code>```

Body:
I am writing a program that extracts a submatrix block (half of source) from a bigger matrix.

The idea is to loop on rows, and copy each row from source matrix with memcpy.

Only problem is when I do  a free() on the initial source matrix I get munmap_chunk() error. I know this happens when I free a pointer that was not allocated by malloc. But this makes no sense here! my mat[i] that I try to free was allocated by malloc. And it was only used as source in memcpy. Is memcpy modifying the source?!

My code looks like this:

void print(int ** data, size_t m,size_t n)
{

    int i,j;

    printf("\n");
    for(i=0;i<m;i++)
    {    for(j=0;j<n;j++)
        {
            printf("%d ",data[i][j]);
        }
    printf("\n");
    }
}

void init(int** tab, int n,int m ){
    const int size_s = 8;
    int mat[size_s][size_s] = {
        { 1, 2, 3, 4, 5, 6, 7, 8},
        { 9,10,11,12,13,14,15,16},
        {17,18,19,20,21,22,23,24},
        {25,26,27,28,29,30,31,32},
        {33,34,35,36,37,38,39,40},
        {41,42,43,44,45,46,47,48},
        {49,50,51,52,53,54,55,56},
        {57,58,59,60,61,62,63,64}
    };

    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
            tab[i][j]= mat[i][j];
        }
    }
}

--Main function

int main (void){
    const int n = 8;
    int sub_mtrx_size = n/2;
    int ** mat =  malloc(sizeof(int*) * n);
    int ** submat =  malloc(sizeof(int*) * n/2);
    for (int k = 0; k < n; k++) {
        mat[k] =  malloc(sizeof(int) * n);
        if ( k < n/2){
            submat[k] =  malloc(sizeof(int) * (n/2));
        }

    }
    init (mat,n,n);
    // start problem: when doing memcpy this issue happen, commenting this leads to no errors
    memcpy( submat[0] , mat[0], sub_mtrx_size* sizeof(&submat) );
    memcpy( submat[1] , mat[1], sub_mtrx_size* sizeof(&submat) );
    memcpy( submat[2] , mat[2], sub_mtrx_size* sizeof(&submat) );
    memcpy( submat[3] , mat[3], sub_mtrx_size* sizeof(&submat) );
    // end problem

    print(submat,4,4);

      for (int i = 0; i < n; i++)
    {
        // free(mat[i]); // this line creates the problem !
        if ( i < n/2){
            free(submat[i]);
        }
    }
    free (mat);
    free (submat);
    return 0;
}

How do I avoid this issue and free the memory properly?

Thanks

Body:
Calls of memcpy like this

memcpy( submat[0] , mat[0], sub_mtrx_size* sizeof(&submat) );

is incorrect. The expression sizeof(&submat) gives the size of a pointer of the type int ***.

You need to write

memcpy( submat[0] , mat[0], sub_mtrx_size* sizeof( int) );

or

memcpy( submat[0] , mat[0], sub_mtrx_size * sizeof( *submat[0] ) );


问:
The artifact has been relocated to
I've an automation testing project which runs by Maven and, I want to add in it an Allure report.

I've added the required dependencies but I get the following warning:

What this means and how can I resolve this ?

The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to
xml-apis:xml-apis:jar:1.0.b2

What is this means and how can I resolve it?

RESULT

XML

```<code><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>auto</groupId>
  <artifactId>auto</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <distributionManagement>
    <relocation>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <message>https://issues.sonatype.org/browse/MVNCENTRAL-244</message>
    </relocation>
  </distributionManagement>
<packaging>jar</packaging>
    <name>AdvancedSelenium</name>
    <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <aspectj.version>1.9.7</aspectj.version>
    </properties>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>4.1.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectj.version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.testng/testng -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.4.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>5.1.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.12.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.30</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>5.0.1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.github.automatedowl/allure-environment-writer -->
        <dependency>
            <groupId>com.github.automatedowl</groupId>
            <artifactId>allure-environment-writer</artifactId>
            <version>1.0.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-testng -->
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-testng</artifactId>
            <version>2.17.1</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                    <systemProperties>
                        <allure.results.directory>${basedir}/target/allure-results</allure.results.directory>
                        <allure.link.issue.pattern>https://example.org/issue/{}</allure.link.issue.pattern>
                        <allure.link.tms.pattern>https://example.org/tms/{}</allure.link.tms.pattern>
                    </systemProperties>
                    <systemPropertyVariables>
                        <testng.dtd.http>true</testng.dtd.http>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-maven -->
            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>2.10.0</version>
            </plugin>
        </plugins>
    </build>
</project>
</code>```

答:
Actually the allure report was not opened because of Firewall block of the antivirus.
After disabling the firewall the report runs despite the Warning message at cmd.

Title: The artifact has been relocated to

Body:
I've an automation testing project which runs by Maven and, I want to add in it an Allure report.

I've added the required dependencies but I get the following warning:

What this means and how can I resolve this ?

The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to
xml-apis:xml-apis:jar:1.0.b2

What is this means and how can I resolve it?

RESULT

XML

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>auto</groupId>
  <artifactId>auto</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <distributionManagement>
    <relocation>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <message>https://issues.sonatype.org/browse/MVNCENTRAL-244</message>
    </relocation>
  </distributionManagement>
<packaging>jar</packaging>
    <name>AdvancedSelenium</name>
    <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <aspectj.version>1.9.7</aspectj.version>
    </properties>
    <dependencies>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>4.1.0</version>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectj.version}</version>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.4.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>5.1.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.12.0</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.30</version>
        </dependency>

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>5.0.1</version>
        </dependency>

        <dependency>
            <groupId>com.github.automatedowl</groupId>
            <artifactId>allure-environment-writer</artifactId>
            <version>1.0.0</version>
        </dependency>

        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-testng</artifactId>
            <version>2.17.1</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                    <systemProperties>
                        <allure.results.directory>${basedir}/target/allure-results</allure.results.directory>
                        <allure.link.issue.pattern>https://example.org/issue/{}</allure.link.issue.pattern>
                        <allure.link.tms.pattern>https://example.org/tms/{}</allure.link.tms.pattern>
                    </systemProperties>
                    <systemPropertyVariables>
                        <testng.dtd.http>true</testng.dtd.http>
                    </systemPropertyVariables>
                </configuration>
            </plugin>

            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>2.10.0</version>
            </plugin>
        </plugins>
    </build>
</project>


问:
Parsing JSON array in Azure Logic App from base64 encoded string to use in For_each
I am trying to iterate through a JSON array which has been encoded to a string for the purpose of storing on a queue. However, I receive the following error message:

{"code":"ExpressionEvaluationFailed","message":"The execution of
  template action 'For_each' failed: The result '[{\"Foo\":\"Bar\"}]' of
  the evaluation of 'foreach' action expression
  '@{json(decodeBase64(triggerBody()['ContentData']))}' is not a valid
  array."}

The following is the string being parsed:
[{"Foo":"Bar"}]

I have no problems parsing a JSON string when it is not in an array, for example:
{"Foo":"Bar"}

This parses just fine when I am not using a For_each.

How do I get the logic app to read this as an array?

答:
```<code> json(decodeBase64(body('HTTP')?['$Content']))
</code>```

enter image description here

Body:
 json(decodeBase64(body('HTTP')?['$Content']))

enter image description here


问:
Connecting via ssh when building app with Jenkins
Tell me please.

I'm using Jenkins to build a project that runs in a docker container and I've run into a problem.

When executing this piece of code:

```<code>stage('deploy front') {
    when { equals expected: 'do', actual: buildFront }
    agent {docker{image 'ebiwd/alpine-ssh'}}

    steps{
        sh 'chmod 400 .iac/privatekey'
        sh "ssh -i   .iac/privatekey ci_user@134.209.181.163"
    }
}
</code>```

I get an error:

+ ssh -i .iac/privatekey ci_user@134.209.181.163

Pseudo-terminal will not be allocated because stdin is not a terminal.

Warning: Permanently added '134.209.181.163' (ECDSA) to the list of
known hosts.

bind: No such file or directory

unix_listener: cannot bind to path:
/root/.ssh/sockets/ci_user@134.209.181.163-22.uzumQ42Zb6Tcr2E9

Moreover, if you execute the following script with your hands in the container, then everything works

```<code>ssh -i   .iac/privatekey ci_user@134.209.181.163
</code>```

container with Jenkins started with docker-compose.yaml

```<code>version: '3.1'
services:
  jenkins:
    image: jenkins/jenkins:2.277.1-lts
    container_name: jenkins
    hostname: jenkins
    restart: always
    user: root
    privileged: true

    ports:
      - 172.17.0.1:8070:8080
      - 50000:50000
    volumes:
      - /opt/docker/jenkins/home:/var/jenkins_home
      - /etc/timezone:/etc/timezone
      - /usr/bin/docker:/usr/bin/docker
      - /etc/localtime:/etc/localtime
      - /var/run/docker.sock:/var/run/docker.sock
</code>```

What could be the problem?

答:
I have the same error in my Gitlab pipelines:

```<code>bind: No such file or directory
unix_listener: cannot bind to path: /root/.ssh/sockets/aap_adm@wp-np2-26.ebi.ac.uk-22.LIXMnQy4cW5klzgB
lost connection
</code>```

I think that the error is related to this changeset.

In particular, the ssh config file requires the path "~/.ssh/sockets" to be present. Since we are not using the script /usr/local/bin/add-ssh-key (custom script created for that image) this path is missing.

I've opened an issue in the image project: Error using the image in CI/CD pipelines #10.

Body:
Tell me please.

I'm using Jenkins to build a project that runs in a docker container and I've run into a problem.

When executing this piece of code:

stage('deploy front') {
    when { equals expected: 'do', actual: buildFront }
    agent {docker{image 'ebiwd/alpine-ssh'}}

    steps{
        sh 'chmod 400 .iac/privatekey'
        sh "ssh -i   .iac/privatekey ci_user@134.209.181.163"
    }
}

I get an error:

+ ssh -i .iac/privatekey ci_user@134.209.181.163

Pseudo-terminal will not be allocated because stdin is not a terminal.

Warning: Permanently added '134.209.181.163' (ECDSA) to the list of
known hosts.

bind: No such file or directory

unix_listener: cannot bind to path:
/root/.ssh/sockets/ci_user@134.209.181.163-22.uzumQ42Zb6Tcr2E9

Moreover, if you execute the following script with your hands in the container, then everything works

ssh -i   .iac/privatekey ci_user@134.209.181.163

container with Jenkins started with docker-compose.yaml

version: '3.1'
services:
  jenkins:
    image: jenkins/jenkins:2.277.1-lts
    container_name: jenkins
    hostname: jenkins
    restart: always
    user: root
    privileged: true

    ports:
      - 172.17.0.1:8070:8080
      - 50000:50000
    volumes:
      - /opt/docker/jenkins/home:/var/jenkins_home
      - /etc/timezone:/etc/timezone
      - /usr/bin/docker:/usr/bin/docker
      - /etc/localtime:/etc/localtime
      - /var/run/docker.sock:/var/run/docker.sock

What could be the problem?

Body:
I have the same error in my Gitlab pipelines:

bind: No such file or directory
unix_listener: cannot bind to path: /root/.ssh/sockets/aap_adm@wp-np2-26.ebi.ac.uk-22.LIXMnQy4cW5klzgB
lost connection

I think that the error is related to this changeset.

In particular, the ssh config file requires the path "~/.ssh/sockets" to be present. Since we are not using the script /usr/local/bin/add-ssh-key (custom script created for that image) this path is missing.

I've opened an issue in the image project: Error using the image in CI/CD pipelines #10.


问:
IE 11 react 'promise' is undefined
I am trying to load a page which is built using react. when the page loads there is a table which is rendered using react. this table doesn't load currently on IE and throws error promise is not defined. the exact same code with promise works on other browsers. below is the code.

```<code>fetchData(url) {
    // Return a new promise.
    return new Promise(function (resolve, reject) {
        $.ajax(
            {
                url: url,
                cache: false,
                context: this,
                dataType: 'json',   // we're expecting JSON as a response
                data: {},
                method: "GET",
                contentType: "application/json; charset=utf-8",
                success: function (data, status, xhr) {
                    resolve(JSON.parse(data));
                },
                error: function (xhr, status, httpErrorText) {
                    reject(httpErrorText);
                }
            });
    });
}
</code>```

any ideas why this is happening and how to fix this.

答:
I had the same issue. I added the following line in public/index.html which fixed all IE11 polyfills and it worked:

```<code><script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6"></script>
</code>```

Title: IE 11 react 'promise' is undefined

Body:
I am trying to load a page which is built using react. when the page loads there is a table which is rendered using react. this table doesn't load currently on IE and throws error promise is not defined. the exact same code with promise works on other browsers. below is the code.

fetchData(url) {
    // Return a new promise.
    return new Promise(function (resolve, reject) {
        $.ajax(
            {
                url: url,
                cache: false,
                context: this,
                dataType: 'json',   // we're expecting JSON as a response
                data: {},
                method: "GET",
                contentType: "application/json; charset=utf-8",
                success: function (data, status, xhr) {
                    resolve(JSON.parse(data));
                },
                error: function (xhr, status, httpErrorText) {
                    reject(httpErrorText);
                }
            });
    });
}

any ideas why this is happening and how to fix this.

Body:
I had the same issue. I added the following line in public/index.html which fixed all IE11 polyfills and it worked:

<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6"></script>