问:
How to integrate novnc client inside django project
I have a couple virtual machines running inside proxmox but I found out you can use the novnc client to connect to these virtual machines and use the console in a web browser. This is perfect for different clients I work with. I already have a small django project that shows the running nodes and vm's inside of them. Now I wanted to include de js library by novnc. However I can't really find a lot of information online and since my coding experience is not that high I don't really know what I am doing wrong.

I used this outdated repo and tried to see if I can find out how to get it to work. https://github.com/missuor/novnc-proxy-django

for now I have a view that call the api of proxmox. /api2/json/nodes/{node}/lxc/{vmid}/vncproxy to be precise. this returns a ticket, port, cert, user and upid. Now I am not sure if I just need to call the vncproxy or use these variable to open a websocket by /api2/json/nodes/{node}/lxc/{vmid}/vncwebsocket. The django view i currently have just call the vncproxy and sends the values to the rendered template.

This template I used from the repo metioned above, but I just don't know why I keep ketting a Server Disconnected(code 1006 error). If you have any tips for me that would be of great help.

this is the view I currently use which receives all the correct values.

```<code>def vnc(request, node, vmid):
    vncproxy = proxmox_vnc().vncproxyVirtualMachine(node, vmid)

    token = vncproxy['data']['ticket']
    port = vncproxy['data']['port']
    host = 'Settings.vnxproxy'
    password = ''

    print(token)

    return render(request, 'vnc_auto.html', {'token': token, 'host': host, 'port': port, 'password': password})

</code>```

And this below is the vnc.html I use to render and uses the novnc client.

```<code>{% load static %}
<!DOCTYPE html>
<html>
<head>

    <!--
    noVNC example: simple example using default UI
    Copyright (C) 2012 Joel Martin
    Copyright (C) 2013 Samuel Mannehed for Cendio AB
    noVNC is licensed under the MPL 2.0 (see LICENSE.txt)
    This file is licensed under the 2-Clause BSD license (see LICENSE.txt).

    Connect parameters are provided in query string:
        http://example.com/?host=HOST&port=PORT&encrypt=1&true_color=1
    -->
    <title>noVNC</title>

    <meta charset="utf-8">

    <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
                Remove this if you use the .htaccess -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <!-- Apple iOS Safari settings -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <!-- App Start Icon  -->
    <link rel="apple-touch-startup-image" href="{% static 'novnc/images/screen_320x460.png' %}" />
    <!-- For iOS devices set the icon to use if user bookmarks app on their homescreen -->
    <link rel="apple-touch-icon" href="{% static 'novnc/images/screen_57x57.png' %}">
    <!--
    <link rel="apple-touch-icon-precomposed" href="{% static 'novnc/images/screen_57x57.png' %}" />
    -->

    <script>var INCLUDE_URI='/static/novnc/include/'</script>
    <!-- Stylesheets -->
    <link rel="stylesheet" href="{% static 'novnc/include/base.css' %}" title="plain">

     <!--
    <script type='text/javascript'
        src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
    -->
        <script src="{% static 'novnc/include/util.js' %}"></script>
</head>

<body style="margin: 0px;">
    <div id="noVNC_screen">
            <div id="noVNC_status_bar" class="noVNC_status_bar" style="margin-top: 0px;">
                <table border=0 width="100%"><tr>
                    <td><div id="noVNC_status" style="position: relative; height: auto;">
                        Loading
                    </div></td>
                    <td width="1%"><div id="noVNC_buttons">
                        <input type=button value="Send CtrlAltDel"
                            id="sendCtrlAltDelButton">
                        <span id="noVNC_xvp_buttons">
                        <input type=button value="Shutdown"
                            id="xvpShutdownButton">
                        <input type=button value="Reboot"
                            id="xvpRebootButton">
                        <input type=button value="Reset"
                            id="xvpResetButton">
                        </span>
                            </div></td>
                </tr></table>
            </div>
            <canvas id="noVNC_canvas" width="640px" height="20px">
                Canvas not supported.
            </canvas>
        </div>

        <script>
        /*jslint white: false */
        /*global window, $, Util, RFB, */
        "use strict";

        // Load supporting scripts
        Util.load_scripts(["webutil.js", "base64.js", "websock.js", "des.js",
                           "keysymdef.js", "keyboard.js", "input.js", "display.js",
                           "jsunzip.js", "rfb.js", "keysym.js"]);

        var rfb;

        function passwordRequired(rfb) {
            var msg;
            msg = '<form onsubmit="return setPassword();"';
            msg += '  style="margin-bottom: 0px">';
            msg += 'Password Required: ';
            msg += '<input type=password size=10 id="password_input" class="noVNC_status">';
            msg += '<\/form>';
            $D('noVNC_status_bar').setAttribute("class", "noVNC_status_warn");
            $D('noVNC_status').innerHTML = msg;
        }
        function setPassword() {
            rfb.sendPassword($D('password_input').value);
            return false;
        }
        function sendCtrlAltDel() {
            rfb.sendCtrlAltDel();
            return false;
        }
        function xvpShutdown() {
            rfb.xvpShutdown();
            return false;
        }
        function xvpReboot() {
            rfb.xvpReboot();
            return false;
        }
        function xvpReset() {
            rfb.xvpReset();
            return false;
        }
        function updateState(rfb, state, oldstate, msg) {
            var s, sb, cad, level;
            s = $D('noVNC_status');
            sb = $D('noVNC_status_bar');
            cad = $D('sendCtrlAltDelButton');
            switch (state) {
                case 'failed':       level = "error";  break;
                case 'fatal':        level = "error";  break;
                case 'normal':       level = "normal"; break;
                case 'disconnected': level = "normal"; break;
                case 'loaded':       level = "normal"; break;
                default:             level = "warn";   break;
            }

            if (state === "normal") {
                cad.disabled = false;
            } else {
                cad.disabled = true;
                xvpInit(0);
            }

            if (typeof(msg) !== 'undefined') {
                sb.setAttribute("class", "noVNC_status_" + level);
                s.innerHTML = msg;
            }
        }

        function xvpInit(ver) {
            var xvpbuttons;
            xvpbuttons = $D('noVNC_xvp_buttons');
            if (ver >= 1) {
                xvpbuttons.style.display = 'inline';
            } else {
                xvpbuttons.style.display = 'none';
            }
        }

        window.onscriptsload = function () {
            var host, port, password, path, token;

            $D('sendCtrlAltDelButton').style.display = "inline";
            $D('sendCtrlAltDelButton').onclick = sendCtrlAltDel;
            $D('xvpShutdownButton').onclick = xvpShutdown;
            $D('xvpRebootButton').onclick = xvpReboot;
            $D('xvpResetButton').onclick = xvpReset;

            WebUtil.init_logging(WebUtil.getQueryVar('logging', 'warn'));
            document.title = unescape(WebUtil.getQueryVar('title', 'noVNC'));
            // By default, use the host and port of server that served this file
            host = WebUtil.getQueryVar('host', '{{host}}'?'{{host}}':window.location.hostname);
            port = WebUtil.getQueryVar('port', {{port}}?{{port}}:window.location.port);
            // if port == 80 (or 443) then it won't be present and should be
            // set manually

            if (!port) {
                if (window.location.protocol.substring(0,5) == 'https') {
                    port = 443;
                }
                else if (window.location.protocol.substring(0,4) == 'http') {
                    port = 80;
                }
            }

            // If a token variable is passed in, set the parameter in a cookie.
            // This is used by nova-novncproxy.
            token = WebUtil.getQueryVar('token', null);
            if (token) {
                WebUtil.createCookie('token', token, 1)
            }

            password = WebUtil.getQueryVar('password', '{{password}}'?'{{password}}':'');
            path = WebUtil.getQueryVar('path', '{{path}}'?'{{path}}':'');
            path += '?token='+token;
            if ((!host) || (!port)) {
                updateState('failed',
                    "Must specify host and port in URL");
                return;
            }

            rfb = new RFB({'target':       $D('noVNC_canvas'),
                           'encrypt':      WebUtil.getQueryVar('encrypt',
                                    (window.location.protocol === "https:")),
                           'repeaterID':   WebUtil.getQueryVar('repeaterID', ''),
                           'true_color':   WebUtil.getQueryVar('true_color', true),
                           'local_cursor': WebUtil.getQueryVar('cursor', true),
                           'shared':       WebUtil.getQueryVar('shared', true),
                           'view_only':    WebUtil.getQueryVar('view_only', false),
                           'onUpdateState':  updateState,
                           'onXvpInit':    xvpInit,
                           'onPasswordRequired':  passwordRequired});
            console.log(host, port, password, path);
            rfb.connect(host, port, password, path);
        };
        </script>

    </body>
</html>

</code>```

Body:
I have a couple virtual machines running inside proxmox but I found out you can use the novnc client to connect to these virtual machines and use the console in a web browser. This is perfect for different clients I work with. I already have a small django project that shows the running nodes and vm's inside of them. Now I wanted to include de js library by novnc. However I can't really find a lot of information online and since my coding experience is not that high I don't really know what I am doing wrong.

I used this outdated repo and tried to see if I can find out how to get it to work. https://github.com/missuor/novnc-proxy-django

for now I have a view that call the api of proxmox. /api2/json/nodes/{node}/lxc/{vmid}/vncproxy to be precise. this returns a ticket, port, cert, user and upid. Now I am not sure if I just need to call the vncproxy or use these variable to open a websocket by /api2/json/nodes/{node}/lxc/{vmid}/vncwebsocket. The django view i currently have just call the vncproxy and sends the values to the rendered template.

This template I used from the repo metioned above, but I just don't know why I keep ketting a Server Disconnected(code 1006 error). If you have any tips for me that would be of great help.

this is the view I currently use which receives all the correct values.

def vnc(request, node, vmid):
    vncproxy = proxmox_vnc().vncproxyVirtualMachine(node, vmid)

    token = vncproxy['data']['ticket']
    port = vncproxy['data']['port']
    host = 'Settings.vnxproxy'
    password = ''

    print(token)

    return render(request, 'vnc_auto.html', {'token': token, 'host': host, 'port': port, 'password': password})

And this below is the vnc.html I use to render and uses the novnc client.

{% load static %}
<!DOCTYPE html>

    <title>noVNC</title>

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

    <link rel="apple-touch-startup-image" href="{% static 'novnc/images/screen_320x460.png' %}" />

    <link rel="apple-touch-icon" href="{% static 'novnc/images/screen_57x57.png' %}">

    <link rel="stylesheet" href="{% static 'novnc/include/base.css' %}" title="plain">

                        Loading

                        <input type=button value="Send CtrlAltDel"
                            id="sendCtrlAltDelButton">

                        <input type=button value="Shutdown"
                            id="xvpShutdownButton">
                        <input type=button value="Reboot"
                            id="xvpRebootButton">
                        <input type=button value="Reset"
                            id="xvpResetButton">

            <canvas id="noVNC_canvas" width="640px" height="20px">
                Canvas not supported.
            </canvas>


