问:
Find out what is the most used or most expensive ODBC query for my database?
I use this query but have noticed that queries made via ODBC by Excel do not show up.

```<code>SELECT TOP 15  object_schema_name(t.objectid, t.dbid) AS [Es creado o es de softland],db.name,object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid) as [object_name],(CASE WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsView') AS [IsView]) = 1
      THEN 'View'  WHEN
     (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsTable') AS [IsTable]) = 1
      THEN 'Table'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsProcedure') AS [IsProcedure]) = 1
      THEN 'Stored Procedure'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsTableFunction') AS [IsTableFunction]) = 1
      THEN 'Table-valued Function'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsTrigger') AS [IsTrigger]) = 1
      THEN 'Trigger'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsSystemTable') AS [IsSystemTable]) = 1
      THEN 'Sytem Table'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsSystemVerified') AS [IsSystemVerified]) = 1
      THEN 'Sytem Verified'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsSchemaBound') AS [IsSchemaBound]) = 1
      THEN 'Schema Bound'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsScalarFunction') AS [IsScalarFunction]) = 1
      THEN 'Scalar Function'
    ELSE
       'Unknown. Maybe add more types to this statement.' END) AS Typ_Object,t.text,statement_start_offset,statement_start_offset,plan_generation_num,
  creation_time,last_execution_time,execution_count,total_worker_time,last_worker_time,min_worker_time,max_worker_time,
  total_physical_reads,last_physical_reads,min_physical_reads,max_physical_reads,
  total_logical_writes,last_logical_writes,min_logical_writes,max_logical_writes,
  total_logical_reads,last_logical_reads,min_logical_reads,max_logical_reads,
  total_elapsed_time as [Tiempo Total Transcurrido],last_elapsed_time as [Ultimo Tiempo Transcurrido],min_elapsed_time as [Mininimo Tiempo Transcurrido], max_elapsed_time as [Maximo Tirmpo Transcurrido],
  total_rows,last_rows,min_rows,max_rows,
  last_dop as [Ultimo grado de paralelismo],min_dop as [Minimo grado de paralelismo], max_dop as [Maximo grado de paralelismo],
  total_used_threads,last_used_threads,min_used_threads,max_used_threads
  FROM sys.dm_exec_query_stats AS QS
  CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t
  LEFT JOIN sys.databases db ON (t.dbid = db.database_id)
  WHERE QS.last_execution_time > DATEADD(day, -30, GETUTCDATE())    -- executed in the last 30 days
    AND QS.execution_count > 40                                     -- executed at least 40 times in the past 30 days
    AND  object_schema_name(t.objectid, t.dbid)='dbo'               -- database owner
  ORDER BY QS.total_worker_time/QS.execution_count DESC             -- average cpu time in ms
</code>```

It is as if I could see only queries that are stored procedures, triggers or queries that are directly executed from sql server, etc. As information, I also know that I have procedures for updating reports in PBI that are executed several times a day and I do not see it reflected in that query either.

I need a query or a way to see the cost of that odbc traffic to the database.

Body:
I use this query but have noticed that queries made via ODBC by Excel do not show up.

SELECT TOP 15  object_schema_name(t.objectid, t.dbid) AS [Es creado o es de softland],db.name,object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid) as [object_name],(CASE WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsView') AS [IsView]) = 1
      THEN 'View'  WHEN
     (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsTable') AS [IsTable]) = 1
      THEN 'Table'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsProcedure') AS [IsProcedure]) = 1
      THEN 'Stored Procedure'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsTableFunction') AS [IsTableFunction]) = 1
      THEN 'Table-valued Function'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsTrigger') AS [IsTrigger]) = 1
      THEN 'Trigger'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsSystemTable') AS [IsSystemTable]) = 1
      THEN 'Sytem Table'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsSystemVerified') AS [IsSystemVerified]) = 1
      THEN 'Sytem Verified'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsSchemaBound') AS [IsSchemaBound]) = 1
      THEN 'Schema Bound'
    WHEN (SELECT OBJECTPROPERTY(OBJECT_ID(object_schema_name(t.objectid, t.dbid)+'.'+object_name(t.objectid, t.dbid)), 'IsScalarFunction') AS [IsScalarFunction]) = 1
      THEN 'Scalar Function'
    ELSE
       'Unknown. Maybe add more types to this statement.' END) AS Typ_Object,t.text,statement_start_offset,statement_start_offset,plan_generation_num,
  creation_time,last_execution_time,execution_count,total_worker_time,last_worker_time,min_worker_time,max_worker_time,
  total_physical_reads,last_physical_reads,min_physical_reads,max_physical_reads,
  total_logical_writes,last_logical_writes,min_logical_writes,max_logical_writes,
  total_logical_reads,last_logical_reads,min_logical_reads,max_logical_reads,
  total_elapsed_time as [Tiempo Total Transcurrido],last_elapsed_time as [Ultimo Tiempo Transcurrido],min_elapsed_time as [Mininimo Tiempo Transcurrido], max_elapsed_time as [Maximo Tirmpo Transcurrido],
  total_rows,last_rows,min_rows,max_rows,
  last_dop as [Ultimo grado de paralelismo],min_dop as [Minimo grado de paralelismo], max_dop as [Maximo grado de paralelismo],
  total_used_threads,last_used_threads,min_used_threads,max_used_threads
  FROM sys.dm_exec_query_stats AS QS
  CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t
  LEFT JOIN sys.databases db ON (t.dbid = db.database_id)
  WHERE QS.last_execution_time > DATEADD(day, -30, GETUTCDATE())    -- executed in the last 30 days
    AND QS.execution_count > 40                                     -- executed at least 40 times in the past 30 days
    AND  object_schema_name(t.objectid, t.dbid)='dbo'               -- database owner
  ORDER BY QS.total_worker_time/QS.execution_count DESC             -- average cpu time in ms

It is as if I could see only queries that are stored procedures, triggers or queries that are directly executed from sql server, etc. As information, I also know that I have procedures for updating reports in PBI that are executed several times a day and I do not see it reflected in that query either.

I need a query or a way to see the cost of that odbc traffic to the database.


来源: stackexchange

问:
Opening the camera with Vue + Ionic causes a reload
I recently asked a question because I was trying to use the "capacitor-community/barcode-scanner" plugin with Ionic + VueJS. but I finally gave up. I can't get it to work.

So I decided to try Ionic Native plugin "https://ionicframework.com/docs/native/barcode-scanner" , w ith the project: "https://github.com/StarleyDev/barcodescanner-sdk31.git" , i managed to make the application compile correctly for Android 11. But look at the this strange behavior, if I call the plugin through the VUE component:

https://streamable.com/ei2lmx

It seems that VUEJS fully reloads right after I call the camera. And even reading the barcode, now that everything has been reloaded, the callbacks don't work. But if I call it directly from the console:

https://streamable.com/0yahnu

Works correctly and doesn't reload the VUEJS, i believe the problem is the same that is causing the Capacitor plugin to malfunction. Any ideias?

I tried calling "SCAN" in several ways, through the BarcodeScanner class, natively through 'window.cordova' and nothing helped me. Same result every time.

ContentLicense: CC BY-SA 4.0


问:
PHP cURL is stretching with Mysql fetch array
I'm fairly new to PHP and cURL. I started pulling data from an API with cURL. My goal is to pull id from database for tokenid in URL. I can pull the data as I want, but the website loads too late. It is stretching a lot while pulling data.

It pulls data very fast If I don't use mysql_fetch_array().

```<code>
<?php
$result = mysql_query("SELECT * FROM elements ORDER by id");
while ($result2 = mysql_fetch_array($result))
    {

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.joepegs.dev/v2/collections/0x74eb4c2ed6d68e81d4b22d8ed7c74335373e45bb/tokens/$result2[id]",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "x-joepegs-api-key: [...]",
    "content-type: application/json"
  ),
));
$response = curl_exec($curl);
$err = curl_error($curl);

$XmlElement = json_decode($response);
$price = $XmlElement->tokenId;

curl_close($curl);

echo $price;
?>

</code>```

When I didn't use mysql_fetch_array, it was pulling the data fast, but I continue to have this problem because I need to pull all the data with id.

Body:
I'm fairly new to PHP and cURL. I started pulling data from an API with cURL. My goal is to pull id from database for tokenid in URL. I can pull the data as I want, but the website loads too late. It is stretching a lot while pulling data.

It pulls data very fast If I don't use mysql_fetch_array().

<?php
$result = mysql_query("SELECT * FROM elements ORDER by id");
while ($result2 = mysql_fetch_array($result))
    {

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.joepegs.dev/v2/collections/0x74eb4c2ed6d68e81d4b22d8ed7c74335373e45bb/tokens/$result2[id]",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "x-joepegs-api-key: [...]",
    "content-type: application/json"
  ),
));
$response = curl_exec($curl);
$err = curl_error($curl);

$XmlElement = json_decode($response);
$price = $XmlElement->tokenId;

curl_close($curl);

echo $price;
?>

When I didn't use mysql_fetch_array, it was pulling the data fast, but I continue to have this problem because I need to pull all the data with id.


问:
Add a Bootstrap loading spinner to a modal body
I have a bootstrap modal that loads a html table in the body. I want to add a spinner that shows before the html table loads and disappears after is loads.

This is my current attempt.

html

```<code><div onload="myFunction()" class="modal-body">
    <div class="spinner-border text-primary"
    id="spinner" role="status">
    <span class="sr-only">Loading...</span>
    </div>
    <div id="table-to-update" class='table-to-update'></div>
</div>
</code>```

JS

```<code>var myVar;

function myFunction() {
  myVar = setTimeout(showPage, 3000);
}

function showPage() {
  document.getElementById("spinner").style.display = "none";
  document.getElementById("table-to-update").style.display = "block";
}
</code>```

As you can see in the picture the spinner appears while the table is loading but when the table loads the spinner is still there.

Any ideas on how I can fix this?

Body:
I have a bootstrap modal that loads a html table in the body. I want to add a spinner that shows before the html table loads and disappears after is loads.

This is my current attempt.

html

    Loading...

JS

var myVar;

function myFunction() {
  myVar = setTimeout(showPage, 3000);
}

function showPage() {
  document.getElementById("spinner").style.display = "none";
  document.getElementById("table-to-update").style.display = "block";
}

As you can see in the picture the spinner appears while the table is loading but when the table loads the spinner is still there.

Any ideas on how I can fix this?


问:
onclick redirect to new page with the current image and json data with pure javaScript
I have a page of products with a gallery slider (10 images) with details of shipping and customers review and shipping details, below I have a Buy button for user if they want to buy the current product. I am getting the data display from Json file with Ajax Req.

I need to redirect the page to Purchase Page on click of a button where user can see the selected product image and product info.

I want to replace the Purchase item details with the user selected on click of a button with vanilla JavaScript and no jQuery.

function clickinner() {
  // onclick redirect to purchase page
  location.href = '/purchase.html';
  // get the id of the current element and save in a variable
  var currentElement = document.getElementById("product_info").innerHTML;
  var purchase_image = document.getElementById("purchase_image");
  var purschasing_product_info = document.getElementById("purschasing_product_info");
  purchase_image.setAttribute("src", "images/" + data[currentElement].image_path);
  purschasing_product_info.innerHTML = data[currentElement].product_description;
  var obj = {
    purchase_image: purchase_image,
    purschasing_product_info: purschasing_product_info
  };
  // Return obj
  return obj;
};```
<pre class="snippet-code-html lang-html prettyprint-override"><code><button class="buy_bttn" onclick="clickinner()" type="button">Buy</button>
<div id="purchase_item_image">
  <img src="images/img1.jpg" id="purchase_image" />
</div>
<div id="purschasing_product_info">
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum quo cumque illum, rerum repellat autem fugit, quod temporibus consequatur eum quos voluptates alias nesciunt? Sed porro voluptas omnis? Ratione, omnis.
  </p>
</div></code>```

Body:
I have a page of products with a gallery slider (10 images) with details of shipping and customers review and shipping details, below I have a Buy button for user if they want to buy the current product. I am getting the data display from Json file with Ajax Req.

I need to redirect the page to Purchase Page on click of a button where user can see the selected product image and product info.

I want to replace the Purchase item details with the user selected on click of a button with vanilla JavaScript and no jQuery.

