问:
Error with opencv when importing joystick.h with types.hpp
I am trying to read the data from an Xbox One controller via Bluetooth on my computer running Ubuntu 20.

The problem appears at the time of compilation, I have the impression that it appears randomly sometimes without any modification on my part of the main code and CMakeLists. Maybe a problem with updates?

```<code>                 from /usr/include/linux/joystick.h:28,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_communication.h:23,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/src/00_communication.cpp:1:
/usr/include/opencv4/opencv2/viz/types.hpp:286:27: error: expected identifier before numeric constant
  286 |             enum Action { KEY_UP = 0, KEY_DOWN = 1};
      |                           ^~~~~~
/usr/include/opencv4/opencv2/viz/types.hpp:286:27: error: expected ‘}’ before numeric constant
In file included from /usr/include/opencv4/opencv2/viz.hpp:49,
                 from /usr/include/opencv4/opencv2/opencv.hpp:104,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_function.h:20,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_communication.h:25,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/src/00_communication.cpp:1:
/usr/include/opencv4/opencv2/viz/types.hpp:286:25: note: to match this ‘{’
  286 |             enum Action { KEY_UP = 0, KEY_DOWN = 1};
      |                         ^
In file included from /usr/include/linux/input.h:18,
                 from /usr/include/linux/joystick.h:28,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_communication.h:23,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/src/00_communication.cpp:1:
/usr/include/opencv4/opencv2/viz/types.hpp:286:27: error: expected unqualified-id before numeric constant
  286 |             enum Action { KEY_UP = 0, KEY_DOWN = 1};
      |                           ^~~~~~
In file included from /usr/include/opencv4/opencv2/viz.hpp:49,
                 from /usr/include/opencv4/opencv2/opencv.hpp:104,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_function.h:20,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_communication.h:25,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/src/00_communication.cpp:1:
/usr/include/opencv4/opencv2/viz/types.hpp:295:26: error: expected constructor, destructor, or type conversion before ‘(’ token
  295 |             KeyboardEvent(Action action, const String& symbol, unsigned char code, int modifiers);
      |                          ^
/usr/include/opencv4/opencv2/viz/types.hpp:297:13: error: ‘Action’ does not name a type
  297 |             Action action;
      |             ^~~~~~
/usr/include/opencv4/opencv2/viz/types.hpp:331:1: error: expected declaration before ‘}’ token
  331 | } /* namespace cv */
</code>```

I tried to modify the Action enum by adding 'class' before it, but it did not work.

Body:
I am trying to read the data from an Xbox One controller via Bluetooth on my computer running Ubuntu 20.

The problem appears at the time of compilation, I have the impression that it appears randomly sometimes without any modification on my part of the main code and CMakeLists. Maybe a problem with updates?

                 from /usr/include/linux/joystick.h:28,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_communication.h:23,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/src/00_communication.cpp:1:
/usr/include/opencv4/opencv2/viz/types.hpp:286:27: error: expected identifier before numeric constant
  286 |             enum Action { KEY_UP = 0, KEY_DOWN = 1};
      |                           ^~~~~~
/usr/include/opencv4/opencv2/viz/types.hpp:286:27: error: expected ‘}’ before numeric constant
In file included from /usr/include/opencv4/opencv2/viz.hpp:49,
                 from /usr/include/opencv4/opencv2/opencv.hpp:104,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_function.h:20,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_communication.h:25,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/src/00_communication.cpp:1:
/usr/include/opencv4/opencv2/viz/types.hpp:286:25: note: to match this ‘{’
  286 |             enum Action { KEY_UP = 0, KEY_DOWN = 1};
      |                         ^
In file included from /usr/include/linux/input.h:18,
                 from /usr/include/linux/joystick.h:28,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_communication.h:23,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/src/00_communication.cpp:1:
/usr/include/opencv4/opencv2/viz/types.hpp:286:27: error: expected unqualified-id before numeric constant
  286 |             enum Action { KEY_UP = 0, KEY_DOWN = 1};
      |                           ^~~~~~
In file included from /usr/include/opencv4/opencv2/viz.hpp:49,
                 from /usr/include/opencv4/opencv2/opencv.hpp:104,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_function.h:20,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/include/00_communication.h:25,
                 from /home/mon20/Dev/HIVE_ROBOT_SOFTWARE/src/00_communication.cpp:1:
/usr/include/opencv4/opencv2/viz/types.hpp:295:26: error: expected constructor, destructor, or type conversion before ‘(’ token
  295 |             KeyboardEvent(Action action, const String& symbol, unsigned char code, int modifiers);
      |                          ^
/usr/include/opencv4/opencv2/viz/types.hpp:297:13: error: ‘Action’ does not name a type
  297 |             Action action;
      |             ^~~~~~
/usr/include/opencv4/opencv2/viz/types.hpp:331:1: error: expected declaration before ‘}’ token
  331 | } /* namespace cv */

I tried to modify the Action enum by adding 'class' before it, but it did not work.


来源: stackexchange

问:
Spinner Item re-selected
I am implementing a spinner with auto fill text view and adding same list in adapter of Spinner and auto fill text view,
If I select a item from spinner it will be set in autoFillTextView,
But the problem is if I select a item from spinner and then make a change in autofillTextView, and then again select same item from spinner then controller is not going back to spinner onSelected method,

Thanks in advance.

```<code>@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (parent.getId()) {
    case R.id.spinnerGroupName:
        actvMatchGroup.setText("");
        //Your Another Action Here.
        for (int i = 0; i < groupList.size(); i++) {
            if (groupName[position] == groupList.get(i).getGroupName())     {
                groupId = Integer.parseInt(groupList.get(i).getGroupId());
                group_id = groupId;
            }
        }
        tvMatchGroup.setText(groupName[position]);
        actvMatchGroup.setText(groupName[position]);
    break;
}
</code>```

ContentLicense: CC BY-SA 4.0

Title: Spinner Item re-selected

Body:
I am implementing a spinner with auto fill text view and adding same list in adapter of Spinner and auto fill text view,
If I select a item from spinner it will be set in autoFillTextView,
But the problem is if I select a item from spinner and then make a change in autofillTextView, and then again select same item from spinner then controller is not going back to spinner onSelected method,

Thanks in advance.

@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (parent.getId()) {
    case R.id.spinnerGroupName:
        actvMatchGroup.setText("");
        //Your Another Action Here.
        for (int i = 0; i < groupList.size(); i++) {
            if (groupName[position] == groupList.get(i).getGroupName())     {
                groupId = Integer.parseInt(groupList.get(i).getGroupId());
                group_id = groupId;
            }
        }
        tvMatchGroup.setText(groupName[position]);
        actvMatchGroup.setText(groupName[position]);
    break;
}


问:
Capture full page screen on macOS Robot Framework
I have a problem to capture full screen on macOS, I try these code in Windows and it works

```<code>Test_Capture
   Set Window Size    2000    2500 #set new window size
   ${currentWidth}   ${currentHight}    Get Window Size    True
   Log  ${currentWidth},${currentHight}
   sleep    0.5
   SeleniumLibrary.Capture Page Screenshot
</code>```

but in macOS it can capture the screen but it capture just visible screen and when I check the log of ${currentWidth} and ${currentHight} it still the original size it doesn't set the new window size.

PS. I get current screen dimensions by ${currentWidth} ${currentHight}= Get Window Size then plus height by 1000 then set new window size by new height

Browser: Firefox

OS: mac

Appreciate everyone can suggest if there are other ways to capture full screen.

Body:
I have a problem to capture full screen on macOS, I try these code in Windows and it works

Test_Capture
   Set Window Size    2000    2500 #set new window size
   ${currentWidth}   ${currentHight}    Get Window Size    True
   Log  ${currentWidth},${currentHight}
   sleep    0.5
   SeleniumLibrary.Capture Page Screenshot

but in macOS it can capture the screen but it capture just visible screen and when I check the log of ${currentWidth} and ${currentHight} it still the original size it doesn't set the new window size.

PS. I get current screen dimensions by ${currentWidth} ${currentHight}= Get Window Size then plus height by 1000 then set new window size by new height

Browser: Firefox

OS: mac

Appreciate everyone can suggest if there are other ways to capture full screen.


问:
Unble to open multiple simultaneous websockets to the same endpoint in case where the consumer is busy for the first websocket
I am using Django channels with React websockets. I am unable to open multiple simulataneous websockets if the consumer of the first websocket channel is busy with some activity. I want to open multiple simultaneous websockets where consumers is doing something for each individual websocket.

The module versions are:

asgiref                       3.6.0

daphne                        3.0.2

django-cors-headers           3.13.0

djangorestframework           3.14.0

djangorestframework-simplejwt 5.2.2

From the snippet below, once one websocket completes the task the second websocket can be connected (in a separate tab) but while 1st websocket is busy (sleeping), the other websockets in the new browser tabs fails after handshake with the following error:

**

```<code>WebSocket HANDSHAKING /ws/socket-server/monitor-rack-kpis/ushoeuhrti/ [127.0.0.1:49228]
django.channels.server INFO     WebSocket HANDSHAKING /ws/socket-server/monitor-rack-kpis/ushoeuhrti/ [127.0.0.1:49228]
daphne.http_protocol DEBUG    Upgraded connection ['127.0.0.1', 49228] to WebSocket
daphne.ws_protocol DEBUG    WebSocket closed for ['127.0.0.1', 49228]
WebSocket DISCONNECT /ws/socket-server/monitor-rack-kpis/ushoeuhrti/ [127.0.0.1:49228]
django.channels.server INFO     WebSocket DISCONNECT /ws/socket-server/monitor-rack-kpis/ushoeuhrti/ [127.0.0.1:49228]
daphne.server WARNING  Application instance <Task pending name='Task-56' coro=<StaticFilesWrapper.__call__() running at /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/channels/staticfiles.py:44> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/futures.py:387, Task.task_wakeup()]>> for connection <WebSocketProtocol client=['127.0.0.1', 49216] path=b'/ws/socket-server/monitor-rack-kpis/vhofoefwmr/'> took too long to shut down and was killed.
</code>```

