问:
How to use Graph SDK to make calls with already obtained access token
I have an C# application that uses MSAL to retreive an access token for the user that is logging in.
I now want to find out, which groups are assigned to that user via the access token using the Graph SDK.

I did figure out to make a call to the api using a normal http request but the result is a JSON string that i somehow cant figure out to use correctly.

I was using google to find examples on how to do it but i only could find examples where the access token of the user is used.

Are there any resources i did miss?

I did the following but are somehow unable to handle the returned json string

```<code>//get usergroups via MS Graph using the UserAccessToken
var httpClient = new HttpClient();
var httpRequest = new HttpRequestMessage(HttpMethod.Get, "https://graph.microsoft.com/v1.0/me/transitiveMemberOf/microsoft.graph.group?$select=displayName");
ttpRequest.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", globals.UserAccessToken);
var response = await httpClient.SendAsync(httpRequest);
string groups = await response.Content.ReadAsStringAsync();
</code>```

I either want the different displayNames as an array or a way to use the Graph SDK so i can access them that way.

Body:
I have an C# application that uses MSAL to retreive an access token for the user that is logging in.
I now want to find out, which groups are assigned to that user via the access token using the Graph SDK.

I did figure out to make a call to the api using a normal http request but the result is a JSON string that i somehow cant figure out to use correctly.

I was using google to find examples on how to do it but i only could find examples where the access token of the user is used.

Are there any resources i did miss?

I did the following but are somehow unable to handle the returned json string

//get usergroups via MS Graph using the UserAccessToken
var httpClient = new HttpClient();
var httpRequest = new HttpRequestMessage(HttpMethod.Get, "https://graph.microsoft.com/v1.0/me/transitiveMemberOf/microsoft.graph.group?$select=displayName");
ttpRequest.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", globals.UserAccessToken);
var response = await httpClient.SendAsync(httpRequest);
string groups = await response.Content.ReadAsStringAsync();

I either want the different displayNames as an array or a way to use the Graph SDK so i can access them that way.


来源: stackexchange

问:
Simple aplication runs in phone not in emulator
I just installed all the things to develope for android with eclipse.
I made a simple application.
I run it in my Phone and it looks like working.
I tryed to run it in the emulator but It show me this long text in the console.
Thanks for your time

```<code>java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doSyncApp(AndroidLaunchController.java:871)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.syncApp(AndroidLaunchController.java:844)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(AndroidLaunchController.java:1487)
    at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:868)
    at com.android.ddmlib.Device.update(Device.java:398)
    at com.android.ddmlib.Client.update(Client.java:835)
    at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)
    at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)
    at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

[2011-09-19 14:51:39 - ddms]null
java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doSyncApp(AndroidLaunchController.java:871)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.syncApp(AndroidLaunchController.java:844)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(AndroidLaunchController.java:1487)
    at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:868)
    at com.android.ddmlib.Device.update(Device.java:398)
    at com.android.ddmlib.Client.update(Client.java:835)
    at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)
    at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)
    at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

[2011-09-19 14:56:00 - ddms]null
java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doSyncApp(AndroidLaunchController.java:871)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.syncApp(AndroidLaunchController.java:844)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(AndroidLaunchController.java:1487)
    at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:868)
    at com.android.ddmlib.Device.update(Device.java:398)
    at com.android.ddmlib.Client.update(Client.java:835)
    at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)
    at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)
    at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

private static final int CAMERA_WIDTH = 480;
private static final int CAMERA_HEIGHT = 800;
private Camera mCamera;

private Font mFont;
private Texture mFontTexture;

private ChangeableText textoOut;

@Override
public Engine onLoadEngine() {
     this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
     return new Engine(new EngineOptions(true, ScreenOrientation.PORTRAIT, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));

}

@Override
public void onLoadResources() {

    // FUENTES
    this.mFontTexture = new Texture(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mFont = FontFactory.createFromAsset(this.mFontTexture, this, "font/Droid.ttf", 32, true, Color.BLACK);
    this.mEngine.getTextureManager().loadTextures(this.mFontTexture);
    this.mEngine.getFontManager().loadFonts(this.mFont);

}

@Override
public Scene onLoadScene() {
    this.mEngine.registerUpdateHandler(new FPSLogger());
    final Scene scene = new Scene(1);
    scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));
    textoOut = new ChangeableText(50, 50, mFont,"Hola mundo");
    scene.attachChild(textoOut);

    // TODO Auto-generated method stub
    return scene;
}

@Override
public void onLoadComplete() {

}
</code>```

}

ContentLicense: CC BY-SA 3.0

Body:
I just installed all the things to develope for android with eclipse.
I made a simple application.
I run it in my Phone and it looks like working.
I tryed to run it in the emulator but It show me this long text in the console.
Thanks for your time

java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doSyncApp(AndroidLaunchController.java:871)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.syncApp(AndroidLaunchController.java:844)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(AndroidLaunchController.java:1487)
    at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:868)
    at com.android.ddmlib.Device.update(Device.java:398)
    at com.android.ddmlib.Client.update(Client.java:835)
    at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)
    at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)
    at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

[2011-09-19 14:51:39 - ddms]null
java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doSyncApp(AndroidLaunchController.java:871)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.syncApp(AndroidLaunchController.java:844)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(AndroidLaunchController.java:1487)
    at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:868)
    at com.android.ddmlib.Device.update(Device.java:398)
    at com.android.ddmlib.Client.update(Client.java:835)
    at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)
    at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)
    at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

[2011-09-19 14:56:00 - ddms]null
java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doSyncApp(AndroidLaunchController.java:871)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.syncApp(AndroidLaunchController.java:844)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(AndroidLaunchController.java:1487)
    at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:868)
    at com.android.ddmlib.Device.update(Device.java:398)
    at com.android.ddmlib.Client.update(Client.java:835)
    at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)
    at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)
    at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

private static final int CAMERA_WIDTH = 480;
private static final int CAMERA_HEIGHT = 800;
private Camera mCamera;

private Font mFont;
private Texture mFontTexture;

private ChangeableText textoOut;

@Override
public Engine onLoadEngine() {
     this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
     return new Engine(new EngineOptions(true, ScreenOrientation.PORTRAIT, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));

}

@Override
public void onLoadResources() {

    // FUENTES
    this.mFontTexture = new Texture(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mFont = FontFactory.createFromAsset(this.mFontTexture, this, "font/Droid.ttf", 32, true, Color.BLACK);
    this.mEngine.getTextureManager().loadTextures(this.mFontTexture);
    this.mEngine.getFontManager().loadFonts(this.mFont);

}

@Override
public Scene onLoadScene() {
    this.mEngine.registerUpdateHandler(new FPSLogger());
    final Scene scene = new Scene(1);
    scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));
    textoOut = new ChangeableText(50, 50, mFont,"Hola mundo");
    scene.attachChild(textoOut);

    // TODO Auto-generated method stub
    return scene;
}

@Override
public void onLoadComplete() {

}

}


问:
How to decode scapy's sniffer data?
Am trying to make a sniffing program for learning and while making the code with scapy I see that the data is not readable.

Here's the code:

import scapy.all as scapy
from scapy.layers import http
import optparse

parser = optparse.OptionParser()
parser.add_option('-i', '--interface', dest='interface', help='Interface to be sniffed.')
opt, args = parser.parse_args()

sniff_interface = opt.interface

def sniff(interface):
    scapy.sniff(iface=interface, store=False, prn=packet_process)

def packet_process(packet):
    # if packet.haslayer(http.HTTPRequest):
        # print(packet)
    anotherpacket = "".join(map(chr, bytes(packet)))
    print(anotherpacket)

sniff(sniff_interface)
```

I tried many decoding options that I saw previously answered here on stackoverflow but none of them worked which means, they didn't decode it. The closest I have been is this here.

The only time this worked correctly was with scapy's HTTP layer that when I ran it with python2 it displayed the human readable format.

ContentLicense: CC BY-SA 4.0

Title: How to decode scapy's sniffer data?

Body:
Am trying to make a sniffing program for learning and while making the code with scapy I see that the data is not readable.

Here's the code:

import scapy.all as scapy
from scapy.layers import http
import optparse

parser = optparse.OptionParser()
parser.add_option('-i', '--interface', dest='interface', help='Interface to be sniffed.')
opt, args = parser.parse_args()

sniff_interface = opt.interface

def sniff(interface):
    scapy.sniff(iface=interface, store=False, prn=packet_process)

def packet_process(packet):
    # if packet.haslayer(http.HTTPRequest):
        # print(packet)
    anotherpacket = "".join(map(chr, bytes(packet)))
    print(anotherpacket)

sniff(sniff_interface)

I tried many decoding options that I saw previously answered here on stackoverflow but none of them worked which means, they didn't decode it. The closest I have been is this here.

The only time this worked correctly was with scapy's HTTP layer that when I ran it with python2 it displayed the human readable format.


问:
Updating UI asynchronously isn't working for native android application
I have a list view in the home screen widget of my android app which fetches items from a database and then updates values in the listview. Since AsyncTask is deprecated, I have tried to use handler. The add item method outside the execute method is working, but the code inside post method(which is dependent on the fetched data) isn't working. Where am I going wrong?

val todosRemoteView = RemoteViews.RemoteCollectionItems.Builder()
val handler: Handler = Handler(Looper.getMainLooper())
val backgroundExecutor = Executors.newSingleThreadScheduledExecutor()

backgroundExecutor.execute {
    val db = Room.databaseBuilder(
        context,
        AppDatabase::class.java, "db"
    ).build()
    val todosDAO = db.TodoDAO()
    val todos: List<Todo> = todosDAO.getByTimeType(timeTypeHash[timeType]!!)

    handler.post {
        Log.d("debugging", "all the todos for ${timeTypeHash[timeType]} are $todos")
        for (todo in todos) {
            val view = RemoteViews(context.packageName, R.layout.each_todo).apply {
                setTextViewText(R.id.each_todo_container_text, todo.taskName)
                setCompoundButtonChecked(
                    R.id.each_todo_container_checkbox,
                    todo.finished!!
                )
            }
            todosRemoteView.addItem(
                todo.id.toString().toInt().toLong(),
                                    view
            )//this doesn't works
        }
        Log.d("debugging", "update is triggered");
    }
}

todosRemoteView.addItem(//this works
849938,
RemoteViews(context.packageName, R.layout.each_todo).apply {
    setTextViewText(R.id.each_todo_container_text, "random")
    setCompoundButtonChecked(
        R.id.each_todo_container_checkbox,
        false
    )
})
setRemoteAdapter(
    R.id.todos_list,
    todosRemoteView
    .build()
)
```