function clickinner() {
  // onclick redirect to purchase page
  location.href = '/purchase.html';
  // get the id of the current element and save in a variable
  var currentElement = document.getElementById("product_info").innerHTML;
  var purchase_image = document.getElementById("purchase_image");
  var purschasing_product_info = document.getElementById("purschasing_product_info");
  purchase_image.setAttribute("src", "images/" + data[currentElement].image_path);
  purschasing_product_info.innerHTML = data[currentElement].product_description;
  var obj = {
    purchase_image: purchase_image,
    purschasing_product_info: purschasing_product_info
  };
  // Return obj
  return obj;
};

<button class="buy_bttn" onclick="clickinner()" type="button">Buy</button>

Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum quo cumque illum, rerum repellat autem fugit, quod temporibus consequatur eum quos voluptates alias nesciunt? Sed porro voluptas omnis? Ratione, omnis.


问:
Selenium Date Format
I'm pulling data with selenium and saving this data to the database. Although the relevant column in the database is date and the field is filled in the relevant site, the database is empty, as '0000-00-00'

The code for the area I'm scraping.

```<code>if "Test" in description_list:
            index_no = description_list.index("Test")
            try:
                first_registration = value_list[index_no]
            except:
                first_registration =
</code>```

An example of the date I am trying to engrave; 07/28. I appreciate your help.

```<code>from xml.etree.ElementTree import QName
import bs4
import urllib.request
import pandas as pd
from datetime import datetime
from tkinter import E
import pymysql
import mysql.connector
import configparser
import re
import numpy as np
import time
import concurrent.futures
# import erequests
# import lxml
from multiprocessing import Pool
# from multiprocessing import Process, Lock
from multiprocessing import Process
from datetime import datetime
from tqdm import tqdm  # progress bar
from urllib.request import urlopen
from bs4 import BeautifulSoup
from datetime import datetime
from sqlalchemy import create_engine
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.firefox.options import Options

mydb = mysql.connector.connect(
   host="localhost",
   user="root",
   password="",
   database="m_n"
)
mycursor = mydb.cursor()

sql = "SELECT ad_link FROM adlinks_d"

mycursor.execute(sql)

myresult = mycursor.fetchall()
all_links = myresult[0:]
len_all_links = len(all_links)
dataframe = pd.DataFrame(all_links, columns=['links'])

x = 1
y = 5

#def fonksiyon(i):

#    global x
#    global y

number = np.arange(x,y)

for i in tqdm(number):
   ad_link = dataframe.links[i]
   fireFoxOptions = Options()
   fireFoxOptions.binary_location = r'C:\Program Files\Firefox Developer Edition\firefox.exe'
   fireFoxOptions.add_argument("--headless")
   fireFoxOptions.add_argument('--disable-gpu')
   fireFoxOptions.add_argument('--no-sandbox')
   driver = webdriver.Firefox(options=fireFoxOptions)
   sleep_time = 1

   driver.get(ad_link)
   time.sleep(sleep_time)
   ad_source = driver.page_source
   ad_soup = BeautifulSoup(ad_source, 'html.parser')

   mainresults = ad_soup.find_all('div', {'class': 'cBox cBox--content u-overflow-inherit '})

   cars_data = pd.DataFrame({
       'brand_and_model': brand_and_model,
       'model_version': model_version,
   },
       index=[0])

   df3 = pd.DataFrame(list(zip(equipment_key, equipment_value)), columns=['all_key', 'all_value'])

   df2 = pd.DataFrame(list(zip(all_key, all_value)), columns=['all_key', 'all_value'])

   df1.insert(0, "brand_and_model", brand_and_model)

   df2_3 = pd.concat([df2, df3])
   df2_3 = df2_3.set_index('all_key').T.reset_index(drop=True)
   df2_3 = df2_3.rename_axis(None, axis=1)

   df_last = pd.concat([df1, df2_3], axis=1)

   df_last = df_last.astype(str).groupby(df_last.columns, sort=False, axis=1).agg(
       lambda x: x.apply(','.join, 1))

   now = datetime.now()
   datetime_string = str(now.strftime("%Y%m%d_%H%M%S"))

   df_last['download_date_time'] = datetime_string

   config = configparser.RawConfigParser()
   config.read(filenames='my.properties')

   scrap_db = pymysql.connect(host='localhost', user='root', password='', database='m_n', charset='utf8mb4',
                              cursorclass=pymysql.cursors.DictCursor)

   cursor = scrap_db.cursor()

   sql = """CREATE TABLE S(
       brand_and_model VARCHAR(32),
       first_registration DATE(6),
       download_date_time DATE(6)
       )"""

   #cursor.execute(sql)

   for row_count in range(0, df_last.shape[0]):
       chunk = df_last.iloc[row_count:row_count + 1, :].values.tolist()

       brand_and_model = ""
       first_registration = ""

       download_date_time = ""

       lenght_of_chunk = len(chunk[0])

       if "brand_and_model" in cars_data:
           try:
               brand_and_model = chunk[0][0]
           except:
               brand_and_model = ""

       if chunk[0][lenght_of_chunk - 1] != "":
           download_date_time = chunk[0][lenght_of_chunk - 1]

   if (brand_and_model == ' '):
       control = "false"
   else:
       control = "true"

   if control == "true":
       mySql_insert_query = "INSERT INTO S (brand_and_model,first_registration,download_date_time) VALUES (%s,%s,%s)"
       val = (
           brand_and_model, location, first_registration, download_date_time)

       cursor = scrap_db.cursor()
       cursor.execute(mySql_insert_query, val)
       scrap_db.commit()
       print(cursor.rowcount, "Record inserted successfully into *S* table")
   driver.close()
</code>```

Title: Selenium Date Format

Body:
I'm pulling data with selenium and saving this data to the database. Although the relevant column in the database is date and the field is filled in the relevant site, the database is empty, as '0000-00-00'

The code for the area I'm scraping.

if "Test" in description_list:
            index_no = description_list.index("Test")
            try:
                first_registration = value_list[index_no]
            except:
                first_registration =

An example of the date I am trying to engrave; 07/28. I appreciate your help.

from xml.etree.ElementTree import QName
import bs4
import urllib.request
import pandas as pd
from datetime import datetime
from tkinter import E
import pymysql
import mysql.connector
import configparser
import re
import numpy as np
import time
import concurrent.futures
# import erequests
# import lxml
from multiprocessing import Pool
# from multiprocessing import Process, Lock
from multiprocessing import Process
from datetime import datetime
from tqdm import tqdm  # progress bar
from urllib.request import urlopen
from bs4 import BeautifulSoup
from datetime import datetime
from sqlalchemy import create_engine
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.firefox.options import Options

mydb = mysql.connector.connect(
   host="localhost",
   user="root",
   password="",
   database="m_n"
)
mycursor = mydb.cursor()

sql = "SELECT ad_link FROM adlinks_d"

mycursor.execute(sql)

myresult = mycursor.fetchall()
all_links = myresult[0:]
len_all_links = len(all_links)
dataframe = pd.DataFrame(all_links, columns=['links'])

x = 1
y = 5

#def fonksiyon(i):

#    global x
#    global y

number = np.arange(x,y)

for i in tqdm(number):
   ad_link = dataframe.links[i]
   fireFoxOptions = Options()
   fireFoxOptions.binary_location = r'C:\Program Files\Firefox Developer Edition\firefox.exe'
   fireFoxOptions.add_argument("--headless")
   fireFoxOptions.add_argument('--disable-gpu')
   fireFoxOptions.add_argument('--no-sandbox')
   driver = webdriver.Firefox(options=fireFoxOptions)
   sleep_time = 1

   driver.get(ad_link)
   time.sleep(sleep_time)
   ad_source = driver.page_source
   ad_soup = BeautifulSoup(ad_source, 'html.parser')

   mainresults = ad_soup.find_all('div', {'class': 'cBox cBox--content u-overflow-inherit '})

   cars_data = pd.DataFrame({
       'brand_and_model': brand_and_model,
       'model_version': model_version,
   },
       index=[0])

   df3 = pd.DataFrame(list(zip(equipment_key, equipment_value)), columns=['all_key', 'all_value'])

   df2 = pd.DataFrame(list(zip(all_key, all_value)), columns=['all_key', 'all_value'])

   df1.insert(0, "brand_and_model", brand_and_model)

   df2_3 = pd.concat([df2, df3])
   df2_3 = df2_3.set_index('all_key').T.reset_index(drop=True)
   df2_3 = df2_3.rename_axis(None, axis=1)

   df_last = pd.concat([df1, df2_3], axis=1)

   df_last = df_last.astype(str).groupby(df_last.columns, sort=False, axis=1).agg(
       lambda x: x.apply(','.join, 1))

   now = datetime.now()
   datetime_string = str(now.strftime("%Y%m%d_%H%M%S"))

   df_last['download_date_time'] = datetime_string

   config = configparser.RawConfigParser()
   config.read(filenames='my.properties')

   scrap_db = pymysql.connect(host='localhost', user='root', password='', database='m_n', charset='utf8mb4',
                              cursorclass=pymysql.cursors.DictCursor)

   cursor = scrap_db.cursor()

   sql = """CREATE TABLE S(
       brand_and_model VARCHAR(32),
       first_registration DATE(6),
       download_date_time DATE(6)
       )"""

   #cursor.execute(sql)

   for row_count in range(0, df_last.shape[0]):
       chunk = df_last.iloc[row_count:row_count + 1, :].values.tolist()

       brand_and_model = ""
       first_registration = ""

       download_date_time = ""

       lenght_of_chunk = len(chunk[0])

       if "brand_and_model" in cars_data:
           try:
               brand_and_model = chunk[0][0]
           except:
               brand_and_model = ""

       if chunk[0][lenght_of_chunk - 1] != "":
           download_date_time = chunk[0][lenght_of_chunk - 1]

   if (brand_and_model == ' '):
       control = "false"
   else:
       control = "true"

   if control == "true":
       mySql_insert_query = "INSERT INTO S (brand_and_model,first_registration,download_date_time) VALUES (%s,%s,%s)"
       val = (
           brand_and_model, location, first_registration, download_date_time)

       cursor = scrap_db.cursor()
       cursor.execute(mySql_insert_query, val)
       scrap_db.commit()
       print(cursor.rowcount, "Record inserted successfully into *S* table")
   driver.close()


问:
I need to extract data from files from an old sensor but I don't recognize the format, encoding or symbols
I need to extract data from raw files from water sensors, but I don't recognize the characters or encoding.

Files come directly from the sensor in plain text and have no extension or description,

the output should be numbers separated by commas.

original example:

„ ÈB9ÿ¤ÿ  Þÿ  Rþc ³

…  rB<ÿ¤ÿ  ßÿ  Sþb ±

„ nC<ÿ¤ÿ  àÿ   Rþb ±

„ ê?<ÿ¤ÿ  àÿ  Qþe µ

...

expected:

-0.339795,0.1001767,0.0101992,-4.27,14.52512,846.7311,0,0,657.7027,0,-1.99,-0.92,29.96391,15.0126,-53.029,0,0,0

-0.3384331,1.082728E-2,0.0514378,-4.3,14.49225,845.3952,0,0,657.6309,0,-1.96,-0.92,29.96391,15.0126,-53.029,0,0,0

...

Is there a way to make this text readable?

Here is a link to a repository with one file in the original format, and one "converted" using the software from the Station (EcoFlux)

files: https://github.com/alejandrogandara/station_files.git


问:
How to Create MSI installer using Command Line with WIX
I have tried to use Wix and the following command :

```<code>candle
light
</code>```

here we need to create a .wxs file which I have already done but am unable to create MSI.

I have a doubt, I have my project which I have built it using MSBuild and now I need to create the MSI but I am unable to do it, how to provide my project binaries PATH  to Wix?

Body:
I have tried to use Wix and the following command :

candle
light

here we need to create a .wxs file which I have already done but am unable to create MSI.

I have a doubt, I have my project which I have built it using MSBuild and now I need to create the MSI but I am unable to do it, how to provide my project binaries PATH  to Wix?


问:
Error APPX3217 SDK folder containing 'UAP.props' for 'UAP 10.0.20348.0' cannot be located, even after installing 10.0.20348.0 with choco
I have an ADO build that keeps failing with,

```<code>Error APPX3217: SDK folder containing 'UAP.props' for 'UAP 10.0.20348.0' cannot be located.
</code>```

That helped me locate the missing 2104 SDK. Earlier in the build, I attempt to remedy this with chocolatey by installing a 2104 SDK, which as far as I can tell is the only 2104 option available with choco:

```<code>- task: CmdLine@2
  inputs:
    script: 'choco install windows-sdk-10-version-2104-all -y'
</code>```

It installs fine. The build breaks at the same point on multiple re-runs across multiple build nodes. All the similar questions I've run across with the same kind of error seems to automatically resolve after installing the correct SDK.

I wasn't sure if it would help, but I also installed the Microsoft.Windows.SDK.BuildTools NuGet package for the faulting project, and it also did not resolve the issue.

I've also tried both the MSBuild and VSBuild tasks. Any idea why it may not be detecting the installation at build-time?

Body:
I have an ADO build that keeps failing with,

Error APPX3217: SDK folder containing 'UAP.props' for 'UAP 10.0.20348.0' cannot be located.

That helped me locate the missing 2104 SDK. Earlier in the build, I attempt to remedy this with chocolatey by installing a 2104 SDK, which as far as I can tell is the only 2104 option available with choco:

- task: CmdLine@2
  inputs:
    script: 'choco install windows-sdk-10-version-2104-all -y'

It installs fine. The build breaks at the same point on multiple re-runs across multiple build nodes. All the similar questions I've run across with the same kind of error seems to automatically resolve after installing the correct SDK.

I wasn't sure if it would help, but I also installed the Microsoft.Windows.SDK.BuildTools NuGet package for the faulting project, and it also did not resolve the issue.

I've also tried both the MSBuild and VSBuild tasks. Any idea why it may not be detecting the installation at build-time?


问:
Where is the source for Oracle JDK 11 sun.security.ssl?
I'm using Oracle JDK version 11.0.16+11-LTS-199.

I'm trying to learn about SSL handshakes from looking at the code but the line numbers in the stack traces do not match any source code I can find.  The source for the sun.security.ssl package is not in src.zip.

I cloned the jdk11u repo from GitHub but the closest tag is jdk-11.0.16+8.  There is no 11.

I can't paste a stack trace here (pasting seems to be disabled) but an example line from a stack trace is:

```<code>at java.base/sun.security.ssl.SSLSocketImpl.bruteForceCloseInput(SSLSocketImpl.java:718)
at java.base/sun.security.ssl.SSLSocketImpl.duplexCloseOutput(SSLSocketImpl.java:579)
at java.base/sun.security.ssl.SSLSocketImpl.close(SSLSocketImpl.java:503)
</code>```

However line 503 in the source I have is a different method.  BaseSSLSocketImpl is also in the stack trace but it seems to match what I see in GitHub.

Body:
I'm using Oracle JDK version 11.0.16+11-LTS-199.

I'm trying to learn about SSL handshakes from looking at the code but the line numbers in the stack traces do not match any source code I can find.  The source for the sun.security.ssl package is not in src.zip.

I cloned the jdk11u repo from GitHub but the closest tag is jdk-11.0.16+8.  There is no 11.

I can't paste a stack trace here (pasting seems to be disabled) but an example line from a stack trace is:

at java.base/sun.security.ssl.SSLSocketImpl.bruteForceCloseInput(SSLSocketImpl.java:718)
at java.base/sun.security.ssl.SSLSocketImpl.duplexCloseOutput(SSLSocketImpl.java:579)
at java.base/sun.security.ssl.SSLSocketImpl.close(SSLSocketImpl.java:503)

However line 503 in the source I have is a different method.  BaseSSLSocketImpl is also in the stack trace but it seems to match what I see in GitHub.


问:
Pandas: Product price calculation by carrier
I have a tariff 'tarifas' of the Sudoeste and Termaco carriers
dataframe and a products 'dpx' dataframe

```<code>  tarifas = {
         'Sudoeste': {
            'PR': {
                'Capital': {'frete_minimo': 47.40,'rate': 0.35,'pedagio_frac': 2.83,'gris': 0.0012,'taxa': 3.36},
                'Interior': {'frete_minimo': 48.34,'rate': 0.36,'pedagio_frac': 2.83,'gris': 0.0012,'taxa': 3.36},},}
'Termaco': {
        'CE':{
            'Capital': {'frete_minimo': 52.69,'Exce_50': 1.06,'pedagio_frac': 2.64,'gris': 0.0011,'taxa': 42.71},
            'Interior': {'frete_minimo': 68.76,'Exce_50': 1.39,'pedagio_frac': 2.64,'gris': 0.0011,'taxa': 42.71},},}
</code>```

I have a function to calculate the delivery freight of a product to a certain region, but it is giving an error.

```<code>def calcular_frete(dpx, tarifas):
    for index, row in dpx.iterrows():
        uf = row['Estado do Destinatário']
        regiao = row['regiao']
        peso_taxado = row['Peso Taxado']
        valor_mercadoria = row['Valor da Mercadoria']

    for transportadora, tarifas_transp in tarifas.items():
        tarifas = tarifas_transp[uf][regiao]
        frete_minimo = tarifas['frete_minimo']
        exce_50 = tarifas.get('Exce_50', 0)
        pedagio_frac = tarifas['pedagio_frac']
        gris = tarifas['gris']
        taxa = tarifas['taxa']
        rate = tarifas['rate']

        if transportadora =='Sudoeste':
            if peso_taxado > 50:
                valor_frete = frete_minimo + (peso_taxado - 50) * rate + (peso_taxado / 100) * pedagio_frac + (valor_mercadoria * gris) + (valor_mercadoria * taxa)
            else:
                valor_frete = frete_minimo + (peso_taxado / 100) * pedagio_frac + (valor_mercadoria * gris) + (valor_mercadoria * taxa)
</code>```

When I call the function to calculate shipping calcular_frete(dpx, tarifas), it results in KeyError: 'SC' in 'tarifas = tarifas_transp[uf][regiao]'

What can I do?