**

I tried using url in routing instead of re_path but that didn't help either

settings.py

`
ASGI_APPLICATION = 'backend.asgi.application'

```<code>CHANNEL_LAYERS={'default':{'BACKEND':'channels.layers.InMemoryChannelLayer'}}
</code>```

`

asgi.py

```<code>application = ProtocolTypeRouter({
    'http':get_asgi_application(),
    'websocket':AuthMiddlewareStack(
        URLRouter(logstatus.routing.websocket_urlpatterns)
    )
})
</code>```

routing.py

```<code>websocket_urlpatterns=[
    re_path(r'^ws/socket-server/monitor-rack-kpis/(?P<username>[A-Za-z]+)/', consumers.InfluxWritePromesthusConsumer.as_asgi())
]
</code>```

consumer.py

```<code>class InfluxWritePromesthusConsumer(WebsocketConsumer):

    def ws_connect(message):
        message.reply_channel.send({"accept": True})

    def receive(self, text_data):
        print(f"\nReceiving  from: {self.channel_name}\n")
        t = 0
        while t<=100:
            self.send(text_data=json.dumps({
                'type':"LearnSocket",
                'message': "Received Messages"
            }))
            t += 10
            time.sleep(10)
</code>```

Frontend- React.JS

```<code>    const randN = generate()
    console.log(randN)
    const socket = new WebSocket('ws://127.0.0.1:8000/ws/socket-server/monitor-rack-kpis/'+ randN+ '/');

    console.log(socket)

    socket.onopen=function(e){
      console.log(socket.readyState)
      if (user && user.access) {
        socket.send("Hi");

      //Receiving response from WebSocket
      socket.onmessage=function(e){
        //let data1=JSON.parse(e.data);
        console.log(e.data, new Date());
        //setOutputResponse(data1['message']);
      }
      }
    }
</code>```

Body:
I am using Django channels with React websockets. I am unable to open multiple simulataneous websockets if the consumer of the first websocket channel is busy with some activity. I want to open multiple simultaneous websockets where consumers is doing something for each individual websocket.

The module versions are:

asgiref                       3.6.0

daphne                        3.0.2

django-cors-headers           3.13.0

djangorestframework           3.14.0

djangorestframework-simplejwt 5.2.2

From the snippet below, once one websocket completes the task the second websocket can be connected (in a separate tab) but while 1st websocket is busy (sleeping), the other websockets in the new browser tabs fails after handshake with the following error:

**

WebSocket HANDSHAKING /ws/socket-server/monitor-rack-kpis/ushoeuhrti/ [127.0.0.1:49228]
django.channels.server INFO     WebSocket HANDSHAKING /ws/socket-server/monitor-rack-kpis/ushoeuhrti/ [127.0.0.1:49228]
daphne.http_protocol DEBUG    Upgraded connection ['127.0.0.1', 49228] to WebSocket
daphne.ws_protocol DEBUG    WebSocket closed for ['127.0.0.1', 49228]
WebSocket DISCONNECT /ws/socket-server/monitor-rack-kpis/ushoeuhrti/ [127.0.0.1:49228]
django.channels.server INFO     WebSocket DISCONNECT /ws/socket-server/monitor-rack-kpis/ushoeuhrti/ [127.0.0.1:49228]
daphne.server WARNING  Application instance <Task pending name='Task-56' coro=<StaticFilesWrapper.__call__() running at /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/channels/staticfiles.py:44> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/futures.py:387, Task.task_wakeup()]>> for connection <WebSocketProtocol client=['127.0.0.1', 49216] path=b'/ws/socket-server/monitor-rack-kpis/vhofoefwmr/'> took too long to shut down and was killed.

**

I tried using url in routing instead of re_path but that didn't help either

settings.py

`
ASGI_APPLICATION = 'backend.asgi.application'

CHANNEL_LAYERS={'default':{'BACKEND':'channels.layers.InMemoryChannelLayer'}}

`

asgi.py

application = ProtocolTypeRouter({
    'http':get_asgi_application(),
    'websocket':AuthMiddlewareStack(
        URLRouter(logstatus.routing.websocket_urlpatterns)
    )
})

routing.py

websocket_urlpatterns=[
    re_path(r'^ws/socket-server/monitor-rack-kpis/(?P<username>[A-Za-z]+)/', consumers.InfluxWritePromesthusConsumer.as_asgi())
]

consumer.py

class InfluxWritePromesthusConsumer(WebsocketConsumer):

    def ws_connect(message):
        message.reply_channel.send({"accept": True})

    def receive(self, text_data):
        print(f"\nReceiving  from: {self.channel_name}\n")
        t = 0
        while t<=100:
            self.send(text_data=json.dumps({
                'type':"LearnSocket",
                'message': "Received Messages"
            }))
            t += 10
            time.sleep(10)

Frontend- React.JS

    const randN = generate()
    console.log(randN)
    const socket = new WebSocket('ws://127.0.0.1:8000/ws/socket-server/monitor-rack-kpis/'+ randN+ '/');

    console.log(socket)

    socket.onopen=function(e){
      console.log(socket.readyState)
      if (user && user.access) {
        socket.send("Hi");

      //Receiving response from WebSocket
      socket.onmessage=function(e){
        //let data1=JSON.parse(e.data);
        console.log(e.data, new Date());
        //setOutputResponse(data1['message']);
      }
      }
    }


问:
DB2 Trigger change in one step
I need to update a lot DB2 triggers.

My way actually is to drop and create the trigger.
e.g.

```<code>DROP TRIGGER IF EXISTS ABC.DELETE_V68_BVVVSP2_V68JOURNAL ;
CREATE TRIGGER ABC.DELETE_V68_BVVVSP2_V68JOURNAL [..]
</code>```

but the risk is that the first command is processed and the second not - then I my trigger is off and it misses database actions.

Is there any way on DB2 to let this run in one step or any command like..

```<code>Update TRIGGER...
RECREATE TRIGGER...
</code>```

The OS is i5 Release 4.
Thanks.

Title: DB2 Trigger change in one step

Body:
I need to update a lot DB2 triggers.

My way actually is to drop and create the trigger.
e.g.

DROP TRIGGER IF EXISTS ABC.DELETE_V68_BVVVSP2_V68JOURNAL ;
CREATE TRIGGER ABC.DELETE_V68_BVVVSP2_V68JOURNAL [..]

but the risk is that the first command is processed and the second not - then I my trigger is off and it misses database actions.

Is there any way on DB2 to let this run in one step or any command like..

Update TRIGGER...
RECREATE TRIGGER...

The OS is i5 Release 4.
Thanks.


问:
Getting Error using Syncfusion HTML to PDF on azure serverless function : BlinkBinariesLinux not found
I want to use Syncfusion library to convert HTML to PDF but even if I follow this guide: https://www.syncfusion.com/kb/10301/how-to-convert-html-to-pdf-in-azure-functions-4-0

I get this error: Blink files are missing at /home/site/wwwroot/bin/BlinkBinariesLinux

I tried to hardcode BlinkPath in BlinkConverterSettings but it seems to have no impact.

By looking output deployed files I see that BlinkBinariesLinux directory is not inside bin path but in it's parent folder.

So I tried to add this to my csproj :

```<code><ItemGroup>
    <FilesToMove Include="$(OutDir)BlinkBinariesLinux\*.*"/>
    <LocaleFilesToMove Include="$(OutDir)BlinkBinariesLinux\locales\**\*.*"/>
</ItemGroup>

<Target Name="MoveFiles" AfterTargets="Build">
    <MakeDir Directories="$(OutDir)bin\BlinkBinariesLinux;$(OutDir)bin\BlinkBinariesLinux\locales" />
    <Move SourceFiles="@(LocaleFilesToMove)" DestinationFolder="$(OutDir)bin\BlinkBinariesLinux\locales"/>
    <Move SourceFiles="@(FilesToMove)" DestinationFolder="$(OutDir)bin\BlinkBinariesLinux"/>
</Target>
</code>```

to move the folder to bin directory but when I look at output file after build, the BlinkBinariesLinux directory created inside bin path is empty and the one in the parent directory still have files.
If I execute build a second time, sometime, files are all correctly moved.

So my question is, why msbuild do that ? and the real question is, what I miss to make it works on azure function ?

Body:
I want to use Syncfusion library to convert HTML to PDF but even if I follow this guide: https://www.syncfusion.com/kb/10301/how-to-convert-html-to-pdf-in-azure-functions-4-0

I get this error: Blink files are missing at /home/site/wwwroot/bin/BlinkBinariesLinux

I tried to hardcode BlinkPath in BlinkConverterSettings but it seems to have no impact.

By looking output deployed files I see that BlinkBinariesLinux directory is not inside bin path but in it's parent folder.

So I tried to add this to my csproj :

<ItemGroup>
    <FilesToMove Include="$(OutDir)BlinkBinariesLinux\*.*"/>
    <LocaleFilesToMove Include="$(OutDir)BlinkBinariesLinux\locales\**\*.*"/>
</ItemGroup>

<Target Name="MoveFiles" AfterTargets="Build">
    <MakeDir Directories="$(OutDir)bin\BlinkBinariesLinux;$(OutDir)bin\BlinkBinariesLinux\locales" />
    <Move SourceFiles="@(LocaleFilesToMove)" DestinationFolder="$(OutDir)bin\BlinkBinariesLinux\locales"/>
    <Move SourceFiles="@(FilesToMove)" DestinationFolder="$(OutDir)bin\BlinkBinariesLinux"/>