问:
Trying to use docker-compose but unknown error happens
I am trying to install traggo docker. I have the latest docker and latest docker CE installed.

docker-compose.yml:

```<code>services:
  traggo:
    image: traggo/server:latest
    ports:
      - 3030:3030
    environment:
      TRAGGO_DEFAULT_USER_NAME: "admin"
      TRAGGO_DEFAULT_USER_PASS: "mynewpassword"
    volumes:
      - ./traggodata:/opt/traggo/data
</code>```

When I try to run the docker-compose up -d command, I get following errors. I have never seen these errors before:

```<code>mead650@mead650-vm:~/docker/traggo$ sudo docker-compose up -d && docker-compose logs -f
Creating traggo_traggo_1 ... done
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 704, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 399, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 440, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 786, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3/dist-packages/six.py", line 718, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 704, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 399, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/usr/lib/python3/dist-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 501, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options
    return get_project(
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 152, in get_project
    client = get_client(
  File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 41, in get_client
    client = docker_client(
  File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 170, in docker_client
    client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))
</code>```

I tried traggo's directions, and they do not have the help or Google search. I have two machines with docker and protainor installed. I have Ubuntu Server, the latest version. I never have issues with using docker-compose from the ether of these machines.

Body:
I am trying to install traggo docker. I have the latest docker and latest docker CE installed.

docker-compose.yml:

services:
  traggo:
    image: traggo/server:latest
    ports:
      - 3030:3030
    environment:
      TRAGGO_DEFAULT_USER_NAME: "admin"
      TRAGGO_DEFAULT_USER_PASS: "mynewpassword"
    volumes:
      - ./traggodata:/opt/traggo/data

When I try to run the docker-compose up -d command, I get following errors. I have never seen these errors before:

mead650@mead650-vm:~/docker/traggo$ sudo docker-compose up -d && docker-compose logs -f
Creating traggo_traggo_1 ... done
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 704, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 399, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 440, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 786, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3/dist-packages/six.py", line 718, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 704, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 399, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/usr/lib/python3/dist-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 501, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options
    return get_project(
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 152, in get_project
    client = get_client(
  File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 41, in get_client
    client = docker_client(
  File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 170, in docker_client
    client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))

I tried traggo's directions, and they do not have the help or Google search. I have two machines with docker and protainor installed. I have Ubuntu Server, the latest version. I never have issues with using docker-compose from the ether of these machines.


问:
GuardTek API - Refernce Issue
I am using GuardTek APIs which are in SOUP. I am using their Docs but I am having issues understanding them.
https://s3.guardtek.net/Report/WebServices/SettingsService.asmx

I want to use https://s3.guardtek.net/Report/WebServices/SettingsService.asmx?op=GetShiftDetails  GetShiftInfo API but I am unable to understand what is meant by Reference and where I can find it .
Below is my code.

```<code>
url = "https://s3.guardtek.net/Report/WebServices/SettingsService.asmx"
payload = """

<?xml version="1.0" encoding="utf-8"?>
                <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
                  <soap:Body>
                    <GetShiftDetails xmlns="http://www.alphasystem.fr/WebServices/GuardTek/Settings">
                      <apiKey>XXX-XXX-XXX</apiKey>
                      <startDateUtc>1670232908</startDateUtc>
                      <endDateUtc>1670243708</endDateUtc>
                      <includeBreakList>false</includeBreakList>
                      <userReference>salman</userReference>
                      <guardroomReference>NADEEM Muhammad</guardroomReference>
                      <shiftReference>salman</shiftReference>
                    </GetShiftDetails>
                  </soap:Body>
                </soap:Envelope>

        """
headers = {
    'Content-Type': 'text/xml; charset=utf-8'
}
response = requests.request("POST", url, headers=headers, data=payload)

</code>```

In Response I am getting this . An empty data.

```<code><?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetShiftDetailsResponse xmlns="http://www.alphasystem.fr/WebServices/GuardTek/Settings" /></soap:Body></soap:Envelope>
</code>```

I want to know What is meant by reference here and how can I find it

I have tried giving fake names in reference parameters and getting 200 response. But data is empty.

Title: GuardTek API - Refernce Issue

Body:
I am using GuardTek APIs which are in SOUP. I am using their Docs but I am having issues understanding them.
https://s3.guardtek.net/Report/WebServices/SettingsService.asmx

I want to use https://s3.guardtek.net/Report/WebServices/SettingsService.asmx?op=GetShiftDetails  GetShiftInfo API but I am unable to understand what is meant by Reference and where I can find it .
Below is my code.

url = "https://s3.guardtek.net/Report/WebServices/SettingsService.asmx"
payload = """

<?xml version="1.0" encoding="utf-8"?>
                <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
                  <soap:Body>
                    <GetShiftDetails xmlns="http://www.alphasystem.fr/WebServices/GuardTek/Settings">
                      <apiKey>XXX-XXX-XXX</apiKey>
                      <startDateUtc>1670232908</startDateUtc>
                      <endDateUtc>1670243708</endDateUtc>
                      <includeBreakList>false</includeBreakList>
                      <userReference>salman</userReference>
                      <guardroomReference>NADEEM Muhammad</guardroomReference>
                      <shiftReference>salman</shiftReference>
                    </GetShiftDetails>
                  </soap:Body>
                </soap:Envelope>

        """
headers = {
    'Content-Type': 'text/xml; charset=utf-8'
}
response = requests.request("POST", url, headers=headers, data=payload)

In Response I am getting this . An empty data.

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetShiftDetailsResponse xmlns="http://www.alphasystem.fr/WebServices/GuardTek/Settings" /></soap:Body></soap:Envelope>

I want to know What is meant by reference here and how can I find it

I have tried giving fake names in reference parameters and getting 200 response. But data is empty.


问:
Linking main (existing) branch to an issue with GitHub
Simple repo with a single main branch. I am trying to link an issue to the main branch (feature avail since Sep 2022.)

I follow the steps to link an existing branch to an Issue here

And I get the error: "No matching pull requests or branches could be found." and can't proceed further.

What am I missing?


问:
XCTestCase runsForEachTargetApplicationUIConfiguration not working as expected
Overriding this method of XCTestCase to return true should run the tests once for each UI configuration an app supports. Documentation

What I get is this (screenshot) having 4 languages3 iPhone orientations, light/dark mode:

far more Italian tests than other languages

only landscape right is triggered, never landscape left

Expectation: exactly 1 test for every language, orientation, light/dark mode

I tried to narrow down the problem: removing the landscape right orientation will make the landscape left orientation work. But then also the count still is wrong.

Is there more documentation about this? Or might this simply be a bug? Any hint is welcome. Thanks in advance.


问:
How to pass a list of objects from view
So I'm dynamically creating sections for my objects, where the entered values would be passed to the controller, but I'm having trouble with indexing. Sometimes it works and I think the problem is with my jQuery code, where some some functions are asynchronous and the indexing gets skipped.

The form submit should return a list of KPIs with KPI value, Name and employeeGID. In this example it should return a List of 4 elements, but it returns only one, because it skips 1 and 2 and goes straight to 3

In View HTML code I just have this div to indicate the place to append sections:

```<code><div id="criteriaSections">
            </div>
</code>```

Scripts:

```<code>var kpiCount = 0;

function createCriteriaSection(criteria) {
    var criterias = @Html.Raw(Json.Serialize(Model.Criterias));

    for (var i = 0; i < criterias.length; i++)
    {
        if (criterias[i].id == criteria.value)
        {
            var critID = criteria.value;
            if (criterias[i].isIndividual)
            {
                var section =
                    `<div class="settings">
                <fieldset>
                    <legend>${criteria.text}</legend>
                        <table id="assignIndividualTable">
                        <thead>
                            <tr>
                                <th style="width:25%; text-align:center">
                                    <label>Employee</label>
                                </th>
                                <th style="width: 65%; text-align: center">
                                    <label>KPI Name</label>
                                </th>
                                <th style="width: 10%; text-align: center">
                                    <label>Value</label>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </fieldset>
            </div>`;
                $("#criteriaSections").append(section);
                showIndividualCiteriaEmployees(critID);
            }
            else
            {
                var section =
                    `<div class="settings">
                <fieldset>
                    <legend>${criteria.text}</legend>
                        <div>
                            <label>KPI Name:  <input type="text" name="KPI[${kpiCount}].Name" class="form-control" required></label>
                            <label>Value:  <input type="text" name="KPI[${kpiCount}].Value" class="form-control" required></label>
                            <input name="KPI[${kpiCount}].CriteriaID" value="${critID}" type="hidden" />
                            <input name="employeeGID[${kpiCount}]" class="form-control" value="" type="hidden"/>
                        </div>
                </fieldset>
            </div>`;
                $("#criteriaSections").append(section);
                kpiCount++;
            }
        }
    }
}

function showIndividualCiteriaEmployees(critID) {
    var resultLength = 0;
    $.post("/KPIs/GetFilteredUsers", { critID: critID }, function (result) {
        resultLength = result.length;
        var rows = "";
        $.each(result, function (i, item) {
            rows +=
                `<tr>
                     <td style="width:20%; text-align:center">
                        <p>${item.text}</p>
                        <input name="employeeGID[${kpiCount + i}]" class="form-control" value="${item.value}" type="hidden"/>
                        <input name="KPI[${kpiCount}].CriteriaID" value="${critID}" type="hidden" />
                    </td>
                    <td style="width:65%; text-align:center">
                        <input type="text" name="KPI[${kpiCount}].Name" class="form-control" required/>
                    </td>
                        <td style="width:15%; text-align:center">
                        <input type="text" name="KPI[${kpiCount}].Value" class="form-control" required/>
                    </td>
                 </tr>`;
                kpiCount++;
        });
        $("#assignIndividualTable tbody").html(rows);
    });
}
</code>```

Controller:

```<code>[HttpPost]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> Create([Bind("Date,Name,Value,ID,CriteriaID,Employee")] List<KPI> KPI, List<string> employeeGID)
    {
        int? id = HttpContext.Session.GetInt32("ID");

        if (ModelState.IsValid)
        {
            for (int i = 0; i < KPI.Count; i++)
            {
                KPI[i].ManagersId = id.GetValueOrDefault();

                KPI[i].Criteria = await _context.Criterias.FirstOrDefaultAsync(x => x.ID == KPI[i].CriteriaID);

                if (KPI[i].Criteria.IsIndividual)
                {
                    KPI[i].EmployeeId = _context.Users.First(x => employeeGID[i] == x.GID).ID;
                }
            }
            _context.AddRange(KPI);
            await _context.SaveChangesAsync();
            return Create();
        }

        return Create();
    }
</code>```

Title: How to pass a list of objects from view

Body:
So I'm dynamically creating sections for my objects, where the entered values would be passed to the controller, but I'm having trouble with indexing. Sometimes it works and I think the problem is with my jQuery code, where some some functions are asynchronous and the indexing gets skipped.

The form submit should return a list of KPIs with KPI value, Name and employeeGID. In this example it should return a List of 4 elements, but it returns only one, because it skips 1 and 2 and goes straight to 3

In View HTML code I just have this div to indicate the place to append sections:

Scripts:

var kpiCount = 0;

function createCriteriaSection(criteria) {
    var criterias = @Html.Raw(Json.Serialize(Model.Criterias));

    for (var i = 0; i < criterias.length; i++)
    {
        if (criterias[i].id == criteria.value)
        {
            var critID = criteria.value;
            if (criterias[i].isIndividual)
            {
                var section =
                    `

                <fieldset>
                    <legend>${criteria.text}</legend>

                                    Employee

                                    KPI Name

                                    Value

                </fieldset>

`;
                $("#criteriaSections").append(section);
                showIndividualCiteriaEmployees(critID);
            }
            else
            {
                var section =
                    `

                <fieldset>
                    <legend>${criteria.text}</legend>

                            KPI Name:  <input type="text" name="KPI[${kpiCount}].Name" class="form-control" required>
                            Value:  <input type="text" name="KPI[${kpiCount}].Value" class="form-control" required>
                            <input name="KPI[${kpiCount}].CriteriaID" value="${critID}" type="hidden" />
                            <input name="employeeGID[${kpiCount}]" class="form-control" value="" type="hidden"/>

                </fieldset>

`;
                $("#criteriaSections").append(section);
                kpiCount++;
            }
        }
    }
}

function showIndividualCiteriaEmployees(critID) {
    var resultLength = 0;
    $.post("/KPIs/GetFilteredUsers", { critID: critID }, function (result) {
        resultLength = result.length;
        var rows = "";
        $.each(result, function (i, item) {
            rows +=
                `

${item.text}

                        <input name="employeeGID[${kpiCount + i}]" class="form-control" value="${item.value}" type="hidden"/>
                        <input name="KPI[${kpiCount}].CriteriaID" value="${critID}" type="hidden" />

                        <input type="text" name="KPI[${kpiCount}].Name" class="form-control" required/>

                        <input type="text" name="KPI[${kpiCount}].Value" class="form-control" required/>

`;
                kpiCount++;
        });
        $("#assignIndividualTable tbody").html(rows);
    });
}

Controller:

[HttpPost]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> Create([Bind("Date,Name,Value,ID,CriteriaID,Employee")] List<KPI> KPI, List<string> employeeGID)
    {
        int? id = HttpContext.Session.GetInt32("ID");

        if (ModelState.IsValid)
        {
            for (int i = 0; i < KPI.Count; i++)
            {
                KPI[i].ManagersId = id.GetValueOrDefault();

                KPI[i].Criteria = await _context.Criterias.FirstOrDefaultAsync(x => x.ID == KPI[i].CriteriaID);

                if (KPI[i].Criteria.IsIndividual)
                {
                    KPI[i].EmployeeId = _context.Users.First(x => employeeGID[i] == x.GID).ID;
                }
            }
            _context.AddRange(KPI);
            await _context.SaveChangesAsync();
            return Create();
        }

        return Create();
    }


问:
How to signed the previous commits in github?
I have a github repository  and committed some PRs. But some of them are signed and some not. So I need 30 commits to be signed. When try to follow this GPG sign old commits with the command

```<code>git filter-branch -f --commit-filter 'git commit-tree -S "$@";' ea20010..HEAD
</code>```

I got this output

Rewrite cf1fb7648c85c8ad41691bfbe3d41e5735fddef5 (17/303) (6 seconds
passed, remaining 100 predicted)

means 303 commits , but I need only 30 to be signed. So what is wrong. Also I tried this solution Retroactively Sign Git Commits , but with the command git rebase -i ea20010 I got many (over 20) auto merging conflict

... Auto-merging test_scripts/dummy_user_input_data_publisher.py
CONFLICT (content): Merge conflict in
test_scripts/dummy_user_input_data_publisher.py ...

So none of the two solutions work. Any help?

Body:
I have a github repository  and committed some PRs. But some of them are signed and some not. So I need 30 commits to be signed. When try to follow this GPG sign old commits with the command

git filter-branch -f --commit-filter 'git commit-tree -S "$@";' ea20010..HEAD

I got this output

Rewrite cf1fb7648c85c8ad41691bfbe3d41e5735fddef5 (17/303) (6 seconds
passed, remaining 100 predicted)

means 303 commits , but I need only 30 to be signed. So what is wrong. Also I tried this solution Retroactively Sign Git Commits , but with the command git rebase -i ea20010 I got many (over 20) auto merging conflict

... Auto-merging test_scripts/dummy_user_input_data_publisher.py
CONFLICT (content): Merge conflict in
test_scripts/dummy_user_input_data_publisher.py ...

So none of the two solutions work. Any help?


问:
Laplace transform of equations in sympy
I want to do a laplace transform of an equation or a system of equations. The following works for one equation (sympy 1.11.1)

```<code>import sympy as sy
from sympy.integrals.transforms import laplace_transform as LT

t=sy.Symbol('t')
s=sy.Symbol('s')
Q=sy.Function('Q')
I0=sy.Function('I0')

ode = sy.Eq( sy.diff(Q(t),t,2) , Q(t) + I0(t))
ode_s = sy.Eq( LT( ode.lhs,t,s) , LT( ode.rhs,t,s))
Lq=sy.solve( ode_s , LT(Q(t),t,s) )[0]
display( Lq )
</code>```

Is there a way to directly transform an equation or a system ( e.g. LT( eq ) or LT( (eq1,e2) )  ). Its not a big deal to write a function doing that but I was just wondering if sympy can do that directly.

Title: Laplace transform of equations in sympy

Body:
I want to do a laplace transform of an equation or a system of equations. The following works for one equation (sympy 1.11.1)

import sympy as sy
from sympy.integrals.transforms import laplace_transform as LT

t=sy.Symbol('t')
s=sy.Symbol('s')
Q=sy.Function('Q')
I0=sy.Function('I0')

ode = sy.Eq( sy.diff(Q(t),t,2) , Q(t) + I0(t))
ode_s = sy.Eq( LT( ode.lhs,t,s) , LT( ode.rhs,t,s))
Lq=sy.solve( ode_s , LT(Q(t),t,s) )[0]
display( Lq )

Is there a way to directly transform an equation or a system ( e.g. LT( eq ) or LT( (eq1,e2) )  ). Its not a big deal to write a function doing that but I was just wondering if sympy can do that directly.


问:
How do you upgrade webpack-dev-server from v3 to v4?
I have been struggling with an issue with hot reloading where making edits in certain files would reload the app without those changes.

My initial solution was to update webpack and related modules. The first module I updated was webpack-dev-server. I went from v3 to v4 which immediately broke the app. All images and json files were getting 404'd when running the dev server.
Here is the original package.json:

```<code>{
  ...
  "scripts": {
    "dev": "set NODE_ENV=development && webpack serve --config config/webpack.dev.js --open",
    "build": "set NODE_ENV=production && webpack --config config/webpack.prod.js",
    "beatmarkers": "babel-node fetchAndFormatData/fetchAndFormatBeatMarkers.js"
  },
  "devDependencies": {
    "@babel/cli": "^7.14.3",
    "@babel/core": "^7.14.3",
    "@babel/node": "^7.14.2",
    "@babel/preset-env": "^7.14.4",
    "clean-webpack-plugin": "^4.0.0-alpha.0",
    "css-loader": "^5.2.6",
    "file-loader": "^6.2.0",
    "html-webpack-plugin": "^5.3.1",
    "lodash.clonedeep": "^4.5.0",
    "node-fetch": "^2.6.1",
    "node-sass": "^6.0.0",
    "sass-loader": "^11.1.1",
    "style-loader": "^2.0.0",
    "webpack": "^5.38.1",
    "webpack-cli": "^4.7.0",
    "webpack-dev-server": "^3.11.2",
    "webpack-merge": "^5.7.3"
  },
  "dependencies": {
    "bezier-easing": "^2.1.0",
    "howler": "^2.2.3",
    "pixi.js": "^6.2.0"
  }
}
</code>```

Here are the original webpack config files:

```<code>const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: './src/app.js',
  plugins: [
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, '../src/template.html')
    })
  ],
  module: {
    rules: [
      {
        test: /\.(png|jpe?g|gif|svg|ico|pvr|mp3|fnt)$/,
        type: 'asset/resource'
      },
      {
        test: /\.scss$/,
        use: ['style-loader', 'css-loader', 'sass-loader']
      }
    ]
  }
};
</code>```

```<code>const { merge } = require('webpack-merge');

const common = require('./webpack.common');

module.exports = merge(common, {
  mode: 'development',
  devServer: {
    historyApiFallback: true,
  },
  output: {
    publicPath: '/'
  },
  devtool: "source-map"
});
</code>```

This configuration produces a sources structure in chrome that looks like this:

```<code>localhost:8080
    main.js
    (index)
    assets/images
        animations
        fonts
        interface
</code>```

When I updated webpack-dev-server to the latest version, 4.11.1, the assets/images folder no longer exists. I haven't be able to figure out how to get it back. Any help would be deeply appreciated.

Body:
I have been struggling with an issue with hot reloading where making edits in certain files would reload the app without those changes.

My initial solution was to update webpack and related modules. The first module I updated was webpack-dev-server. I went from v3 to v4 which immediately broke the app. All images and json files were getting 404'd when running the dev server.
Here is the original package.json:

{
  ...
  "scripts": {
    "dev": "set NODE_ENV=development && webpack serve --config config/webpack.dev.js --open",
    "build": "set NODE_ENV=production && webpack --config config/webpack.prod.js",
    "beatmarkers": "babel-node fetchAndFormatData/fetchAndFormatBeatMarkers.js"
  },
  "devDependencies": {
    "@babel/cli": "^7.14.3",
    "@babel/core": "^7.14.3",
    "@babel/node": "^7.14.2",
    "@babel/preset-env": "^7.14.4",
    "clean-webpack-plugin": "^4.0.0-alpha.0",
    "css-loader": "^5.2.6",
    "file-loader": "^6.2.0",
    "html-webpack-plugin": "^5.3.1",
    "lodash.clonedeep": "^4.5.0",
    "node-fetch": "^2.6.1",
    "node-sass": "^6.0.0",
    "sass-loader": "^11.1.1",
    "style-loader": "^2.0.0",
    "webpack": "^5.38.1",
    "webpack-cli": "^4.7.0",
    "webpack-dev-server": "^3.11.2",
    "webpack-merge": "^5.7.3"
  },
  "dependencies": {
    "bezier-easing": "^2.1.0",
    "howler": "^2.2.3",
    "pixi.js": "^6.2.0"
  }
}

Here are the original webpack config files:

const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: './src/app.js',
  plugins: [
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, '../src/template.html')
    })
  ],
  module: {
    rules: [
      {
        test: /\.(png|jpe?g|gif|svg|ico|pvr|mp3|fnt)$/,
        type: 'asset/resource'
      },
      {
        test: /\.scss$/,
        use: ['style-loader', 'css-loader', 'sass-loader']
      }
    ]
  }
};