Body:
I have a tariff 'tarifas' of the Sudoeste and Termaco carriers
dataframe and a products 'dpx' dataframe

  tarifas = {
         'Sudoeste': {
            'PR': {
                'Capital': {'frete_minimo': 47.40,'rate': 0.35,'pedagio_frac': 2.83,'gris': 0.0012,'taxa': 3.36},
                'Interior': {'frete_minimo': 48.34,'rate': 0.36,'pedagio_frac': 2.83,'gris': 0.0012,'taxa': 3.36},},}
'Termaco': {
        'CE':{
            'Capital': {'frete_minimo': 52.69,'Exce_50': 1.06,'pedagio_frac': 2.64,'gris': 0.0011,'taxa': 42.71},
            'Interior': {'frete_minimo': 68.76,'Exce_50': 1.39,'pedagio_frac': 2.64,'gris': 0.0011,'taxa': 42.71},},}

I have a function to calculate the delivery freight of a product to a certain region, but it is giving an error.

def calcular_frete(dpx, tarifas):
    for index, row in dpx.iterrows():
        uf = row['Estado do Destinatário']
        regiao = row['regiao']
        peso_taxado = row['Peso Taxado']
        valor_mercadoria = row['Valor da Mercadoria']

    for transportadora, tarifas_transp in tarifas.items():
        tarifas = tarifas_transp[uf][regiao]
        frete_minimo = tarifas['frete_minimo']
        exce_50 = tarifas.get('Exce_50', 0)
        pedagio_frac = tarifas['pedagio_frac']
        gris = tarifas['gris']
        taxa = tarifas['taxa']
        rate = tarifas['rate']

        if transportadora =='Sudoeste':
            if peso_taxado > 50:
                valor_frete = frete_minimo + (peso_taxado - 50) * rate + (peso_taxado / 100) * pedagio_frac + (valor_mercadoria * gris) + (valor_mercadoria * taxa)
            else:
                valor_frete = frete_minimo + (peso_taxado / 100) * pedagio_frac + (valor_mercadoria * gris) + (valor_mercadoria * taxa)

When I call the function to calculate shipping calcular_frete(dpx, tarifas), it results in KeyError: 'SC' in 'tarifas = tarifas_transp[uf][regiao]'

What can I do?


问:
How to read DNS Servers/ DNS Domain details using C sd-bus apis
I want to read the data available in Link 2; mainly DNS Servers and DNS Domains. I am not able to figure out how to read those data using c sd bus api.

```<code>test@ubuntu:~/Desktop/$systemd-resolve --status
Global
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa

                      ....bla bla.
Link 2 (ens33)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 49.205.72.130
                      183.82.243.66
          DNS Domain: ~.
</code>```

If I had to use GetLink method, how could I get the DNS Servers and Domain information?

Needed something similar as below

```<code>#define DESTINATION "org.freedesktop.resolve1"
#define PATH        "/org/freedesktop/resolve1"
#define INTERFACE   "org.freedesktop.resolve1.Manager"
#define MEMBER      "GetLink"

static int log_error(int error, const char *message) {
  errno = -error;
  fprintf(stderr, "%s: %m\n", message);
  return error;
}

static int print_unit_path(sd_bus *bus) {
   sd_bus_message *m = NULL;
   sd_bus_error error = SD_BUS_ERROR_NULL;
   sd_bus_message *reply = NULL;
   int r;

  r = sd_bus_message_new_method_call(bus, &m,
                                     DESTINATION, PATH, INTERFACE, MEMBER);
  if (r < 0)
    return log_error(r, "Failed to create bus message");

  r = sd_bus_message_append(m, "i", 2);
  if (r < 0)
    return log_error(r, "Failed to append to bus message");

  r = sd_bus_call(bus, m, -1, &error, &reply);
  if (r < 0)
    return log_error(r, "Call failed");

  const char *ans;
  r = sd_bus_message_read(reply, "o", &ans);
  if (r < 0)
    return log_error(r, "Failed to read reply");

  printf("Link is \"%s\".\n", ans);

}

int main(int argc, char **argv) {
  sd_bus *bus = NULL;
  int r;

  r = sd_bus_open_system(&bus);
  if (r < 0)
    return log_error(r, "Failed to acquire bus");

  print_unit_path(bus);
}

</code>```

Output: "/org/freedesktop/resolve1/link/_32"

How do I read the DNS using this link?

Thanks

Body:
I want to read the data available in Link 2; mainly DNS Servers and DNS Domains. I am not able to figure out how to read those data using c sd bus api.

test@ubuntu:~/Desktop/$systemd-resolve --status
Global
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa

                      ....bla bla.
Link 2 (ens33)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 49.205.72.130
                      183.82.243.66
          DNS Domain: ~.

If I had to use GetLink method, how could I get the DNS Servers and Domain information?

Needed something similar as below

#define DESTINATION "org.freedesktop.resolve1"
#define PATH        "/org/freedesktop/resolve1"
#define INTERFACE   "org.freedesktop.resolve1.Manager"
#define MEMBER      "GetLink"

static int log_error(int error, const char *message) {
  errno = -error;
  fprintf(stderr, "%s: %m\n", message);
  return error;
}

static int print_unit_path(sd_bus *bus) {
   sd_bus_message *m = NULL;
   sd_bus_error error = SD_BUS_ERROR_NULL;
   sd_bus_message *reply = NULL;
   int r;

  r = sd_bus_message_new_method_call(bus, &m,
                                     DESTINATION, PATH, INTERFACE, MEMBER);
  if (r < 0)
    return log_error(r, "Failed to create bus message");

  r = sd_bus_message_append(m, "i", 2);
  if (r < 0)
    return log_error(r, "Failed to append to bus message");

  r = sd_bus_call(bus, m, -1, &error, &reply);
  if (r < 0)
    return log_error(r, "Call failed");

  const char *ans;
  r = sd_bus_message_read(reply, "o", &ans);
  if (r < 0)
    return log_error(r, "Failed to read reply");

  printf("Link is \"%s\".\n", ans);

}

int main(int argc, char **argv) {
  sd_bus *bus = NULL;
  int r;

  r = sd_bus_open_system(&bus);
  if (r < 0)
    return log_error(r, "Failed to acquire bus");

  print_unit_path(bus);
}

Output: "/org/freedesktop/resolve1/link/_32"

How do I read the DNS using this link?

Thanks


问:
Can't read an Excel file using Pandas. BookView.__init__() got an unexpected keyword argument 'WindowWidth'
I've been trying to read a df using pandas. But i get the following error:

BookView.__init__() got an unexpected keyword argument 'WindowWidth'
```
<p>This is what i am doing:</p>
<p>This what i've done:</p>
<pre class="lang-py prettyprint-override"><code>arquivo = pd.read_excel(path)
</code>```

Body:
I've been trying to read a df using pandas. But i get the following error:

BookView.__init__() got an unexpected keyword argument 'WindowWidth'

This is what i am doing:

This what i've done:

arquivo = pd.read_excel(path)


问:
Averaging column value of one table between 2 timestamps of each record of another table
#Blocks has the following columns.

enter image description here #Blocks table.

#Amb_Temp table has many outside temperature records with a timestamp and vehicle ID.

enter image description here #Amb_Temp

I need to add a column AvgTemp to the #Blocks table and one record at a time, show the average temperature in #AmbTemp matching the #Blocks.VehicleId and with all timestamps values between  #Blocks.ValidityStart and #Blocks.ValifityEnd

My end result would be like this

enter image description here End Result

I can figure this our in dbase language but not in SQL.


问:
How to perform replacement with re.sub() if and only if there is a ; or \n. in the middle of the capture groups?

import re, datetime

#Ejemplos en donde si se debe hacer uno o mas reemplazos
input_text = "Decian muchas cosas; Seguro eso ocurrira despues de 3 dias"
input_text = "seguro eso ocurrira despues de 3 dias.\n empieza el 2021-11-12"
input_text = "Recien el 2021-10-12; seguro eso ocurrira despues de 3 dias."

#Ejemplos en donde no se deberia hacer ningun reemplazo
input_text = "seguro eso ocurrira despues de 3 dias. empieza el 2021-11-12"
input_text = "Recien el 2021-10-12, seguro eso ocurrira despues 3 dias."

#operation function (  ([12]\d{3}-[01]\d-[0-3]\d)(\D*?), (\d+) , "add" )
def add_or_subtract_days(datestr, days, operation):
    today = datetime.date.today()
    if   operation == "add" : x = (datetime.datetime.strptime(today, "%Y-%m-%d") + datetime.timedelta(days=int(days))).strftime('%Y-%m-%d')
    elif operation == "subtract" : x = (datetime.datetime.strptime(today, "%Y-%m-%d") - datetime.timedelta(days=int(days))).strftime('%Y-%m-%d')

    return x

some_text = r"[\s|]*"

input_text = re.sub(r"(?:([12]\d{3}-[01]\d-[0-3]\d)(\D*?)|)" + some_text + r"(?:(?:pasados|pasado|despues del|despues de el|despues de|despues|tras) (\d+) (?:días|día|dias|dia)|(\d+) (?:días|día|dias|dia) (?:pasados|pasado|despues del|despues de el|despues de|despues|tras))" + some_text + r"(?:([12]\d{3}-[01]\d-[0-3]\d)(\D*?)|)",
                lambda m: print(m[3]) ,
                #lambda m: add_or_subtract_days(  m[1] or m[4] , m[2] or m[3] , "add" ),
                input_text)

print("output: " + repr(input_text)) # ---> output
```
<p>You should only perform the replace only if there is at least one <code>";"</code> or <code>".\n"</code> <strong>between</strong> <code>"(pasado|despues|tras) n (dias|dia)"</code> and the date <code>"\d*-\d{2}-\d{2}"</code></p>
<p>output that I need (today = 2022-12-13):</p>
```"Decian muchas cosas; Seguro eso ocurrira 2022-12-16"
"seguro eso ocurrira 2022-12-16.\n empieza el 2021-11-12"
"Recien el 2021-10-12; seguro eso ocurrira despues de 2022-12-16."

In this last two examples no replacement is made since there is no ; or \n. in the middle of the capture groups
"seguro eso ocurrira despues de 3 dias. empieza el 2021-11-12"
"Recien el 2021-10-12, seguro eso ocurrira despues de 3 dias."
```

Body:
import re, datetime

#Ejemplos en donde si se debe hacer uno o mas reemplazos
input_text = "Decian muchas cosas; Seguro eso ocurrira despues de 3 dias"
input_text = "seguro eso ocurrira despues de 3 dias.\n empieza el 2021-11-12"
input_text = "Recien el 2021-10-12; seguro eso ocurrira despues de 3 dias."

#Ejemplos en donde no se deberia hacer ningun reemplazo
input_text = "seguro eso ocurrira despues de 3 dias. empieza el 2021-11-12"
input_text = "Recien el 2021-10-12, seguro eso ocurrira despues 3 dias."

#operation function (  ([12]\d{3}-[01]\d-[0-3]\d)(\D*?), (\d+) , "add" )
def add_or_subtract_days(datestr, days, operation):
    today = datetime.date.today()
    if   operation == "add" : x = (datetime.datetime.strptime(today, "%Y-%m-%d") + datetime.timedelta(days=int(days))).strftime('%Y-%m-%d')
    elif operation == "subtract" : x = (datetime.datetime.strptime(today, "%Y-%m-%d") - datetime.timedelta(days=int(days))).strftime('%Y-%m-%d')

    return x

some_text = r"[\s|]*"

input_text = re.sub(r"(?:([12]\d{3}-[01]\d-[0-3]\d)(\D*?)|)" + some_text + r"(?:(?:pasados|pasado|despues del|despues de el|despues de|despues|tras) (\d+) (?:días|día|dias|dia)|(\d+) (?:días|día|dias|dia) (?:pasados|pasado|despues del|despues de el|despues de|despues|tras))" + some_text + r"(?:([12]\d{3}-[01]\d-[0-3]\d)(\D*?)|)",
                lambda m: print(m[3]) ,
                #lambda m: add_or_subtract_days(  m[1] or m[4] , m[2] or m[3] , "add" ),
                input_text)

print("output: " + repr(input_text)) # ---> output

You should only perform the replace only if there is at least one ";" or ".\n" between "(pasado|despues|tras) n (dias|dia)" and the date "\d*-\d{2}-\d{2}"

output that I need (today = 2022-12-13):

"Decian muchas cosas; Seguro eso ocurrira 2022-12-16"
"seguro eso ocurrira 2022-12-16.\n empieza el 2021-11-12"
"Recien el 2021-10-12; seguro eso ocurrira despues de 2022-12-16."

In this last two examples no replacement is made since there is no ; or \n. in the middle of the capture groups
"seguro eso ocurrira despues de 3 dias. empieza el 2021-11-12"
"Recien el 2021-10-12, seguro eso ocurrira despues de 3 dias."


问:
High Chart is not visible on dynamic data
I am using simple line high chart. It is working fine static arrays like if i assign series with data array series=[10,20,30], but assigning a variable like series = data; where data variable value fetch value from api getgymgoer() then graph  is not visible. I checked many answers making highchart with dynamic data but they are not working in my case.

```<code>import { Component, OnInit } from '@angular/core';
import * as Highcharts from 'highcharts';
import HC_exporting from 'highcharts/modules/exporting';
import { AuthService } from 'src/app/services/auth/auth.service';

HC_exporting(Highcharts);

@Component({
  selector: 'app-weight-chart',
  templateUrl: './weight-chart.component.html',
  styleUrls: ['./weight-chart.component.scss']
})
export class WeightChartComponent implements OnInit {
  // chartOptions = {};
  Highcharts: typeof Highcharts = Highcharts;
  user: any;
  constructor(private authService:AuthService) { }
  gymgoerweight = [];
  ngOnInit(): void {

    this.user=this.authService.getUser();
    this.getgymgoer();
  }
  getgymgoer(){
    this.authService.getCurrentUser(this.user.id).subscribe((response:any)=>{
      this.gymgoerweight=response.weight;
      console.log("------goer weight from streak-------");
      console.log(this.gymgoerweight);
    })
  }

  weight:any=[10,20,30,40];
  chartOptions: Highcharts.Options = {
    // start chart
    colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572',
           '#FF9655', '#FFF263', '#6AF9C4'],
  chart:{
    events: {
      load: function() {

        var series = this.series[0],
        last = series.data[series.data.length - 1];
      }
    },
    backgroundColor: {
      linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
      stops: [
        [0, '#2e2e2c'],
        [1, '#2e2e2c']
      ]
    }
  },
    title: {
      text: '<h3 style="color:white; margin-left:0px; text-transform:uppercase">Weight Chart</h3>'
    },

    subtitle: {

      text: '<h5 style="color:white">Source: Open.fit</h5>'
    },

    yAxis: {
      title: {

        text: ' <h5 style="color:white">Active user count</h5>'
      }
    },

    // legend: {
    //   layout: 'vertical',
    //   align: 'right',
    //   verticalAlign: 'middle'
    // },
    credits: {
      enabled: false,
    },
    exporting: {
      enabled: true,
    },

    plotOptions: {
      series: {
        pointStart: Date.UTC(2022, 0, 4),
        pointInterval: 24 * 3600 * 1000*30
        // 24 * 3600 * 1000 One day expression
    }
    },

    series: [
      {
      type:'line',
      data: this.gymgoerweight
      },
  ],

    responsive: {
      rules: [{
        condition: {
          maxWidth: 500,
        },
        chartOptions: {
          legend: {
            layout: 'horizontal',
            align: 'center',
            verticalAlign: 'bottom',

          }
        }
      }]
    }
    // end chart
  }

}
</code>```

here on calling getCurrentUser api in console i am getting data in gymgoerweight sucessfull but when I am assigning it to series then chart is not visible. Any solution?

Body:
I am using simple line high chart. It is working fine static arrays like if i assign series with data array series=[10,20,30], but assigning a variable like series = data; where data variable value fetch value from api getgymgoer() then graph  is not visible. I checked many answers making highchart with dynamic data but they are not working in my case.

import { Component, OnInit } from '@angular/core';
import * as Highcharts from 'highcharts';
import HC_exporting from 'highcharts/modules/exporting';
import { AuthService } from 'src/app/services/auth/auth.service';

HC_exporting(Highcharts);

@Component({
  selector: 'app-weight-chart',
  templateUrl: './weight-chart.component.html',
  styleUrls: ['./weight-chart.component.scss']
})
export class WeightChartComponent implements OnInit {
  // chartOptions = {};
  Highcharts: typeof Highcharts = Highcharts;
  user: any;
  constructor(private authService:AuthService) { }
  gymgoerweight = [];
  ngOnInit(): void {

    this.user=this.authService.getUser();
    this.getgymgoer();
  }
  getgymgoer(){
    this.authService.getCurrentUser(this.user.id).subscribe((response:any)=>{
      this.gymgoerweight=response.weight;
      console.log("------goer weight from streak-------");
      console.log(this.gymgoerweight);
    })
  }

  weight:any=[10,20,30,40];
  chartOptions: Highcharts.Options = {
    // start chart
    colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572',
           '#FF9655', '#FFF263', '#6AF9C4'],
  chart:{
    events: {
      load: function() {

        var series = this.series[0],
        last = series.data[series.data.length - 1];
      }
    },
    backgroundColor: {
      linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
      stops: [
        [0, '#2e2e2c'],
        [1, '#2e2e2c']
      ]
    }
  },
    title: {
      text: '
Weight Chart
'
    },

    subtitle: {

      text: '
Source: Open.fit
'
    },

    yAxis: {
      title: {

        text: '
Active user count
'
      }
    },

    // legend: {
    //   layout: 'vertical',
    //   align: 'right',
    //   verticalAlign: 'middle'
    // },
    credits: {
      enabled: false,
    },
    exporting: {
      enabled: true,
    },

    plotOptions: {
      series: {
        pointStart: Date.UTC(2022, 0, 4),
        pointInterval: 24 * 3600 * 1000*30
        // 24 * 3600 * 1000 One day expression
    }
    },

    series: [
      {
      type:'line',
      data: this.gymgoerweight
      },
  ],

    responsive: {
      rules: [{
        condition: {
          maxWidth: 500,
        },
        chartOptions: {
          legend: {
            layout: 'horizontal',
            align: 'center',
            verticalAlign: 'bottom',

          }
        }
      }]
    }
    // end chart
  }

}

here on calling getCurrentUser api in console i am getting data in gymgoerweight sucessfull but when I am assigning it to series then chart is not visible. Any solution?


问:
Why Is This Column Name Invalid?
The code below results in the error (On Line 25):

Invalid column name: FileDate.

IF OBJECT_ID(N'TempDB.dbo.#CriminalCases') IS NOT NULL DROP TABLE #CriminalCases

SELECT cc.CourtCaseID, cc.CaseDisplayNumber, cc.FileDate

into #CriminalCases
FROM (SELECT CourtCaseID, CaseDisplayNumber, FileDate, EndReasonID FROM dbo.CourtCase
        WHERE NOT (CaseCaption LIKE 'BAD %' OR CaseCaption LIKE '%ERROR%' OR CaseCaption LIKE '%VOID%')
        and FileDate >= '2010-01-01') AS cc
    INNER JOIN dbo.CourtCaseSubType ccst ON cc.CourtCaseID = ccst.CourtCaseID
    INNER JOIN dbo.CaseSubTypeCodes cstc ON ccst.CaseSubTypeID = cstc.CaseSubTypeID
    INNER JOIN dbo.CaseTypeCodes ctc ON cstc.CaseTypeID = ctc.CaseTypeID
    INNER JOIN dbo.CaseCategoryCodes ccc ON ctc.CaseCategoryID = ccc.CaseCategoryID AND ccc.BenchID = 1 ---ccc.CaseCategory = 'Criminal Case'
WHERE (cc.Endreasonid not in (SELECT reasonID from dbo.RptExcludeReasonCodes) or cc.EndReasonID is NULL)

--------------------------------------------------------------------------------------------------------------------

SELECT DISTINCT crc.CaseDisplayNumber as MultiDefCriminalCases2010Forward, crc.FileDate --Why is this invalid?
from #CriminalCases crc
INNER JOIN dbo.CaseAction ca on crc.CourtCaseID = ca.CourtCaseID
INNER JOIN dbo.PartyCaseActionRole pcar on ca.CaseActionID = pcar.CaseActionID
INNER JOIN dbo.PartyRoleCodes prc on pcar.PartyRoleID = prc.PartyRoleID and prc.PartyRole = 'Defendant'
Where (pcar.EndReasonID not in (SELECT reasonID from dbo.RptExcludeReasonCodes) or pcar.EndReasonID is NULL)
Group by crc.CaseDisplayNumber
Having Count(pcar.PartyCaseActionRoleID) > 1
```