</Target>

to move the folder to bin directory but when I look at output file after build, the BlinkBinariesLinux directory created inside bin path is empty and the one in the parent directory still have files.
If I execute build a second time, sometime, files are all correctly moved.

So my question is, why msbuild do that ? and the real question is, what I miss to make it works on azure function ?


问:
Cannot use vscode-cpptools in docker without root permission
I defined a simple docker here : https://github.com/htool-ddm/htool_testing_environments/blob/master/ubuntu/Dockerfile where I defined a user with

```<code>ARG USER=mpi
ENV USER ${USER}
ENV USER_HOME /home/${USER}
RUN useradd -s /bin/bash --user-group --system --create-home --no-log-init ${USER}
</code>```

and when I used this image as a devcontainer with

```<code>"image": "pierremarchand/htool_testing_environments:ubuntu_gcc_openmpi",
"workspaceFolder": "/home/mpi",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/mpi/,type=bind",
</code>```

I get the following error:

```<code>Error - 4:48:52 PM] cpptools client: couldn't create connection to server.
Launching server using command /home/mpi/.vscode-server/extensions/ms-vscode.cpptools-1.13.9-linux-x64/bin/cpptools failed. Error: spawn /home/mpi/.vscode-server/extensions/ms-vscode.cpptools-1.13.9-linux-x64/bin/cpptools EACCES
</code>```

I guess this is an issue with permission because it works when running the devcontainer with root permission (using "remoteUser": "root"). Is there an issue in the way I defined my docker image ? or is this an issue in the way I define my devcontainer ?

Body:
I defined a simple docker here : https://github.com/htool-ddm/htool_testing_environments/blob/master/ubuntu/Dockerfile where I defined a user with

ARG USER=mpi
ENV USER ${USER}
ENV USER_HOME /home/${USER}
RUN useradd -s /bin/bash --user-group --system --create-home --no-log-init ${USER}

and when I used this image as a devcontainer with

"image": "pierremarchand/htool_testing_environments:ubuntu_gcc_openmpi",
"workspaceFolder": "/home/mpi",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/mpi/,type=bind",

I get the following error:

Error - 4:48:52 PM] cpptools client: couldn't create connection to server.
Launching server using command /home/mpi/.vscode-server/extensions/ms-vscode.cpptools-1.13.9-linux-x64/bin/cpptools failed. Error: spawn /home/mpi/.vscode-server/extensions/ms-vscode.cpptools-1.13.9-linux-x64/bin/cpptools EACCES

I guess this is an issue with permission because it works when running the devcontainer with root permission (using "remoteUser": "root"). Is there an issue in the way I defined my docker image ? or is this an issue in the way I define my devcontainer ?


问:
where and how grace period for Linux RCU's is initialized and accounted?
Trying to understand, how and where grace period in an RCU is initialized. Is there a static declaration somewhere in Linux Kernel to define the grace period, or are there some other complex ways to do this, for example as per this small snippet:

```<code> for_each_online_cpu(cpu)
     run_on(cpu);
</code>```

grace period is total time taken to run the current thread on all the CPUs and after this total time has elapsed all the readers are done their critical sections ?

Body:
Trying to understand, how and where grace period in an RCU is initialized. Is there a static declaration somewhere in Linux Kernel to define the grace period, or are there some other complex ways to do this, for example as per this small snippet:

 for_each_online_cpu(cpu)
     run_on(cpu);

grace period is total time taken to run the current thread on all the CPUs and after this total time has elapsed all the readers are done their critical sections ?


问:
Asp.Net MVC5 dropzone js send with paramters
I want to post to a controller using bs-stepper and dropzone js together. How can I capture data in Controller?

html page, script and entity class and controller are below. I wonder where am I doing wrong

my scripts

```<code> document.getElementById("dropzone-yukle").addEventListener("click", function (event) {
        event.preventDefault();
        const form = document.getElementById('stepper-form');
        formData = new FormData(form);
        var object = {};
        formData.forEach(function (value, key) {
            object\[key\] = value;
        });
        var jsonData = JSON.stringify(object);
        let params = { model: jsonData };
        myDropzone.options.params = params;

        myDropzone.processQueue();
    });
</code>```

Controller

```<code>[HttpPost]

public ActionResult OdaForm(ent_ODALAR model, HttpPostedFileBase[] files)

{

}
</code>```

Entity class

```<code>public class ent_ODALAR
    {
        public long id { get; set; }
        public int oda_no { get; set; }
        public string oda_adi { get; set; }
        public string oda_aciklamasi { get; set; }
        public string oda_turu { get; set; }
        public double oda_fiyati { get; set; }
        public int oda_max_sayisi { get; set; }
        public string oda_durumu { get; set; }
        public int sira { get; set; }
        public bool durum { get; set; }
        public string oda_resim { get; set; }
    }
</code>```

Body:
I want to post to a controller using bs-stepper and dropzone js together. How can I capture data in Controller?

html page, script and entity class and controller are below. I wonder where am I doing wrong

my scripts

 document.getElementById("dropzone-yukle").addEventListener("click", function (event) {
        event.preventDefault();
        const form = document.getElementById('stepper-form');
        formData = new FormData(form);
        var object = {};
        formData.forEach(function (value, key) {
            object\[key\] = value;
        });
        var jsonData = JSON.stringify(object);
        let params = { model: jsonData };
        myDropzone.options.params = params;

        myDropzone.processQueue();
    });

Controller

[HttpPost]

public ActionResult OdaForm(ent_ODALAR model, HttpPostedFileBase[] files)

{

}

Entity class

public class ent_ODALAR
    {
        public long id { get; set; }
        public int oda_no { get; set; }
        public string oda_adi { get; set; }
        public string oda_aciklamasi { get; set; }
        public string oda_turu { get; set; }
        public double oda_fiyati { get; set; }
        public int oda_max_sayisi { get; set; }
        public string oda_durumu { get; set; }
        public int sira { get; set; }
        public bool durum { get; set; }
        public string oda_resim { get; set; }
    }


问:
How to apply nested group by in DAX power bi
I have a survey data in a DWH and I want to calculate satisfaction rate,
I was able to do so with SQL server query, but due to lack of knowledge in DAX I couldn't achieve it as a measure in power BI using DAX.

The data warehouse contains 3 tables plus the DIM_DAT, bellow is a sample of the data:

Data model:

The formula to calculate the satisfaction:

(Count of RESPONDENT where ANSWER_VALUE >= 4 for each question (group by QUESTION_DESC).
divided by the number of answers for each question)

grouped by QUESTION_PRIMARY_STAGE and multiply by the weight (the weight is different for each QUESTION_PRIMARY_STAGE)

I was able to achieve the desired result by SQL server query, but because it's only the final result (satisfaction I can't do further analytics on it for example : satisfaction by department / Question / Stage).
.

My SQL server query:

```<code>SELECT SURVEY_NAME, SUM(FINALPERC) as SATISFACTION -- sum the satisfaction of the Stages
FROM
(
SELECT SURVEY_NAME, QUESTION_PRIMARY_STAGE,
(AVG("4-5 %") * WEIGHT)/100 AS FINALPERC -- multiply by the weight of each QUESTION_PRIMARY_STAGE and divid it by 100 (the sum of the weight for the stages are 100)
FROM (
select tmp0.SURVEY_NAME, tmp0.QUESTION_DESC, tmp0.QUESTION_PRIMARY_STAGE, tmp0.WEIGHT ,
("4-5"*1.0 / tmp1.COUNTR) as "4-5 %"  -- divide by the number of answers for each question
from(
select da.SURVEY_NAME, QUESTION_DESC, da.QUESTION_PRIMARY_STAGE, da.WEIGHT ,
count(fr.RESPONDENT_SRGT) as "4-5" -- Count of RESPONDENT where ANSWER_VALUE >= 4 for each question (group by QUESTION_DESC)
from [dbo].[DWH_QLT_FACT_SURVEY_RESPONSES] fr
join [dbo].[DWH_QLT_DIM_QUESTION_ANSWER] da
on fr.QUESTION_ANSWER_SRGT = da.QUESTION_ANSWER_SRGT

and da.ANSWER_VALUE >= 4
group by da.SURVEY_NAME, QUESTION_DESC, QUESTION_PRIMARY_STAGE, WEIGHT
) tmp0
join
(
--------------------------------Get the number of answers for each question----------------------
select da.SURVEY_NAME, QUESTION_DESC, COUNT(RESPONDENT_SRGT) COUNTR
from  [dbo].[DWH_QLT_FACT_SURVEY_RESPONSES] fr
join [dbo].[DWH_QLT_DIM_QUESTION_ANSWER] da
on fr.QUESTION_ANSWER_SRGT = da.QUESTION_ANSWER_SRGT

group by da.SURVEY_NAME, QUESTION_DESC
)tmp1

on tmp0.QUESTION_DESC = tmp1.QUESTION_DESC
-------------------------------------------------------------------------------------------------
)TMP2
GROUP BY SURVEY_NAME, QUESTION_PRIMARY_STAGE,WEIGHT
)TMP2
GROUP BY SURVEY_NAME
</code>```

Problem:

I want to convert this formula in DAX.

Original masked data are in the shared excel sheet bellow:

https://1drv.ms/x/s!Aq0hOy_0CV0IhD04ClHKc9F-DP2H?e=s5dhjG

Body:
I have a survey data in a DWH and I want to calculate satisfaction rate,
I was able to do so with SQL server query, but due to lack of knowledge in DAX I couldn't achieve it as a measure in power BI using DAX.

The data warehouse contains 3 tables plus the DIM_DAT, bellow is a sample of the data:

Data model:

The formula to calculate the satisfaction:

(Count of RESPONDENT where ANSWER_VALUE >= 4 for each question (group by QUESTION_DESC).
divided by the number of answers for each question)