来源: stackexchange

问:
Textfield filter in Flutter
I'm a total beginner in Flutter. I try to integrate a textfield filter for my table, but the table is not filtered, but remains unchanged. I added a Provider because I need the current table of Students. after that the Table can't be filtered anymore. Can anyone help me?

here is my code:

```<code>
class ResultPage extends StatefulWidget {
  const ResultPage({Key? key}) : super(key: key);

  @override
  State<ResultPage> createState() => _ResultPageState();
}

class _ResultPageState extends State<ResultPage> {
  List<User>? myData = [];
  List<User>? filterData;
  _getData(BuildContext context){
    myData = Provider.of<LoginService>(context).getStudentsList();
    filterData = Provider.of<LoginService>(context).getStudentsList();
  }

  bool sort = true;

  @override
  void initState() {
    filterData = myData;
    super.initState();

  }

  TextEditingController controller = TextEditingController();

  @override
  Widget build(BuildContext context) {
    _getData(context);
    return Scaffold(
        body: SingleChildScrollView(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          SizedBox(
              width: double.infinity,
              child: Theme(
                data: ThemeData.light()
                    .copyWith(cardColor: Theme.of(context).canvasColor),
                child: PaginatedDataTable(
                  sortColumnIndex: 0,
                  sortAscending: sort,
                  header: Container(
                    padding: const EdgeInsets.all(5),
                    decoration: BoxDecoration(
                        border: Border.all(
                          color: Colors.grey,
                        ),
                        borderRadius: BorderRadius.circular(12)),
                    child: TextField(
                      controller: controller,
                      decoration: const InputDecoration(
                          hintText: "Enter name to filter"),
                      onChanged: (value) {
                        setState(() {
                          myData = filterData!
                              .where(
                                  (element) => element.getName.contains(value))
                              .toList();
                        });
                      },
                      onSubmitted: (value) {
                        setState(() {
                          FocusScope.of(context).unfocus();
                        });
                      },
                    ),
                  ),
                  source: RowSource(
                    myData: myData,
                    count: myData!.length,
                  ),
                  rowsPerPage: 16,
                  columnSpacing: 8,
                  columns: const [
                    DataColumn(
                      label: Text(
                        "Schüler",
                        style: TextStyle(
                            fontWeight: FontWeight.w600, fontSize: 14),
                      ),
                    ),
                    DataColumn(
                      label: Text(
                        "Anzahl Spiele",
                        style: TextStyle(
                            fontWeight: FontWeight.w600, fontSize: 14),
                      ),
                    ),
                    DataColumn(
                      label: Text(
                        "Score",
                        style: TextStyle(
                            fontWeight: FontWeight.w600, fontSize: 14),
                      ),
                    ),
                  ],
                ),
              )),
          const SizedBox(height: 20),
        ],
      ),
     )
    );
  }
}

class RowSource extends DataTableSource {
  var myData;
  final count;
  RowSource({
    required this.myData,
    required this.count,
  });

  @override
  DataRow? getRow(int index) {
    if (index < rowCount) {
      return recentFileDataRow(myData![index]);
    } else {
      return null;
    }
  }

  @override
  bool get isRowCountApproximate => false;

  @override
  int get rowCount => count;

  @override
  int get selectedRowCount => 0;
}

DataRow recentFileDataRow(User data) {
  return DataRow(
    cells: [
      DataCell(Text(data.getName)),
      DataCell(Text(data.getSolvedGames().toString())),
      DataCell(Text(data.getScore().toString())),
    ],
  );
}

</code>```

With my code the table always remains unchanged.

ContentLicense: CC BY-SA 4.0

Title: Textfield filter in Flutter

Body:
I'm a total beginner in Flutter. I try to integrate a textfield filter for my table, but the table is not filtered, but remains unchanged. I added a Provider because I need the current table of Students. after that the Table can't be filtered anymore. Can anyone help me?

here is my code:

class ResultPage extends StatefulWidget {
  const ResultPage({Key? key}) : super(key: key);

  @override
  State<ResultPage> createState() => _ResultPageState();
}

class _ResultPageState extends State<ResultPage> {
  List<User>? myData = [];
  List<User>? filterData;
  _getData(BuildContext context){
    myData = Provider.of<LoginService>(context).getStudentsList();
    filterData = Provider.of<LoginService>(context).getStudentsList();
  }

  bool sort = true;

  @override
  void initState() {
    filterData = myData;
    super.initState();

  }

  TextEditingController controller = TextEditingController();

  @override
  Widget build(BuildContext context) {
    _getData(context);
    return Scaffold(
        body: SingleChildScrollView(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          SizedBox(
              width: double.infinity,
              child: Theme(
                data: ThemeData.light()
                    .copyWith(cardColor: Theme.of(context).canvasColor),
                child: PaginatedDataTable(
                  sortColumnIndex: 0,
                  sortAscending: sort,
                  header: Container(
                    padding: const EdgeInsets.all(5),
                    decoration: BoxDecoration(
                        border: Border.all(
                          color: Colors.grey,
                        ),
                        borderRadius: BorderRadius.circular(12)),
                    child: TextField(
                      controller: controller,
                      decoration: const InputDecoration(
                          hintText: "Enter name to filter"),
                      onChanged: (value) {
                        setState(() {
                          myData = filterData!
                              .where(
                                  (element) => element.getName.contains(value))
                              .toList();
                        });
                      },
                      onSubmitted: (value) {
                        setState(() {
                          FocusScope.of(context).unfocus();
                        });
                      },
                    ),
                  ),
                  source: RowSource(
                    myData: myData,
                    count: myData!.length,
                  ),
                  rowsPerPage: 16,
                  columnSpacing: 8,
                  columns: const [
                    DataColumn(
                      label: Text(
                        "Schüler",
                        style: TextStyle(
                            fontWeight: FontWeight.w600, fontSize: 14),
                      ),
                    ),
                    DataColumn(
                      label: Text(
                        "Anzahl Spiele",
                        style: TextStyle(
                            fontWeight: FontWeight.w600, fontSize: 14),
                      ),
                    ),
                    DataColumn(
                      label: Text(
                        "Score",
                        style: TextStyle(
                            fontWeight: FontWeight.w600, fontSize: 14),
                      ),
                    ),
                  ],
                ),
              )),
          const SizedBox(height: 20),
        ],
      ),
     )
    );
  }
}

class RowSource extends DataTableSource {
  var myData;
  final count;
  RowSource({
    required this.myData,
    required this.count,
  });

  @override
  DataRow? getRow(int index) {
    if (index < rowCount) {
      return recentFileDataRow(myData![index]);
    } else {
      return null;
    }
  }

  @override
  bool get isRowCountApproximate => false;

  @override
  int get rowCount => count;

  @override
  int get selectedRowCount => 0;
}

DataRow recentFileDataRow(User data) {
  return DataRow(
    cells: [
      DataCell(Text(data.getName)),
      DataCell(Text(data.getSolvedGames().toString())),
      DataCell(Text(data.getScore().toString())),
    ],
  );
}

With my code the table always remains unchanged.


问:
Perform selector for methods with arguments
Consider the following class in dyLib

```<code>@objc public class MyClass : NSObject{

    @objc  public func printString(myStr: NSString)  {

            print("printString : \(myStr)")
        }

        @objc public func printAndReturn()-> String {

        let string = "Test String"
            print("On print and return \(string)  ")
            return string
        }
}
</code>```

I am trying to call its method in the dyLib from another project like:

```<code>let value = instance1.perform(Selector("printAndReturn") ) //working fine

instance1.perform(NSSelectorFromString("printString:"), with: "testString") or

instance1.perform(Selector(("printString:")), with: "testString" )
</code>```

but crashing with error:

printString:]: unrecognized selector sent to instance

Please suggest the correct way to calling printString: method (methods with arguments) using perform selector.

Body:
Consider the following class in dyLib

@objc public class MyClass : NSObject{

    @objc  public func printString(myStr: NSString)  {

            print("printString : \(myStr)")
        }

        @objc public func printAndReturn()-> String {

        let string = "Test String"
            print("On print and return \(string)  ")
            return string
        }
}

I am trying to call its method in the dyLib from another project like:

let value = instance1.perform(Selector("printAndReturn") ) //working fine

instance1.perform(NSSelectorFromString("printString:"), with: "testString") or

instance1.perform(Selector(("printString:")), with: "testString" )

but crashing with error:

printString:]: unrecognized selector sent to instance

Please suggest the correct way to calling printString: method (methods with arguments) using perform selector.


问:
Is there way to get DATA in embedded jRuby?
I am using org.jruby.embed.ScriptingContainer class, runScriptlet and parse(script).run() both does not provide DATA (text after __END__ at the end of the script). I am curious if I can get it by using other jRuby embedding mechanisms.
Besides, is it a bug? Does C Ruby do it same way too?</p>

ContentLicense: CC BY-SA 3.0


问:
Error while running haystack models in CPU
```<code>INFO:haystack.modeling.utils:Using devices: CPU - Number of GPUs: 0
Using devices: CPU - Number of GPUs: 0
'<' not supported between instances of 'torch.device' and 'int'
</code>```

I am trying to run a QA model in my local machine which I took from huggingface.co . I have encountered this error. Has anyone seen this error ever? I am running this on CPU.

Body:
INFO:haystack.modeling.utils:Using devices: CPU - Number of GPUs: 0
Using devices: CPU - Number of GPUs: 0
'<' not supported between instances of 'torch.device' and 'int'

I am trying to run a QA model in my local machine which I took from huggingface.co . I have encountered this error. Has anyone seen this error ever? I am running this on CPU.


问:
Split GA4 conversions by corresponding event
I'm tracking several events on my website using Google Analytics 4.

Some of those events are more important and I'm considering them as conversions. However, they happen at different steps of the user journey, so each of them would have a different cost and return, so I'd like to consider them as different conversions, in the same way they correspond to different events.

The problem is, when I want to report on them (e.g. on Data Studio, or Google Ads UI, or even on Google Analytics funnels), you can only see the aggregated sum of conversions, rater than being able to select a specific conversion.

Is there a way to make GA4 (an Data Studio) either:

Split reports by specific conversions (rather than the total number of conversions)?

Split reports by events rather than conversions?

I feel like GA4 has been a step back in terms of report customisation and data analysis.

Thanks!