const { merge } = require('webpack-merge');

const common = require('./webpack.common');

module.exports = merge(common, {
  mode: 'development',
  devServer: {
    historyApiFallback: true,
  },
  output: {
    publicPath: '/'
  },
  devtool: "source-map"
});

This configuration produces a sources structure in chrome that looks like this:

localhost:8080
    main.js
    (index)
    assets/images
        animations
        fonts
        interface

When I updated webpack-dev-server to the latest version, 4.11.1, the assets/images folder no longer exists. I haven't be able to figure out how to get it back. Any help would be deeply appreciated.


问:
firebase storage security rules allow only create folder
Is there a possibility in the security rules to only allow the creation of folders

Something link:

```<code>allow create: if request.resource.contentType.matches('folder/.*');
</code>```

Body:
Is there a possibility in the security rules to only allow the creation of folders

Something link:

allow create: if request.resource.contentType.matches('folder/.*');


问:
Is there any way to prioritize two elements in an array of Json Objects using java script
I have a array of JSON objects in the alphabetical order of country_name as shown below

```<code>  [
    {
        "country_name":"Afghanistan",
        "country_code":"AF",
        "id":"AF",
        "phoneCountryCode":"+93"
    },
    {
        "country_name":"Albania",
        "country_code":"AL",
        "id":"AL",
        "phoneCountryCode":"+355"
    },
    {
        "country_name":"Algeria",
        "country_code":"DZ",
        "id":"DZ",
        "phoneCountryCode":"+213"
    },
    {
        "country_name":"American Samoa",
        "country_code":"AS",
        "id":"AS",
        "phoneCountryCode":"+684"
    },
    {
        "country_name":"Andorra",
        "country_code":"AD",
        "id":"AD",
        "phoneCountryCode":"+376"
    },
    {
        "country_name":"Angola",
        "country_code":"AO",
        "id":"AO",
        "phoneCountryCode":"+244"
    },
    {
        "country_name":"Anguilla",
        "country_code":"AI",
        "id":"AI",
        "phoneCountryCode":"+264"
    },
    {
        "country_name":"Antigua AND Barbuda",
        "country_code":"AG",
        "id":"AG",
        "phoneCountryCode":"+268"
    },
    {
        "country_name":"Argentina",
        "country_code":"AR",
        "id":"AR",
        "phoneCountryCode":"+54"
    },
    {
        "country_name":"Armenia",
        "country_code":"AM",
        "id":"AM",
        "phoneCountryCode":"+374"
    },
    {
        "country_name":"Aruba",
        "country_code":"AW",
        "id":"AW",
        "phoneCountryCode":"+297"
    },
    {
        "country_name":"Australia",
        "country_code":"AU",
        "id":"AU",
        "phoneCountryCode":"+61"
    },
    {
        "country_name":"Austria",
        "country_code":"AT",
        "id":"AT",
        "phoneCountryCode":"+43"
    }
]
</code>```

Is there any way we can prioritize two countries in the array, bring up those two countries to the top of list in javascript.

For example, can I bring up Argentina and Australia to the top of list and show like below.

[{"country_name":"Argentina","country_code":"AR","id":"AR","phoneCountryCode":"+54"},{"country_name":"Australia","country_code":"AU","id":"AU","phoneCountryCode":"+61"},{"country_name":"Afghanistan","country_code":"AF","id":"AF","phoneCountryCode":"+93"},{"country_name":"Albania","country_code":"AL","id":"AL","phoneCountryCode":"+355"},{"country_name":"Algeria","country_code":"DZ","id":"DZ","phoneCountryCode":"+213"},{"country_name":"American Samoa","country_code":"AS","id":"AS","phoneCountryCode":"+684"},{"country_name":"Andorra","country_code":"AD","id":"AD","phoneCountryCode":"+376"},{"country_name":"Angola","country_code":"AO","id":"AO","phoneCountryCode":"+244"},{"country_name":"Anguilla","country_code":"AI","id":"AI","phoneCountryCode":"+264"},{"country_name":"Antigua AND Barbuda","country_code":"AG","id":"AG","phoneCountryCode":"+268"},{"country_name":"Armenia","country_code":"AM","id":"AM","phoneCountryCode":"+374"},{"country_name":"Aruba","country_code":"AW","id":"AW","phoneCountryCode":"+297"},{"country_name":"Austria","country_code":"AT","id":"AT","phoneCountryCode":"+43"}]

Those two prioritized countries also should be in alphabetical order.