grouped by QUESTION_PRIMARY_STAGE and multiply by the weight (the weight is different for each QUESTION_PRIMARY_STAGE)

I was able to achieve the desired result by SQL server query, but because it's only the final result (satisfaction I can't do further analytics on it for example : satisfaction by department / Question / Stage).
.

My SQL server query:

SELECT SURVEY_NAME, SUM(FINALPERC) as SATISFACTION -- sum the satisfaction of the Stages
FROM
(
SELECT SURVEY_NAME, QUESTION_PRIMARY_STAGE,
(AVG("4-5 %") * WEIGHT)/100 AS FINALPERC -- multiply by the weight of each QUESTION_PRIMARY_STAGE and divid it by 100 (the sum of the weight for the stages are 100)
FROM (
select tmp0.SURVEY_NAME, tmp0.QUESTION_DESC, tmp0.QUESTION_PRIMARY_STAGE, tmp0.WEIGHT ,
("4-5"*1.0 / tmp1.COUNTR) as "4-5 %"  -- divide by the number of answers for each question
from(
select da.SURVEY_NAME, QUESTION_DESC, da.QUESTION_PRIMARY_STAGE, da.WEIGHT ,
count(fr.RESPONDENT_SRGT) as "4-5" -- Count of RESPONDENT where ANSWER_VALUE >= 4 for each question (group by QUESTION_DESC)
from [dbo].[DWH_QLT_FACT_SURVEY_RESPONSES] fr
join [dbo].[DWH_QLT_DIM_QUESTION_ANSWER] da
on fr.QUESTION_ANSWER_SRGT = da.QUESTION_ANSWER_SRGT

and da.ANSWER_VALUE >= 4
group by da.SURVEY_NAME, QUESTION_DESC, QUESTION_PRIMARY_STAGE, WEIGHT
) tmp0
join
(
--------------------------------Get the number of answers for each question----------------------
select da.SURVEY_NAME, QUESTION_DESC, COUNT(RESPONDENT_SRGT) COUNTR
from  [dbo].[DWH_QLT_FACT_SURVEY_RESPONSES] fr
join [dbo].[DWH_QLT_DIM_QUESTION_ANSWER] da
on fr.QUESTION_ANSWER_SRGT = da.QUESTION_ANSWER_SRGT

group by da.SURVEY_NAME, QUESTION_DESC
)tmp1

on tmp0.QUESTION_DESC = tmp1.QUESTION_DESC
-------------------------------------------------------------------------------------------------
)TMP2
GROUP BY SURVEY_NAME, QUESTION_PRIMARY_STAGE,WEIGHT
)TMP2
GROUP BY SURVEY_NAME

Problem:

I want to convert this formula in DAX.

Original masked data are in the shared excel sheet bellow:

https://1drv.ms/x/s!Aq0hOy_0CV0IhD04ClHKc9F-DP2H?e=s5dhjG


问:
Register a custom URL protocol in Windows doesn't open my file?
I am trying to make a custom protocol to open my c# windows application through a web application following the first comment's steps here: How do I register a custom URL protocol in Windows?
After setting everything up, I got to the last part where I have to type the link. Internet Explorer knows that I have to open some sort of a file but it requires a different reader.

Here is the protocol I made.

And this is the path, I have copied it, so it should be correct!

This is the folder of the program that I want to open.

Here is what happens when I go to that website. As you can see, I need to allow the browser to open the app.

And here is the problem. Any solutions to that? Of course, I can open normally the .exe file without getting any errors.


问:
How to reset column ordering on Mui Data Grid?
I want to reset column ordering:

```<code>import * as React from 'react';
import Box from '@mui/material/Box';
import { DataGridPro } from '@mui/x-data-grid-pro';
import { useDemoData } from '@mui/x-data-grid-generator';

export default function DataGridProDemo() {
    const { data } = useDemoData({
        dataSet: 'Commodity',
        rowLength: 100000,
        editable: true,
    });

    const resetOrdering = () => {
        // I need to get ordering state and reset it by default
    }

    return (
        <Box sx={{ height: 520, width: '100%' }}>
            <button onClick={resetOrdering} > Reset </button>
            <DataGridPro
                {...data}
                loading={data.rows.length === 0}
                rowHeight={38}
                checkboxSelection
                disableSelectionOnClick
                experimentalFeatures={{ newEditingApi: true }}
            />
        </Box>
    );
}
</code>```

I have tried to use separated setters from the Data Grid Pro API, but it doesn't help me.

Body:
I want to reset column ordering:

import * as React from 'react';
import Box from '@mui/material/Box';
import { DataGridPro } from '@mui/x-data-grid-pro';
import { useDemoData } from '@mui/x-data-grid-generator';

export default function DataGridProDemo() {
    const { data } = useDemoData({
        dataSet: 'Commodity',
        rowLength: 100000,
        editable: true,
    });

    const resetOrdering = () => {
        // I need to get ordering state and reset it by default
    }

    return (
        <Box sx={{ height: 520, width: '100%' }}>
            <button onClick={resetOrdering} > Reset </button>
            <DataGridPro
                {...data}
                loading={data.rows.length === 0}
                rowHeight={38}
                checkboxSelection
                disableSelectionOnClick
                experimentalFeatures={{ newEditingApi: true }}
            />
        </Box>
    );
}

I have tried to use separated setters from the Data Grid Pro API, but it doesn't help me.


问:
Netbeans Plugin with GUI
I would ask if there is any possibility to write my own plugin with GUI for Netbeans?

I have some things (e.g. files creation) that I want to do automatically depending on specification that I choose on GUI.

Title: Netbeans Plugin with GUI


问:
Is it possible to delete an externally scoped image file from the phone using Flutter?
I want to select a photo through the OS gallery picker, obtain the path or unique identifier, then delete that photo from the phone entirely.

This is not a file that is local or within the Flutter app itself.

Using an Android emulator, when I get the path of the file it is a cached version internal to the app:

File: '/data/user/0/io.flutter.plugins.imagepicker.example/cache/image_picker3104450369160425156.jpg'

I am using the image_picker package to get the image. This is how:

```<code> List<XFile>? _imageFileList;
  final ImagePicker _picker = ImagePicker();

  void _setImageFileListFromFile(XFile? value) {
    _imageFileList = value == null ? null : <XFile>[value];
  }

  Future<void> _onImageButtonPressed(ImageSource source, {BuildContext? context}) async {
      try {
        final List<XFile> pickedFileList = await _picker.pickMultiImage();
        setState(() {
          _imageFileList = pickedFileList;
        });
      } catch (e) {
        log('error');
      }
  }
</code>```

Body:
I want to select a photo through the OS gallery picker, obtain the path or unique identifier, then delete that photo from the phone entirely.

This is not a file that is local or within the Flutter app itself.

Using an Android emulator, when I get the path of the file it is a cached version internal to the app:

File: '/data/user/0/io.flutter.plugins.imagepicker.example/cache/image_picker3104450369160425156.jpg'

I am using the image_picker package to get the image. This is how:

 List<XFile>? _imageFileList;
  final ImagePicker _picker = ImagePicker();

  void _setImageFileListFromFile(XFile? value) {
    _imageFileList = value == null ? null : <XFile>[value];
  }

  Future<void> _onImageButtonPressed(ImageSource source, {BuildContext? context}) async {
      try {
        final List<XFile> pickedFileList = await _picker.pickMultiImage();
        setState(() {
          _imageFileList = pickedFileList;
        });
      } catch (e) {
        log('error');
      }
  }


问:
How to get selected id in Color adapter under Size Adapter

There is a Size adapter & under the size adapter, i added a color adapter. How can i get the selected size id & selected color id.


问:
Jhipster Registry Logs Menu not shho in admin menu
In my fresh Jhipster Registry 7.0.4 launch with jar application from github (with dev profile), I can see the logs menu (and all other).

I apply the default configuration files.

Application-dev.yml:

```<code>spring:
    devtools:
        restart:
            enabled: false
        livereload:
            enabled: false
    mail:
        host: localhost
        port: 25
        username:
        password:
    security:
        user:
            name: admin
            password: admin
            role: USER,ADMIN

server:
    port: 9762
    compression:
        enabled: true
        mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json
        min-response-size: 1024

eureka:
  client:
    service-url:
      defaultZone: http://admin:admin@localhost:9762/eureka

logging:
    file: logs/jhipster-registry.log
    level:
        ROOT: INFO
        io.github.jhipster: INFO
        io.github.jhipster.registry: INFO

jhipster:
    http:
        cache: # Used by the CachingHttpHeadersFilter
            timeToLiveInDays: 1461
    security:
        authentication:
            jwt:
                token-validity-in-seconds: 86400
                token-validity-in-seconds-for-remember-me: 2592000
    mail: # specific JHipster mail property, for standard properties see MailProperties
        from: JHipsterRegistry@localhost
        base-url: http://my-server-url-to-change # Modify according to your server's URL
    logging:
        logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration
            enabled: false
            host: localhost
            port: 5000
            queue-size: 512
    cache:
        hazelcast:

# application:
</code>```

registry is OK I can use it but I can't see and configure log level of jhipster of any module registered. How can I see them ?

Body:
In my fresh Jhipster Registry 7.0.4 launch with jar application from github (with dev profile), I can see the logs menu (and all other).

I apply the default configuration files.

Application-dev.yml:

spring:
    devtools:
        restart:
            enabled: false
        livereload:
            enabled: false
    mail:
        host: localhost
        port: 25
        username:
        password:
    security:
        user:
            name: admin
            password: admin
            role: USER,ADMIN

server:
    port: 9762
    compression:
        enabled: true
        mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json
        min-response-size: 1024

eureka:
  client:
    service-url:
      defaultZone: http://admin:admin@localhost:9762/eureka