问:
Why is AWS Glue DataBrew project when created, Is trying to load all data from the RDS table
When we create a DataBrew project and refer to the Dataset based on JDBC connection
we find that the RDS(MySQL database) executes  the query=> select * from table. But
our table contains huge data. Why is the complete data being loaded ?. Can we restrict loading all data. Because loading whole data in DataBrew project is huge concern for us. But we see that DataBrew Project has Default sample size 500 records to load. Our main concern is why is the query (Select * From table) is sent to the rds.


问:
Issue trying to host docusaurus site on Sharepoint Online
I am trying to host a docusaurus site on a SharePoint Online library. I have followed this article: How to host static HTML sites on modern SharePoint site collections - HANDS ON SharePoint (handsontek.net)

It's almost working: when I use the URL of an index.aspx page (previously generated as index.html by docusaurus) the page opens in the browser, but only the navigation bar, left menu and the footer are displayed. The main content in the center is shown as 'page not found'.

If I then click on any link in the navigation bar, pages are correctly displayed. From there, the navigation between pages behaves as expected.

The pain point is that this issues prevents me from using links to single pages. One always have to navigate to a page using the menu.

Would anyone have a solution ?

I have tried the two trailingslash options, but no change.


问:
Unity)How to use Profiler.Sample with #if UNITY_EDITOR

I want to run Profiler.Sample() only in Unity Editor.
However, not-matching errors occur when running in the above state.
Does anyone know how to fix it?


问:
Angular - updating fragment without a page reload
I have a TabGroup component containing a number of Tab components. The selected tab is controlled / managed using the fragment in the URL.

Whenever a tab is selected I do (in the TabGroup):

  ...
  @ContentChildren(Tab) public tabs: QueryList<Tab>;

  constructor(private readonly route: ActivatedRoute, private readonly router: Router) {}

  setActiveTab(tab: Tab) {
    // set all tabs to not selected.
    this.tabs.forEach((currTab) => (currTab.active = false));
    // update the `fragment` in the url (but don't change the page)
    this.router.navigate(['.'], { relativeTo: this.route, fragment: tab.key });
  }
  ...
```
<p>The issue I'm having is that whenever the tab is clicked the whole page reloads. Obviously the tab content should update but not the whole page.</p>
<p>These are my app router options:</p>
<pre class="lang-js prettyprint-override"><code>   RouterModule.forRoot(routes, {
      onSameUrlNavigation: 'ignore',
      relativeLinkResolution: 'corrected',
      scrollPositionRestoration: 'enabled',
   }),
</code>```

Any idea what I'm missing here?

Body:
I have a TabGroup component containing a number of Tab components. The selected tab is controlled / managed using the fragment in the URL.

Whenever a tab is selected I do (in the TabGroup):

  ...
  @ContentChildren(Tab) public tabs: QueryList<Tab>;

  constructor(private readonly route: ActivatedRoute, private readonly router: Router) {}

  setActiveTab(tab: Tab) {
    // set all tabs to not selected.
    this.tabs.forEach((currTab) => (currTab.active = false));
    // update the `fragment` in the url (but don't change the page)
    this.router.navigate(['.'], { relativeTo: this.route, fragment: tab.key });
  }
  ...

The issue I'm having is that whenever the tab is clicked the whole page reloads. Obviously the tab content should update but not the whole page.

These are my app router options:

   RouterModule.forRoot(routes, {
      onSameUrlNavigation: 'ignore',
      relativeLinkResolution: 'corrected',
      scrollPositionRestoration: 'enabled',
   }),

Any idea what I'm missing here?


问:
script crashing with error message: "couldn't execute bsub"
our IT updated LSF farm/OS and now our Tcl script does not work anymore: within our script we executing "bsub -q reg -R "rh70" csh_file" in a loop.

for unknown reason, at some point during the loop 'on 5th element' we are getting following error message: "couldn't execute bsub" as if command is unkown...

we don't understand why starting at some point in the loop the same command does not work anymore... can you help me understand this issue?

Thanks,

Chris

sript is supposed to work without any issue within foreach loop (as it was the case before IT update LSF/OS).


问:
Ajax form processing
After submitting a form to Django, it takes about 3 seconds to process

I need an Ajax script that will redirect the user to an intermediate page where he will wait for a response from Django.

Django got a new redirect after receiving the response
I tried to solve this problem with Django, but I can't do 2 redirects in one view

```<code>Fields: phone, name, email, web, id_web
</code>```

Title: Ajax form processing

Body:
After submitting a form to Django, it takes about 3 seconds to process

I need an Ajax script that will redirect the user to an intermediate page where he will wait for a response from Django.

Django got a new redirect after receiving the response
I tried to solve this problem with Django, but I can't do 2 redirects in one view

Fields: phone, name, email, web, id_web


问:
React Native Crash Region Type start - end
so I am using a react-native-signature-capture and it works fined on android and Ios except on iso Ipad.  It crashes.   I tried everything I can think of tryinng to find out what this is

```<code>VM Region Info: 0 is not in any region.  Bytes before following region: 4390486016
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->
      __TEXT                      105b18000-10653c000    [ 10.1M] r-x/r-x SM=COW  ...pp/mediproapp

 "exception" : {"codes":"0x0000000000000001, 0x0000000000000000","rawCodes":[1,0],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000000000000000"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":2608},
</code>```

any thoughts?

Body:
so I am using a react-native-signature-capture and it works fined on android and Ios except on iso Ipad.  It crashes.   I tried everything I can think of tryinng to find out what this is

VM Region Info: 0 is not in any region.  Bytes before following region: 4390486016
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->
      __TEXT                      105b18000-10653c000    [ 10.1M] r-x/r-x SM=COW  ...pp/mediproapp

 "exception" : {"codes":"0x0000000000000001, 0x0000000000000000","rawCodes":[1,0],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000000000000000"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":2608},

any thoughts?


问:
Gitlab Pages and cookies
I am thinking about hosting my static website using gitlab pages.

The website is completely static, no dynamic contents (besides me updating it from time to time).

Now I am wondering: Since I am in the EU, I have to add a cookie Banner if applicable. Looking at my websites request headers, I can see the following cookie:

```<code>gitlab-pages=MTY3MzI2MDgwMXxSMGFLVnNPYVk2X1F3WTlDeVhkeENLMGw5blVBNDItTHRwNDlEQVJ1b2p1ZUMwVExRaUMwOF9zcXl0UElic21JbDFUajlzdl9tUkJJNm05U29yMnRBUFNEV1pvMGhycDJuLXZEMUV2bGN5cEhneWRrdC1EaDI2aEI4QXByR3YyYXl6OVZKSEJ0VnFveTJzdFNwU1NOdGFlOFZnLWFfMHRuUGEzd0s3QWd4aXhLOUMtcXlyQ3QwVExXRURSZEFKa0JWNWdiS0MzbmREQWR0MHlPdGVXTmZGSzN2cV9zaWZ6c0NtOWZiNXFIZ2RpMHlHeGI1N2RCT3UzRU42WDRpZGR4YjlfeTdYcm1TODVPVW5WYzZqdmZ4YU5mZWhsWFA3N0I4Zm9uME5aR3B1ellhYTBadXpqeGt1a0Q3YWlYN2FkQzloMzRNX2ZQQmhCMXQxa0NvQnh4a1BGWTlPdE5MOXVLdHl5T0oxRkcxNzBQTHZ0eFpFMW9QeTlHNTZoUHhlemxUUW4yaDJZRVZsNkF8uBra7CQZU8byJzld_UbWI8oEm_Rl-pfIPpynNRNoM1U=
</code>```

I am wondering:

What does this cookie do?

Can I disable it somehow?

If I cannot disable it, do I have to make a cookie banner?

Title: Gitlab Pages and cookies

Body:
I am thinking about hosting my static website using gitlab pages.

The website is completely static, no dynamic contents (besides me updating it from time to time).

Now I am wondering: Since I am in the EU, I have to add a cookie Banner if applicable. Looking at my websites request headers, I can see the following cookie:

gitlab-pages=MTY3MzI2MDgwMXxSMGFLVnNPYVk2X1F3WTlDeVhkeENLMGw5blVBNDItTHRwNDlEQVJ1b2p1ZUMwVExRaUMwOF9zcXl0UElic21JbDFUajlzdl9tUkJJNm05U29yMnRBUFNEV1pvMGhycDJuLXZEMUV2bGN5cEhneWRrdC1EaDI2aEI4QXByR3YyYXl6OVZKSEJ0VnFveTJzdFNwU1NOdGFlOFZnLWFfMHRuUGEzd0s3QWd4aXhLOUMtcXlyQ3QwVExXRURSZEFKa0JWNWdiS0MzbmREQWR0MHlPdGVXTmZGSzN2cV9zaWZ6c0NtOWZiNXFIZ2RpMHlHeGI1N2RCT3UzRU42WDRpZGR4YjlfeTdYcm1TODVPVW5WYzZqdmZ4YU5mZWhsWFA3N0I4Zm9uME5aR3B1ellhYTBadXpqeGt1a0Q3YWlYN2FkQzloMzRNX2ZQQmhCMXQxa0NvQnh4a1BGWTlPdE5MOXVLdHl5T0oxRkcxNzBQTHZ0eFpFMW9QeTlHNTZoUHhlemxUUW4yaDJZRVZsNkF8uBra7CQZU8byJzld_UbWI8oEm_Rl-pfIPpynNRNoM1U=

I am wondering:

What does this cookie do?

Can I disable it somehow?

If I cannot disable it, do I have to make a cookie banner?


问:
WSDL FaultExceptions not caught
I'm attempting to get FaultExceptions to hit for a WSDL service.

I have attempted the following:

Created a new .Net 7.0 project in Visual studio

Added the WSDL service reference for https://wsaimport.uni-login.dk/wsaimport-v7/ws?WSDL

Called the generated WSDL method hentDataAftalerAsync

Added below code to Program.cs

var binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None), Encoding.UTF8), new HttpsTransportBindingElement { MaxReceivedMessageSize = 104857600 });