Body:
I have a array of JSON objects in the alphabetical order of country_name as shown below

  [
    {
        "country_name":"Afghanistan",
        "country_code":"AF",
        "id":"AF",
        "phoneCountryCode":"+93"
    },
    {
        "country_name":"Albania",
        "country_code":"AL",
        "id":"AL",
        "phoneCountryCode":"+355"
    },
    {
        "country_name":"Algeria",
        "country_code":"DZ",
        "id":"DZ",
        "phoneCountryCode":"+213"
    },
    {
        "country_name":"American Samoa",
        "country_code":"AS",
        "id":"AS",
        "phoneCountryCode":"+684"
    },
    {
        "country_name":"Andorra",
        "country_code":"AD",
        "id":"AD",
        "phoneCountryCode":"+376"
    },
    {
        "country_name":"Angola",
        "country_code":"AO",
        "id":"AO",
        "phoneCountryCode":"+244"
    },
    {
        "country_name":"Anguilla",
        "country_code":"AI",
        "id":"AI",
        "phoneCountryCode":"+264"
    },
    {
        "country_name":"Antigua AND Barbuda",
        "country_code":"AG",
        "id":"AG",
        "phoneCountryCode":"+268"
    },
    {
        "country_name":"Argentina",
        "country_code":"AR",
        "id":"AR",
        "phoneCountryCode":"+54"
    },
    {
        "country_name":"Armenia",
        "country_code":"AM",
        "id":"AM",
        "phoneCountryCode":"+374"
    },
    {
        "country_name":"Aruba",
        "country_code":"AW",
        "id":"AW",
        "phoneCountryCode":"+297"
    },
    {
        "country_name":"Australia",
        "country_code":"AU",
        "id":"AU",
        "phoneCountryCode":"+61"
    },
    {
        "country_name":"Austria",
        "country_code":"AT",
        "id":"AT",
        "phoneCountryCode":"+43"
    }
]

Is there any way we can prioritize two countries in the array, bring up those two countries to the top of list in javascript.

For example, can I bring up Argentina and Australia to the top of list and show like below.

[{"country_name":"Argentina","country_code":"AR","id":"AR","phoneCountryCode":"+54"},{"country_name":"Australia","country_code":"AU","id":"AU","phoneCountryCode":"+61"},{"country_name":"Afghanistan","country_code":"AF","id":"AF","phoneCountryCode":"+93"},{"country_name":"Albania","country_code":"AL","id":"AL","phoneCountryCode":"+355"},{"country_name":"Algeria","country_code":"DZ","id":"DZ","phoneCountryCode":"+213"},{"country_name":"American Samoa","country_code":"AS","id":"AS","phoneCountryCode":"+684"},{"country_name":"Andorra","country_code":"AD","id":"AD","phoneCountryCode":"+376"},{"country_name":"Angola","country_code":"AO","id":"AO","phoneCountryCode":"+244"},{"country_name":"Anguilla","country_code":"AI","id":"AI","phoneCountryCode":"+264"},{"country_name":"Antigua AND Barbuda","country_code":"AG","id":"AG","phoneCountryCode":"+268"},{"country_name":"Armenia","country_code":"AM","id":"AM","phoneCountryCode":"+374"},{"country_name":"Aruba","country_code":"AW","id":"AW","phoneCountryCode":"+297"},{"country_name":"Austria","country_code":"AT","id":"AT","phoneCountryCode":"+43"}]

Those two prioritized countries also should be in alphabetical order.


问:
Trying to create a shopping cart in Yii2 and MySQL
I'm trying to create a functional shopping cart using Yii2 and MySQL but I'm kinda blocked right now
In MySQL i have two tabels: "Carrello" and "Prodotti". The first one should be the shopping cart, the second one a product list to insert into the shopping cart (Carrello).
Here is my model:

`

```<code> public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'prodotto' => 'Prodotto',
            'username' => 'Username',
        ];
    }

    public static function getProdotti($username)
    {
        $sql = "SELECT p.*,c.elementi
                FROM Prodotti p
                LEFT JOIN Carrello_Prodotti cp ON cp.Id_Prodotto = p.id
                LEFT JOIN Carrello c ON c.id = cp.Id_Carrello
                WHERE c.username = '".$username."'";

        $prodotti = Yii::$app->db->createCommand($sql)->queryAll();
        return $prodotti;
    }

</code>```

`
and my controller:

`

```<code>public function actionCarrello($username)
    {
        $prodotti = Carrello::getProdotti($username);
        $id = Carrello::findOne(1);
        if($id != null){
            foreach($prodotti as $p)
            {
                $p['nome_prodotto'];
            }
        }
        else
        {
            Yii::$app->request->isPost;

            $username = Yii::$app->request->post('Yii::$app->user->identity->username');
            $prodotti = Yii::$app->request->post('prodotto');

            $nuovocarrello = new Carrello();
            $nuovocarrello->prodotto = $prodotti;
            $nuovocarrello->username = $username;

            $nuovocarrello->save(false);
        }

        return $this->render('carrello',['prodotti' => $prodotti,'id' => $id]);
    }
</code>```

`

but I'm not really sure about this code. My idea was to show every product if there was an already existing shopping cart or to create a new one in case not, but I'm really insecure about this code.
Any help is appreciated

..............................................................................

Body:
I'm trying to create a functional shopping cart using Yii2 and MySQL but I'm kinda blocked right now
In MySQL i have two tabels: "Carrello" and "Prodotti". The first one should be the shopping cart, the second one a product list to insert into the shopping cart (Carrello).
Here is my model:

`

 public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'prodotto' => 'Prodotto',
            'username' => 'Username',
        ];
    }

    public static function getProdotti($username)
    {
        $sql = "SELECT p.*,c.elementi
                FROM Prodotti p
                LEFT JOIN Carrello_Prodotti cp ON cp.Id_Prodotto = p.id
                LEFT JOIN Carrello c ON c.id = cp.Id_Carrello
                WHERE c.username = '".$username."'";

        $prodotti = Yii::$app->db->createCommand($sql)->queryAll();
        return $prodotti;
    }

`
and my controller:

`

public function actionCarrello($username)
    {
        $prodotti = Carrello::getProdotti($username);
        $id = Carrello::findOne(1);
        if($id != null){
            foreach($prodotti as $p)
            {
                $p['nome_prodotto'];
            }
        }
        else
        {
            Yii::$app->request->isPost;

            $username = Yii::$app->request->post('Yii::$app->user->identity->username');
            $prodotti = Yii::$app->request->post('prodotto');

            $nuovocarrello = new Carrello();
            $nuovocarrello->prodotto = $prodotti;
            $nuovocarrello->username = $username;

            $nuovocarrello->save(false);
        }

        return $this->render('carrello',['prodotti' => $prodotti,'id' => $id]);
    }

`

but I'm not really sure about this code. My idea was to show every product if there was an already existing shopping cart or to create a new one in case not, but I'm really insecure about this code.
Any help is appreciated

..............................................................................


问:
how to combine these multiple queries in laravel
How to combine these queries in laravel. Please help me, thanks a lot

```<code>$keyTitleUnique = Setting::where('key', 'title')->first();
$keyDescriptionUnique = Setting::where('key', 'description')->first();
$keyUnique = Setting::where('key', $request->key)->first();
</code>```

i need ouput:

Body:
How to combine these queries in laravel. Please help me, thanks a lot

$keyTitleUnique = Setting::where('key', 'title')->first();
$keyDescriptionUnique = Setting::where('key', 'description')->first();
$keyUnique = Setting::where('key', $request->key)->first();

i need ouput:


问:
Docker build centos:6.4 gives manifest for centos:6.4 not found error on Ubuntu 22
I'm new to Docker, and got a project that with following content in the Dockerfile

```<code>from    centos:6.4
run     rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
run     rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
#there are more lines..
</code>```

When I try to build the image with following

```<code>sudo docker build -t test .
</code>```

I get following result;

```<code>Sending build context to Docker daemon  6.656kB
Step 1/22 : from    centos:6.4
manifest for centos:6.4 not found: manifest unknown: manifest unknown
</code>```

I can see there is a version specified in the file in https://wiki.centos.org/Manuals/ReleaseNotes/CentOS6.4

but not sure why the manifest unknown message appears.

Any help would be highly appreciated to identify and resolve this issue.

Body:
I'm new to Docker, and got a project that with following content in the Dockerfile

from    centos:6.4
run     rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
run     rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
#there are more lines..

When I try to build the image with following

sudo docker build -t test .

I get following result;

Sending build context to Docker daemon  6.656kB
Step 1/22 : from    centos:6.4
manifest for centos:6.4 not found: manifest unknown: manifest unknown

I can see there is a version specified in the file in https://wiki.centos.org/Manuals/ReleaseNotes/CentOS6.4

but not sure why the manifest unknown message appears.

Any help would be highly appreciated to identify and resolve this issue.


问:
How can I get the library reference such as user32.lib in MASM32 Library?
I'm using MASM32 SDK to learn assembly language. I want to develop a program using extra functions in libraries of masm32 SDK such as user32.lib, windows.lib. I want to know how can I find the information about each library file, their usages, what kind of functions they contain.

I already know .inc file have some information but only function declaration. And I check masmlib.chm  but it only contains masm32.lib information


问:
How to install cgal in windows 10?
I wanted to install cgal 5.5.1 in windows10 with the command: ".\vcpkg install cgal:x64-windows"
But I got the following Error:

```<code> 0 [main] perl (21212) C:\src\vcpkg\downloads\tools\msys2\583ad6e4115a307a\usr\bin\perl.exe: *** fatal error - cygheap base mismatch detected - 0x1322408/0xDE2408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:96 (message):
    Command failed: C:/src/vcpkg/downloads/tools/msys2/583ad6e4115a307a/usr/bin/bash.exe --noprofile --norc --debug -c "autoreconf -vfi"
    Working Directory: C:/src/vcpkg/buildtrees/gmp/src/v6.2.1-0c723d4b6f.clean/
    Error code: 127
    See logs for more information:
      C:\src\vcpkg\buildtrees\gmp\autoconf-x64-windows-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:601 (vcpkg_execute_required_process)
  ports/gmp/portfile.cmake:82 (vcpkg_configure_make)
  scripts/ports.cmake:147 (include)

error: building gmp:x64-windows failed with: BUILD_FAILED
error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+gmp
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[gmp]+Build+error
Include '[gmp] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-11-10-5fdee72bc1fceca198fb1ab7589837206a8b81ba
    vcpkg-scripts version: 5d1f18840 2022-12-06 (10 hours ago)
</code>```