logging:
    file: logs/jhipster-registry.log
    level:
        ROOT: INFO
        io.github.jhipster: INFO
        io.github.jhipster.registry: INFO

jhipster:
    http:
        cache: # Used by the CachingHttpHeadersFilter
            timeToLiveInDays: 1461
    security:
        authentication:
            jwt:
                token-validity-in-seconds: 86400
                token-validity-in-seconds-for-remember-me: 2592000
    mail: # specific JHipster mail property, for standard properties see MailProperties
        from: JHipsterRegistry@localhost
        base-url: http://my-server-url-to-change # Modify according to your server's URL
    logging:
        logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration
            enabled: false
            host: localhost
            port: 5000
            queue-size: 512
    cache:
        hazelcast:

# application:

registry is OK I can use it but I can't see and configure log level of jhipster of any module registered. How can I see them ?


问:
ASP.NET URL and XSS
In my application (ASP.NET) i have to localize the page. In the top corder there are classic flag interface to choose among supported languages.

Each flag has it own language calculated server side (i need to tranlsate also the page slug) so :

en : mysite.com/customer_support?language=en

de : mysite.com/benutzer-support?language=de

As you can see also the link change (not only url parameter) so i have to do this localization server side, and procedee that way

```<code><ul class="dropdown-menu" style="">
    <% foreach (string languageCode in this.Configuration?.ActiveLanguages)  {%>
        <li>
            <a class="dropdown-item nav-link text-nowrap" href="<%=_myUrlObject.Localize(languageCode).UpdateParameter("languageCode",languageCode )%>" >
            <img src="/Images/Flags/<%=languageCode%>.svg" height="12" width="16" />
        </a>
        </li>
    <% } %>
</ul>
</code>```

Where _myUrlObject is an instance of custom class that basically act similary to Uri class but let me localize the slug.
Problem is that class does not handle query string that survive as it arrive from client.

So if i receive :
mysite.com/customer_support?language=en&someEvilData

I will produce the flags including someEvilData sent by the client.
It seems to me that whatever it come, it's urlencoded, but i ask myself if there is some character combination that may escape the href quote, leading to XSS :

```<code><%=_myUrlObject.Localize(languageCode).UpdateParameter("language",languageCode )%>" > //eg : de
        |
        V
href="mysite.com/benutzer-support?language=de&someEvilData" >
</code>```

Seems to me that because all query strings are url encoded, is not possible to evade href quotes, but it's a my guess and i am not sure. Is there something i need to be concerned?

Title: ASP.NET URL and XSS

Body:
In my application (ASP.NET) i have to localize the page. In the top corder there are classic flag interface to choose among supported languages.

Each flag has it own language calculated server side (i need to tranlsate also the page slug) so :

en : mysite.com/customer_support?language=en

de : mysite.com/benutzer-support?language=de

As you can see also the link change (not only url parameter) so i have to do this localization server side, and procedee that way

    <% foreach (string languageCode in this.Configuration?.ActiveLanguages)  {%>

            <a class="dropdown-item nav-link text-nowrap" href="<%=_myUrlObject.Localize(languageCode).UpdateParameter("languageCode",languageCode )%>" >
            <img src="/Images/Flags/<%=languageCode%>.svg" height="12" width="16" />

    <% } %>

Where _myUrlObject is an instance of custom class that basically act similary to Uri class but let me localize the slug.
Problem is that class does not handle query string that survive as it arrive from client.

So if i receive :
mysite.com/customer_support?language=en&someEvilData

I will produce the flags including someEvilData sent by the client.
It seems to me that whatever it come, it's urlencoded, but i ask myself if there is some character combination that may escape the href quote, leading to XSS :

<%=_myUrlObject.Localize(languageCode).UpdateParameter("language",languageCode )%>" > //eg : de
        |
        V
href="mysite.com/benutzer-support?language=de&someEvilData" >

Seems to me that because all query strings are url encoded, is not possible to evade href quotes, but it's a my guess and i am not sure. Is there something i need to be concerned?


问:
Pyspark Python Find a symbol and append next row
I struggling with dataset obtained from host server in .ipt format converted to .csv.
Dataset comes with NO HEADERS.
Dataset with no headers

All I have to do it to search for \ if found then replace & append next row.

Please, can you help me on how to resolve it?

It will look like this in final stage.
Final Desirable Output


问:
Error report when using ROUND with APERCENTILE and 't-digest' configurations in TDengine
Error will be reported when using ROUND with the percentile APERCENTILE and the 't-digest' configuration in a super table with 20 million data

```<code>SELECT count(*) as count, APERCENTILE(api_response_time, 50, 't-digest') AS percent50, APERCENTILE(api_response_time, 80, 't-digest') AS percent80, APE
RCENTILE(api_response_time, 90, 't-digest') AS percent90, APERCENTILE(api_response_time, 95, 't-digest') AS percent95 FROM api WHERE app_id=1 AND api
_http_status IN ('200', '304') AND time_server >= TODAY() AND time_server <= NOW() INTERVAL(1m) FILL(VALUE, 0);
</code>```

the result

my environment: Ubuntu：8C、32G、4T；TDengine Version：2.6.0.32

Body:
Error will be reported when using ROUND with the percentile APERCENTILE and the 't-digest' configuration in a super table with 20 million data

SELECT count(*) as count, APERCENTILE(api_response_time, 50, 't-digest') AS percent50, APERCENTILE(api_response_time, 80, 't-digest') AS percent80, APE
RCENTILE(api_response_time, 90, 't-digest') AS percent90, APERCENTILE(api_response_time, 95, 't-digest') AS percent95 FROM api WHERE app_id=1 AND api
_http_status IN ('200', '304') AND time_server >= TODAY() AND time_server <= NOW() INTERVAL(1m) FILL(VALUE, 0);

the result

my environment: Ubuntu：8C、32G、4T；TDengine Version：2.6.0.32


问:
Android Studio: Making a music player that changes songs every hour
I am currently making a music player that changes songs every hour. There are 4 playlists of songs which are downloaded into android studio to choose from which I used MaterialButtonToggleGroup for. The song is supposed to play when I press one of these buttons and change to another playlist when I press another toggle button.

The problems I've ran into is I don't know what function to use to get the hour or update the music player. The music player does not stop the previous songs when I press another button and I don't know how to make it play another song every hour.

I tried using Calender.getInstance() to get the time but I'm not sure how to update it. I was also unable to stop the music player when another button was pressed.

I am a beginner :P

Here is my current code:

```<code>var playlist = mutableListOf<Int>()

class MainActivity : AppCompatActivity() {
    @RequiresApi(Build.VERSION_CODES.N)
    @SuppressLint("MissingInflatedId", "SetTextI18n")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        //      phone time tracker
//      button
        //place holder
        val clock = Calendar.getInstance()
        val hour24:Int = clock.get(Calendar.HOUR_OF_DAY)
        val hour12:Int = clock.get(Calendar.HOUR)
        val amPm:Int = clock.get(Calendar.AM_PM)
        val amPM:String = if (amPm == 0){
            "AM"
        }else{
            "PM"
        }
        val tv1: TextView = findViewById(R.id.etSongName)
        val img: ImageView = findViewById(R.id.ivAC)
        var gameName= ""
        val tG:MaterialButtonToggleGroup = findViewById(R.id.tbg)
        tG.addOnButtonCheckedListener { _, checkedId, isChecked ->
            if (isChecked) {
                when(checkedId) {
                    //if that button pressed, then thing activates
                    R.id.btnACGC->
                    {
                        gameName = "ACGC"
                        img.setImageResource(R.drawable.acgc)
                        playlist = mutableListOf(R.raw.acgc12am,R.raw.acgc1am,R.raw.acgc2am,R.raw.acgc3am,R.raw.acgc4am,R.raw.acgc5am,R.raw.acgc6am,R.raw.acgc7am,R.raw.acgc8am,R.raw.acgc9am,R.raw.acgc10am,
                            R.raw.acgc11am,R.raw.acgc12pm,R.raw.acgc1pm,R.raw.acgc2pm,R.raw.acgc3pm,R.raw.acgc4pm,R.raw.acgc5pm,R.raw.acgc6pm,R.raw.acgc7pm,R.raw.acgc8pm,
                            R.raw.acgc9pm,R.raw.acgc10pm,R.raw.acgc11pm)
                        //^Havent actually added the music but the files are in raw
                    }
                    //   add playlists
                    R.id.btnACWW->
                    {
                        gameName = "ACWW"
                        img.setImageResource(R.drawable.acww)
                        playlist = mutableListOf(R.raw.accf12am,R.raw.accf1am,R.raw.accf2am,R.raw.accf3am,R.raw.accf4am,R.raw.accf5am,R.raw.accf6am,R.raw.accf7am,R.raw.accf8am,R.raw.accf9am,R.raw.accf10am,
                            R.raw.accf11am,R.raw.accf12pm,R.raw.accf1pm,R.raw.accf2pm,R.raw.accf3pm,R.raw.accf4pm,R.raw.accf5pm,R.raw.accf6pm,R.raw.accf7pm,R.raw.accf8pm,
                            R.raw.accf9pm,R.raw.accf10pm,R.raw.accf11pm)

                    }
                    R.id.btnACCF->
                    {
                        gameName = "ACCF"
                        img.setImageResource(R.drawable.accf)
                        playlist = mutableListOf(R.raw.accf12am,R.raw.accf1am,R.raw.accf2am,R.raw.accf3am,R.raw.accf4am,R.raw.accf5am,R.raw.accf6am,R.raw.accf7am,R.raw.accf8am,R.raw.accf9am,R.raw.accf10am,
                            R.raw.accf11am,R.raw.accf12pm,R.raw.accf1pm,R.raw.accf2pm,R.raw.accf3pm,R.raw.accf4pm,R.raw.accf5pm,R.raw.accf6pm,R.raw.accf7pm,R.raw.accf8pm,
                            R.raw.accf9pm,R.raw.accf10pm,R.raw.accf11pm)
                    }
                    R.id.btnACNL->
                    {
                        gameName = "ACNL"
                        img.setImageResource(R.drawable.acnl)
                        playlist = mutableListOf(R.raw.acnl12am,R.raw.acnl1am,R.raw.acnl2am,R.raw.acnl3am,R.raw.acnl4am,R.raw.acnl5am,R.raw.acnl6am,R.raw.acnl7am,R.raw.acnl8am,R.raw.acnl9am,R.raw.acnl10am,
                            R.raw.acnl11am,R.raw.acnl12pm,R.raw.acnl1pm,R.raw.acnl2pm,R.raw.acnl3pm,R.raw.acnl4pm,R.raw.acnl5pm,R.raw.acnl6pm,R.raw.acnl7pm,R.raw.acnl8pm,
                            R.raw.acnl9pm,R.raw.acnl10pm,R.raw.acnl11pm)
                    }
                    R.id.btnACNH->
                    {
                        gameName = "ACNH"
                        img.setImageResource(R.drawable.acnh)
                        playlist = mutableListOf(R.raw.acnh12am,R.raw.acnh1am,R.raw.acnh2am,R.raw.acnh3am,R.raw.acnh4am,R.raw.acnh5am,R.raw.acnh6am,R.raw.acnh7am,R.raw.acnh8am,R.raw.acnh9am,R.raw.acnh10am,
                            R.raw.acnh11am,R.raw.acnh12pm,R.raw.acnh1pm,R.raw.acnh2pm,R.raw.acnh3pm,R.raw.acnh4pm,R.raw.acnh5pm,R.raw.acnh6pm,R.raw.acnh7pm,R.raw.acnh8pm,
                            R.raw.acnh9pm,R.raw.acnh10pm,R.raw.acnh11pm)

                }
            }

            }
            if(playlist.isNotEmpty()) {
                tv1.text="$gameName $hour12$amPM"
                //      mediaplayer & musiclist
                //make this so when playlist is not empty these will activate
                val mediaplayerr: MediaPlayer = MediaPlayer.create(this, playlist[hour24])
//        //the thing crashes since there is nothing in playlist so playlist[0] doenst work
                mediaplayerr.start()
                mediaplayerr.isLooping = true
            }
        }
    }
</code>```