var ws10Client = new ServiceReference2.WsaImportPortTypeClient(binding, new EndpointAddress("https://wsaimport.uni-login.dk/wsaimport-v7/ws"));
try
{

    var res = await ws10Client.hentDataAftalerAsync(new Credentials() {
        wsBrugerid = "randomusername",
        wsPassword = "randompassword"
    });

    // this is reached if credentials are correct
    foreach (var item in res.hentDataAftalerResponse1.ToList())
    {
        Console.WriteLine(item);
    }
}
catch(FaultException<AuthentificationError> ex)
{
    // Neven hit (I expect this exception on wrong credentials)
    Console.WriteLine(ex.Message);
}
catch (FaultException ex)
{
    // Never hit
    Console.WriteLine(ex.Message);
}
catch (ProtocolException ex)
{
    // this exception is hit (but no info about the actual soap fault)
}
catch (Exception ex)
{
    // Never hit
    Console.WriteLine(ex.Message);
}
```

I have tested the hentDataAftaler operation in SoapUI, and when the credentials are wrong it does generate a SOAP response with a Fault of authentificationError.

So my question is, why is it not working for me in C#?

Title: WSDL FaultExceptions not caught

Body:
I'm attempting to get FaultExceptions to hit for a WSDL service.

I have attempted the following:

Created a new .Net 7.0 project in Visual studio

Added the WSDL service reference for https://wsaimport.uni-login.dk/wsaimport-v7/ws?WSDL

Called the generated WSDL method hentDataAftalerAsync

Added below code to Program.cs

var binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None), Encoding.UTF8), new HttpsTransportBindingElement { MaxReceivedMessageSize = 104857600 });

var ws10Client = new ServiceReference2.WsaImportPortTypeClient(binding, new EndpointAddress("https://wsaimport.uni-login.dk/wsaimport-v7/ws"));
try
{

    var res = await ws10Client.hentDataAftalerAsync(new Credentials() {
        wsBrugerid = "randomusername",
        wsPassword = "randompassword"
    });

    // this is reached if credentials are correct
    foreach (var item in res.hentDataAftalerResponse1.ToList())
    {
        Console.WriteLine(item);
    }
}
catch(FaultException<AuthentificationError> ex)
{
    // Neven hit (I expect this exception on wrong credentials)
    Console.WriteLine(ex.Message);
}
catch (FaultException ex)
{
    // Never hit
    Console.WriteLine(ex.Message);
}
catch (ProtocolException ex)
{
    // this exception is hit (but no info about the actual soap fault)
}
catch (Exception ex)
{
    // Never hit
    Console.WriteLine(ex.Message);
}

I have tested the hentDataAftaler operation in SoapUI, and when the credentials are wrong it does generate a SOAP response with a Fault of authentificationError.

So my question is, why is it not working for me in C#?


问:
How can you move tabs?
I use the controlP5 library and did not find how to change the layout of the tabs.
Tried various tricks but .setPosition is not responsive.

import controlP5.*;

```<code>ControlP5 cp5;
int myColorBackground = color(128);
int sliderValue = 100;