You can see the log file in following.
Could you please help me?

```<code>Computing installation plan...
The following packages will be built and installed:
    cgal[core]:x64-windows -> 5.5.1
  * gmp[core]:x64-windows -> 6.2.1#14
  * mpfr[core]:x64-windows -> 4.1.0#7
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Restored 0 package(s) from C:\Users\sajad.mohseni\AppData\Local\vcpkg\archives in 269.7 us. Use --debug to see more details.
Installing 1/3 gmp:x64-windows...
Building gmp[core]:x64-windows...
-- Using cached gmp-6.2.1.tar.xz.
-- Using cached gmp-arm64-asm-fix-5f32dbc41afc.patch.
-- Cleaning sources at C:/src/vcpkg/buildtrees/gmp/src/v6.2.1-0c723d4b6f.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/src/vcpkg/downloads/gmp-6.2.1.tar.xz
-- Applying patch asmflags.patch
-- Applying patch cross-tools.patch
-- Applying patch subdirs.patch
-- Applying patch msvc_symbol.patch
-- Applying patch arm64-coff.patch
-- Applying patch C:/src/vcpkg/downloads/gmp-arm64-asm-fix-5f32dbc41afc.patch
-- Using source at C:/src/vcpkg/buildtrees/gmp/src/v6.2.1-0c723d4b6f.clean
-- Found external ninja('1.10.2').
-- Getting CMake variables for x64-windows
-- Getting CMake variables for x64-windows
-- Using cached msys-gzip-1.11-1-x86_64.pkg.tar.zst.
-- Using cached msys-bash-5.1.008-1-x86_64.pkg.tar.zst.
-- Using cached msys-autoconf-2.71-3-any.pkg.tar.zst.
-- Using cached msys-diffutils-3.8-2-x86_64.pkg.tar.zst.
-- Using cached msys-binutils-2.37-5-x86_64.pkg.tar.zst.
-- Using cached msys-libtool-2.4.6-9-x86_64.pkg.tar.xz.
-- Using cached msys-file-5.41-2-x86_64.pkg.tar.zst.
-- Using cached msys-zlib-1.2.11-1-x86_64.pkg.tar.xz.
-- Using cached msys-libbz2-1.0.8-3-x86_64.pkg.tar.zst.
-- Using cached msys-coreutils-8.32-2-x86_64.pkg.tar.zst.
-- Using cached msys-grep-3.0-2-x86_64.pkg.tar.xz.
-- Using cached msys-sed-4.8-2-x86_64.pkg.tar.zst.
-- Using cached msys-libpcre-8.45-1-x86_64.pkg.tar.zst.
-- Using cached msys-m4-1.4.19-2-x86_64.pkg.tar.zst.
-- Using cached msys-automake-wrapper-11-4-any.pkg.tar.zst.
-- Using cached msys-gawk-5.1.0-2-x86_64.pkg.tar.zst.
-- Using cached msys-mpfr-4.1.0-1-x86_64.pkg.tar.zst.
-- Using cached msys-gmp-6.2.1-1-x86_64.pkg.tar.zst.
-- Using cached msys-libreadline-8.1.001-1-x86_64.pkg.tar.zst.
-- Using cached msys-ncurses-6.2-2-x86_64.pkg.tar.zst.
-- Using cached msys-automake1.16-1.16.3-3-any.pkg.tar.zst.
-- Using cached msys-perl-5.32.1-2-x86_64.pkg.tar.zst.
-- Using cached msys-libcrypt-2.1-3-x86_64.pkg.tar.zst.
-- Using cached msys-pkg-config-0.29.2-4-x86_64.pkg.tar.zst.
-- Using cached msys-make-4.3-3-x86_64.pkg.tar.zst.
-- Using cached msys-findutils-4.8.0-1-x86_64.pkg.tar.zst.
-- Using cached msys-libintl-0.21-1-x86_64.pkg.tar.zst.
-- Using cached msys-libiconv-1.16-2-x86_64.pkg.tar.zst.
-- Using cached msys-gcc-libs-11.2.0-3-x86_64.pkg.tar.zst.
-- Using cached msys-msys2-runtime-3.2.0-8-x86_64.pkg.tar.zst.
-- Using cached msys-which-2.21-4-x86_64.pkg.tar.zst.
-- Applying patch C:/src/vcpkg/scripts/msys/compile_wrapper_consider_clang-cl.patch
-- Using msys root at C:/src/vcpkg/downloads/tools/msys2/583ad6e4115a307a
-- Generating configure for x64-windows
      0 [main] perl (21212) C:\src\vcpkg\downloads\tools\msys2\583ad6e4115a307a\usr\bin\perl.exe: *** fatal error - cygheap base mismatch detected - 0x1322408/0xDE2408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:96 (message):
    Command failed: C:/src/vcpkg/downloads/tools/msys2/583ad6e4115a307a/usr/bin/bash.exe --noprofile --norc --debug -c "autoreconf -vfi"
    Working Directory: C:/src/vcpkg/buildtrees/gmp/src/v6.2.1-0c723d4b6f.clean/
    Error code: 127
    See logs for more information:
      C:\src\vcpkg\buildtrees\gmp\autoconf-x64-windows-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:601 (vcpkg_execute_required_process)
  ports/gmp/portfile.cmake:82 (vcpkg_configure_make)
  scripts/ports.cmake:147 (include)

error: building gmp:x64-windows failed with: BUILD_FAILED
error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+gmp
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[gmp]+Build+error
Include '[gmp] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-11-10-5fdee72bc1fceca198fb1ab7589837206a8b81ba
    vcpkg-scripts version: 5d1f18840 2022-12-06 (10 hours ago)
</code>```

Title: How to install cgal in windows 10?

Body:
I wanted to install cgal 5.5.1 in windows10 with the command: ".\vcpkg install cgal:x64-windows"
But I got the following Error:

 0 [main] perl (21212) C:\src\vcpkg\downloads\tools\msys2\583ad6e4115a307a\usr\bin\perl.exe: *** fatal error - cygheap base mismatch detected - 0x1322408/0xDE2408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:96 (message):
    Command failed: C:/src/vcpkg/downloads/tools/msys2/583ad6e4115a307a/usr/bin/bash.exe --noprofile --norc --debug -c "autoreconf -vfi"
    Working Directory: C:/src/vcpkg/buildtrees/gmp/src/v6.2.1-0c723d4b6f.clean/
    Error code: 127
    See logs for more information:
      C:\src\vcpkg\buildtrees\gmp\autoconf-x64-windows-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:601 (vcpkg_execute_required_process)
  ports/gmp/portfile.cmake:82 (vcpkg_configure_make)
  scripts/ports.cmake:147 (include)

error: building gmp:x64-windows failed with: BUILD_FAILED
error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+gmp
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[gmp]+Build+error
Include '[gmp] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-11-10-5fdee72bc1fceca198fb1ab7589837206a8b81ba
    vcpkg-scripts version: 5d1f18840 2022-12-06 (10 hours ago)

You can see the log file in following.
Could you please help me?