Body:
I am currently making a music player that changes songs every hour. There are 4 playlists of songs which are downloaded into android studio to choose from which I used MaterialButtonToggleGroup for. The song is supposed to play when I press one of these buttons and change to another playlist when I press another toggle button.

The problems I've ran into is I don't know what function to use to get the hour or update the music player. The music player does not stop the previous songs when I press another button and I don't know how to make it play another song every hour.

I tried using Calender.getInstance() to get the time but I'm not sure how to update it. I was also unable to stop the music player when another button was pressed.

I am a beginner :P

Here is my current code:

var playlist = mutableListOf<Int>()

class MainActivity : AppCompatActivity() {
    @RequiresApi(Build.VERSION_CODES.N)
    @SuppressLint("MissingInflatedId", "SetTextI18n")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        //      phone time tracker
//      button
        //place holder
        val clock = Calendar.getInstance()
        val hour24:Int = clock.get(Calendar.HOUR_OF_DAY)
        val hour12:Int = clock.get(Calendar.HOUR)
        val amPm:Int = clock.get(Calendar.AM_PM)
        val amPM:String = if (amPm == 0){
            "AM"
        }else{
            "PM"
        }
        val tv1: TextView = findViewById(R.id.etSongName)
        val img: ImageView = findViewById(R.id.ivAC)
        var gameName= ""
        val tG:MaterialButtonToggleGroup = findViewById(R.id.tbg)
        tG.addOnButtonCheckedListener { _, checkedId, isChecked ->
            if (isChecked) {
                when(checkedId) {
                    //if that button pressed, then thing activates
                    R.id.btnACGC->
                    {
                        gameName = "ACGC"
                        img.setImageResource(R.drawable.acgc)
                        playlist = mutableListOf(R.raw.acgc12am,R.raw.acgc1am,R.raw.acgc2am,R.raw.acgc3am,R.raw.acgc4am,R.raw.acgc5am,R.raw.acgc6am,R.raw.acgc7am,R.raw.acgc8am,R.raw.acgc9am,R.raw.acgc10am,
                            R.raw.acgc11am,R.raw.acgc12pm,R.raw.acgc1pm,R.raw.acgc2pm,R.raw.acgc3pm,R.raw.acgc4pm,R.raw.acgc5pm,R.raw.acgc6pm,R.raw.acgc7pm,R.raw.acgc8pm,
                            R.raw.acgc9pm,R.raw.acgc10pm,R.raw.acgc11pm)
                        //^Havent actually added the music but the files are in raw
                    }
                    //   add playlists
                    R.id.btnACWW->
                    {
                        gameName = "ACWW"
                        img.setImageResource(R.drawable.acww)
                        playlist = mutableListOf(R.raw.accf12am,R.raw.accf1am,R.raw.accf2am,R.raw.accf3am,R.raw.accf4am,R.raw.accf5am,R.raw.accf6am,R.raw.accf7am,R.raw.accf8am,R.raw.accf9am,R.raw.accf10am,
                            R.raw.accf11am,R.raw.accf12pm,R.raw.accf1pm,R.raw.accf2pm,R.raw.accf3pm,R.raw.accf4pm,R.raw.accf5pm,R.raw.accf6pm,R.raw.accf7pm,R.raw.accf8pm,
                            R.raw.accf9pm,R.raw.accf10pm,R.raw.accf11pm)

                    }
                    R.id.btnACCF->
                    {
                        gameName = "ACCF"
                        img.setImageResource(R.drawable.accf)
                        playlist = mutableListOf(R.raw.accf12am,R.raw.accf1am,R.raw.accf2am,R.raw.accf3am,R.raw.accf4am,R.raw.accf5am,R.raw.accf6am,R.raw.accf7am,R.raw.accf8am,R.raw.accf9am,R.raw.accf10am,
                            R.raw.accf11am,R.raw.accf12pm,R.raw.accf1pm,R.raw.accf2pm,R.raw.accf3pm,R.raw.accf4pm,R.raw.accf5pm,R.raw.accf6pm,R.raw.accf7pm,R.raw.accf8pm,
                            R.raw.accf9pm,R.raw.accf10pm,R.raw.accf11pm)
                    }
                    R.id.btnACNL->
                    {
                        gameName = "ACNL"
                        img.setImageResource(R.drawable.acnl)
                        playlist = mutableListOf(R.raw.acnl12am,R.raw.acnl1am,R.raw.acnl2am,R.raw.acnl3am,R.raw.acnl4am,R.raw.acnl5am,R.raw.acnl6am,R.raw.acnl7am,R.raw.acnl8am,R.raw.acnl9am,R.raw.acnl10am,
                            R.raw.acnl11am,R.raw.acnl12pm,R.raw.acnl1pm,R.raw.acnl2pm,R.raw.acnl3pm,R.raw.acnl4pm,R.raw.acnl5pm,R.raw.acnl6pm,R.raw.acnl7pm,R.raw.acnl8pm,
                            R.raw.acnl9pm,R.raw.acnl10pm,R.raw.acnl11pm)
                    }
                    R.id.btnACNH->
                    {
                        gameName = "ACNH"
                        img.setImageResource(R.drawable.acnh)
                        playlist = mutableListOf(R.raw.acnh12am,R.raw.acnh1am,R.raw.acnh2am,R.raw.acnh3am,R.raw.acnh4am,R.raw.acnh5am,R.raw.acnh6am,R.raw.acnh7am,R.raw.acnh8am,R.raw.acnh9am,R.raw.acnh10am,
                            R.raw.acnh11am,R.raw.acnh12pm,R.raw.acnh1pm,R.raw.acnh2pm,R.raw.acnh3pm,R.raw.acnh4pm,R.raw.acnh5pm,R.raw.acnh6pm,R.raw.acnh7pm,R.raw.acnh8pm,
                            R.raw.acnh9pm,R.raw.acnh10pm,R.raw.acnh11pm)

                }
            }

            }
            if(playlist.isNotEmpty()) {
                tv1.text="$gameName $hour12$amPM"
                //      mediaplayer & musiclist
                //make this so when playlist is not empty these will activate
                val mediaplayerr: MediaPlayer = MediaPlayer.create(this, playlist[hour24])
//        //the thing crashes since there is nothing in playlist so playlist[0] doenst work
                mediaplayerr.start()
                mediaplayerr.isLooping = true
            }
        }
    }


问:
How we can convert hl7 message to C-CDA report?
We want to convert HL7 message to C-CDA format.

Looking for tools or solutions


问:
Real-time Conversation Transcription using azure speech to text
Create voice signatures does not work in Asp.Net core 3.1 console app .

I am implementing speech to text using azure speech to text service.  I am trying to get users conversation from  .wav audio file using Microsoft link which mention  in blow

https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-use-conversation-transcription?pivots=programming-language-csharp .

When I implement Create voice signatures it does not return any Json String Result and execution of program stops.


问:
How to get property type in property attribute in C#?
I am declaring the custom attribute that accept its property type. For example, let my attribute name as MyCustomAttribute, then

public class MyCustomAttribute : Attribute
{
    public Type PropertyType { get; }

    public MyCustomAttribute(Type propertyType)
    {
        PropertyType = propertyType;
    }
}
```
<p>And its usage is</p>
<pre class="lang-cs prettyprint-override"><code>enum Gender
{
    Male,
    Female
}

[MyCustom(typeof(Gender))]
public Gender Gender { get; set; }
</code>```