void setup() {
  size(700,400);
  noStroke();
  cp5 = new ControlP5(this);

  // By default all controllers are stored inside Tab 'default'
  // add a second tab with name 'extra'
  cp5.addTab("extra")
     .setColorBackground(color(0, 160, 100))
     .setColorLabel(color(255))
     .setColorActive(color(255,128,0))
     ;

  // if you want to receive a controlEvent when
  // a  tab is clicked, use activeEvent(true)
  cp5.getTab("default")
     .activateEvent(true)
     .setLabel("my default tab")
     .setPosition (120 , 230)
     .setId(1)
     ;

  cp5.getTab("extra")
     .activateEvent(true)
     .setPosition (150, 260)
     .setId(2)
     ;
</code>```

Title: How can you move tabs?

Body:
I use the controlP5 library and did not find how to change the layout of the tabs.
Tried various tricks but .setPosition is not responsive.

import controlP5.*;

ControlP5 cp5;
int myColorBackground = color(128);
int sliderValue = 100;

void setup() {
  size(700,400);
  noStroke();
  cp5 = new ControlP5(this);

  // By default all controllers are stored inside Tab 'default'
  // add a second tab with name 'extra'
  cp5.addTab("extra")
     .setColorBackground(color(0, 160, 100))
     .setColorLabel(color(255))
     .setColorActive(color(255,128,0))
     ;

  // if you want to receive a controlEvent when
  // a  tab is clicked, use activeEvent(true)
  cp5.getTab("default")
     .activateEvent(true)
     .setLabel("my default tab")
     .setPosition (120 , 230)
     .setId(1)
     ;

  cp5.getTab("extra")
     .activateEvent(true)
     .setPosition (150, 260)
     .setId(2)
     ;


问:
Audio Duration issue while Merging audio using FFMPEG
I am using FFMPEG to merge 2 or more audios into one audio.

The audio is getting merged properly but the output duration of the audio is wrong.

Eg: Actual merged audio plays for 23 seconds and it shows 25 seconds.

Here is the command I am using for merging the audios.

```<code>-i audio1.aac -i audio2.aac -i audio3 -filter_complex "[1:a]adelay=5s:all=1[a1]; [2:a]adelay=10s:all=1[a2]; [0:a] [a1] [a2] amix=inputs=3[a] "-map "[a]" /data/user/0/com.sound.it/cache/mergedAudio1673260887341.aac

</code>```

Let me know if you have any solutions for the same.

Thanks

Body:
I am using FFMPEG to merge 2 or more audios into one audio.

The audio is getting merged properly but the output duration of the audio is wrong.

Eg: Actual merged audio plays for 23 seconds and it shows 25 seconds.

Here is the command I am using for merging the audios.

-i audio1.aac -i audio2.aac -i audio3 -filter_complex "[1:a]adelay=5s:all=1[a1]; [2:a]adelay=10s:all=1[a2]; [0:a] [a1] [a2] amix=inputs=3[a] "-map "[a]" /data/user/0/com.sound.it/cache/mergedAudio1673260887341.aac

Let me know if you have any solutions for the same.

Thanks


问:
Wpf send layout object not by button or textbox
I've got a little bit problem with sending my layout object. I'm trying to create an WPF app in style like a chrome with draggable cards. To do this, I'm using OpenControls.Wpf library + Prism + MahApps.Metro

Layout declarated in main xaml view

```<code><dockManager:LayoutManager x:Name="_layoutManager" Grid.Row="1" Grid.Column="0"
                                           DocumentsSource="{Binding Documents}" ToolsSource="{Binding Tools}"
                                           VerticalAlignment="Stretch" HorizontalAlignment="Stretch" UseLayoutRounding="False"
                                           Margin="0,-4,0,0">

                    <dockManager:LayoutManager.Theme>
                        <themes:ModernTheme/>
                    </dockManager:LayoutManager.Theme>
                    <dockManager:LayoutManager.DocumentTemplates>

                        <DataTemplate DataType="{x:Type usViewModel:UsersModule_ViewModel}" >
                            <usViews:UsersModule_View x:Name="UsersModuleModule" Margin="4"/>
                        </DataTemplate>

                    </dockManager:LayoutManager.DocumentTemplates>
</dockManager:LayoutManager>
</code>```

Buttons to open projects in card in the same xaml file

```<code><StackPanel>
        <Button x:Name="myButton" Style="{StaticResource ButtonMore}" Content="Users"
         Command="{Binding LoadModule1Command}"
         CommandParameter="{Binding ElementName=_layoutManager}"
         HorizontalAlignment="Left" Margin="24,80,24,0" VerticalAlignment="Top" Width="208" Height="40"/>

    </StackPanel>
</code>```

By the DelegateCommand { get; private set; } in my module, through the button CommandParameter is sending an layoutManager object. I need to get that object, but without click any button or textbox.

So my main question:
Is it possible, to send an object without any buttons or is it possible to programmatically call of the click event in WPF.

I've search something about that problem, but did not find any solution.

Body:
I've got a little bit problem with sending my layout object. I'm trying to create an WPF app in style like a chrome with draggable cards. To do this, I'm using OpenControls.Wpf library + Prism + MahApps.Metro

Layout declarated in main xaml view

<dockManager:LayoutManager x:Name="_layoutManager" Grid.Row="1" Grid.Column="0"
                                           DocumentsSource="{Binding Documents}" ToolsSource="{Binding Tools}"
                                           VerticalAlignment="Stretch" HorizontalAlignment="Stretch" UseLayoutRounding="False"
                                           Margin="0,-4,0,0">

                    <dockManager:LayoutManager.Theme>
                        <themes:ModernTheme/>
                    </dockManager:LayoutManager.Theme>
                    <dockManager:LayoutManager.DocumentTemplates>

                        <DataTemplate DataType="{x:Type usViewModel:UsersModule_ViewModel}" >
                            <usViews:UsersModule_View x:Name="UsersModuleModule" Margin="4"/>
                        </DataTemplate>

                    </dockManager:LayoutManager.DocumentTemplates>
</dockManager:LayoutManager>

Buttons to open projects in card in the same xaml file

<StackPanel>
        <Button x:Name="myButton" Style="{StaticResource ButtonMore}" Content="Users"
         Command="{Binding LoadModule1Command}"
         CommandParameter="{Binding ElementName=_layoutManager}"
         HorizontalAlignment="Left" Margin="24,80,24,0" VerticalAlignment="Top" Width="208" Height="40"/>

    </StackPanel>

By the DelegateCommand { get; private set; } in my module, through the button CommandParameter is sending an layoutManager object. I need to get that object, but without click any button or textbox.

So my main question:
Is it possible, to send an object without any buttons or is it possible to programmatically call of the click event in WPF.

I've search something about that problem, but did not find any solution.


问:
How to display the selected drop-down option in Teams using adaptive cards
I am using an adaptive card to prompt the drop-down list to the user. Once submit action is performed I want the selected user option to be displayed to the user in Teams. I am using a bot framework.

I probably want to display the userinput id which captures the data.

```<code>"items": [{
         "type": "Input.ChoiceSet",
         "style": "compact",
         "id": "UserInput",
          "choices" : categories
          },
          {
         "type": "ActionSet",
         "actions": [{
      "type": "Action.Submit",
      "title": "Confirm",
      "data": {
        "msteams": {
        "type": "imBack",
        "value": ?????
    }
      }
    }
]
</code>```

Body:
I am using an adaptive card to prompt the drop-down list to the user. Once submit action is performed I want the selected user option to be displayed to the user in Teams. I am using a bot framework.

I probably want to display the userinput id which captures the data.

"items": [{
         "type": "Input.ChoiceSet",
         "style": "compact",
         "id": "UserInput",
          "choices" : categories
          },
          {
         "type": "ActionSet",
         "actions": [{
      "type": "Action.Submit",
      "title": "Confirm",
      "data": {
        "msteams": {
        "type": "imBack",
        "value": ?????
    }
      }
    }
]


问:
Swift present transitions navigation controller UIBarbuttonitem disappearing
navigation controller > searchviewcontroller > detailviewcontroller , With the present module, I want it to pass with the effect using the hero library, but the back button disappears, I transfer the data with json, how can I bring it back button but present transition must because hero 3rd library use transitions effect

```<code>
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let vc =  UIStoryboard.init(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "searchViewController") as! searchviewcontroller
            vc.hero.isEnabled = true
            vc.hero.modalAnimationType = .fade
            let backItem = UIBarButtonItem()

            backItem.title = self.viewModel.moviesList?[indexPath.row].Title
            backItem.tintColor = .white
            navigationItem.backBarButtonItem = backItem
            vc.viewModel.movieId = self.viewModel.moviesList?[indexPath.row].imdbID

            self.present(vc, animated: true, completion: nil)
        }
    }

</code>```

SearchViewController

this way it works without any problems, the data goes through and when I press back it comes back without any problems

```<code>
self.navigationController?.pushViewController(vc, animated: true)

</code>```

The back button disappears, how can I add it here?

```<code>
self.present(vc, animated: true, completion: nil)

</code>```

Body:
navigation controller > searchviewcontroller > detailviewcontroller , With the present module, I want it to pass with the effect using the hero library, but the back button disappears, I transfer the data with json, how can I bring it back button but present transition must because hero 3rd library use transitions effect

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let vc =  UIStoryboard.init(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "searchViewController") as! searchviewcontroller
            vc.hero.isEnabled = true
            vc.hero.modalAnimationType = .fade
            let backItem = UIBarButtonItem()

            backItem.title = self.viewModel.moviesList?[indexPath.row].Title
            backItem.tintColor = .white
            navigationItem.backBarButtonItem = backItem
            vc.viewModel.movieId = self.viewModel.moviesList?[indexPath.row].imdbID

            self.present(vc, animated: true, completion: nil)
        }
    }

SearchViewController

this way it works without any problems, the data goes through and when I press back it comes back without any problems

self.navigationController?.pushViewController(vc, animated: true)

The back button disappears, how can I add it here?

self.present(vc, animated: true, completion: nil)


问:
Schemalocation error when validating xml with xsd in C#
Good morning, I validate the xml files sent based on the xsd, but it keeps claiming an error when declaring more than one URL in the schemalocation. I searched a lot, but I didn't find the solution.

Can you tell if this error is due to some configuration or if the schemalocation is really not accepting more than one URL?

Code

Schemalocation

Error message

I did several searches, I tried to change the validator settings and the xml, but it didn't work


问:
How to include default namespace in xml file while writing in scala spark
how can we add default namespace in xml file while writing through xmldataframewriter.

I want to add the highlighted text in my xm file.

```<code><sitemapindex
    xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</code>```

I am writing it through:

```<code>list.coalesce(1)
  .write
  .mode("overwrite")
  .option("rootTag", "sitemapindex")
  .option("rowTag", "sitemap")
  .xml("/Users/user1/Downloads/xml/main/")
</code>```

Body:
how can we add default namespace in xml file while writing through xmldataframewriter.

I want to add the highlighted text in my xm file.

<sitemapindex
    xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

I am writing it through:

list.coalesce(1)
  .write
  .mode("overwrite")
  .option("rootTag", "sitemapindex")
  .option("rowTag", "sitemap")
  .xml("/Users/user1/Downloads/xml/main/")


问:
LineSeries Multiple Date Axes breaks the DateAxis (Amcharts 4 )
I am trying to make a multiple date axis graph in AmCharts 4
I have two inputs from two temperature sensors. The dateAxis is cutted at some value and the values are not properly set.

Any ideas please on what's wrong ?

Here is the graph from first temperature sensor
chart from sensor 1

2.The graph from second temperature sensor
chart from sensor 2

3.The resulting image of both sensors:
chart from both sensors

4.Here is the code:

`
chart.data = chartData;

```<code>        if (chart.data[0]) {
            seriesArray = Object.keys(chart.data[0]);
            // TODO: only for occurDate
            seriesArray.splice(0, 1);
        }

        // Create axes
        var dateAxis = chart.xAxes.push(new am4charts.DateAxis());
        dateAxis.renderer.grid.template.location = 0;
        dateAxis.renderer.minGridDistance = 50;
        dateAxis.baseInterval = {
        "timeUnit": "day",
        "count": 1
        };
        dateAxis.skipEmptyPeriods = true;

        // Create value axis
        var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());

        for(let i=0;i<seriesArray.length;i++){

            // Create series
            var series = chart.series.push(new am4charts.LineSeries());
            series.dataFields.valueY = seriesArray[i];
            series.dataFields.dateX = "date";
            series.strokeWidth = 2;
            series.tensionX = 0.90;
            series.name = seriesArray[i];

            var bullet = series.bullets.push(new am4charts.Bullet());
            bullet.tooltipText = seriesArray[i] + ": {valueY}" + unit;

            bullet.adapter.add("fill", function(fill, target){
                if(target.dataItem.valueY < 21){
                    return am4core.color("#D66D6D");
                }
                return fill;
            })

            var range = valueAxis.createSeriesRange(series);
            range.value = goodRange.min;
            range.endValue = 0;
            range.contents.stroke = am4core.color("#D66D6D");
            range.contents.fill = range.contents.stroke;
            range.axisFill.fill = am4core.color("#cccccc");
            range.axisFill.fillOpacity = 0.2;
            range.grid.strokeOpacity = 0;

            var range2 = valueAxis.createSeriesRange(series);
            range2.value = 1000000;
            range2.endValue = goodRange.max;
            range2.contents.stroke = am4core.color("#D66D6D");
            range2.contents.fill = range.contents.stroke;
            range2.axisFill.fill = am4core.color("#cccccc");
            range2.axisFill.fillOpacity = 0.2;
            range2.grid.strokeOpacity = 0;

        }

        // Add scrollbar
        var scrollbarX = new am4charts.XYChartScrollbar();
        scrollbarX.series.push(series);
        chart.scrollbarX = scrollbarX;
        chart.cursor = new am4charts.XYCursor();
        chart.legend = new am4charts.Legend();
        chart.legend.position = "bottom";
        chart.legend.scrollable = true;
    }`
</code>```

Body:
I am trying to make a multiple date axis graph in AmCharts 4
I have two inputs from two temperature sensors. The dateAxis is cutted at some value and the values are not properly set.

Any ideas please on what's wrong ?

Here is the graph from first temperature sensor
chart from sensor 1

2.The graph from second temperature sensor
chart from sensor 2

3.The resulting image of both sensors:
chart from both sensors

4.Here is the code:

`
chart.data = chartData;

        if (chart.data[0]) {
            seriesArray = Object.keys(chart.data[0]);
            // TODO: only for occurDate
            seriesArray.splice(0, 1);
        }

        // Create axes
        var dateAxis = chart.xAxes.push(new am4charts.DateAxis());
        dateAxis.renderer.grid.template.location = 0;
        dateAxis.renderer.minGridDistance = 50;
        dateAxis.baseInterval = {
        "timeUnit": "day",
        "count": 1
        };
        dateAxis.skipEmptyPeriods = true;

        // Create value axis
        var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());

        for(let i=0;i<seriesArray.length;i++){

            // Create series
            var series = chart.series.push(new am4charts.LineSeries());
            series.dataFields.valueY = seriesArray[i];
            series.dataFields.dateX = "date";
            series.strokeWidth = 2;
            series.tensionX = 0.90;
            series.name = seriesArray[i];

            var bullet = series.bullets.push(new am4charts.Bullet());
            bullet.tooltipText = seriesArray[i] + ": {valueY}" + unit;

            bullet.adapter.add("fill", function(fill, target){
                if(target.dataItem.valueY < 21){
                    return am4core.color("#D66D6D");
                }
                return fill;
            })

            var range = valueAxis.createSeriesRange(series);
            range.value = goodRange.min;
            range.endValue = 0;
            range.contents.stroke = am4core.color("#D66D6D");
            range.contents.fill = range.contents.stroke;
            range.axisFill.fill = am4core.color("#cccccc");
            range.axisFill.fillOpacity = 0.2;
            range.grid.strokeOpacity = 0;

            var range2 = valueAxis.createSeriesRange(series);
            range2.value = 1000000;
            range2.endValue = goodRange.max;
            range2.contents.stroke = am4core.color("#D66D6D");
            range2.contents.fill = range.contents.stroke;
            range2.axisFill.fill = am4core.color("#cccccc");
            range2.axisFill.fillOpacity = 0.2;
            range2.grid.strokeOpacity = 0;

        }

        // Add scrollbar
        var scrollbarX = new am4charts.XYChartScrollbar();
        scrollbarX.series.push(series);
        chart.scrollbarX = scrollbarX;
        chart.cursor = new am4charts.XYCursor();
        chart.legend = new am4charts.Legend();
        chart.legend.position = "bottom";
        chart.legend.scrollable = true;
    }`


问:
How to use mlflow to deploy model that requires tensorflow_text for bert on local machine?
I recently use mlflow 1.29.0 to track my model training, I use BERT for text embedding which need to import tensorflow_text to register op before training, here is an example:

```<code>import tensorflow_hub as hub
import tensorflow_text as text

def create_model():
    text_input = tf.keras.layers.Input(shape = (),dtype = tf.string, name = 'text_input')
    preprocessed_text = preprocess_model(text_input)
    encoder_text = encoder_model(preprocessed_text)['pooled_output']

    text_output = tf.keras.layers.Dropout(0.1,name = 'dropout1')(encoder_text)
    text_output = tf.keras.layers.Dense(units = 400, activation = tf.keras.activations.sigmoid, name = 'text_dense1')(text_output)

    text_output = tf.keras.layers.Dropout(0.1,name = 'dropout2')(text_output)
    final_output = tf.keras.layers.Dense(units = 1, activation = tf.keras.activations.sigmoid,name = 'output')(text_output)

    model = tf.keras.Model(inputs = [text_input],outputs = [final_output])
    return model

if __name__ == '__main__':

    preprocess_path = 'https://tfhub.dev/tensorflow/bert_en_uncased_preprocess/3'
    encoder_path = 'https://tfhub.dev/tensorflow/bert_en_uncased_L-24_H-1024_A-16/4'

    preprocess_model = hub.KerasLayer(preprocess_path)
    encoder_model = hub.KerasLayer(encoder_path)

    with mlflow.start_run() as run:
        model = create_model()
        model.fit(...)
        mlflow.keras.log_model(keras_model = model,...)
        mlflow.end_run()