Computing installation plan...
The following packages will be built and installed:
    cgal[core]:x64-windows -> 5.5.1
  * gmp[core]:x64-windows -> 6.2.1#14
  * mpfr[core]:x64-windows -> 4.1.0#7
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Restored 0 package(s) from C:\Users\sajad.mohseni\AppData\Local\vcpkg\archives in 269.7 us. Use --debug to see more details.
Installing 1/3 gmp:x64-windows...
Building gmp[core]:x64-windows...
-- Using cached gmp-6.2.1.tar.xz.
-- Using cached gmp-arm64-asm-fix-5f32dbc41afc.patch.
-- Cleaning sources at C:/src/vcpkg/buildtrees/gmp/src/v6.2.1-0c723d4b6f.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/src/vcpkg/downloads/gmp-6.2.1.tar.xz
-- Applying patch asmflags.patch
-- Applying patch cross-tools.patch
-- Applying patch subdirs.patch
-- Applying patch msvc_symbol.patch
-- Applying patch arm64-coff.patch
-- Applying patch C:/src/vcpkg/downloads/gmp-arm64-asm-fix-5f32dbc41afc.patch
-- Using source at C:/src/vcpkg/buildtrees/gmp/src/v6.2.1-0c723d4b6f.clean
-- Found external ninja('1.10.2').
-- Getting CMake variables for x64-windows
-- Getting CMake variables for x64-windows
-- Using cached msys-gzip-1.11-1-x86_64.pkg.tar.zst.
-- Using cached msys-bash-5.1.008-1-x86_64.pkg.tar.zst.
-- Using cached msys-autoconf-2.71-3-any.pkg.tar.zst.
-- Using cached msys-diffutils-3.8-2-x86_64.pkg.tar.zst.
-- Using cached msys-binutils-2.37-5-x86_64.pkg.tar.zst.
-- Using cached msys-libtool-2.4.6-9-x86_64.pkg.tar.xz.
-- Using cached msys-file-5.41-2-x86_64.pkg.tar.zst.
-- Using cached msys-zlib-1.2.11-1-x86_64.pkg.tar.xz.
-- Using cached msys-libbz2-1.0.8-3-x86_64.pkg.tar.zst.
-- Using cached msys-coreutils-8.32-2-x86_64.pkg.tar.zst.
-- Using cached msys-grep-3.0-2-x86_64.pkg.tar.xz.
-- Using cached msys-sed-4.8-2-x86_64.pkg.tar.zst.
-- Using cached msys-libpcre-8.45-1-x86_64.pkg.tar.zst.
-- Using cached msys-m4-1.4.19-2-x86_64.pkg.tar.zst.
-- Using cached msys-automake-wrapper-11-4-any.pkg.tar.zst.
-- Using cached msys-gawk-5.1.0-2-x86_64.pkg.tar.zst.
-- Using cached msys-mpfr-4.1.0-1-x86_64.pkg.tar.zst.
-- Using cached msys-gmp-6.2.1-1-x86_64.pkg.tar.zst.
-- Using cached msys-libreadline-8.1.001-1-x86_64.pkg.tar.zst.
-- Using cached msys-ncurses-6.2-2-x86_64.pkg.tar.zst.
-- Using cached msys-automake1.16-1.16.3-3-any.pkg.tar.zst.
-- Using cached msys-perl-5.32.1-2-x86_64.pkg.tar.zst.
-- Using cached msys-libcrypt-2.1-3-x86_64.pkg.tar.zst.
-- Using cached msys-pkg-config-0.29.2-4-x86_64.pkg.tar.zst.
-- Using cached msys-make-4.3-3-x86_64.pkg.tar.zst.
-- Using cached msys-findutils-4.8.0-1-x86_64.pkg.tar.zst.
-- Using cached msys-libintl-0.21-1-x86_64.pkg.tar.zst.
-- Using cached msys-libiconv-1.16-2-x86_64.pkg.tar.zst.
-- Using cached msys-gcc-libs-11.2.0-3-x86_64.pkg.tar.zst.
-- Using cached msys-msys2-runtime-3.2.0-8-x86_64.pkg.tar.zst.
-- Using cached msys-which-2.21-4-x86_64.pkg.tar.zst.
-- Applying patch C:/src/vcpkg/scripts/msys/compile_wrapper_consider_clang-cl.patch
-- Using msys root at C:/src/vcpkg/downloads/tools/msys2/583ad6e4115a307a
-- Generating configure for x64-windows
      0 [main] perl (21212) C:\src\vcpkg\downloads\tools\msys2\583ad6e4115a307a\usr\bin\perl.exe: *** fatal error - cygheap base mismatch detected - 0x1322408/0xDE2408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:96 (message):
    Command failed: C:/src/vcpkg/downloads/tools/msys2/583ad6e4115a307a/usr/bin/bash.exe --noprofile --norc --debug -c "autoreconf -vfi"
    Working Directory: C:/src/vcpkg/buildtrees/gmp/src/v6.2.1-0c723d4b6f.clean/
    Error code: 127
    See logs for more information:
      C:\src\vcpkg\buildtrees\gmp\autoconf-x64-windows-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:601 (vcpkg_execute_required_process)
  ports/gmp/portfile.cmake:82 (vcpkg_configure_make)
  scripts/ports.cmake:147 (include)

error: building gmp:x64-windows failed with: BUILD_FAILED
error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+gmp
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[gmp]+Build+error
Include '[gmp] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-11-10-5fdee72bc1fceca198fb1ab7589837206a8b81ba
    vcpkg-scripts version: 5d1f18840 2022-12-06 (10 hours ago)


问:
Proper use of target_include_directories() in CMake
I`m refactoring a CMake project. I wanted to include pre-compiled third-party .dll library into custom shared library, but have difficulties with populating headers files.

Project structure:

```<code>CMakeListst.txt

app
    CMakeLists.txt

modules
    my-library
        include
        CMakeLists.txt

    ...

third-party // precompiled, non-CMake
    third-party.dll
    include

build
    modules
        my-library
            my-library.dll
            include

    app
            app.exe
</code>```

I have a third-party library ("third-party"), which I want to include into "my-library". So CMakeLists for "my-library" looks like this:

```<code>cmake_minimum_required(VERSION 3.15)

project("my-library" VERSION 0.0.0 LANGUAGES CXX)

set(PUBLIC_HEADERS
    include/my-library.h
)

set(SOURCES
    my-library.cpp
)

add_library("my-library" SHARED ${PUBLIC_HEADERS} ${SOURCES})

target_link_libraries("my-library" PUBLIC "${CMAKE_SOURCE_DIR}/third-party/third-party.dll")
target_include_directories("my-library" PUBLIC "${CMAKE_SOURCE_DIR}/third-party/include")

target_include_directories("my-library" PUBLIC include)
</code>```

And then add "my-library" to the app like this:

```<code>target_include_directories("app" PRIVATE "${CMAKE_SOURCE_DIR}/modules/my-library/include")
target_link_libraries("app" PRIVATE "${CMAKE_BINARY_DIR}/modules/my-library/my-library.dll")
</code>```

But I get 'No such file or directory #include "third-party.h"'. In other words, app has no access to third-party inlcude directory.
Though it can be fixed by copying "include" of third-party to "include" of my-library,
is doesn`t look like a correct method. Or is it how includes supposed to be used? What am I missing here? I had a perception, that unlike include_directories() target_include_directories() should export included path.

Body:
I`m refactoring a CMake project. I wanted to include pre-compiled third-party .dll library into custom shared library, but have difficulties with populating headers files.

Project structure:

CMakeListst.txt

app
    CMakeLists.txt

modules
    my-library
        include
        CMakeLists.txt

    ...

third-party // precompiled, non-CMake
    third-party.dll
    include

build
    modules
        my-library
            my-library.dll
            include

    app
            app.exe

I have a third-party library ("third-party"), which I want to include into "my-library". So CMakeLists for "my-library" looks like this:

cmake_minimum_required(VERSION 3.15)

project("my-library" VERSION 0.0.0 LANGUAGES CXX)

set(PUBLIC_HEADERS
    include/my-library.h
)

set(SOURCES
    my-library.cpp
)

add_library("my-library" SHARED ${PUBLIC_HEADERS} ${SOURCES})

target_link_libraries("my-library" PUBLIC "${CMAKE_SOURCE_DIR}/third-party/third-party.dll")
target_include_directories("my-library" PUBLIC "${CMAKE_SOURCE_DIR}/third-party/include")

target_include_directories("my-library" PUBLIC include)

And then add "my-library" to the app like this:

target_include_directories("app" PRIVATE "${CMAKE_SOURCE_DIR}/modules/my-library/include")
target_link_libraries("app" PRIVATE "${CMAKE_BINARY_DIR}/modules/my-library/my-library.dll")

But I get 'No such file or directory #include "third-party.h"'. In other words, app has no access to third-party inlcude directory.
Though it can be fixed by copying "include" of third-party to "include" of my-library,
is doesn`t look like a correct method. Or is it how includes supposed to be used? What am I missing here? I had a perception, that unlike include_directories() target_include_directories() should export included path.


问:
how to check if I created a stream successfully in TDengine
I created a stream with the following statement:

```<code>create stream device_running_s trigger WINDOW_CLOSE watermark 60m into device_running as select tbname,wcs_sx_runing,_wstart,_wend,_wduration from point partition by tbname state_window(wcs_sx_runing);
</code>```

The output seems ok.

Query OK, 0 of 0 rows affected (0.084000s)

However, when I execute a query on this stream, it failed.

taos> select * from device_running;

DB error: Fail to get table info, error: Invalid value in client (0.240000s)

I can't be sure if the stream was created successfully. Is there any way to check it?

Body:
I created a stream with the following statement:

create stream device_running_s trigger WINDOW_CLOSE watermark 60m into device_running as select tbname,wcs_sx_runing,_wstart,_wend,_wduration from point partition by tbname state_window(wcs_sx_runing);

The output seems ok.

Query OK, 0 of 0 rows affected (0.084000s)

However, when I execute a query on this stream, it failed.

taos> select * from device_running;

DB error: Fail to get table info, error: Invalid value in client (0.240000s)

I can't be sure if the stream was created successfully. Is there any way to check it?