The field FileDate is in the select statement. So why is it invalid on line 25?

Title: Why Is This Column Name Invalid?

Body:
The code below results in the error (On Line 25):

Invalid column name: FileDate.

IF OBJECT_ID(N'TempDB.dbo.#CriminalCases') IS NOT NULL DROP TABLE #CriminalCases

SELECT cc.CourtCaseID, cc.CaseDisplayNumber, cc.FileDate

into #CriminalCases
FROM (SELECT CourtCaseID, CaseDisplayNumber, FileDate, EndReasonID FROM dbo.CourtCase
        WHERE NOT (CaseCaption LIKE 'BAD %' OR CaseCaption LIKE '%ERROR%' OR CaseCaption LIKE '%VOID%')
        and FileDate >= '2010-01-01') AS cc
    INNER JOIN dbo.CourtCaseSubType ccst ON cc.CourtCaseID = ccst.CourtCaseID
    INNER JOIN dbo.CaseSubTypeCodes cstc ON ccst.CaseSubTypeID = cstc.CaseSubTypeID
    INNER JOIN dbo.CaseTypeCodes ctc ON cstc.CaseTypeID = ctc.CaseTypeID
    INNER JOIN dbo.CaseCategoryCodes ccc ON ctc.CaseCategoryID = ccc.CaseCategoryID AND ccc.BenchID = 1 ---ccc.CaseCategory = 'Criminal Case'
WHERE (cc.Endreasonid not in (SELECT reasonID from dbo.RptExcludeReasonCodes) or cc.EndReasonID is NULL)

--------------------------------------------------------------------------------------------------------------------

SELECT DISTINCT crc.CaseDisplayNumber as MultiDefCriminalCases2010Forward, crc.FileDate --Why is this invalid?
from #CriminalCases crc
INNER JOIN dbo.CaseAction ca on crc.CourtCaseID = ca.CourtCaseID
INNER JOIN dbo.PartyCaseActionRole pcar on ca.CaseActionID = pcar.CaseActionID
INNER JOIN dbo.PartyRoleCodes prc on pcar.PartyRoleID = prc.PartyRoleID and prc.PartyRole = 'Defendant'
Where (pcar.EndReasonID not in (SELECT reasonID from dbo.RptExcludeReasonCodes) or pcar.EndReasonID is NULL)
Group by crc.CaseDisplayNumber
Having Count(pcar.PartyCaseActionRoleID) > 1

The field FileDate is in the select statement. So why is it invalid on line 25?


问:
TTS Wit.Ai Quest 2 Unity change language
I would like to change the language for the TTS in my App for my Quest 2.

I'm using the TTS from Wit.AI https://developer.oculus.com/documentation/unity/voice-sdk-tts-overview

There are only English speakers. In the Configuration File the Language is defined as en.

Is there a way to change the language?

There are multiple languages supported here: https://developer.oculus.com/documentation/unity/voice-sdk-built-in

Thanks for your help!


问:
Access an element in D3 that was previously added with a transition
I want to draw a D3 graph with nodes that are interconnected with edges. All nodes and edges are defined in a data object. Edges between nodes have a specific name and a weight. I want to draw the edge name and its weight at the center of the corresponding edge. This works so far as desired but it breaks when I add transitions for the edges (SVG path elements). To be precise, when introducing transitions for path elements, the element I want to get seems not be in the DOM yet (or that is at least what I am assuming).

I created a small example of what I have so far. As soon as I remove the transition for path elements (lines 46-47), it works as desired. I did some research online and read a bit about transition chaining, transition delays, getting the selection of a transition, but to be honest, I was not yet able to sort this out.

const data = {
  "nodes": [{
      "id": 0, "x": 300,
      "y": 100
    },
    {
      "id": 1, "x": 500,
      "y": 300
    },
    {
      "id": 2,
      "x": 300,
      "y": 500
    }
  ],
  "links": [{
      "source": 0,
      "target": 1,
      "weight": 5,
      "linkName": "B"
    },
    {
      "source": 1,
      "target": 2,
      "weight": 9,
      "linkName": "C"
    },
    {
      "source": 2,
      "target": 0,
      "weight": 7,
      "linkName": "A"
    }
  ]
}

const svg = d3.select("svg")
  .attr("preserveAspectRatio", "xMinYMin meet")
  .attr("viewBox", `0 0 800 600`)

svg
  .selectAll("path")
  .data(data.links)
  .enter()
  .append("path")
  .transition()    // Adding a foreignObject works without this transition
  .duration(1000)
  .style("stroke", "#000")
  .attr("stroke-width", 2)
  .attr("id", d => `${d.source}-${d.target}`)
  .attr("d", function(d) {
    const sourceNode = data.nodes.find(e => e.id === d.source)
    const targetNode = data.nodes.find(e => e.id === d.target)
    return `M${sourceNode.x},${sourceNode.y} L${targetNode.x},${targetNode.y}`
  })

svg
  .selectAll("circle")
  .data(data.nodes)
  .enter()
  .append("circle")
  .transition()
  .duration(1000)
  .attr("cx", d => d.x)
  .attr("cy", d => d.y)
  .attr("r", 20)

svg
    .selectAll("path.label")
  .data(data.links)
  .enter()
  .append("foreignObject")
  .attr("class", "label")
  .attr("height", 50)
  .attr("width", 140)
  .attr("x", function(d) {
        const associatedPath = document.getElementById(`${d.source}-${d.target}`)
    const pathCenter = associatedPath.getPointAtLength(0.5*associatedPath.getTotalLength())
    return pathCenter.x
    })
    .attr("y", function(d) {
        const associatedPath = document.getElementById(`${d.source}-${d.target}`)
    const pathCenter = associatedPath.getPointAtLength(0.5*associatedPath.getTotalLength())
    return pathCenter.y
    })

svg
    .selectAll(".label")
  .append("xhtml:span")
    .data(data.links)
    .text(d => d.linkName)

svg
    .selectAll(".label")
  .append("xhtml:input")
  .attr("type", "number")
  .attr("min", 0)
  .attr("max", 10)
  .data(data.links)
  .attr("value", d => d.weight)```
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html>
<head>
  <script src="https://d3js.org/d3.v7.min.js" type="text/javascript"></script>
</head>
<body>
  <svg>
  </svg>
</body>
</html></code>```

What piece of code is missing to get the path element from the DOM in order I can render a foreignObject on its center?

Body:
I want to draw a D3 graph with nodes that are interconnected with edges. All nodes and edges are defined in a data object. Edges between nodes have a specific name and a weight. I want to draw the edge name and its weight at the center of the corresponding edge. This works so far as desired but it breaks when I add transitions for the edges (SVG path elements). To be precise, when introducing transitions for path elements, the element I want to get seems not be in the DOM yet (or that is at least what I am assuming).

I created a small example of what I have so far. As soon as I remove the transition for path elements (lines 46-47), it works as desired. I did some research online and read a bit about transition chaining, transition delays, getting the selection of a transition, but to be honest, I was not yet able to sort this out.

const data = {
  "nodes": [{
      "id": 0, "x": 300,
      "y": 100
    },
    {
      "id": 1, "x": 500,
      "y": 300
    },
    {
      "id": 2,
      "x": 300,
      "y": 500
    }
  ],
  "links": [{
      "source": 0,
      "target": 1,
      "weight": 5,
      "linkName": "B"
    },
    {
      "source": 1,
      "target": 2,
      "weight": 9,
      "linkName": "C"
    },
    {
      "source": 2,
      "target": 0,
      "weight": 7,
      "linkName": "A"
    }
  ]
}

const svg = d3.select("svg")
  .attr("preserveAspectRatio", "xMinYMin meet")
  .attr("viewBox", `0 0 800 600`)

svg
  .selectAll("path")
  .data(data.links)
  .enter()
  .append("path")
  .transition()    // Adding a foreignObject works without this transition
  .duration(1000)
  .style("stroke", "#000")
  .attr("stroke-width", 2)
  .attr("id", d => `${d.source}-${d.target}`)
  .attr("d", function(d) {
    const sourceNode = data.nodes.find(e => e.id === d.source)
    const targetNode = data.nodes.find(e => e.id === d.target)
    return `M${sourceNode.x},${sourceNode.y} L${targetNode.x},${targetNode.y}`
  })

svg
  .selectAll("circle")
  .data(data.nodes)
  .enter()
  .append("circle")
  .transition()
  .duration(1000)
  .attr("cx", d => d.x)
  .attr("cy", d => d.y)
  .attr("r", 20)

svg
    .selectAll("path.label")
  .data(data.links)
  .enter()
  .append("foreignObject")
  .attr("class", "label")
  .attr("height", 50)
  .attr("width", 140)
  .attr("x", function(d) {
        const associatedPath = document.getElementById(`${d.source}-${d.target}`)
    const pathCenter = associatedPath.getPointAtLength(0.5*associatedPath.getTotalLength())
    return pathCenter.x
    })
    .attr("y", function(d) {
        const associatedPath = document.getElementById(`${d.source}-${d.target}`)
    const pathCenter = associatedPath.getPointAtLength(0.5*associatedPath.getTotalLength())
    return pathCenter.y
    })

svg
    .selectAll(".label")
  .append("xhtml:span")
    .data(data.links)
    .text(d => d.linkName)

svg
    .selectAll(".label")
  .append("xhtml:input")
  .attr("type", "number")
  .attr("min", 0)
  .attr("max", 10)
  .data(data.links)
  .attr("value", d => d.weight)

<!DOCTYPE html>

  <svg>
  </svg>

What piece of code is missing to get the path element from the DOM in order I can render a foreignObject on its center?


问:
How to Export Packages in a Library then Publish to Maven
Let's say I want to publish a library like Apache Math to Maven Central.

It should expose capabilities in packages that are explicitly exported by either OSGI or JPMS. That way, consuming applications can access those packages.

Any packages not explicitly exported are unavailable in consuming applications. They are able to download the JAR via a Maven dependency declaration, but are unable to see any packages, as the manifest and module-info.class are both empty. OSGI is able to automatically and robustly resolve the package-level dependency tree and generate meaningful entries in the manifest. There is no tool that robustly does the same for module-info, guidance I can find in other forums is to use jdeps with the stated caveat that it is not robust and the resulting module-info.java needs to be further adjusted manually.

Unless there is something fundamental that I am misunderstanding about the Java compilation system, Java ignores all class files in a jar file unless they are identified as "exported" by either the module system (JPMS) or OSGI, or the class files are explicitly included by some other mechanism.

What are the steps to configuring and publishing such a library such that relevant packages are exported, and why is there no step-by-step guide to do this already?