I want to know that is there a way that pass the property type automatically in C#. Like CallerMemberNameAttribute in  RaisePropertyChanged implementation, can I register an attribute like the below code?

[MyCustom()] // typeof(Gender) is omitted
public Gender Gender { get; set; }
```

Body:
I am declaring the custom attribute that accept its property type. For example, let my attribute name as MyCustomAttribute, then

public class MyCustomAttribute : Attribute
{
    public Type PropertyType { get; }

    public MyCustomAttribute(Type propertyType)
    {
        PropertyType = propertyType;
    }
}

And its usage is

enum Gender
{
    Male,
    Female
}

[MyCustom(typeof(Gender))]
public Gender Gender { get; set; }

I want to know that is there a way that pass the property type automatically in C#. Like CallerMemberNameAttribute in  RaisePropertyChanged implementation, can I register an attribute like the below code?

[MyCustom()] // typeof(Gender) is omitted
public Gender Gender { get; set; }


问:
Unity，When I package an empty scene, the GPU usage reaches 100%！！！
[[enter image description here](https://i.stack.imgur.com/orTud.png)](https://i.stack.imgur.com/C67tO.png)

I didn't do anything, just packed an empty scene, with this graphics card it reached 100%

I used Unity 2021, 2019, 2017 have the same problem, what is the problem?


问:
How can I create a clickable button in a pdf view underneath certain words in Flutter?
I have a pdf-file. On each page are titles that refer to a screen in the app. How can I (1) scan the text for certain words and then (2) show underneath them a button that links to my screen?

Right now I use flutter_pdfview but I would also use another plugin.


问:
I have a python script to merge excel files but it's resulting in the following error: TypeError: cannot use a string pattern on a bytes-like object
I have been working on the following code (slowly but surely improving my Python) that is supposed to merge Excel files.

```<code>import sys
from PyQt5.QtWidgets import (QApplication, QFileDialog, QLabel, QLineEdit, QPushButton, QVBoxLayout, QWidget)
import pandas as pd
import openpyxl

class MergeExcelGUI(QWidget):
    def __init__(self):
        super().__init__()
        self.mainFile = None
        self.fileNames = []
        self.initUI()

    def mergeFiles(self):
        # Get the file name from the line edit
        fileName = self.fileNameEdit.text()

        # Open a file dialog to select the save location
        options = QFileDialog.Options()
        options |= QFileDialog.ReadOnly
        fileName, _ = QFileDialog.getSaveFileName(self, 'Save file', fileName, 'Excel Files (*.xlsx);;All Files (*)', options=options)
        if fileName:
            # Load the 'main' Excel file
            df_main = pd.read_excel(self.mainFile)
            dfs = []
            for f in self.fileNames:
                with open(f, 'rb') as file:
                    xl = pd.read_excel(file, sheet_name=None, engine='openpyxl')
                if 'Den Bosch' in xl:
                    df = xl['Den Bosch']
                    sheet_name = df.iloc[0,0]
                    dfs.append((df, sheet_name))
            # Write the dataframes to an Excel file with multiple tabs
            with pd.ExcelWriter(fileName, engine='openpyxl') as writer:
                df_main.to_excel(writer, sheet_name='Main', index=False)
                for df, sheet_name in dfs:
                    df.to_excel(writer, sheet_name=sheet_name, index=False)

    def initUI(self):
        # Create a label and two buttons
        self.label = QLabel('Select the main Excel file and the Excel files to merge:')
        self.btn1 = QPushButton('Select main file')
        self.btn2 = QPushButton('Select files to merge')
        self.runBtn = QPushButton('Merge files')

        # Create labels to display the file names
        self.mainFileLabel = QLabel('')
        self.fileNamesLabel = QLabel('')

        # Create a line edit and a label to enter the file name
        self.fileNameEdit = QLineEdit()
        self.fileNameLabel = QLabel('Enter file name:')

        # Connect the buttons to their event handlers
        self.btn1.clicked.connect(self.selectMainFile)
        self.btn2.clicked.connect(self.selectFiles)
        self.runBtn.clicked.connect(self.mergeFiles)

        # Create a vertical layout and add
        # Create a vertical layout and add the widgets
        layout = QVBoxLayout()
        layout.addWidget(self.label)
        layout.addWidget(self.btn1)
        layout.addWidget(self.mainFileLabel)
        layout.addWidget(self.btn2)
        layout.addWidget(self.fileNamesLabel)
        layout.addWidget(self.fileNameLabel)
        layout.addWidget(self.fileNameEdit)
        layout.addWidget(self.runBtn)
        self.setLayout(layout)

        # Set the window properties
        self.setGeometry(300, 300, 300, 200)
        self.setWindowTitle('Excel Merger')
        self.show()

    def selectMainFile(self):
        # Open a file dialog and get the selected file name
        options = QFileDialog.Options()
        options |= QFileDialog.ReadOnly
        fileName, _ = QFileDialog.getOpenFileName(self, 'Select main file', '', 'Excel Files (*.xlsx);;All Files (*)', options=options)
        if fileName:
            # Store the selected file name in a class attribute and update the label
            self.mainFile = fileName
            self.mainFileLabel.setText('Main file: {}'.format(fileName))

    def selectFiles(self):
        # Open a file dialog and get the selected file names
        options = QFileDialog.Options()
        options |= QFileDialog.ReadOnly
        fileNames, _ = QFileDialog.getOpenFileNames(self, 'Select files to merge', '', 'Excel Files (*.xlsx);;All Files (*)', options=options)
        if fileNames:
            # Store the selected file names in a class attribute and update the label
            self.fileNames = fileNames
            self.fileNamesLabel.setText('Files to merge: {}'.format(', '.join(fileNames)))

if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = MergeExcelGUI()
    sys.exit(app.exec_())
</code>```

To elaborate on what I want to achieve: There is supposed to be one 'main' Excel file. This main file contains one tab with data. I want to merge a multitude of other Excel files to the main file. These other Excel files have multiple tabs but I only want the information from the tab called 'Den Bosch'. FYI, all these secondary files have a tab named Den Bosch.

In these Den Bosch tabs I want to take the value in cell A1 and use that as the tab name in the main file once it gets merged! e.g. I have the main file, I have another Excel file with a Den Bosch tab that has the name test123 in cell A1. I now want to merge this file with the main file and put the information of this Den Bosch tab in a new tab named test123. When using my code it is giving me the following error: TypeError: cannot use a string pattern on a bytes-like object. This error occurs in line 38

```<code>df.to_excel(writer, sheet_name=sheet_name, index=False)
</code>```

I have tried many things but I cannot seem to solve it. Does anyone have any idea? Help would be very much appreciated.

Body:
I have been working on the following code (slowly but surely improving my Python) that is supposed to merge Excel files.

import sys
from PyQt5.QtWidgets import (QApplication, QFileDialog, QLabel, QLineEdit, QPushButton, QVBoxLayout, QWidget)
import pandas as pd
import openpyxl

class MergeExcelGUI(QWidget):
    def __init__(self):
        super().__init__()
        self.mainFile = None
        self.fileNames = []
        self.initUI()

    def mergeFiles(self):
        # Get the file name from the line edit
        fileName = self.fileNameEdit.text()

        # Open a file dialog to select the save location
        options = QFileDialog.Options()
        options |= QFileDialog.ReadOnly
        fileName, _ = QFileDialog.getSaveFileName(self, 'Save file', fileName, 'Excel Files (*.xlsx);;All Files (*)', options=options)
        if fileName:
            # Load the 'main' Excel file
            df_main = pd.read_excel(self.mainFile)
            dfs = []
            for f in self.fileNames:
                with open(f, 'rb') as file:
                    xl = pd.read_excel(file, sheet_name=None, engine='openpyxl')
                if 'Den Bosch' in xl:
                    df = xl['Den Bosch']
                    sheet_name = df.iloc[0,0]
                    dfs.append((df, sheet_name))
            # Write the dataframes to an Excel file with multiple tabs
            with pd.ExcelWriter(fileName, engine='openpyxl') as writer:
                df_main.to_excel(writer, sheet_name='Main', index=False)
                for df, sheet_name in dfs:
                    df.to_excel(writer, sheet_name=sheet_name, index=False)

    def initUI(self):
        # Create a label and two buttons
        self.label = QLabel('Select the main Excel file and the Excel files to merge:')
        self.btn1 = QPushButton('Select main file')
        self.btn2 = QPushButton('Select files to merge')
        self.runBtn = QPushButton('Merge files')

        # Create labels to display the file names
        self.mainFileLabel = QLabel('')
        self.fileNamesLabel = QLabel('')

        # Create a line edit and a label to enter the file name
        self.fileNameEdit = QLineEdit()
        self.fileNameLabel = QLabel('Enter file name:')

        # Connect the buttons to their event handlers
        self.btn1.clicked.connect(self.selectMainFile)
        self.btn2.clicked.connect(self.selectFiles)
        self.runBtn.clicked.connect(self.mergeFiles)

        # Create a vertical layout and add
        # Create a vertical layout and add the widgets
        layout = QVBoxLayout()
        layout.addWidget(self.label)
        layout.addWidget(self.btn1)
        layout.addWidget(self.mainFileLabel)
        layout.addWidget(self.btn2)
        layout.addWidget(self.fileNamesLabel)
        layout.addWidget(self.fileNameLabel)
        layout.addWidget(self.fileNameEdit)
        layout.addWidget(self.runBtn)
        self.setLayout(layout)

        # Set the window properties
        self.setGeometry(300, 300, 300, 200)
        self.setWindowTitle('Excel Merger')
        self.show()

    def selectMainFile(self):
        # Open a file dialog and get the selected file name
        options = QFileDialog.Options()
        options |= QFileDialog.ReadOnly
        fileName, _ = QFileDialog.getOpenFileName(self, 'Select main file', '', 'Excel Files (*.xlsx);;All Files (*)', options=options)
        if fileName:
            # Store the selected file name in a class attribute and update the label
            self.mainFile = fileName
            self.mainFileLabel.setText('Main file: {}'.format(fileName))

    def selectFiles(self):
        # Open a file dialog and get the selected file names
        options = QFileDialog.Options()
        options |= QFileDialog.ReadOnly
        fileNames, _ = QFileDialog.getOpenFileNames(self, 'Select files to merge', '', 'Excel Files (*.xlsx);;All Files (*)', options=options)
        if fileNames:
            # Store the selected file names in a class attribute and update the label
            self.fileNames = fileNames
            self.fileNamesLabel.setText('Files to merge: {}'.format(', '.join(fileNames)))

if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = MergeExcelGUI()
    sys.exit(app.exec_())

To elaborate on what I want to achieve: There is supposed to be one 'main' Excel file. This main file contains one tab with data. I want to merge a multitude of other Excel files to the main file. These other Excel files have multiple tabs but I only want the information from the tab called 'Den Bosch'. FYI, all these secondary files have a tab named Den Bosch.

In these Den Bosch tabs I want to take the value in cell A1 and use that as the tab name in the main file once it gets merged! e.g. I have the main file, I have another Excel file with a Den Bosch tab that has the name test123 in cell A1. I now want to merge this file with the main file and put the information of this Den Bosch tab in a new tab named test123. When using my code it is giving me the following error: TypeError: cannot use a string pattern on a bytes-like object. This error occurs in line 38

df.to_excel(writer, sheet_name=sheet_name, index=False)

I have tried many things but I cannot seem to solve it. Does anyone have any idea? Help would be very much appreciated.


问:
How to avoid unit test of subdirectory from parent CMakeLists.txt
I am working with cmake project where one subdirectory is added from parent CMakeLists.txt file.

In Parent CMakeLists.txt, I have below line which adds subproject folder.
add_subdirectory(subproject)

In subdirectory CMakeLists.txt, I have this line which is not inside any macro.
add_test(NAME sub-tests COMMAND subproject_test)

As of now subproject is always compiles subproject-test.
I want only library of subproject and want to avoid test. So that "make test" command do not show below error.

LOG:
Could not find executable /home/root/project/subproject/subproject_test
Looked in the following places:
/home/root/project/subproject/subproject_test
.
.
.

I tried adding EXCLUDE_FROM_ALL, but it do not completely remove test target of subproject.
add_subdirectory(subproject EXCLUDE_FROM_ALL)

How to avoid executing subproject's subproject_test to execute during "make test" command.
This issue will help me successfully run component on Jenkins pipe line.


问:
Unicode box drawing characters in a portable C program
I'm trying to use Unicode box drawing characters in a C program that is intended to be portable across a range of operating systems, C compilers and environments.  Example:

```<code>#include <stdio.h>
#include <stdlib.h>