</code>```

The code run successfully, and the mlflow ui showed everything, however, when I start to deploy the data on my local machine with the following command

```<code>mlflow sagemaker build-and-push-container
mlflow sagemaker run-local -m runs:/XXXXX/XXXX -p 4999
</code>```

it showed the following error:

FileNotFoundError: Op type not registered 'CaseFoldUTF8' in binary running on mighty. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) tf.contrib.resampler should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.

I think it's because the tensorflow_text need to be import before running the model. (based on mlflow, the conda.yaml contain tensorflow-text==2.3.0)

I've meet this error several times when I train the model, I put 'import tensorflow_text as text' at top and the problem was fixed.

However I'm not quite sure how to do that when I deploy the model locally, can anyone help me with that? thank you!

I tried other command like mlflow models serve -m runs:/XXXXX/XXXX -p 4999, and the error is still there.

Body:
I recently use mlflow 1.29.0 to track my model training, I use BERT for text embedding which need to import tensorflow_text to register op before training, here is an example:

import tensorflow_hub as hub
import tensorflow_text as text

def create_model():
    text_input = tf.keras.layers.Input(shape = (),dtype = tf.string, name = 'text_input')
    preprocessed_text = preprocess_model(text_input)
    encoder_text = encoder_model(preprocessed_text)['pooled_output']

    text_output = tf.keras.layers.Dropout(0.1,name = 'dropout1')(encoder_text)
    text_output = tf.keras.layers.Dense(units = 400, activation = tf.keras.activations.sigmoid, name = 'text_dense1')(text_output)

    text_output = tf.keras.layers.Dropout(0.1,name = 'dropout2')(text_output)
    final_output = tf.keras.layers.Dense(units = 1, activation = tf.keras.activations.sigmoid,name = 'output')(text_output)

    model = tf.keras.Model(inputs = [text_input],outputs = [final_output])
    return model

if __name__ == '__main__':

    preprocess_path = 'https://tfhub.dev/tensorflow/bert_en_uncased_preprocess/3'
    encoder_path = 'https://tfhub.dev/tensorflow/bert_en_uncased_L-24_H-1024_A-16/4'

    preprocess_model = hub.KerasLayer(preprocess_path)
    encoder_model = hub.KerasLayer(encoder_path)

    with mlflow.start_run() as run:
        model = create_model()
        model.fit(...)
        mlflow.keras.log_model(keras_model = model,...)
        mlflow.end_run()

The code run successfully, and the mlflow ui showed everything, however, when I start to deploy the data on my local machine with the following command

mlflow sagemaker build-and-push-container
mlflow sagemaker run-local -m runs:/XXXXX/XXXX -p 4999

it showed the following error:

FileNotFoundError: Op type not registered 'CaseFoldUTF8' in binary running on mighty. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) tf.contrib.resampler should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.

I think it's because the tensorflow_text need to be import before running the model. (based on mlflow, the conda.yaml contain tensorflow-text==2.3.0)

I've meet this error several times when I train the model, I put 'import tensorflow_text as text' at top and the problem was fixed.

However I'm not quite sure how to do that when I deploy the model locally, can anyone help me with that? thank you!

I tried other command like mlflow models serve -m runs:/XXXXX/XXXX -p 4999, and the error is still there.


问:
Sphinx confluenceBuilder extension returns ValueError in `str2bool` (with no additional information)
When running Sphinx confluence build, it returns a ValueError without a message from the str2bool function within the confluence extension.

I am using version sphinxcontrib_confluencebuilder-2.0.0 on Python 3.8.10

My sphinx documentation build is triggered from an Azure pipeline:

```<code>- task: Bash@3
  displayName: Build Sphinx documentation
  env:
    AUTHOR: ${{ parameters.author }}
    SOURCE_FOLDER: ${{ parameters.sourceDirectory }}
    CONFLUENCE_PUBLISH: ${{ parameters.publishDocsToConfluence }}
    CONFLUENCE_PAGE_ID: ${{ parameters.confluencePageId }}
    CONFLUENCE_PUBLISH_TOKEN: $(sphinx-to-confluence-writer-token)
    PACKAGE_NAME: $(packageName)
    PACKAGE_VERSION: $(packageVersion)
  inputs:
    targetType: inline
    workingDirectory: ${{ parameters.sourceDirectory }}
    script: |
      sphinx-build -b confluence ./source ./build_confluence -E -a
      sphinx-build -b html ./source ./build_html
      rm -rf source/ make.bat Makefile
</code>```

The error seems to indicate that it receives something (or nothing) from a certain config variable that is not "y, yes, t, true, on or 1", causing str2bool to fail.

The full error stack when printing /tmp/sphinx-err-...:

```<code># Sphinx version: 5.3.0
# Python version: 3.8.10 (CPython)
# Docutils version: 0.19
# Jinja2 version: 3.1.2
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinx/cmd/build.py", line 276, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinx/application.py", line 262, in __init__
    self._init_builder()
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinx/application.py", line 334, in _init_builder
    self.builder.init()
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinxcontrib/confluencebuilder/builder.py", line 100, in init
    apply_defaults(self)
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinxcontrib/confluencebuilder/config/defaults.py", line 89, in apply_defaults
    conf[key] = str2bool(conf[key])
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinxcontrib/confluencebuilder/util.py", line 366, in str2bool
    raise ValueError
ValueError
</code>```

This seems to suggest that some /confluencebuilder/config/defaults.py value is failing it's own audit.

The index.rst and config.py files

source/index.rst:

```<code>.. mdinclude:: ${{ parameters.sourceDirectory }}/README.md
.. automodule:: ${{ parameters.sourceDirectory }}/src
:members:

.. toctree::
$(packageName)/api/$(packageName)/index
:maxdepth: 3
:caption: Contents:
</code>```

conf.py:

```<code>import os
import sys

sys.path.insert(0, os.path.abspath("../.."))

project = "abc"
author = "abc"
copyright = "abc"

# The full version, including alpha/beta/rc tags
release = os.environ["PACKAGE_VERSION"]
extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.coverage",
    "sphinx.ext.napoleon",
    "autoapi.extension",
    "m2r",
    "sphinx_rtd_theme",
    "sphinxcontrib.confluencebuilder",
]
templates_path = ["_templates"]
exclude_patterns = []
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
autoapi_type = "python"
autoapi_dirs = [f"{os.environ['SOURCE_FOLDER']}/src"]
autoapi_add_toctree_entry = False
autoapi_root = f"{project}/api"
source_suffix = [".rst", ".md"]

# -- Confluence plugin config -------------------------------------------------
publish_to_confluence = os.environ["CONFLUENCE_PUBLISH"] # "true"

confluence_publish = publish_to_confluence.lower() == "true" and confluence_page_id
confluence_space_key = "some Space Key"
confluence_server_url = "some URL"
confluence_parent_page = 123456

confluence_page_hierarchy = True
confluence_page_generation_notice = True
</code>```

Attempts:

It might be the way that confluence_publish is defined, but when reading the code, it should be able to deal with a boolean value. For the sake of testing I changed it to a string, but it throws the same error.

Body:
When running Sphinx confluence build, it returns a ValueError without a message from the str2bool function within the confluence extension.

I am using version sphinxcontrib_confluencebuilder-2.0.0 on Python 3.8.10

My sphinx documentation build is triggered from an Azure pipeline:

- task: Bash@3
  displayName: Build Sphinx documentation
  env:
    AUTHOR: ${{ parameters.author }}
    SOURCE_FOLDER: ${{ parameters.sourceDirectory }}
    CONFLUENCE_PUBLISH: ${{ parameters.publishDocsToConfluence }}
    CONFLUENCE_PAGE_ID: ${{ parameters.confluencePageId }}
    CONFLUENCE_PUBLISH_TOKEN: $(sphinx-to-confluence-writer-token)
    PACKAGE_NAME: $(packageName)
    PACKAGE_VERSION: $(packageVersion)
  inputs:
    targetType: inline
    workingDirectory: ${{ parameters.sourceDirectory }}
    script: |
      sphinx-build -b confluence ./source ./build_confluence -E -a
      sphinx-build -b html ./source ./build_html
      rm -rf source/ make.bat Makefile

The error seems to indicate that it receives something (or nothing) from a certain config variable that is not "y, yes, t, true, on or 1", causing str2bool to fail.

The full error stack when printing /tmp/sphinx-err-...:

# Sphinx version: 5.3.0
# Python version: 3.8.10 (CPython)
# Docutils version: 0.19
# Jinja2 version: 3.1.2
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinx/cmd/build.py", line 276, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinx/application.py", line 262, in __init__
    self._init_builder()
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinx/application.py", line 334, in _init_builder
    self.builder.init()
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinxcontrib/confluencebuilder/builder.py", line 100, in init
    apply_defaults(self)
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinxcontrib/confluencebuilder/config/defaults.py", line 89, in apply_defaults
    conf[key] = str2bool(conf[key])
  File "/home/vsts/.local/lib/python3.8/site-packages/sphinxcontrib/confluencebuilder/util.py", line 366, in str2bool
    raise ValueError
ValueError

This seems to suggest that some /confluencebuilder/config/defaults.py value is failing it's own audit.

The index.rst and config.py files

source/index.rst:

.. mdinclude:: ${{ parameters.sourceDirectory }}/README.md
.. automodule:: ${{ parameters.sourceDirectory }}/src
:members:

.. toctree::
$(packageName)/api/$(packageName)/index
:maxdepth: 3
:caption: Contents:

conf.py:

import os
import sys

sys.path.insert(0, os.path.abspath("../.."))

project = "abc"
author = "abc"
copyright = "abc"

# The full version, including alpha/beta/rc tags
release = os.environ["PACKAGE_VERSION"]
extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.coverage",
    "sphinx.ext.napoleon",
    "autoapi.extension",
    "m2r",
    "sphinx_rtd_theme",
    "sphinxcontrib.confluencebuilder",
]
templates_path = ["_templates"]
exclude_patterns = []
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
autoapi_type = "python"
autoapi_dirs = [f"{os.environ['SOURCE_FOLDER']}/src"]
autoapi_add_toctree_entry = False
autoapi_root = f"{project}/api"
source_suffix = [".rst", ".md"]

# -- Confluence plugin config -------------------------------------------------
publish_to_confluence = os.environ["CONFLUENCE_PUBLISH"] # "true"

confluence_publish = publish_to_confluence.lower() == "true" and confluence_page_id
confluence_space_key = "some Space Key"
confluence_server_url = "some URL"
confluence_parent_page = 123456

confluence_page_hierarchy = True
confluence_page_generation_notice = True

Attempts:

It might be the way that confluence_publish is defined, but when reading the code, it should be able to deal with a boolean value. For the sake of testing I changed it to a string, but it throws the same error.


问:
Driver's SQLAllocHandle on SQL_HANDLE_HENV failed while connecting extremeDB ODBC driver
Getting the following error while running
isql EXDB -v
[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
[ISQL]ERROR: Could not SQLConnect

```<code>Below are contents of odbc.ini
[EXDB]
Description = eXtremeSQL data source
Driver = eXtremeSQL
#DATABASE = exdb
SERVER = localhost:5099
</code>```
```<code>odbcinst.ini :
[eXtremeSQL]
Description = ODBC for eXtremeSQL
Driver =
Setup =
Driver64 = /root/extremeDB-v8.0.1799.25104.1/odbc/bin.so/libmcoodbc_drv_debug.so
Setup64 =
FileUsage = 1
</code>```

isql command is giving some error. Please help

Body:
Getting the following error while running
isql EXDB -v
[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
[ISQL]ERROR: Could not SQLConnect

Below are contents of odbc.ini
[EXDB]
Description = eXtremeSQL data source
Driver = eXtremeSQL
#DATABASE = exdb
SERVER = localhost:5099

odbcinst.ini :
[eXtremeSQL]
Description = ODBC for eXtremeSQL
Driver =
Setup =
Driver64 = /root/extremeDB-v8.0.1799.25104.1/odbc/bin.so/libmcoodbc_drv_debug.so
Setup64 =
FileUsage = 1

isql command is giving some error. Please help


问:
Unable to add and delete columns in tanstack table v8. Not sure how to work with generic types
I am trying to create a table using tanstack table v8 where I can

add columns of types text, number and select

delete columns

add rows

Since I have less experience in typescript, I am struggling with defining generic types that can work with any kind of table type.

I tried to follow the example in https://tanstack.com/table/v8/docs/examples/react/editable-data but did not know how to change the explicit type declaration of Person to a generic type that is stored in the backend and updated by the user dynamically


问:
React Redux Routing
Versions:
react-router: 3.2.0
react-redux : 5.1.1
react-router-redex: 4.0.7
redux 4.0.4
In one of the react project the routing configuration is as below. I am able to access the app using localhost:5200 but when I try to access using localhost:5200/settings, its not finding the path. I think with react redux, we need to push the path to the history to redirect to the page. In that case, can I achieve this by passing specific query params to redirect to specific page? If yes how can I impement this?</p>
```<code> <PhoneProvider phone={phone}>
      <Provider store={phone.store}>
        <Router history={phone.routerInteraction.history}>
          <Route
            component={(routerProps) => (
              <AppView hostingUrl={hostingUrl}>
                {routerProps.children}
                <ConnectivityBadgeContainer />
              </AppView>
            )}
          >
            <Route
              path="/"
              component={() => (
                <LoginPage>
                  <AlertContainer />
                </LoginPage>
              )}
            />
            <Route
              path="/"
              component={(routerProps) => (
                <MainView>
                {routerProps.children}
                <AlertContainer />
              </MainView>
              )}
            >
              <Route
                path="/settings"
                component={(routerProps) => (
                  <SettingsPage
                    params={routerProps.location.query}
                    regionSettingsUrl="/settings/region"
                    callingSettingsUrl="/settings/calling"
                    showAudio={false}
                    showUserGuide={false}
                    showFeedback={false}
                  />
                )}
              />

            </Route>
          </Route>
        </Router>
      </Provider>
    </PhoneProvider>