问:
Why is c++ not finding asio even whenI included it in the vc++ directories? I have also had a similar problem with python; when using new libraries
```<code>
    #include <iostream>

    #ifdef _WIN32
    #define _WIN32_WINNT 0x0A00
    #endif
    #define ASIO_STANDALONE
    #include <asio.hpp>
    #include <asio/ts/buffer.hpp>
    #include <asio/ts/internet.hpp>

    int main() {
        return 0;
    }
</code>```

The error I get

Error C1083   Cannot open include file: 'asio.hpp': No such file or directory SImpleExample

enter image description hereenter image description here

I tried changing up the directory name like making it asio-1.24.0 asio-1.24 but to no avail.

Body:
    #include <iostream>

    #ifdef _WIN32
    #define _WIN32_WINNT 0x0A00
    #endif
    #define ASIO_STANDALONE
    #include <asio.hpp>
    #include <asio/ts/buffer.hpp>
    #include <asio/ts/internet.hpp>

    int main() {
        return 0;
    }

The error I get

Error C1083   Cannot open include file: 'asio.hpp': No such file or directory SImpleExample

enter image description hereenter image description here

I tried changing up the directory name like making it asio-1.24.0 asio-1.24 but to no avail.


问:
Making a function that displays an error message in MySQL
I want to be able to create a function that totals up work hours, but displays an error message once the the employee has reached a certain amount of hours that week (i.e. "This employee cannot enter overtime").

```<code>DELIMITER //
CREATE FUNCTION sumHours(id INT)
RETURNS INT
BEGIN
    RETURN (SELECT sum(hours_worked) FROM shifts WHERE employee_id = id);
END;//
DELIMITER ;
</code>```

I was able to make the function to total the number of hours, but I'm not sure how to add an error message to the above function.

Body:
I want to be able to create a function that totals up work hours, but displays an error message once the the employee has reached a certain amount of hours that week (i.e. "This employee cannot enter overtime").

DELIMITER //
CREATE FUNCTION sumHours(id INT)
RETURNS INT
BEGIN
    RETURN (SELECT sum(hours_worked) FROM shifts WHERE employee_id = id);
END;//
DELIMITER ;

I was able to make the function to total the number of hours, but I'm not sure how to add an error message to the above function.


问:
Kafka-Streams app unknown topic or partition error
I have a problem trying to get a Kafka-Streams running with a Kafka Cluster. As you can see from the bootstrap servers property there are 3 Kafka servers in the cluster. All is working fine there. But for some reason when this app is started I keep getting "unknown topic or partition error" errors as if the Stream app does not have rights to create the Changlog and Partition topics it needs to run. I have it Kafka set to "auto.create.topics.enable=true" but I ont think this is the issue. Any clues would be a great help.

```<code>#Docker YAML file

#KV STORE Instance
   kvstore1gcf102:
        image: kafka-kv-store:1.1.125
        restart: always
        hostname: kvstore_13_1_gcf102
        ports:
            - 7071:8080
        environment:
            APPLICATIONID_KVSTORE: "kafka-kv-store-gcf102"
            HOSTNAME_KVSTORE: "kvstore_13_1_gcf102"
            STREAMPROPS_KVSTORE: "bootstrap.servers=192.168.2.13:9092,192.168.2.14:9092,192.168.2.16:9092 num.standby.replicas=0"
          TOPIC_KVSTORE: "messages_shown"
</code>```

Error I am getting:

```<code>18:31:11,637 WARN  org.apache.kafka.clients.consumer.internals.Fetcher
- [Consumer clientId=kafka-kv-store-gcf102-ab44b41c-71cb-4cfa-926a-898cdfbb192c-StreamThread-1-consumer,
groupId=kafka-kv-store-gcf102] Received unknown topic or partition error
in ListOffset request for partition kafka-kv-store-gcf102-shown-count-kv-repartition-0
</code>```

as an edit:

```<code>root@SRV-003:~/tmp# /opt/kafka/bin/kafka-topics.sh --list --bootstrap-server 192.168.2.13:9092 | grep kafka-kv-store-gcf102
kafka-kv-store-gcf102-shown-count-kv-changelog
kafka-kv-store-gcf102-shown-count-kv-repartition
</code>```

Body:
I have a problem trying to get a Kafka-Streams running with a Kafka Cluster. As you can see from the bootstrap servers property there are 3 Kafka servers in the cluster. All is working fine there. But for some reason when this app is started I keep getting "unknown topic or partition error" errors as if the Stream app does not have rights to create the Changlog and Partition topics it needs to run. I have it Kafka set to "auto.create.topics.enable=true" but I ont think this is the issue. Any clues would be a great help.

#Docker YAML file

#KV STORE Instance
   kvstore1gcf102:
        image: kafka-kv-store:1.1.125
        restart: always
        hostname: kvstore_13_1_gcf102
        ports:
            - 7071:8080
        environment:
            APPLICATIONID_KVSTORE: "kafka-kv-store-gcf102"
            HOSTNAME_KVSTORE: "kvstore_13_1_gcf102"
            STREAMPROPS_KVSTORE: "bootstrap.servers=192.168.2.13:9092,192.168.2.14:9092,192.168.2.16:9092 num.standby.replicas=0"
          TOPIC_KVSTORE: "messages_shown"

Error I am getting:

18:31:11,637 WARN  org.apache.kafka.clients.consumer.internals.Fetcher
- [Consumer clientId=kafka-kv-store-gcf102-ab44b41c-71cb-4cfa-926a-898cdfbb192c-StreamThread-1-consumer,
groupId=kafka-kv-store-gcf102] Received unknown topic or partition error
in ListOffset request for partition kafka-kv-store-gcf102-shown-count-kv-repartition-0

as an edit:

root@SRV-003:~/tmp# /opt/kafka/bin/kafka-topics.sh --list --bootstrap-server 192.168.2.13:9092 | grep kafka-kv-store-gcf102
kafka-kv-store-gcf102-shown-count-kv-changelog
kafka-kv-store-gcf102-shown-count-kv-repartition


问:
Passing std::array by reference in constexpr constructor results in null data pointer
My class has a constexpr constructor which takes a reference to a std::array. When creating a global constexpr constant of my class and passing an immediate array, the constructor gets a null data pointer from the array reference even though the underlying data exists:

```<code>class MyClass {
public:
    explicit constexpr MyClass(const std::array<int, 3> &from) {
        assert(from[0] == 1);           // Ok
        assert(from[1] == 2);           // Ok
        assert(from[2] == 3);           // Ok
        assert(from.data() != nullptr); // Compilation halts here
    }
};

static constexpr MyClass constGlobal{std::array{1, 2, 3}};
</code>```

Requires C++ 17+

Tested on:

MinGW w64 9.0

ARM gcc 12.2

I would expect the data() pointer to exist considering operator[] works perfectly fine.

EDIT:

The data() pointer does exist. This seems to be an issue with GCC not allowing pointer comparison to temporaries. There still exists a related problem which this simplified example attempted to describe (badly).

Here's the root problem.

EDIT:

Looks like this is the likely gcc bug for comparison of addresses of temporaries in constexpr context:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85944

Body:
My class has a constexpr constructor which takes a reference to a std::array. When creating a global constexpr constant of my class and passing an immediate array, the constructor gets a null data pointer from the array reference even though the underlying data exists:

class MyClass {
public:
    explicit constexpr MyClass(const std::array<int, 3> &from) {
        assert(from[0] == 1);           // Ok
        assert(from[1] == 2);           // Ok
        assert(from[2] == 3);           // Ok
        assert(from.data() != nullptr); // Compilation halts here
    }
};

static constexpr MyClass constGlobal{std::array{1, 2, 3}};

Requires C++ 17+

Tested on:

MinGW w64 9.0

ARM gcc 12.2

I would expect the data() pointer to exist considering operator[] works perfectly fine.

EDIT:

The data() pointer does exist. This seems to be an issue with GCC not allowing pointer comparison to temporaries. There still exists a related problem which this simplified example attempted to describe (badly).

Here's the root problem.

EDIT:

Looks like this is the likely gcc bug for comparison of addresses of temporaries in constexpr context:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85944


问:
Reading CSV with float and Int in a column
I am trying to load a csv file without converting the integer value (4950) into float (4950.0). The column has a mixture of both integer and float. I don't want the conversion because I need to create a Boolean column to check if the data in the column is float or not.

How do I go about loading the csv file to load the csv the way it was.

```<code>   final_collar['ELEV_FLOAT']=np.where(final_collar['ELEV'] ==float, True, False)
   final_collar.head(20)
</code>```

Body:
I am trying to load a csv file without converting the integer value (4950) into float (4950.0). The column has a mixture of both integer and float. I don't want the conversion because I need to create a Boolean column to check if the data in the column is float or not.

How do I go about loading the csv file to load the csv the way it was.

   final_collar['ELEV_FLOAT']=np.where(final_collar['ELEV'] ==float, True, False)
   final_collar.head(20)


问:
Vue - path #ID scrollBehavior
Hey i have a multiple sections on my website and im using full-page scroll (fullpage.js),
i also have a menu with atributes Home , Services and Contact, when i click on Services page it scrolls to section as it should but it does not scroll back after i click on Home.
Here is the code:

Navigation

<router-link v-show="!mobile" class="link bio" :to="{ name: 'Home' }">Bio</router-link>
<router-link v-show="!mobile" class="link link2" :to="{ name: 'Services' }">Services</router-link>
```
<p>Router</p>
<pre class="lang-js prettyprint-override"><code>{
  path: "/home",
  name: "Home",
  component: Home,
  meta: {
    title: "Bio",
    requiresAuth: false,
  },
},
{
  path: "/home#fifthPage",
  name: "Services",
  component: Home,
  meta: {
    title: "Services",
    requiresAuth: false,
  },
},

const router = new VueRouter({
  mode: "history",

  routes,
  scrollBehavior() {
    return { x: 0, y: 0 };
  },
});

router.beforeEach((to, from, next) => {
  document.title = `${to.meta.title} | YounesFilm`;
  next();
});

router.beforeEach(async (to, from, next) => {
  let user = firebase.auth().currentUser;
  let admin = null;
  if (user) {
    let token = await user.getIdTokenResult();
    admin = token.claims.admin;
  }
  if (to.matched.some((res) => res.meta.requiresAuth)) {
    if (user) {
      if (to.matched.some((res) => res.meta.requiresAdmin)) {
        if (admin) {
          return next();
        }
        return next({ name: "Home" });
      }
      return next();
    }
    return next({ name: "Home" });
  }
  return next();
})

export default router
</code>```

Title: Vue - path #ID scrollBehavior

Body:
Hey i have a multiple sections on my website and im using full-page scroll (fullpage.js),
i also have a menu with atributes Home , Services and Contact, when i click on Services page it scrolls to section as it should but it does not scroll back after i click on Home.
Here is the code:

Navigation

<router-link v-show="!mobile" class="link bio" :to="{ name: 'Home' }">Bio</router-link>
<router-link v-show="!mobile" class="link link2" :to="{ name: 'Services' }">Services</router-link>

Router

{
  path: "/home",
  name: "Home",
  component: Home,
  meta: {
    title: "Bio",
    requiresAuth: false,
  },
},
{
  path: "/home#fifthPage",
  name: "Services",
  component: Home,
  meta: {
    title: "Services",
    requiresAuth: false,
  },
},

const router = new VueRouter({
  mode: "history",

  routes,
  scrollBehavior() {
    return { x: 0, y: 0 };
  },
});

router.beforeEach((to, from, next) => {
  document.title = `${to.meta.title} | YounesFilm`;
  next();
});

router.beforeEach(async (to, from, next) => {
  let user = firebase.auth().currentUser;
  let admin = null;
  if (user) {
    let token = await user.getIdTokenResult();
    admin = token.claims.admin;
  }
  if (to.matched.some((res) => res.meta.requiresAuth)) {
    if (user) {
      if (to.matched.some((res) => res.meta.requiresAdmin)) {
        if (admin) {
          return next();
        }
        return next({ name: "Home" });
      }
      return next();
    }
    return next({ name: "Home" });
  }
  return next();
})

export default router


问:
BigNumber.add "is not a function "when using a method from an SDK
I have an SDK that does a calculation using BigNumber from ethers.

SDK library:

```<code>import { BigNumber } from "ethers";

function myFxn() {
  const a = BigNumber.from(0);
  const b = BigNumber.from(1);
  const c = a.add(b);
  return c;
}
</code>```