int main (int argc, char *argv[])
{
  printf ("┌─────┐\n");
  printf ("│┼┼┼┼┼│\n");
  printf ("└─────┘\n");
  return EXIT_SUCCESS;
}
</code>```

The above works just fine in Linux with either gcc or icc, in Windows WSL with gcc, in Windows with Cygwin gcc in both Command Prompt and Cygwin Terminal windows, and with Windows MinGW in a Command Prompt window.
That is, in all those cases, the output looks like this:

```<code>┌─────┐
│┼┼┼┼┼│
└─────┘
</code>```

But with MinGW in a Cygwin Terminal, the output looks like this:

```<code>ÔöîÔöÇÔöÇÔöÇÔöÇÔöÇÔöÉ
ÔöéÔö╝Ôö╝Ôö╝Ôö╝Ôö╝Ôöé
ÔööÔöÇÔöÇÔöÇÔöÇÔöÇÔöÿ
</code>```

The problem doesn't seem to be the Cygwin Terminal font, because the same program compiled with Cygwin gcc displays correctly in the same Cygwin Terminal.  Also, the same MinGW program displays correctly in a Windows Command Prompt window, just not in a Cygwin Terminal.

Windows compiler versions used:

```<code> gcc (MinGW.org GCC-6.3.0-1) 6.3.0
 gcc (GCC) 11.3.0                   - with Cygwin
</code>```

What do I need to do to fix this please?

Thanks, Peter McGavin.

Body:
I'm trying to use Unicode box drawing characters in a C program that is intended to be portable across a range of operating systems, C compilers and environments.  Example:

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

int main (int argc, char *argv[])
{
  printf ("┌─────┐\n");
  printf ("│┼┼┼┼┼│\n");
  printf ("└─────┘\n");
  return EXIT_SUCCESS;
}

The above works just fine in Linux with either gcc or icc, in Windows WSL with gcc, in Windows with Cygwin gcc in both Command Prompt and Cygwin Terminal windows, and with Windows MinGW in a Command Prompt window.
That is, in all those cases, the output looks like this:

┌─────┐
│┼┼┼┼┼│
└─────┘

But with MinGW in a Cygwin Terminal, the output looks like this:

ÔöîÔöÇÔöÇÔöÇÔöÇÔöÇÔöÉ
ÔöéÔö╝Ôö╝Ôö╝Ôö╝Ôö╝Ôöé
ÔööÔöÇÔöÇÔöÇÔöÇÔöÇÔöÿ

The problem doesn't seem to be the Cygwin Terminal font, because the same program compiled with Cygwin gcc displays correctly in the same Cygwin Terminal.  Also, the same MinGW program displays correctly in a Windows Command Prompt window, just not in a Cygwin Terminal.

Windows compiler versions used:

 gcc (MinGW.org GCC-6.3.0-1) 6.3.0
 gcc (GCC) 11.3.0                   - with Cygwin

What do I need to do to fix this please?

Thanks, Peter McGavin.


问:
How to set AppCheck Debug token for Android Device?
I am currently switching our Flutter App from the AppCheck SafetyNet provider to the PlayIntegrity Provider.

Now I can't connect to Firebase any longer from all our development devices (real phones, no emulator) as the debug builds are not coming from the PlayStore.

I already set up to use the DebugProvider and added the DebugToken in Firebase and this is basically working.

When I use the same device with another computer and install the app again, the app is first uninstalled and reinstalled. This wipes all app information from the device and with it the Debug Token. So now I have to set up another debug token in Firebase and the old one is invalid.

Is there any way to provide a specific debug token in Android e.g. via an environment variable or like it is done for Flutter Web, that a specific token can be registered by setting self.FIREBASE_APPCHECK_DEBUG_TOKEN to the tokenString?

In DebugAppCheckProvider.java it seems there is no way to do this, but perhaps I am missing something?

The DebugProvider is mentioned in the Documentation always with emulators but not with real devices. Is this the normal way to use App Check when developing or is there another way to use it with my real devices?


问:
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@anbsystems%2fcrud - Not found
Why I am getting this error when installing npm i
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@anbsystems%2fcrud - Not found</p>


问:
Can't get the response from directLine.activity$
I want to send a message to the bot and then listen to the responses coming in, after I get 1 or 2 responses I want to end the Azure function.

However, everything I tried (setTimeout, setInterval, check if "responseReceive = true" etc does not work and Azure terminates the function early, so the response from directLine.activity$ is not included in my context.res body.

```<code>        directLine.postActivity({
            from: { id: '123'}, // required (from.name is optional)
            type: 'message',
            text: 'a message for you, Rudy'
        }).subscribe(
            id => {console.log("Posted activity, assigned ID ", id)
            directLine.activity$
            .subscribe(
                activity => {
                    if (activity.from.id === "tbot1000v5") {
                    console.log("received activity ", activity.text)
                    myActivity = activity.text
                    console.log("myactivity here " + myActivity)
                    responseCount++
                    console.log("ResponseCount is " + responseCount)
                    twiml.message(myActivity);
                    console.log("here")

                    } //end if

                }

            )

        },
            error => console.log("Error posting activity", error)
        )

</code>```

How can I be sure to wait for myActivity to have a value before Azure sends "Executed 'Functions.twilioagogo' (Succeeded, Id=27a621aa-5876-44d8-babb-dbd741a66dba, Duration=253ms)"?

Body:
I want to send a message to the bot and then listen to the responses coming in, after I get 1 or 2 responses I want to end the Azure function.

However, everything I tried (setTimeout, setInterval, check if "responseReceive = true" etc does not work and Azure terminates the function early, so the response from directLine.activity$ is not included in my context.res body.

        directLine.postActivity({
            from: { id: '123'}, // required (from.name is optional)
            type: 'message',
            text: 'a message for you, Rudy'
        }).subscribe(
            id => {console.log("Posted activity, assigned ID ", id)
            directLine.activity$
            .subscribe(
                activity => {
                    if (activity.from.id === "tbot1000v5") {
                    console.log("received activity ", activity.text)
                    myActivity = activity.text
                    console.log("myactivity here " + myActivity)
                    responseCount++
                    console.log("ResponseCount is " + responseCount)
                    twiml.message(myActivity);
                    console.log("here")

                    } //end if

                }

            )

        },
            error => console.log("Error posting activity", error)
        )

How can I be sure to wait for myActivity to have a value before Azure sends "Executed 'Functions.twilioagogo' (Succeeded, Id=27a621aa-5876-44d8-babb-dbd741a66dba, Duration=253ms)"?


问:
How to observe variables during debugging with Rust?
I'm trying to debug Rust in VS Code.

Following this answer, I installed CodeLLDB and was able to view all currently available variables in the IDE's variables window.

However, the values of some variables are not observable, e.g., nalgebra::Vector3<f64>. Meanwhile, I don't want to achieve this by println!, which I think is inefficient.

Do you have any suggestions?