</code>```

Title: React Redux Routing

Body:
Versions:
react-router: 3.2.0
react-redux : 5.1.1
react-router-redex: 4.0.7
redux 4.0.4
In one of the react project the routing configuration is as below. I am able to access the app using localhost:5200 but when I try to access using localhost:5200/settings, its not finding the path. I think with react redux, we need to push the path to the history to redirect to the page. In that case, can I achieve this by passing specific query params to redirect to specific page? If yes how can I impement this?

 <PhoneProvider phone={phone}>
      <Provider store={phone.store}>
        <Router history={phone.routerInteraction.history}>
          <Route
            component={(routerProps) => (
              <AppView hostingUrl={hostingUrl}>
                {routerProps.children}
                <ConnectivityBadgeContainer />
              </AppView>
            )}
          >
            <Route
              path="/"
              component={() => (
                <LoginPage>
                  <AlertContainer />
                </LoginPage>
              )}
            />
            <Route
              path="/"
              component={(routerProps) => (
                <MainView>
                {routerProps.children}
                <AlertContainer />
              </MainView>
              )}
            >
              <Route
                path="/settings"
                component={(routerProps) => (
                  <SettingsPage
                    params={routerProps.location.query}
                    regionSettingsUrl="/settings/region"
                    callingSettingsUrl="/settings/calling"
                    showAudio={false}
                    showUserGuide={false}
                    showFeedback={false}
                  />
                )}
              />

            </Route>
          </Route>
        </Router>
      </Provider>
    </PhoneProvider>


问:
Find camera matrices for image patches
I have an image and its corresponding camera matrix(intrinsics and extrinsics). I need to chop the image in 4 or n patches. What will be the new camera matrices for each patch of the image? Or is this even possible to find?</p>

Title: Find camera matrices for image patches


问:
Pymem Could not read memory at: , length: 4 - GetLastError: 299

from pymem import *
from pymem.process import *

pm = pymem.Pymem("SHIFT.exe")

gameModule = module_from_name(pm.process_handle , "SHIFT.exe").lpBaseOfDll

def GetptrAddr(base , offsets):

    addr = pm.read_int(base)
    for i in offsets:
        if i != offsets[-1]:
            addr = pm.read_int(addr + i) #problem --> Could not read memory at: 1715211616, length: 4 - GetLastError: 299
    return addr + offsets[-1]

while True:
    pm.write_int(GetptrAddr(gameModule + 0x001F30AC, [0x8E4,0x2C,0x20,0x14,0x10,0x28,0x5C]),11)
```

I use Cheat engine and Pymem to change the timer in game but it doesn't work.

Cheat Engine7.4 Pointer:

Pymem Error:

Body:
from pymem import *
from pymem.process import *

pm = pymem.Pymem("SHIFT.exe")

gameModule = module_from_name(pm.process_handle , "SHIFT.exe").lpBaseOfDll

def GetptrAddr(base , offsets):

    addr = pm.read_int(base)
    for i in offsets:
        if i != offsets[-1]:
            addr = pm.read_int(addr + i) #problem --> Could not read memory at: 1715211616, length: 4 - GetLastError: 299
    return addr + offsets[-1]

while True:
    pm.write_int(GetptrAddr(gameModule + 0x001F30AC, [0x8E4,0x2C,0x20,0x14,0x10,0x28,0x5C]),11)

I use Cheat engine and Pymem to change the timer in game but it doesn't work.

Cheat Engine7.4 Pointer:

Pymem Error:


问:
fastapi-keycloak quickstart example gives error: The 'realm_access' section of the provided access token is missing
I'm trying to run basic quickstart example of fastapi-keycloak library.