When importing this library and using it in another application, I get an error that "a.add is not a function".

But in unit tests, this works perfectly fine.

In unit tests, this works perfectly fine. And in other TypeScript projects, this does work. However, the project that I'm importing the SDK in is pure JavaScript. Not sure if that messes up BigNumber typing?

Body:
I have an SDK that does a calculation using BigNumber from ethers.

SDK library:

import { BigNumber } from "ethers";

function myFxn() {
  const a = BigNumber.from(0);
  const b = BigNumber.from(1);
  const c = a.add(b);
  return c;
}

When importing this library and using it in another application, I get an error that "a.add is not a function".

But in unit tests, this works perfectly fine.

In unit tests, this works perfectly fine. And in other TypeScript projects, this does work. However, the project that I'm importing the SDK in is pure JavaScript. Not sure if that messes up BigNumber typing?


问:
Stack overflow after call to OSStartHighRdy (uC/OS-III)
I'm in the process of getting uC/OS-III working on an NXP MIMXRT1062 using the MCUXpresso ide with gcc compiler. When the OS starts multitasking it calls the OSStartHighRdy function:

```<code>.thumb_func
OSStartHighRdy:
    CPSID   I                                                   @ Prevent interruption during context switch
    MOVW    R0, #:lower16:NVIC_SYSPRI14                         @ Set the PendSV exception priority
    MOVT    R0, #:upper16:NVIC_SYSPRI14

    MOVW    R1, #:lower16:NVIC_PENDSV_PRI
    MOVT    R1, #:upper16:NVIC_PENDSV_PRI
    STRB    R1, [R0]

    MOVS    R0, #0                                              @ Set the PSP to 0 for initial context switch call
    MSR     PSP, R0

    MOVW    R0, #:lower16:OS_CPU_ExceptStkBase                  @ Initialize the MSP to the OS_CPU_ExceptStkBase
    MOVT    R0, #:upper16:OS_CPU_ExceptStkBase
    LDR     R1, [R0]
    MSR     MSP, R1

    BL      OSTaskSwHook                                        @ Call OSTaskSwHook() for FPU Push & Pop

    MOVW    R0, #:lower16:OSPrioCur                             @ OSPrioCur   = OSPrioHighRdy;
    MOVT    R0, #:upper16:OSPrioCur
    MOVW    R1, #:lower16:OSPrioHighRdy
    MOVT    R1, #:upper16:OSPrioHighRdy
    LDRB    R2, [R1]
    STRB    R2, [R0]

    MOVW    R0, #:lower16:OSTCBCurPtr                           @ OSTCBCurPtr = OSTCBHighRdyPtr;
    MOVT    R0, #:upper16:OSTCBCurPtr
    MOVW    R1, #:lower16:OSTCBHighRdyPtr
    MOVT    R1, #:upper16:OSTCBHighRdyPtr
    LDR     R2, [R1]
    STR     R2, [R0]

    LDR     R0, [R2]                                            @ R0 is new process SP; SP = OSTCBHighRdyPtr->StkPtr;
    MSR     PSP, R0                                             @ Load PSP with new process SP

    MRS     R0, CONTROL
    ORR     R0, R0, #2
    BIC     R0, R0, #4                                          @ Clear FPCA bit to indicate FPU is not in use
    MSR     CONTROL, R0
    ISB                                                         @ Sync instruction stream

    LDMFD    SP!, {R4-R11, LR}                                  @ Restore r4-11, lr from new process stack
    LDMFD    SP!, {R0-R3}                                       @ Restore r0, r3
    LDMFD    SP!, {R12, LR}                                     @ Load R12 and LR
    LDMFD    SP!, {R1, R2}                                      @ Load PC and discard xPSR
    CPSIE    I
    BX       R1
</code>```

However, the stack overflows after this line MSR     MSP, R1

This is my main function:

```<code>#include <stdio.h>
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "MIMXRT1062.h"
#include "fsl_debug_console.h"
/* TODO: insert other include files here. */
#include "../uC-OS3/uCOS-III/Source/os.h"
#include "start_task.h"
#include "../BSP/bsp_clk.h"
#include "../BSP/bsp_int.h"
#include "../BSP/bsp_os.h"
#include "../uC-OS3/uC-LIB/lib_mem.h"
#include "os_app_hooks.h"
/* TODO: insert other definitions and declarations here. */
void PendSV_Handler(void)
{
    OS_CPU_PendSVHandler();
}

void SysTick_Handler(void)
{
    OS_CPU_SysTickHandler();
}
/*
 * @brief   Application entry point.
 */
int main(void)
{
    OS_ERR err;

    /* Init board hardware. */
    BOARD_ConfigMPU();
    BSP_ClkInit();
    SysTick_Config(SystemCoreClock/600000);
    BSP_IntInit();
    BSP_OS_TickInit();
    Mem_Init();
    CPU_IntDis();
    CPU_Init();

    // 1. Call OSInit
    OSInit(&err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    App_OS_SetAllHooks();

    OSSchedRoundRobinCfg(DEF_ENABLED, 10, &err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    // 2. Call OSTaskCreate only once after call to OSInit
    OSTaskCreate(&startTaskTCB,
                 startTaskName,
                 startTask,
                 (void *)0,
                 startTaskPrio,
                 &startTaskStk[0],
                 startTaskStkLimit,
                 startTaskStkSize,
                 startTaskQSize,
                 startTaskQuanta,
                 (void *)0,
                 OS_OPT_TASK_NONE,
                 &err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    // 3. Call OSStart -- starts multitasking, doesn't return
    OSStart(&err);

    while (1);

    return 0;
}
</code>```

This are the 3 tasks I have:

```<code>#include "start_task.h"
#include "blinky_task.h"
#include "other_task.h"
#include "../BSP/bsp_os.h"

OS_TCB          startTaskTCB;
CPU_CHAR*       startTaskName     = "START TASK";
OS_PRIO         startTaskPrio     = 2;
CPU_STK_SIZE    startTaskStkLimit = START_TASK_STK_SIZE/10;
CPU_STK_SIZE    startTaskStkSize  = START_TASK_STK_SIZE;
CPU_STK         startTaskStk[START_TASK_STK_SIZE];
OS_MSG_QTY      startTaskQSize    = 0;
OS_TICK         startTaskQuanta   = 0;

void startTask(void *p_arg)
{
    (void)p_arg;

    OS_ERR err;

    BSP_OS_TickEnable();

    // Create all tasks needed
    OSTaskCreate(&blinkyTaskTCB,
                 blinkyTaskName,
                 blinkyTask,
                 (void *)0,
                 blinkyTaskPrio,
                 &blinkyTaskStk[0],
                 blinkyTaskStkLimit,
                 blinkyTaskStkSize,
                 blinkyTaskQSize,
                 blinkyTaskQuanta,
                 (void *)0,
                 OS_OPT_TASK_NONE,
                 &err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    OSTaskCreate(&otherTaskTCB,
                 otherTaskName,
                 otherTask,
                 (void *)0,
                 otherTaskPrio,
                 &otherTaskStk[0],
                 otherTaskStkLimit,
                 otherTaskStkSize,
                 otherTaskQSize,
                 otherTaskQuanta,
                 (void *)0,
                 OS_OPT_TASK_NONE,
                 &err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    while (DEF_ON)
    {
        // Just have a small delay
        OSTimeDlyHMSM(0, 0, 0, 100, OS_OPT_TIME_HMSM_STRICT, &err);

        if (OS_ERR_NONE != err)
        {
            while (1); // Hang here
        }
    }

}
</code>```
```<code>#include "blinky_task.h"
#include "stdbool.h"
#include "fsl_gpio.h"

OS_TCB          blinkyTaskTCB;
CPU_CHAR*       blinkyTaskName     = "BLINKY TASK";
OS_PRIO         blinkyTaskPrio     = 3;
CPU_STK_SIZE    blinkyTaskStkLimit = BLINKY_TASK_STK_SIZE/10;
CPU_STK_SIZE    blinkyTaskStkSize  = BLINKY_TASK_STK_SIZE;
CPU_STK         blinkyTaskStk[BLINKY_TASK_STK_SIZE];
OS_MSG_QTY      blinkyTaskQSize    = 0;
OS_TICK         blinkyTaskQuanta   = 0;

static bool     blinkState         = true;

void blinkyTask(void *p_arg)
{
    (void)p_arg;

    OS_ERR err;

    gpio_pin_config_t ledPinConf = { kGPIO_DigitalOutput, 1, kGPIO_NoIntmode };

    GPIO_PinInit(GPIO1, 8U, &ledPinConf);

    while (DEF_ON)
    {
        // Delay between LED toggle
        OSTimeDlyHMSM(0, 0, 1, 0, OS_OPT_TIME_HMSM_STRICT, &err);

        if (OS_ERR_NONE != err)
        {
            while (1); // Hang here
        }

        // Toggle LED
        if (blinkState)
        {
            GPIO_PinWrite(GPIO1, 8U, 0U);
            blinkState = false;
        }
        else
        {
            GPIO_PinWrite(GPIO1, 8U, 1U);
            blinkState = true;
        }
    }

}
</code>```
```<code>#include "other_task.h"

OS_TCB          otherTaskTCB;
CPU_CHAR*       otherTaskName     = "OTHER TASK";
OS_PRIO         otherTaskPrio     = 4;
CPU_STK_SIZE    otherTaskStkLimit = OTHER_TASK_STK_SIZE/10;
CPU_STK_SIZE    otherTaskStkSize  = OTHER_TASK_STK_SIZE;
CPU_STK         otherTaskStk[OTHER_TASK_STK_SIZE];
OS_MSG_QTY      otherTaskQSize    = 0;
OS_TICK         otherTaskQuanta   = 0;

void otherTask(void *p_arg)
{
    (void)p_arg;

    OS_ERR err;

    while (DEF_ON)
    {
        OSTimeDlyHMSM(0, 0, 0, 100, OS_OPT_TIME_HMSM_STRICT, &err);

        if (OS_ERR_NONE != err)
        {
            while (1); // Hang here
        }
    }

}
</code>```

The task header files:

```<code>#ifndef START_TASK_H_
#define START_TASK_H_

#include "../uC-OS3/uCOS-III/Source/os.h"

#define  START_TASK_STK_SIZE        (256U)

extern OS_TCB           startTaskTCB;
extern CPU_CHAR*        startTaskName;
extern OS_PRIO          startTaskPrio;
extern CPU_STK_SIZE     startTaskStkLimit;
extern CPU_STK_SIZE     startTaskStkSize;
extern CPU_STK          startTaskStk[START_TASK_STK_SIZE];
extern OS_MSG_QTY       startTaskQSize;
extern OS_TICK          startTaskQuanta;

void startTask(void *p_arg);

#endif /* START_TASK_H_ */
</code>```
```<code>#ifndef BLINKY_TASK_H_
#define BLINKY_TASK_H_

#include "../uC-OS3/uCOS-III/Source/os.h"

#define  BLINKY_TASK_STK_SIZE       (256U)

extern OS_TCB           blinkyTaskTCB;
extern CPU_CHAR*        blinkyTaskName;
extern OS_PRIO          blinkyTaskPrio;
extern CPU_STK_SIZE     blinkyTaskStkLimit;
extern CPU_STK_SIZE     blinkyTaskStkSize;
extern CPU_STK          blinkyTaskStk[BLINKY_TASK_STK_SIZE];
extern OS_MSG_QTY       blinkyTaskQSize;
extern OS_TICK          blinkyTaskQuanta;

void blinkyTask(void *p_arg);

#endif /* BLINKY_TASK_H_ */
</code>```
```<code>#ifndef OTHER_TASK_H_
#define OTHER_TASK_H_

#include "../uC-OS3/uCOS-III/Source/os.h"

#define  OTHER_TASK_STK_SIZE        (256U)

extern OS_TCB           otherTaskTCB;
extern CPU_CHAR*        otherTaskName;
extern OS_PRIO          otherTaskPrio;
extern CPU_STK_SIZE     otherTaskStkLimit;
extern CPU_STK_SIZE     otherTaskStkSize;
extern CPU_STK          otherTaskStk[OTHER_TASK_STK_SIZE];
extern OS_MSG_QTY       otherTaskQSize;
extern OS_TICK          otherTaskQuanta;

void otherTask(void *p_arg);

#endif /* OTHER_TASK_H_ */
</code>```

I can also include the uC/OS-III code if needed.