问:
Getting popup (chrome extension's ui) to open new window and pass to it (and load from it) data
I'm having a simple UI which opens when the user clicks on the extension's icon (popup), and now I attempt to pass information which exists in the popup, to that new page, perform a few tasks, and then, eventually return with data to the same UI (popup) I was starting with.

I thought I could do something like this in order to create the new window and pass information to it:

```<code>  const new_window = chrome.windows.create({ type: "normal", focused: true }, () => { });

  (imgSrc !== "" && chrome.runtime.sendMessage({ type: "take_img", data: imgSrc }))
</code>```

and then, from whatever script I choose to be the responder, I'll perform:

```<code>chrome.runtime.onMessage.addListener(function (request) {
    if (request.type === "take_img") {
        console.log(request.data); // request has the payload from the parent window
    }
});
</code>```

and then I will be able to access the data.

I couldn't have been more wrong. I get the new window open, but it's just the standard chrome homepage, and it logs nothing on console.

What am I doing wrong? How would you suggest me that on click, I will open a new window, which will present a the image I am passing from my popup?

Regards!

Body:
I'm having a simple UI which opens when the user clicks on the extension's icon (popup), and now I attempt to pass information which exists in the popup, to that new page, perform a few tasks, and then, eventually return with data to the same UI (popup) I was starting with.

I thought I could do something like this in order to create the new window and pass information to it:

  const new_window = chrome.windows.create({ type: "normal", focused: true }, () => { });

  (imgSrc !== "" && chrome.runtime.sendMessage({ type: "take_img", data: imgSrc }))

and then, from whatever script I choose to be the responder, I'll perform:

chrome.runtime.onMessage.addListener(function (request) {
    if (request.type === "take_img") {
        console.log(request.data); // request has the payload from the parent window
    }
});

and then I will be able to access the data.

I couldn't have been more wrong. I get the new window open, but it's just the standard chrome homepage, and it logs nothing on console.

What am I doing wrong? How would you suggest me that on click, I will open a new window, which will present a the image I am passing from my popup?

Regards!


问:
React admin not asking for password
Simple page given

```<code>import { fetchUtils, Admin, Resource, ListGuesser } from 'react-admin';

import * as React from "react";
import apiDataProvider from './apiDataProvider';
import apiAuthProvider from './apiAuthProvider';

const dataProvider = apiDataProvider('https://example.com/api/v1');

const App = () => (
    <Admin dataProvider={dataProvider} authProvider={apiAuthProvider}>
       <Resource name="campaign" list={ListGuesser} />
    </Admin>
);

export default App;
</code>```

apiDataProvider used for url customization, probably there's better solution

```<code>const endPoint = 'https://example.com/api/v1'

const apiAuthProvider = {
    login: ({ username, password }) => {
        console.log('login');
        const request = new Request(endPoint+'/sign-in/', {
          method: 'POST',
          body: JSON.stringify({ username: username, password: password }),
          headers: new Headers({ 'Content-Type': 'application/json' }),
        });
        return fetch(request)
          .then(response => {
            if (response.status < 200 || response.status >= 300) {
              throw new Error(response.statusText);
            }
            return response.json();
          })
          .then(auth => {
            localStorage.setItem('auth', JSON.stringify(auth));
          })
          .catch(() => {
            throw new Error('Network error')
          });
      },
    logout: () => {
        console.log('logout');
        localStorage.removeItem('username');
        const request = new Request(endPoint+'/sign-out/', {
          method: 'POST',
          body: JSON.stringify({ }),
          headers: new Headers({ 'Content-Type': 'application/json' }),
        });
        return fetch(request)
          .then(response => {
            if (response.status < 200 || response.status >= 300) {
              throw new Error(response.statusText);
            }
            return response.json();
          })
          .then(auth => {
            localStorage.setItem('auth', JSON.stringify(auth));
          })
          .catch(() => {
            throw new Error('Network error')
          });
        },
    checkAuth: () => {
        console.log('checkAuth', localStorage.getItem('username'));
        return localStorage.getItem('username') ? Promise.resolve() : Promise.reject();
    },
    checkError:  (error) => {
        console.log('checkError');
        const status = error.status;
        if (status === 401 || status === 403) {
            localStorage.removeItem('username');
            return Promise.reject();
        }
        // other error code (404, 500, etc): no need to log out
        return Promise.resolve();
    },
    getIdentity: () => {
        try {
            const { id, fullName, avatar } = JSON.parse(localStorage.getItem('auth'));
            return Promise.resolve({ id, fullName, avatar });
        } catch (error) {
            return Promise.reject(error);
        }
    },
    getPermissions: () => Promise.resolve(''),
};

export default apiAuthProvider;
</code>```

On load "/" it calls logout twice, queries for campaign list (custom url), gets 401 and calls logout url again.

On the page I can see "Please login to continue" message, but no login window. Login form is available on /login. Why RA doesn't redirect to login form?

Title: React admin not asking for password

Body:
Simple page given

import { fetchUtils, Admin, Resource, ListGuesser } from 'react-admin';

import * as React from "react";
import apiDataProvider from './apiDataProvider';
import apiAuthProvider from './apiAuthProvider';

const dataProvider = apiDataProvider('https://example.com/api/v1');

const App = () => (
    <Admin dataProvider={dataProvider} authProvider={apiAuthProvider}>
       <Resource name="campaign" list={ListGuesser} />
    </Admin>
);

export default App;

apiDataProvider used for url customization, probably there's better solution

const endPoint = 'https://example.com/api/v1'

const apiAuthProvider = {
    login: ({ username, password }) => {
        console.log('login');
        const request = new Request(endPoint+'/sign-in/', {
          method: 'POST',
          body: JSON.stringify({ username: username, password: password }),
          headers: new Headers({ 'Content-Type': 'application/json' }),
        });
        return fetch(request)
          .then(response => {
            if (response.status < 200 || response.status >= 300) {
              throw new Error(response.statusText);
            }
            return response.json();
          })
          .then(auth => {
            localStorage.setItem('auth', JSON.stringify(auth));
          })
          .catch(() => {
            throw new Error('Network error')
          });
      },
    logout: () => {
        console.log('logout');
        localStorage.removeItem('username');
        const request = new Request(endPoint+'/sign-out/', {
          method: 'POST',
          body: JSON.stringify({ }),
          headers: new Headers({ 'Content-Type': 'application/json' }),
        });
        return fetch(request)
          .then(response => {
            if (response.status < 200 || response.status >= 300) {
              throw new Error(response.statusText);
            }
            return response.json();
          })
          .then(auth => {
            localStorage.setItem('auth', JSON.stringify(auth));
          })
          .catch(() => {
            throw new Error('Network error')
          });
        },
    checkAuth: () => {
        console.log('checkAuth', localStorage.getItem('username'));
        return localStorage.getItem('username') ? Promise.resolve() : Promise.reject();
    },
    checkError:  (error) => {
        console.log('checkError');
        const status = error.status;
        if (status === 401 || status === 403) {
            localStorage.removeItem('username');
            return Promise.reject();
        }
        // other error code (404, 500, etc): no need to log out
        return Promise.resolve();
    },
    getIdentity: () => {
        try {
            const { id, fullName, avatar } = JSON.parse(localStorage.getItem('auth'));
            return Promise.resolve({ id, fullName, avatar });
        } catch (error) {
            return Promise.reject(error);
        }
    },
    getPermissions: () => Promise.resolve(''),
};

export default apiAuthProvider;

On load "/" it calls logout twice, queries for campaign list (custom url), gets 401 and calls logout url again.

On the page I can see "Please login to continue" message, but no login window. Login form is available on /login. Why RA doesn't redirect to login form?


问:
Angular Show More Pagination
I am trying to implement show more pagination on my angular project. What I am trying is to show maximum of 8 products per page, and by clicking Show More button product list expands for another 4 products. I followed this tutorial, and my compiler says this:

None of those variables is string. event is a model that contains multiple data types, and I am making array of it. Here is the .ts of this component.

```<code>import { Component } from '@angular/core';
import { EventService } from '../services/event/event.service';
import { Event } from '../shared/models/event'
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})
export class HomeComponent {

  events:Event[]=[];
  startPage : Number;
  paginationLimit:Number
  constructor(private eventService:EventService, private route:ActivatedRoute){
    this.startPage = 0;
    this.paginationLimit = 8;
   }
   showMoreItems()
   {
      this.paginationLimit = Number(this.paginationLimit) + 3;
   }
   showLessItems()
   {
     this.paginationLimit = Number(this.paginationLimit) - 3;
   }

  ngOnInit(): void{
    this.events=this.eventService.getAll();
    this.route.params.subscribe(params=>{
      if(params['searchTerm'])
        this.events=this.eventService.getAll().filter(events=>events.name.toLowerCase().includes(params['searchTerm'].toLowerCase()));
      else
      this.events=this.eventService.getAll();
    })
  }

}
</code>```

Can you help me to figure out what is the problem here?

Title: Angular Show More Pagination

Body:
I am trying to implement show more pagination on my angular project. What I am trying is to show maximum of 8 products per page, and by clicking Show More button product list expands for another 4 products. I followed this tutorial, and my compiler says this:

None of those variables is string. event is a model that contains multiple data types, and I am making array of it. Here is the .ts of this component.

import { Component } from '@angular/core';
import { EventService } from '../services/event/event.service';
import { Event } from '../shared/models/event'
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})
export class HomeComponent {

  events:Event[]=[];
  startPage : Number;
  paginationLimit:Number
  constructor(private eventService:EventService, private route:ActivatedRoute){
    this.startPage = 0;
    this.paginationLimit = 8;
   }
   showMoreItems()
   {
      this.paginationLimit = Number(this.paginationLimit) + 3;
   }
   showLessItems()
   {
     this.paginationLimit = Number(this.paginationLimit) - 3;
   }

  ngOnInit(): void{
    this.events=this.eventService.getAll();
    this.route.params.subscribe(params=>{
      if(params['searchTerm'])
        this.events=this.eventService.getAll().filter(events=>events.name.toLowerCase().includes(params['searchTerm'].toLowerCase()));
      else
      this.events=this.eventService.getAll();
    })
  }

}

Can you help me to figure out what is the problem here?


问:
Contexthub to Adobe target
May I know if its already default that the data in contexthub is already saved in adobe target as profile visitor if not do anyone know how can i export the data from aem contexthub to adobe target.

I tried to create audience in adobe target and choose the visitor profile and get the customized data from content hub but it shows to the report that my audience wasn't read

Title: Contexthub to Adobe target