I've started keycloak server via docker-compose with their provided docker-compose.yaml and realm-export.json. Than I've started an example FastAPI app on localhost:8081, created a keycloak user in admin panel (localhost:8085), logged in (http://localhost:8081/login) and obtained access token.

After that I've tried to use this access token in some external request: I ran Postman and created a request http://localhost:8081/admin with Authorization header filled as Bearer {token}. This request should check user roles, but I got the following error:

```<code>  File "/mnt/dump1/Projects/fastapi_sandbox/venv_py3.8/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/mnt/dump1/Projects/fastapi_sandbox/venv_py3.8/lib/python3.8/site-packages/fastapi_keycloak/api.py", line 264, in current_user
    if role not in user.roles:
  File "/mnt/dump1/Projects/fastapi_sandbox/venv_py3.8/lib/python3.8/site-packages/fastapi_keycloak/model.py", line 122, in roles
    raise KeycloakError(
fastapi_keycloak.exceptions.KeycloakError: HTTP 404: The 'realm_access' section of the provided access token is missing
</code>```

After that I went to keycloak admin panel again and enabled role mapper for this client (Clients --> test-client --> Mappers --> Add builtin --> realm roles), I even enabled "Add to ID token" and "Add to userinfo". Than I got new access token with /login, but nothing changed.

How can it be fixed -- and what am I doing wrong?

Body:
I'm trying to run basic quickstart example of fastapi-keycloak library.

I've started keycloak server via docker-compose with their provided docker-compose.yaml and realm-export.json. Than I've started an example FastAPI app on localhost:8081, created a keycloak user in admin panel (localhost:8085), logged in (http://localhost:8081/login) and obtained access token.

After that I've tried to use this access token in some external request: I ran Postman and created a request http://localhost:8081/admin with Authorization header filled as Bearer {token}. This request should check user roles, but I got the following error:

  File "/mnt/dump1/Projects/fastapi_sandbox/venv_py3.8/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/mnt/dump1/Projects/fastapi_sandbox/venv_py3.8/lib/python3.8/site-packages/fastapi_keycloak/api.py", line 264, in current_user
    if role not in user.roles:
  File "/mnt/dump1/Projects/fastapi_sandbox/venv_py3.8/lib/python3.8/site-packages/fastapi_keycloak/model.py", line 122, in roles
    raise KeycloakError(
fastapi_keycloak.exceptions.KeycloakError: HTTP 404: The 'realm_access' section of the provided access token is missing

After that I went to keycloak admin panel again and enabled role mapper for this client (Clients --> test-client --> Mappers --> Add builtin --> realm roles), I even enabled "Add to ID token" and "Add to userinfo". Than I got new access token with /login, but nothing changed.

How can it be fixed -- and what am I doing wrong?


问:
Power Virtual Agent trigger flow on error
I am trying to catch error generated by power virtual agent chat bot and send to power automate flow.

Below is the sample error screenshot generated by power virtual agent for reference.

I tried figuring out the topic that triggers and displays this kind of error codes but was not able to find.

Any ideas and suggestions would be helpful.


问:
Get text from tweets in the twitter widget timeline
I'm using the following widget from the twitter page:

https://publish.twitter.com/?query=https%3A%2F%2Ftwitter.com%2Fmartinmbauer&widget=Timeline

If you want, here you have an example with tweets from Martin Bauer that you can implement.

```<code> <a class="twitter-timeline" href="https://twitter.com/martinmbauer?ref_src=twsrc%5Etfw">Tweets by martinmbauer</a>

 <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</code>```

I'm looking for a way to obtain the text from the tweets, in javascript. I didn't find an easy way to filter the information out, but probabily exists a simple command.

Thanks in advance.

Body:
I'm using the following widget from the twitter page:

https://publish.twitter.com/?query=https%3A%2F%2Ftwitter.com%2Fmartinmbauer&widget=Timeline

If you want, here you have an example with tweets from Martin Bauer that you can implement.

 Tweets by martinmbauer

I'm looking for a way to obtain the text from the tweets, in javascript. I didn't find an easy way to filter the information out, but probabily exists a simple command.

Thanks in advance.


问:
curl/curl.h library not found in dev c++ 6.3
```<code>`#include <stdio.h>
#include <curl/curl.h>
 int main(void)
 {
    CURL *curl;
    CURLcode res;

    curl = curl_easy_init();
    if(curl)
    {
       curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");
       /* example.com is redirected, so we tell libcurl to follow redirection */
       curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

       /* Perform the request, res will get the return code */
       res = curl_easy_perform(curl);
       /* Check for errors */
       if(res != CURLE_OK)
       fprintf(stderr, "curl_easy_perform() failed: %s\n",
       curl_easy_strerror(res));

       /* always cleanup */
       curl_easy_cleanup(curl);
    }
  return 0;
 }`

</code>```

i have linked libcurl.a file in the project and added inlude folder from the curl-7.87.0_1-win64-mingw folder, i have also copied the include in C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\x86_64-w64-mingw32 folder and copied the libraries too (as suggested in a previous answer to a similar question here) but still it isnt working, the error im seeing is [Error] curl/curl.h: No such file or directory.

this is the code im trying to run

Body:
`#include <stdio.h>
#include <curl/curl.h>
 int main(void)
 {
    CURL *curl;
    CURLcode res;

    curl = curl_easy_init();
    if(curl)
    {
       curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");
       /* example.com is redirected, so we tell libcurl to follow redirection */
       curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

       /* Perform the request, res will get the return code */
       res = curl_easy_perform(curl);
       /* Check for errors */
       if(res != CURLE_OK)
       fprintf(stderr, "curl_easy_perform() failed: %s\n",
       curl_easy_strerror(res));

       /* always cleanup */
       curl_easy_cleanup(curl);
    }
  return 0;
 }`

i have linked libcurl.a file in the project and added inlude folder from the curl-7.87.0_1-win64-mingw folder, i have also copied the include in C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\x86_64-w64-mingw32 folder and copied the libraries too (as suggested in a previous answer to a similar question here) but still it isnt working, the error im seeing is [Error] curl/curl.h: No such file or directory.

this is the code im trying to run


问:
How do I refer to code in main.rs from tests?
I have some code in src/main.rs, including pub fn display(word: &str, guesses: &str) -> String { ... } (it runs fine with cargo run).

I have

```<code>[package]
name = "hangman"
version = "0.1.0"
edition = "2021"
</code>```

in Cargo.toml

and I have

```<code>use hangman::*;

#[test]
fn test_display() {
    assert_eq!(display("banana", ""), String::from("_ _ _ _ _ _"))
}
</code>```

in tests/hangman.rs

When I run cargo test I get the following errors:

```<code>   Compiling hangman v0.1.0 (/home/feature/projects/hangman)
error[E0432]: unresolved import `hangman`
 --> tests/hangman.rs:2:5
  |
2 | use hangman::*;
  |     ^^^^^^^ use of undeclared crate or module `hangman`

error[E0425]: cannot find function `display` in this scope
 --> tests/hangman.rs:5:16
  |
5 |     assert_eq!(display("banana", ""), String::from("_ _ _ _ _ _"))
  |                ^^^^^^^ not found in this scope

Some errors have detailed explanations: E0425, E0432.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `hangman` due to 2 previous errors
</code>```

Why is hangman undeclared if it's named as such in Cargo.toml? Is there another place I need to declare it?

Body:
I have some code in src/main.rs, including pub fn display(word: &str, guesses: &str) -> String { ... } (it runs fine with cargo run).

I have

[package]
name = "hangman"
version = "0.1.0"
edition = "2021"

in Cargo.toml

and I have

use hangman::*;

#[test]
fn test_display() {
    assert_eq!(display("banana", ""), String::from("_ _ _ _ _ _"))
}

in tests/hangman.rs

When I run cargo test I get the following errors:

   Compiling hangman v0.1.0 (/home/feature/projects/hangman)
error[E0432]: unresolved import `hangman`
 --> tests/hangman.rs:2:5
  |
2 | use hangman::*;
  |     ^^^^^^^ use of undeclared crate or module `hangman`

error[E0425]: cannot find function `display` in this scope
 --> tests/hangman.rs:5:16
  |
5 |     assert_eq!(display("banana", ""), String::from("_ _ _ _ _ _"))
  |                ^^^^^^^ not found in this scope

Some errors have detailed explanations: E0425, E0432.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `hangman` due to 2 previous errors

Why is hangman undeclared if it's named as such in Cargo.toml? Is there another place I need to declare it?


问:
Find nutanix version details using API
I am trying to get the below details from nutanix cluster using API.

lcm version

ahv version

prism central version

I tried the API explorer but could not find any solution. Please suggest.

Title: Find nutanix version details using API


问:
changing adonis js public folder path
as you know adonis 5 public folder will be deleted on every build my question is how can I change that folder path to preserve this folder on build.
there is an issue in the adonis repo that mentions symlincs is the best way to do this I appreciate guiding me on this matter and I have to ask if the symlink approach will be a problem on local development time on windows</p>

Title: changing adonis js public folder path


问:
Rust generic parameter matching
The problem arises when implementing From trait.
I understand the problem is that generic type T collides with RangeFull.

impl<T: Ord + 'static> From<RangeFull> for X<T> { ... }
impl<T: Ord + 'static> From<T> for X<T> { ... }
```

I was expecting the matching process as the following (like C++ template)

Check input type is RangeFull if yes, matched, otherwise go 2

match the most generic T

Title: Rust generic parameter matching

Body:
The problem arises when implementing From trait.
I understand the problem is that generic type T collides with RangeFull.

impl<T: Ord + 'static> From<RangeFull> for X<T> { ... }
impl<T: Ord + 'static> From<T> for X<T> { ... }

I was expecting the matching process as the following (like C++ template)

Check input type is RangeFull if yes, matched, otherwise go 2

match the most generic T


问:
JQuery append to IMG URL, this works, but Developer Console reports 404 errors. How to stop those errors?
The images are from a markdown template and the SRC once parsed is just the filename only, no complete URL. I append the URL with the JQuery below, and the image is loaded as expected. The issue isn't that the image file doesn't exist, it does, but the developer console reports the file not found. And because of this, the browser fails to load other dependencies, such as the RRSSB plugin, for example.

Anyone got any suggestions please? Here is the JQuery below:

```<code>$(".markdown").find("img").each(function()
        {
            $(this).addClass("markdown");
            $(this).attr("src", function(i, value)
            {
                return "{{ config("website.aws.s3") }}" + value;
            });
        });
</code>```

As I said, the actual image itself is loaded without any problems. I just need the console not to report the 404 error, that's all.

Body:
The images are from a markdown template and the SRC once parsed is just the filename only, no complete URL. I append the URL with the JQuery below, and the image is loaded as expected. The issue isn't that the image file doesn't exist, it does, but the developer console reports the file not found. And because of this, the browser fails to load other dependencies, such as the RRSSB plugin, for example.

Anyone got any suggestions please? Here is the JQuery below:

$(".markdown").find("img").each(function()
        {
            $(this).addClass("markdown");
            $(this).attr("src", function(i, value)
            {
                return "{{ config("website.aws.s3") }}" + value;
            });
        });

As I said, the actual image itself is loaded without any problems. I just need the console not to report the 404 error, that's all.


问:
Keras Conv Layer followed by Scikit Learn Random Forest Classifier
I need to solve a binary classification problem. I have to use a Random Forest Classifier instead of the traditional Dense Layers after the Convolution Layers that are used for that purpouse. But i also need to use that traditional Conv+Dense to compare the prediction results with the Conv+RFC.

Here is what i have done:

```<code>feature_extractor = Sequential(name='Conv1D')
feature_extractor.add(InputLayer((x_train.shape[1], features), name='Input_Layer'))
feature_extractor.add(Conv1D(filters=144, kernel_size=2, activation='relu', name='1_Conv_Layer'))
feature_extractor.add(MaxPooling1D(pool_size=2))
feature_extractor.add(Conv1D(filters=72, kernel_size=2, activation='relu', name='2_Conv_Layer'))
feature_extractor.add(MaxPooling1D(pool_size=2))
feature_extractor.add(Conv1D(filters=36, kernel_size=2, activation='relu', name='3_Conv_Layer'))
feature_extractor.add(MaxPooling1D(pool_size=2))
feature_extractor.add(Flatten())
x_RF = feature_extractor.output  # This goes to RFC
feature_extractor.add(Dense(units=50, activation='relu', name='Dense1'))
feature_extractor.add(Dropout(0.3))
feature_extractor.add(Dense(units=25, activation='relu', name='Dense2'))
feature_extractor.add(Dropout(0.2))
feature_extractor.add(Dense(units=1, activation='sigmoid', name='Output_Layer'))
feature_extractor.compile(optimizer='adam', metrics='binary_accuracy', loss='binary_crossentropy')

# Train Conv+Dense
feature_extractor.fit(x_train, y_train, epochs=200, validation_data=(x_test, y_test))
prediction_ConvDense = feature_extractor.predict(x_test)

# Train Conv+RFC
RFC = RandomForestClassifier(n_estimators=50, random_state=42)
RFC.fit(x_RF, y_train)
prediction_ConvRF = RFC.predict(x_test_feature)
</code>```

Is this correct?

Body:
I need to solve a binary classification problem. I have to use a Random Forest Classifier instead of the traditional Dense Layers after the Convolution Layers that are used for that purpouse. But i also need to use that traditional Conv+Dense to compare the prediction results with the Conv+RFC.

Here is what i have done:

feature_extractor = Sequential(name='Conv1D')
feature_extractor.add(InputLayer((x_train.shape[1], features), name='Input_Layer'))
feature_extractor.add(Conv1D(filters=144, kernel_size=2, activation='relu', name='1_Conv_Layer'))
feature_extractor.add(MaxPooling1D(pool_size=2))
feature_extractor.add(Conv1D(filters=72, kernel_size=2, activation='relu', name='2_Conv_Layer'))
feature_extractor.add(MaxPooling1D(pool_size=2))
feature_extractor.add(Conv1D(filters=36, kernel_size=2, activation='relu', name='3_Conv_Layer'))
feature_extractor.add(MaxPooling1D(pool_size=2))
feature_extractor.add(Flatten())
x_RF = feature_extractor.output  # This goes to RFC
feature_extractor.add(Dense(units=50, activation='relu', name='Dense1'))
feature_extractor.add(Dropout(0.3))
feature_extractor.add(Dense(units=25, activation='relu', name='Dense2'))
feature_extractor.add(Dropout(0.2))
feature_extractor.add(Dense(units=1, activation='sigmoid', name='Output_Layer'))
feature_extractor.compile(optimizer='adam', metrics='binary_accuracy', loss='binary_crossentropy')

# Train Conv+Dense
feature_extractor.fit(x_train, y_train, epochs=200, validation_data=(x_test, y_test))
prediction_ConvDense = feature_extractor.predict(x_test)

# Train Conv+RFC
RFC = RandomForestClassifier(n_estimators=50, random_state=42)
RFC.fit(x_RF, y_train)
prediction_ConvRF = RFC.predict(x_test_feature)

Is this correct?