At the moment a hardfault occurs after the last task (otherTask) and I'm not sure where to begin looking.

I have increased and decreased the task's stack size but no change.
The mcu's stack is 4k and after the MSR     MSP, R1 line, it goes to around 120k

Body:
I'm in the process of getting uC/OS-III working on an NXP MIMXRT1062 using the MCUXpresso ide with gcc compiler. When the OS starts multitasking it calls the OSStartHighRdy function:

.thumb_func
OSStartHighRdy:
    CPSID   I                                                   @ Prevent interruption during context switch
    MOVW    R0, #:lower16:NVIC_SYSPRI14                         @ Set the PendSV exception priority
    MOVT    R0, #:upper16:NVIC_SYSPRI14

    MOVW    R1, #:lower16:NVIC_PENDSV_PRI
    MOVT    R1, #:upper16:NVIC_PENDSV_PRI
    STRB    R1, [R0]

    MOVS    R0, #0                                              @ Set the PSP to 0 for initial context switch call
    MSR     PSP, R0

    MOVW    R0, #:lower16:OS_CPU_ExceptStkBase                  @ Initialize the MSP to the OS_CPU_ExceptStkBase
    MOVT    R0, #:upper16:OS_CPU_ExceptStkBase
    LDR     R1, [R0]
    MSR     MSP, R1

    BL      OSTaskSwHook                                        @ Call OSTaskSwHook() for FPU Push & Pop

    MOVW    R0, #:lower16:OSPrioCur                             @ OSPrioCur   = OSPrioHighRdy;
    MOVT    R0, #:upper16:OSPrioCur
    MOVW    R1, #:lower16:OSPrioHighRdy
    MOVT    R1, #:upper16:OSPrioHighRdy
    LDRB    R2, [R1]
    STRB    R2, [R0]

    MOVW    R0, #:lower16:OSTCBCurPtr                           @ OSTCBCurPtr = OSTCBHighRdyPtr;
    MOVT    R0, #:upper16:OSTCBCurPtr
    MOVW    R1, #:lower16:OSTCBHighRdyPtr
    MOVT    R1, #:upper16:OSTCBHighRdyPtr
    LDR     R2, [R1]
    STR     R2, [R0]

    LDR     R0, [R2]                                            @ R0 is new process SP; SP = OSTCBHighRdyPtr->StkPtr;
    MSR     PSP, R0                                             @ Load PSP with new process SP

    MRS     R0, CONTROL
    ORR     R0, R0, #2
    BIC     R0, R0, #4                                          @ Clear FPCA bit to indicate FPU is not in use
    MSR     CONTROL, R0
    ISB                                                         @ Sync instruction stream

    LDMFD    SP!, {R4-R11, LR}                                  @ Restore r4-11, lr from new process stack
    LDMFD    SP!, {R0-R3}                                       @ Restore r0, r3
    LDMFD    SP!, {R12, LR}                                     @ Load R12 and LR
    LDMFD    SP!, {R1, R2}                                      @ Load PC and discard xPSR
    CPSIE    I
    BX       R1

However, the stack overflows after this line MSR     MSP, R1

This is my main function:

#include <stdio.h>
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "MIMXRT1062.h"
#include "fsl_debug_console.h"
/* TODO: insert other include files here. */
#include "../uC-OS3/uCOS-III/Source/os.h"
#include "start_task.h"
#include "../BSP/bsp_clk.h"
#include "../BSP/bsp_int.h"
#include "../BSP/bsp_os.h"
#include "../uC-OS3/uC-LIB/lib_mem.h"
#include "os_app_hooks.h"
/* TODO: insert other definitions and declarations here. */
void PendSV_Handler(void)
{
    OS_CPU_PendSVHandler();
}

void SysTick_Handler(void)
{
    OS_CPU_SysTickHandler();
}
/*
 * @brief   Application entry point.
 */
int main(void)
{
    OS_ERR err;

    /* Init board hardware. */
    BOARD_ConfigMPU();
    BSP_ClkInit();
    SysTick_Config(SystemCoreClock/600000);
    BSP_IntInit();
    BSP_OS_TickInit();
    Mem_Init();
    CPU_IntDis();
    CPU_Init();

    // 1. Call OSInit
    OSInit(&err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    App_OS_SetAllHooks();

    OSSchedRoundRobinCfg(DEF_ENABLED, 10, &err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    // 2. Call OSTaskCreate only once after call to OSInit
    OSTaskCreate(&startTaskTCB,
                 startTaskName,
                 startTask,
                 (void *)0,
                 startTaskPrio,
                 &startTaskStk[0],
                 startTaskStkLimit,
                 startTaskStkSize,
                 startTaskQSize,
                 startTaskQuanta,
                 (void *)0,
                 OS_OPT_TASK_NONE,
                 &err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    // 3. Call OSStart -- starts multitasking, doesn't return
    OSStart(&err);

    while (1);

    return 0;
}

This are the 3 tasks I have:

#include "start_task.h"
#include "blinky_task.h"
#include "other_task.h"
#include "../BSP/bsp_os.h"

OS_TCB          startTaskTCB;
CPU_CHAR*       startTaskName     = "START TASK";
OS_PRIO         startTaskPrio     = 2;
CPU_STK_SIZE    startTaskStkLimit = START_TASK_STK_SIZE/10;
CPU_STK_SIZE    startTaskStkSize  = START_TASK_STK_SIZE;
CPU_STK         startTaskStk[START_TASK_STK_SIZE];
OS_MSG_QTY      startTaskQSize    = 0;
OS_TICK         startTaskQuanta   = 0;

void startTask(void *p_arg)
{
    (void)p_arg;

    OS_ERR err;

    BSP_OS_TickEnable();

    // Create all tasks needed
    OSTaskCreate(&blinkyTaskTCB,
                 blinkyTaskName,
                 blinkyTask,
                 (void *)0,
                 blinkyTaskPrio,
                 &blinkyTaskStk[0],
                 blinkyTaskStkLimit,
                 blinkyTaskStkSize,
                 blinkyTaskQSize,
                 blinkyTaskQuanta,
                 (void *)0,
                 OS_OPT_TASK_NONE,
                 &err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    OSTaskCreate(&otherTaskTCB,
                 otherTaskName,
                 otherTask,
                 (void *)0,
                 otherTaskPrio,
                 &otherTaskStk[0],
                 otherTaskStkLimit,
                 otherTaskStkSize,
                 otherTaskQSize,
                 otherTaskQuanta,
                 (void *)0,
                 OS_OPT_TASK_NONE,
                 &err);

    if (OS_ERR_NONE != err)
    {
        while (1); // Hang here
    }

    while (DEF_ON)
    {
        // Just have a small delay
        OSTimeDlyHMSM(0, 0, 0, 100, OS_OPT_TIME_HMSM_STRICT, &err);

        if (OS_ERR_NONE != err)
        {
            while (1); // Hang here
        }
    }

}

#include "blinky_task.h"
#include "stdbool.h"
#include "fsl_gpio.h"

OS_TCB          blinkyTaskTCB;
CPU_CHAR*       blinkyTaskName     = "BLINKY TASK";
OS_PRIO         blinkyTaskPrio     = 3;
CPU_STK_SIZE    blinkyTaskStkLimit = BLINKY_TASK_STK_SIZE/10;
CPU_STK_SIZE    blinkyTaskStkSize  = BLINKY_TASK_STK_SIZE;
CPU_STK         blinkyTaskStk[BLINKY_TASK_STK_SIZE];
OS_MSG_QTY      blinkyTaskQSize    = 0;
OS_TICK         blinkyTaskQuanta   = 0;

static bool     blinkState         = true;

void blinkyTask(void *p_arg)
{
    (void)p_arg;

    OS_ERR err;

    gpio_pin_config_t ledPinConf = { kGPIO_DigitalOutput, 1, kGPIO_NoIntmode };

    GPIO_PinInit(GPIO1, 8U, &ledPinConf);

    while (DEF_ON)
    {
        // Delay between LED toggle
        OSTimeDlyHMSM(0, 0, 1, 0, OS_OPT_TIME_HMSM_STRICT, &err);

        if (OS_ERR_NONE != err)
        {
            while (1); // Hang here
        }

        // Toggle LED
        if (blinkState)
        {
            GPIO_PinWrite(GPIO1, 8U, 0U);
            blinkState = false;
        }
        else
        {
            GPIO_PinWrite(GPIO1, 8U, 1U);
            blinkState = true;
        }
    }

}

#include "other_task.h"

OS_TCB          otherTaskTCB;
CPU_CHAR*       otherTaskName     = "OTHER TASK";
OS_PRIO         otherTaskPrio     = 4;
CPU_STK_SIZE    otherTaskStkLimit = OTHER_TASK_STK_SIZE/10;
CPU_STK_SIZE    otherTaskStkSize  = OTHER_TASK_STK_SIZE;
CPU_STK         otherTaskStk[OTHER_TASK_STK_SIZE];
OS_MSG_QTY      otherTaskQSize    = 0;
OS_TICK         otherTaskQuanta   = 0;

void otherTask(void *p_arg)
{
    (void)p_arg;

    OS_ERR err;

    while (DEF_ON)
    {
        OSTimeDlyHMSM(0, 0, 0, 100, OS_OPT_TIME_HMSM_STRICT, &err);

        if (OS_ERR_NONE != err)
        {
            while (1); // Hang here
        }
    }

}

The task header files:

#ifndef START_TASK_H_
#define START_TASK_H_

#include "../uC-OS3/uCOS-III/Source/os.h"

#define  START_TASK_STK_SIZE        (256U)

extern OS_TCB           startTaskTCB;
extern CPU_CHAR*        startTaskName;
extern OS_PRIO          startTaskPrio;
extern CPU_STK_SIZE     startTaskStkLimit;
extern CPU_STK_SIZE     startTaskStkSize;
extern CPU_STK          startTaskStk[START_TASK_STK_SIZE];
extern OS_MSG_QTY       startTaskQSize;
extern OS_TICK          startTaskQuanta;

void startTask(void *p_arg);

#endif /* START_TASK_H_ */

#ifndef BLINKY_TASK_H_
#define BLINKY_TASK_H_

#include "../uC-OS3/uCOS-III/Source/os.h"

#define  BLINKY_TASK_STK_SIZE       (256U)

extern OS_TCB           blinkyTaskTCB;
extern CPU_CHAR*        blinkyTaskName;
extern OS_PRIO          blinkyTaskPrio;
extern CPU_STK_SIZE     blinkyTaskStkLimit;
extern CPU_STK_SIZE     blinkyTaskStkSize;
extern CPU_STK          blinkyTaskStk[BLINKY_TASK_STK_SIZE];
extern OS_MSG_QTY       blinkyTaskQSize;
extern OS_TICK          blinkyTaskQuanta;

void blinkyTask(void *p_arg);

#endif /* BLINKY_TASK_H_ */

#ifndef OTHER_TASK_H_
#define OTHER_TASK_H_

#include "../uC-OS3/uCOS-III/Source/os.h"

#define  OTHER_TASK_STK_SIZE        (256U)

extern OS_TCB           otherTaskTCB;
extern CPU_CHAR*        otherTaskName;
extern OS_PRIO          otherTaskPrio;
extern CPU_STK_SIZE     otherTaskStkLimit;
extern CPU_STK_SIZE     otherTaskStkSize;
extern CPU_STK          otherTaskStk[OTHER_TASK_STK_SIZE];
extern OS_MSG_QTY       otherTaskQSize;
extern OS_TICK          otherTaskQuanta;

void otherTask(void *p_arg);

#endif /* OTHER_TASK_H_ */

I can also include the uC/OS-III code if needed.

At the moment a hardfault occurs after the last task (otherTask) and I'm not sure where to begin looking.

I have increased and decreased the task's stack size but no change.
The mcu's stack is 4k and after the MSR     MSP, R1 line, it goes to around 120k


问:
SonarQube Api Hostspot
I am trying to make a rest call to the Sonarqube API and can't seem to be able to grab the hotspots. Below is the url I am trying to call:

```<code>baseURL/measures/component?metricKeys=hotspot&component=projectKey
</code>```

Documentation says you are required to only pass hotspot parameter.

Title: SonarQube Api Hostspot

Body:
I am trying to make a rest call to the Sonarqube API and can't seem to be able to grab the hotspots. Below is the url I am trying to call:

baseURL/measures/component?metricKeys=hotspot&component=projectKey

Documentation says you are required to only pass hotspot parameter.