问:
ODOO 12 server error regarding invoice sequencing
I am trying to change the sequence of my invoicing. Instead of resetting it each new year, I can keep the count going upwards continuously.

(for example)

inv/2021/0001 date 1/1/2023   (this one should be 2366)

inv/2021/2365    date 31/12/2022

researching on the subject I found out I need to go into technical -> sequences to get the invoice numbers I want.

but my problem is, once i click sequences I get the following server error:

```<code>Error:
Odoo Server Error

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/api.py", line 1039, in get
    value = self._data[key][field][record._ids[0]]
KeyError: 254

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/fields.py", line 981, in __get__
    value = record.env.cache.get(record, self)
  File "/odoo/odoo-server/odoo/api.py", line 1041, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('ir.sequence(254,).number_next_actual', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/odoo/odoo-server/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 904, in search_read
    return self.do_search_read(model, fields, offset, limit, domain, sort)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 926, in do_search_read
    offset=offset or 0, limit=limit or False, order=sort or False)
  File "/odoo/odoo-server/odoo/models.py", line 4589, in search_read
    result = records.read(fields)
  File "/odoo/odoo-server/odoo/models.py", line 2791, in read
    vals[name] = convert(record[name], record, use_name_get)
  File "/odoo/odoo-server/odoo/models.py", line 5117, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/odoo/odoo-server/odoo/fields.py", line 985, in __get__
    self.determine_value(record)
  File "/odoo/odoo-server/odoo/fields.py", line 1098, in determine_value
    self.compute_value(recs)
  File "/odoo/odoo-server/odoo/fields.py", line 1052, in compute_value
    self._compute_value(records)
  File "/odoo/odoo-server/odoo/fields.py", line 1043, in _compute_value
    getattr(records, self.compute)()
  File "/odoo/odoo-server/odoo/addons/base/models/ir_sequence.py", line 96, in _get_number_next_actual
    seq.number_next_actual = _predict_nextval(self, seq_id)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_sequence.py", line 68, in _predict_nextval
    self.env.cr.execute(query % {'seq_id': seq_id})
  File "/odoo/odoo-server/odoo/sql_db.py", line 148, in wrapper
    return f(self, *args, **kwargs)
  File "/odoo/odoo-server/odoo/sql_db.py", line 225, in execute
    res = self._obj.execute(query, params)
psycopg2.ProgrammingError: relation "ir_sequence_1000015" does not exist
LINE 6:                FROM ir_sequence_1000015

</code>```

I believe it could be a database error but I am not sure what this is about. Any idea?

Thanks!

Body:
I am trying to change the sequence of my invoicing. Instead of resetting it each new year, I can keep the count going upwards continuously.

(for example)

inv/2021/0001 date 1/1/2023   (this one should be 2366)

inv/2021/2365    date 31/12/2022

researching on the subject I found out I need to go into technical -> sequences to get the invoice numbers I want.

but my problem is, once i click sequences I get the following server error:

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/api.py", line 1039, in get
    value = self._data[key][field][record._ids[0]]
KeyError: 254

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/fields.py", line 981, in __get__
    value = record.env.cache.get(record, self)
  File "/odoo/odoo-server/odoo/api.py", line 1041, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('ir.sequence(254,).number_next_actual', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/odoo/odoo-server/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 904, in search_read
    return self.do_search_read(model, fields, offset, limit, domain, sort)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 926, in do_search_read
    offset=offset or 0, limit=limit or False, order=sort or False)
  File "/odoo/odoo-server/odoo/models.py", line 4589, in search_read
    result = records.read(fields)
  File "/odoo/odoo-server/odoo/models.py", line 2791, in read
    vals[name] = convert(record[name], record, use_name_get)
  File "/odoo/odoo-server/odoo/models.py", line 5117, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/odoo/odoo-server/odoo/fields.py", line 985, in __get__
    self.determine_value(record)
  File "/odoo/odoo-server/odoo/fields.py", line 1098, in determine_value
    self.compute_value(recs)
  File "/odoo/odoo-server/odoo/fields.py", line 1052, in compute_value
    self._compute_value(records)
  File "/odoo/odoo-server/odoo/fields.py", line 1043, in _compute_value
    getattr(records, self.compute)()
  File "/odoo/odoo-server/odoo/addons/base/models/ir_sequence.py", line 96, in _get_number_next_actual
    seq.number_next_actual = _predict_nextval(self, seq_id)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_sequence.py", line 68, in _predict_nextval
    self.env.cr.execute(query % {'seq_id': seq_id})
  File "/odoo/odoo-server/odoo/sql_db.py", line 148, in wrapper
    return f(self, *args, **kwargs)
  File "/odoo/odoo-server/odoo/sql_db.py", line 225, in execute
    res = self._obj.execute(query, params)
psycopg2.ProgrammingError: relation "ir_sequence_1000015" does not exist
LINE 6:                FROM ir_sequence_1000015

I believe it could be a database error but I am not sure what this is about. Any idea?

Thanks!


来源: stackexchange

问:
Is there anyway to add icons to labels and additional custom info to a graph aligned to y axis

So I have this graph with some icons on the names of y axis (left side) and some additional info on the right side which is the comparison between expected/actual tCO2e and the percentage difference (right side)

I have this graph in tableau but haven't been able to add custom SVG icons on the left side neither the additional info on the right side:

How can I achieve this in tableau

ContentLicense: CC BY-SA 4.0


问:
SSIS - Flow doesn't continue to next task in control flow
I have the following flow:

The script TASK "GET PROJECTS FROM SQL" returns around 7000 rows.
So the foreach loop should loop through all the result lines.
Somehow, it goes only one time to the "GET REFRESH TOKEN" and does not continue to the 'GET DEMANDES TO SQL". After a while it stops with no error. The constraint between "GET REFRESH TOKEN" and "GET DEMANDES TO SQL" is just SUCCESS. I don't know why it can't continue.
Here is the content of the GET REFRESH TOKEN:

I'm just making a JSON request an setting the values of the request response to variables via a Script Component. I've verified, the Script Component runs only onces and the variables are correctly set.

It looks like the script component is not notifying when it finishes.
Any idea ?


问:
Contentful Content Migration API try/catch on field creation?
We are trying to setup a workflow for delivering content model changes to our other environments (stage & prod).

Right now, our approach is this:

Create a new contentful field as a migration script using Contentful CLI.

Run script in local dev to make sure the result is as desired using contentful space migration migrations/2023-01-12-add-field.ts

Add script to GIT in folder migrations/[date]-[description].js

When release to prod, run all scripts in the migrations folder, in order, as part of the build process.

When folder contains "too many" scripts, and we are certain all changes are applied to all envs, manually remove the scripts from GIT and start over in an empty folder.

Where it fails

But, between point 4 & 5 there will be cases where a script has already been run in an earlier release, and that throws an error:

I would like the scripts to continue more gracefully without throwing an error, but I cant find support for it in the space migration docs. I have tried wrapping the code in try/catch without any luck.

Contentful recommends using the Content Migration API in favour for Content Management API since it is faster. I guess we could use the Content Management API, but at the same time we want to use "best practise".

Are we missing something here?

I would like to do something like:

```<code>module.exports = function (migration) {
  // Create a new category field in the blog post content type.
  const blogPost = migration.editContentType('blogPost')

  if (blogPost.fieldExists('testField')) {
    console.log('Field already exists')
  } else {
    blogPost.createField('testField').name('Test field').type('Symbol')
  }
}
</code>```

Body:
We are trying to setup a workflow for delivering content model changes to our other environments (stage & prod).

Right now, our approach is this:

Create a new contentful field as a migration script using Contentful CLI.

Run script in local dev to make sure the result is as desired using contentful space migration migrations/2023-01-12-add-field.ts

Add script to GIT in folder migrations/[date]-[description].js

When release to prod, run all scripts in the migrations folder, in order, as part of the build process.

When folder contains "too many" scripts, and we are certain all changes are applied to all envs, manually remove the scripts from GIT and start over in an empty folder.

Where it fails

But, between point 4 & 5 there will be cases where a script has already been run in an earlier release, and that throws an error:

I would like the scripts to continue more gracefully without throwing an error, but I cant find support for it in the space migration docs. I have tried wrapping the code in try/catch without any luck.

Contentful recommends using the Content Migration API in favour for Content Management API since it is faster. I guess we could use the Content Management API, but at the same time we want to use "best practise".

Are we missing something here?

I would like to do something like:

module.exports = function (migration) {
  // Create a new category field in the blog post content type.
  const blogPost = migration.editContentType('blogPost')

  if (blogPost.fieldExists('testField')) {
    console.log('Field already exists')
  } else {
    blogPost.createField('testField').name('Test field').type('Symbol')
  }
}


问:
Newline between buttons adds space between them
I am trying to make a simple row of buttons that, when hovered, drops down stylistically.

Here is my HTML:

.yellow {
  background-color: #fff444;
}

.blue {
  background-color: #7d7dff;
}

.bordered {
  border-radius: 5px;
  border: 2px solid #000;
}

.bordered-bottom {
  border-bottom: 2px solid #000;
}

.round-button {
  color: #000;
  cursor: pointer;
  display: inline-block;
  box-shadow: 3px 3px #000;
  transition: box-shadow 0.2s, transform 0.2s;
  margin: 0 3px 3px 0;
}

.round-button:hover {
  background-color: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
}

.round-button:active {
  transform: translate(2px, 2px);
  background-color: #fff;
  box-shadow: 1px 1px #000;
  transition: box-shadow 0.2s, transform 0.2s;
}

.pad {
  padding: 10px;
}

body {
  margin: 0px;
}

h1 {
  color: black;
  font-weight: bold;
  margin: 0px;
}

.button-row {
  height: 100%;
}

.button-row button {
  border: 2px solid #000;
  border-left: none;
  border-top: none;
  height: 100%;
  margin-bottom: -2px;
  margin-right: 0px;
  margin-left: 0px;
  transition: padding-top 0.2s, transform 0.2s, margin-top 0.2s;
}

.button-row button+button {
  border-left: 2px solid #000;
  margin-left: -2px;
}

.button-row button:hover {
  background-color: #fff;
  display: inline-block;
  padding-top: 10px;
  margin-top: -10px;
  transform: translate(0px, 10px);
  transition: padding-top 0.2s, transform 0.2s, margin-top 0.2s;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="head" class="yellow">
  <h1 class="pad">header</h1>
  <div class="button-row bordered-bottom">
    <button id="button" class="yellow">Home</button>
    <button id="button2" class="yellow">About</button>
  </div>
</div></code>```

I expect the result to be as in fig 1:

fig 1

But it appears as in fig 2:

fig 2

fig 1 is the result I get when making the buttons defined inline in the html like so:

<button id="button" class="yellow">Home</button><button id="button2" class="yellow">About</button>
```
<p>fig 2 has the same result as putting a space between these two inline buttons:</p>
<pre class="lang-html prettyprint-override"><code><button id="button" class="yellow">Home</button> <button id="button2" class="yellow">About</button>
</code>```

I believed that both ways of writing it (not the one with the space) would appear the same. But it isn't appearing the same. Is there some reason for this? I checked my whitespace--I can remove the tabs, but not the newline.

Body:
I am trying to make a simple row of buttons that, when hovered, drops down stylistically.

Here is my HTML:

.yellow {
  background-color: #fff444;
}

.blue {
  background-color: #7d7dff;
}

.bordered {
  border-radius: 5px;
  border: 2px solid #000;
}

.bordered-bottom {
  border-bottom: 2px solid #000;
}

.round-button {
  color: #000;
  cursor: pointer;
  display: inline-block;
  box-shadow: 3px 3px #000;
  transition: box-shadow 0.2s, transform 0.2s;
  margin: 0 3px 3px 0;
}

.round-button:hover {
  background-color: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
}

.round-button:active {
  transform: translate(2px, 2px);
  background-color: #fff;
  box-shadow: 1px 1px #000;
  transition: box-shadow 0.2s, transform 0.2s;
}

.pad {
  padding: 10px;
}

body {
  margin: 0px;
}

h1 {
  color: black;
  font-weight: bold;
  margin: 0px;
}

.button-row {
  height: 100%;
}

.button-row button {
  border: 2px solid #000;
  border-left: none;
  border-top: none;
  height: 100%;
  margin-bottom: -2px;
  margin-right: 0px;
  margin-left: 0px;
  transition: padding-top 0.2s, transform 0.2s, margin-top 0.2s;
}

.button-row button+button {
  border-left: 2px solid #000;
  margin-left: -2px;
}

.button-row button:hover {
  background-color: #fff;
  display: inline-block;
  padding-top: 10px;
  margin-top: -10px;
  transform: translate(0px, 10px);
  transition: padding-top 0.2s, transform 0.2s, margin-top 0.2s;
}

header

    <button id="button" class="yellow">Home</button>
    <button id="button2" class="yellow">About</button>

I expect the result to be as in fig 1:

fig 1

But it appears as in fig 2:

fig 2

fig 1 is the result I get when making the buttons defined inline in the html like so:

<button id="button" class="yellow">Home</button><button id="button2" class="yellow">About</button>

fig 2 has the same result as putting a space between these two inline buttons:

<button id="button" class="yellow">Home</button> <button id="button2" class="yellow">About</button>

I believed that both ways of writing it (not the one with the space) would appear the same. But it isn't appearing the same. Is there some reason for this? I checked my whitespace--I can remove the tabs, but not the newline.


问:
PDO: Delete query only deleting entries of first value in IN statement
I am trying to delete entries using PDO:

```<code>$query = $pdo->prepare("DELETE FROM matches
    WHERE sportsmen_id IN (:sportsmenIds)
    AND game_id = :gameId
    AND category_id = :categoryId
    AND place_id IN (:placeIds)");

$query->bindValue('sportsmenIds', rtrim($sportsmenIds, ','));
$query->bindValue('gameId', $gameId);
$query->bindValue('categoryId', $categoryId);
$query->bindValue('placeIds', rtrim($placeIds, ','));

$query->execute();`
</code>```

I even tried dumping the query and the values and it resulted correct:

```<code>{
     "sportsmenIds": "17117",
      "gameId": 15073,
      "categoryId": 47295,
      "placeIds": "10,38,40,37",
      "query": "DELETE FROM matches WHERE sportsmen_id IN
          (:sportsmenIds) AND game_id = :gameId AND
          category_id =
          :categoryId AND place_id IN (:placeId)"
}
</code>```

But what's deleted are only entries where place_id = 10 (the first place_id in $placeIds)

I also suspect that if I got more than 1 $sportsmenIds, same thing will also happen, only the first from $sportsmenIds will also be deleted.

What I am expecting:

For all the entries that met the condition of sportsmen_id, game_id, category_id, and all values for place_id inside IN STATEMENT, not just the place_id = 10

Body:
I am trying to delete entries using PDO:

$query = $pdo->prepare("DELETE FROM matches
    WHERE sportsmen_id IN (:sportsmenIds)
    AND game_id = :gameId
    AND category_id = :categoryId
    AND place_id IN (:placeIds)");

$query->bindValue('sportsmenIds', rtrim($sportsmenIds, ','));
$query->bindValue('gameId', $gameId);
$query->bindValue('categoryId', $categoryId);
$query->bindValue('placeIds', rtrim($placeIds, ','));

$query->execute();`

I even tried dumping the query and the values and it resulted correct:

{
     "sportsmenIds": "17117",
      "gameId": 15073,
      "categoryId": 47295,
      "placeIds": "10,38,40,37",
      "query": "DELETE FROM matches WHERE sportsmen_id IN
          (:sportsmenIds) AND game_id = :gameId AND
          category_id =
          :categoryId AND place_id IN (:placeId)"
}

But what's deleted are only entries where place_id = 10 (the first place_id in $placeIds)

I also suspect that if I got more than 1 $sportsmenIds, same thing will also happen, only the first from $sportsmenIds will also be deleted.

What I am expecting:

For all the entries that met the condition of sportsmen_id, game_id, category_id, and all values for place_id inside IN STATEMENT, not just the place_id = 10


问:
CRTP implementation in c#
I'm trying to implement Curiously recurring template pattern(CRTP) in c#.

here is some code i wrote.

using System;
using System.Collections;
using System.Collections.Generic;

// Curiously recurring template pattern in c#
namespace MyApp
{
    public class Program
    {
        public static void Main (string[] arg)
        {
            new Child().CallChildMethod();
        }
    }

    public abstract class Base <T> where T: Base<T>, new ()
    {
        // Game loop
        void Upate ()
        {
            Method ();
        }

        public void CallChildMethod ()
        {
            T t = (T)this;
            t?.Method ();
        }

        public void Method ()
        {
            Console.WriteLine ("Base Method!");
        }
    }

    public class Child: Base <Child>
    {
        public new void Method ()
        {
            Console.WriteLine ("Child Method!");
        }
    }
}
```
<p>In output i'm getting</p>
```Base Method!
```
<p>but my code should print</p>
```Child Method!
```

any idea?

Expected

I want to access child class object in base class instead of overriding base methods and please suggest is there any other way to do the same?.

Title: CRTP implementation in c#

Body:
I'm trying to implement Curiously recurring template pattern(CRTP) in c#.

here is some code i wrote.

using System;
using System.Collections;
using System.Collections.Generic;

// Curiously recurring template pattern in c#
namespace MyApp
{
    public class Program
    {
        public static void Main (string[] arg)
        {
            new Child().CallChildMethod();
        }
    }

    public abstract class Base <T> where T: Base<T>, new ()
    {
        // Game loop
        void Upate ()
        {
            Method ();
        }

        public void CallChildMethod ()
        {
            T t = (T)this;
            t?.Method ();
        }

        public void Method ()
        {
            Console.WriteLine ("Base Method!");
        }
    }

    public class Child: Base <Child>
    {
        public new void Method ()
        {
            Console.WriteLine ("Child Method!");
        }
    }
}

In output i'm getting

Base Method!

but my code should print

Child Method!

any idea?

Expected

I want to access child class object in base class instead of overriding base methods and please suggest is there any other way to do the same?.


问:
QuantLib: What is the command to check or access the QuantLib version in conda prompt or spyder?
I have looked Quantlib library to get the answer but couldnt find the right answer. This will surely help to check the quantlib version and installed package versions.</p>


问:
Saving current route in bottom navigation - Compose
I have a NavigationBar and each of the items have their own separate navGraphs. One of the NavGraphs has a following scheme:

```<code>sealed class ShopDestination(val name: String) {
object Shop : ShopDestination("shop") {
    object Category: ShopDestination("${super.name}/category")
    class Listing(listingId: Long? = null) : ShopDestination("${super.name}/listing/${listingId ?: ("{" + ShopArguments.ListingId.name + "}")}")
    class Product(productId: Long? = null) : ShopDestination("${super.name}/${productId ?: ("{" + RouteArguments.ProductId.name + "}")}")
}
</code>```

and here's the graph:

```<code>.shopNavGraph(navController: NavController) {
navigation(
    route = ShopDestination.Shop.name,
    startDestination = ShopDestination.Shop.Category.name
) {
    composable(ShopDestination.Shop.Category.name) {
        ShopScreen({ navController.navigate(ShopDestination.Shop.Listing(it).name) })
    }
    composable(
        route = ShopDestination.Shop.Listing().name,
        arguments = listOf(
            navArgument(ShopArguments.ListingId.name) {
                type = NavType.LongType
            }
        ),
    ) {
        ListingComposable(
            contract = hiltViewModel<ListingViewModel>(),
            goBack = { navController.popBackStack() },
            goToProduct = { navController.navigate(ShopDestination.Shop.Product(it).name) },
        )
    }

    composable(
        route = ShopDestination.Shop.Product().name, arguments = listOf(navArgument(
            RouteArguments.ProductId.name
        ) {
            type = NavType.LongType
        })
    ) {
        ProductScreen(
            { navController.popBackStack() },
            { navController.navigate(ShopDestination.Shop.Product(it).name) })
    }
}
</code>```

When a user click on a different NavigationBarItem and then goes back the shopNavGraph starts from the startDestination. I would like the NavigationBar to save the backstack and once the user clicks back on it, start from where it left of (for example Product). How do I achieve that? Here's also the NavigationBar if it helps in any way:

```<code> NavigationBar(containerColor = MaterialTheme.colorScheme.primary) {
    val navBackStackEntry by navController.currentBackStackEntryAsState()
    val currentRoute = navBackStackEntry?.destination?.route ?: ""

    items.forEach {
        NavigationBarItem(
            colors = NavigationBarItemDefaults.colors(indicatorColor = Color.Transparent),
            icon = {
                Row(verticalAlignment = CenterVertically) {
                    Icon(
                        imageVector = it.icon,
                        contentDescription = it.name,
                        tint = MaterialTheme.colorScheme.onPrimary
                    )
                    Text(
                        text = stringResource(id = it.titleResId).uppercase(),
                        modifier = Modifier.padding(start = dimensionResource(id = R.dimen.margin_normal)),
                        color = MaterialTheme.colorScheme.onPrimary,
                        style = MaterialTheme.typography.labelMedium
                    )
                }
            },
            alwaysShowLabel = true,
            selected = currentRoute.contains(it.name),
            onClick = {
                navController.navigate(it.name)
            }
</code>```

Body:
I have a NavigationBar and each of the items have their own separate navGraphs. One of the NavGraphs has a following scheme:

sealed class ShopDestination(val name: String) {
object Shop : ShopDestination("shop") {
    object Category: ShopDestination("${super.name}/category")
    class Listing(listingId: Long? = null) : ShopDestination("${super.name}/listing/${listingId ?: ("{" + ShopArguments.ListingId.name + "}")}")
    class Product(productId: Long? = null) : ShopDestination("${super.name}/${productId ?: ("{" + RouteArguments.ProductId.name + "}")}")
}

and here's the graph:

.shopNavGraph(navController: NavController) {
navigation(
    route = ShopDestination.Shop.name,
    startDestination = ShopDestination.Shop.Category.name
) {
    composable(ShopDestination.Shop.Category.name) {
        ShopScreen({ navController.navigate(ShopDestination.Shop.Listing(it).name) })
    }
    composable(
        route = ShopDestination.Shop.Listing().name,
        arguments = listOf(
            navArgument(ShopArguments.ListingId.name) {
                type = NavType.LongType
            }
        ),
    ) {
        ListingComposable(
            contract = hiltViewModel<ListingViewModel>(),
            goBack = { navController.popBackStack() },
            goToProduct = { navController.navigate(ShopDestination.Shop.Product(it).name) },
        )
    }

    composable(
        route = ShopDestination.Shop.Product().name, arguments = listOf(navArgument(
            RouteArguments.ProductId.name
        ) {
            type = NavType.LongType
        })
    ) {
        ProductScreen(
            { navController.popBackStack() },
            { navController.navigate(ShopDestination.Shop.Product(it).name) })
    }
}

When a user click on a different NavigationBarItem and then goes back the shopNavGraph starts from the startDestination. I would like the NavigationBar to save the backstack and once the user clicks back on it, start from where it left of (for example Product). How do I achieve that? Here's also the NavigationBar if it helps in any way:

 NavigationBar(containerColor = MaterialTheme.colorScheme.primary) {
    val navBackStackEntry by navController.currentBackStackEntryAsState()
    val currentRoute = navBackStackEntry?.destination?.route ?: ""

    items.forEach {
        NavigationBarItem(
            colors = NavigationBarItemDefaults.colors(indicatorColor = Color.Transparent),
            icon = {
                Row(verticalAlignment = CenterVertically) {
                    Icon(
                        imageVector = it.icon,
                        contentDescription = it.name,
                        tint = MaterialTheme.colorScheme.onPrimary
                    )
                    Text(
                        text = stringResource(id = it.titleResId).uppercase(),
                        modifier = Modifier.padding(start = dimensionResource(id = R.dimen.margin_normal)),
                        color = MaterialTheme.colorScheme.onPrimary,
                        style = MaterialTheme.typography.labelMedium
                    )
                }
            },
            alwaysShowLabel = true,
            selected = currentRoute.contains(it.name),
            onClick = {
                navController.navigate(it.name)
            }


问:
SpicIE toolbar, SHDocVw.IWebBrowser2 execScript problem?
I'm developing an addon for IE8+.

Main function:
- when I click the toolbar, it will display a box inside every single page, ex: google.com, bing.com, codeproject.com... by using execScript to execute jQuery.
Therefore, what Im doing is run javascript in the current page.

Everything has done except when that page perform an Pop-up, it doesnt work anymore.
I click the toolbar, nothing happen, but when I look at the pop-up, surprise! has the box which im trying to display. So, I think the current tab and the popup of its is running the same process.

I have change registry key TabProcGrowth to 20, to make sure every single tab run by its own process, but maybe it not work with popup.

sr for my bad english, any suggestion is welcome.

Thanks in advance.

update:
I have changed the way to develop my addon, so I change my question, too. (But any suggestion for the 1st question still very useful for me).

My new question still mention the "execScript" problem.

HOW to execute javascript with every individual tab of IE browser with TabProcGrowth = 0. I need this value set to 0 because I have the timer to request to the server every interval1 (ex: 60s). So if there are more than one processes of IE, the addon will send multi request to server at the sametime.

In my situation now, I set TabProcGrowth to 0. Open IE, open some tabs. Click the toolbar at the newest tab, it works, ofcourse!. But when I click toolbar at the old one, nothing happen. The script still be execute but it takes effect on the newest tab.

It's the big problem for me, resolve this problem, you guys save my life.

ContentLicense: CC BY-SA 3.0


问:
org.hibernate.MappingException: Repeated column in mapping for entity: x column: fk_profile_id (should be mapped with insert="false" update="false")
I try to map two tables

Profile - profile_validation - Validation

with a mapping table /link table and I get this error during start of Wildfly:

Caused by: org.hibernate.MappingException: Repeated column in mapping
for entity:
com.cl.myapp.core.rmgt.profile.business.object.RmgtProfileValidationBVOImpl
column: fk_profile_id (should be mapped with insert="false"
update="false")

Here are the relevant mapping parts:

RmgtProfile.hbm.xml:

```<code><hibernate-mapping>
    <class name="com.cl.myapp.core.rmgt.profile.business.object.RmgtProfileBVOImpl" table="rmgt_t_profile" proxy="com.cl.myapp.core.rmgt.profile.common.business.object.RmgtProfileBVO">
        <id name="rowguid" column="rowguid" type="java.lang.Long">
            <generator class="sequence">
                <param name="sequence_name">rmgt_t_profile_rowguid_seq</param>
            </generator>
        </id>
        <set name="profileValidations" table="rmgt_t_profile_validation" lazy="false" cascade="all-delete-orphan">
            <key column="fk_profile_id"  />
            <one-to-many class="com.cl.ilogic.core.rmgt.profile.business.object.RmgtProfileValidationBVOImpl"/>
        </set>
    </class>
</hibernate-mapping>
</code>```

VsValidationsVO.hbm.xml

```<code><hibernate-mapping>
    <class name="com.cl.myapp.core.vs.business.object.VsValidationBVOImpl" table="vs_t_validation" proxy="com.cl.myapp.core.vs.common.business.object.VsValidationBVO">
        <id name="rowguid" column="rowguid" type="java.lang.Long">
            <generator class="sequence">
                <param name="sequence_name">vs_t_validation_rowguid_seq</param>
            </generator>
        </id>

            <set name="profileValidations" table="rmgt_t_profile_validation" lazy="false" cascade="all-delete-orphan" >
        <key column="fk_validation_id"/>
        <one-to-many class="com.cl.myapp.core.rmgt.profile.business.object.RmgtProfileValidationBVOImpl"/>
    </set>

    </class>
</hibernate-mapping>
</code>```

And the mapping table:

```<code>@Entity
@IdClass(RmgtProfileValidationId.class)
@Table(name = "rmgt_t_profile_validation")
@Proxy(proxyClass = RmgtProfileValidationBVO.class)
public class RmgtProfileValidationBVOImpl implements RmgtProfileValidationBVO {

    @Id
    @NotNull
    @Column(name="fk_profile_id")
    private Long profileId;

    @Id
    @NotNull
    @Column(name="fk_validation_id")
    private Long validationId;

    @Column(name = "pv_post_import")
    private Boolean pvPostImport;

    /..getter/setter omitted
}
</code>```

The IdClass:

```<code>public class RmgtProfileValidationId implements Serializable {
    private static final long serialVersionUID = 6805524598016438604L;

    private Long profileId;

    private Long validationId;

    public RmgtProfileValidationId(Long profileId, Long validationId) {
        this.profileId = profileId;
        this.validationId = validationId;
    }

    public RmgtProfileValidationId() {
    }

    public Long getProfileId() {
        return profileId;
    }

    public void setProfileId(Long profileId) {
        this.profileId = profileId;
    }

    public Long getValidationId() {
        return validationId;
    }

    public void setValidationId(Long validationId) {
        this.validationId = validationId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
        RmgtProfileValidationId entity = (RmgtProfileValidationId) o;
        return Objects.equals(this.profileId, entity.profileId) &&
                Objects.equals(this.validationId, entity.validationId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(profileId, validationId);
    }

}
</code>```

I can't see more than 1 occurrence where I map the fk_profile_id. Where does this error come from?

Body:
I try to map two tables

Profile - profile_validation - Validation

with a mapping table /link table and I get this error during start of Wildfly:

Caused by: org.hibernate.MappingException: Repeated column in mapping
for entity:
com.cl.myapp.core.rmgt.profile.business.object.RmgtProfileValidationBVOImpl
column: fk_profile_id (should be mapped with insert="false"
update="false")

Here are the relevant mapping parts:

RmgtProfile.hbm.xml:

<hibernate-mapping>
    <class name="com.cl.myapp.core.rmgt.profile.business.object.RmgtProfileBVOImpl" table="rmgt_t_profile" proxy="com.cl.myapp.core.rmgt.profile.common.business.object.RmgtProfileBVO">
        <id name="rowguid" column="rowguid" type="java.lang.Long">
            <generator class="sequence">
                <param name="sequence_name">rmgt_t_profile_rowguid_seq</param>
            </generator>
        </id>
        <set name="profileValidations" table="rmgt_t_profile_validation" lazy="false" cascade="all-delete-orphan">
            <key column="fk_profile_id"  />
            <one-to-many class="com.cl.ilogic.core.rmgt.profile.business.object.RmgtProfileValidationBVOImpl"/>
        </set>
    </class>
</hibernate-mapping>

VsValidationsVO.hbm.xml

<hibernate-mapping>
    <class name="com.cl.myapp.core.vs.business.object.VsValidationBVOImpl" table="vs_t_validation" proxy="com.cl.myapp.core.vs.common.business.object.VsValidationBVO">
        <id name="rowguid" column="rowguid" type="java.lang.Long">
            <generator class="sequence">
                <param name="sequence_name">vs_t_validation_rowguid_seq</param>
            </generator>
        </id>

            <set name="profileValidations" table="rmgt_t_profile_validation" lazy="false" cascade="all-delete-orphan" >
        <key column="fk_validation_id"/>
        <one-to-many class="com.cl.myapp.core.rmgt.profile.business.object.RmgtProfileValidationBVOImpl"/>
    </set>

    </class>
</hibernate-mapping>

And the mapping table:

@Entity
@IdClass(RmgtProfileValidationId.class)
@Table(name = "rmgt_t_profile_validation")
@Proxy(proxyClass = RmgtProfileValidationBVO.class)
public class RmgtProfileValidationBVOImpl implements RmgtProfileValidationBVO {

    @Id
    @NotNull
    @Column(name="fk_profile_id")
    private Long profileId;

    @Id
    @NotNull
    @Column(name="fk_validation_id")
    private Long validationId;

    @Column(name = "pv_post_import")
    private Boolean pvPostImport;

    /..getter/setter omitted
}

The IdClass:

public class RmgtProfileValidationId implements Serializable {
    private static final long serialVersionUID = 6805524598016438604L;

    private Long profileId;

    private Long validationId;

    public RmgtProfileValidationId(Long profileId, Long validationId) {
        this.profileId = profileId;
        this.validationId = validationId;
    }

    public RmgtProfileValidationId() {
    }

    public Long getProfileId() {
        return profileId;
    }

    public void setProfileId(Long profileId) {
        this.profileId = profileId;
    }

    public Long getValidationId() {
        return validationId;
    }

    public void setValidationId(Long validationId) {
        this.validationId = validationId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
        RmgtProfileValidationId entity = (RmgtProfileValidationId) o;
        return Objects.equals(this.profileId, entity.profileId) &&
                Objects.equals(this.validationId, entity.validationId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(profileId, validationId);
    }

}

I can't see more than 1 occurrence where I map the fk_profile_id. Where does this error come from?


问:
How to calculate a FUE in SAP S/4HANA user
We are doing a greenfield of an SAP S/4HANA implementation and were wondering if users how could one determine how much of an FUE is being used.

Looking at SAP documentation and it is vague at best. Also asked in forums and networking events with clear answers.


问:
Scheduling execution of a Vertex AI notebook returns error: "2: Unknown Error.: Unable to submit schedule"
I'm using GCP's Vertex AI Workbench to develop ML code in a Managed Notebook. The notebook execution works just fine both when run interactively, and when run by an Executor with Type: "One-time execution" from the notebook's web interface.

On the other hand, whenever I select Type: "Schedule-based recurring executions" and click on SUBMIT, it hangs for about 30 seconds with the message "Submitting schedule", then it fails with the following error:

2: Unknown Error.: Unable to submit schedule

All the parameters of the execution are the same in both cases.

I believe there must be something very obvious that I'm missing here, but couldn't really find anything useful in the documentation nor anywhere else.

EDIT:

This is the full log of the error, which I also find not helpful:

```<code>{
  "protoPayload": {
    "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
    "status": {
      "code": 2,
      "message": "Error 0: googleapi: Error 503: The service is currently unavailable.\nDetails:\n[\n  {\n    \"@type\": \"type.googleapis.com/google.rpc.DebugInfo\",\n    \"detail\": \"[ORIGINAL ERROR] RPC::DEADLINE_EXCEEDED: Deadline exceeded while waiting for channels to become available, and/or be able to accept RPCs. Channel count = 0. Queue size = 0. Deadline=28.992677276s; Extensible Stubs capped the outgoing deadline: see go/stubs-longest-allowed-deadline; \\ncom.google.net.rpc3.RpcException: DEADLINE_EXCEEDED: Deadline exceeded while waiting for channels to become available, and/or be able to accept RPCs. Channel count = 0. Queue size = 0. Deadline=28.992677276s; Extensible Stubs capped the outgoing deadline: see go/stubs-longest-allowed-deadline; \\n\\tat com.google.apphosting.admin.mixer.actions.CreateApplicationAction.checkRpcPresentStatus(CreateApplicationAction.java:194)\\n\\tSuppressed: com.google.common.labs.concurrent.LabsFutures$LabeledExecutionException: GraphFuture{key=@com.google.apphosting.admin.mixer.actions.CreateApplicationAction$CreateReturnMessage com.google.protobuf.Message} failed: com.google.net.rpc3.RpcException: DEADLINE_EXCEEDED: Deadline exceeded while waiting for channels to become available, and/or be able to accept RPCs. Channel count = 0. Queue size = 0. Deadline=28.992677276s; Extensible Stubs capped the outgoing deadline: see go/stubs-longest-allowed-deadline; \\n\"\n  }\n]\n, backendError"
    },
    "authenticationInfo": {
      "principalEmail": "xxxxxxxxxx@developer.gserviceaccount.com",
      "serviceAccountDelegationInfo": [
        {
          "firstPartyPrincipal": {
            "principalEmail": "xxxxxxxxxx@gcp-sa-notebooks.iam.gserviceaccount.com"
          }
        }
      ]
    },
    "requestMetadata": {
      "requestAttributes": {},
      "destinationAttributes": {}
    },
    "serviceName": "notebooks.googleapis.com",
    "methodName": "google.cloud.notebooks.v1.NotebookService.CreateSchedule",
    "resourceName": "projects/MY-PROJECT/locations/europe-west4/schedules/test_rnn_aria__1673534440196",
    "resourceLocation": {
      "currentLocations": [
        "europe-west4"
      ]
    }
  },
  "insertId": "184n01ud3oul",
  "resource": {
    "type": "audited_resource",
    "labels": {
      "method": "google.cloud.notebooks.v1.NotebookService.CreateSchedule",
      "service": "notebooks.googleapis.com",
      "project_id": "MY-PROJECT"
    }
  },
  "timestamp": "2023-01-12T14:42:42.563449708Z",
  "severity": "ERROR",
  "logName": "projects/MY-PROJECT/logs/cloudaudit.googleapis.com%2Factivity",
  "operation": {
    "id": "projects/MY-PROJECT/locations/europe-west4/operations/operation-XXXXXXXXXX",
    "producer": "notebooks.googleapis.com",
    "last": true
  },
  "receiveTimestamp": "2023-01-12T14:42:43.526355300Z"
}
</code>```

Appreciate your help!

Body:
I'm using GCP's Vertex AI Workbench to develop ML code in a Managed Notebook. The notebook execution works just fine both when run interactively, and when run by an Executor with Type: "One-time execution" from the notebook's web interface.

On the other hand, whenever I select Type: "Schedule-based recurring executions" and click on SUBMIT, it hangs for about 30 seconds with the message "Submitting schedule", then it fails with the following error:

2: Unknown Error.: Unable to submit schedule

All the parameters of the execution are the same in both cases.

I believe there must be something very obvious that I'm missing here, but couldn't really find anything useful in the documentation nor anywhere else.

EDIT:

This is the full log of the error, which I also find not helpful:

{
  "protoPayload": {
    "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
    "status": {
      "code": 2,
      "message": "Error 0: googleapi: Error 503: The service is currently unavailable.\nDetails:\n[\n  {\n    \"@type\": \"type.googleapis.com/google.rpc.DebugInfo\",\n    \"detail\": \"[ORIGINAL ERROR] RPC::DEADLINE_EXCEEDED: Deadline exceeded while waiting for channels to become available, and/or be able to accept RPCs. Channel count = 0. Queue size = 0. Deadline=28.992677276s; Extensible Stubs capped the outgoing deadline: see go/stubs-longest-allowed-deadline; \\ncom.google.net.rpc3.RpcException: DEADLINE_EXCEEDED: Deadline exceeded while waiting for channels to become available, and/or be able to accept RPCs. Channel count = 0. Queue size = 0. Deadline=28.992677276s; Extensible Stubs capped the outgoing deadline: see go/stubs-longest-allowed-deadline; \\n\\tat com.google.apphosting.admin.mixer.actions.CreateApplicationAction.checkRpcPresentStatus(CreateApplicationAction.java:194)\\n\\tSuppressed: com.google.common.labs.concurrent.LabsFutures$LabeledExecutionException: GraphFuture{key=@com.google.apphosting.admin.mixer.actions.CreateApplicationAction$CreateReturnMessage com.google.protobuf.Message} failed: com.google.net.rpc3.RpcException: DEADLINE_EXCEEDED: Deadline exceeded while waiting for channels to become available, and/or be able to accept RPCs. Channel count = 0. Queue size = 0. Deadline=28.992677276s; Extensible Stubs capped the outgoing deadline: see go/stubs-longest-allowed-deadline; \\n\"\n  }\n]\n, backendError"
    },
    "authenticationInfo": {
      "principalEmail": "xxxxxxxxxx@developer.gserviceaccount.com",
      "serviceAccountDelegationInfo": [
        {
          "firstPartyPrincipal": {
            "principalEmail": "xxxxxxxxxx@gcp-sa-notebooks.iam.gserviceaccount.com"
          }
        }
      ]
    },
    "requestMetadata": {
      "requestAttributes": {},
      "destinationAttributes": {}
    },
    "serviceName": "notebooks.googleapis.com",
    "methodName": "google.cloud.notebooks.v1.NotebookService.CreateSchedule",
    "resourceName": "projects/MY-PROJECT/locations/europe-west4/schedules/test_rnn_aria__1673534440196",
    "resourceLocation": {
      "currentLocations": [
        "europe-west4"
      ]
    }
  },
  "insertId": "184n01ud3oul",
  "resource": {
    "type": "audited_resource",
    "labels": {
      "method": "google.cloud.notebooks.v1.NotebookService.CreateSchedule",
      "service": "notebooks.googleapis.com",
      "project_id": "MY-PROJECT"
    }
  },
  "timestamp": "2023-01-12T14:42:42.563449708Z",
  "severity": "ERROR",
  "logName": "projects/MY-PROJECT/logs/cloudaudit.googleapis.com%2Factivity",
  "operation": {
    "id": "projects/MY-PROJECT/locations/europe-west4/operations/operation-XXXXXXXXXX",
    "producer": "notebooks.googleapis.com",
    "last": true
  },
  "receiveTimestamp": "2023-01-12T14:42:43.526355300Z"
}

Appreciate your help!


问:
How to consume all the messages from RabbitMQ queue
I'm trying to consume all the messages from RabbitMQ queue, that queue contains N number of messages, I just want to read all the messages in my java code.

The below Approach I'm trying in my Project

I have defined the RabbitMQ configuration in my application.properties file, I didn't show it here

The below class is already exists in my my project

```<code>import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.*;
import org.springframework.amqp.rabbit.transaction.RabbitTransactionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.*;

@Configuration
@ConditionalOnClass(EnableRabbit.class)
public class RabbitConfiguration {
    @Autowired
    private ConnectionFactory connectionFactory;
    @Bean
    public RabbitTransactionManager rabbitTransactionManager() {
        return new RabbitTransactionManager(connectionFactory);
    }
    @Bean
    public RabbitAdmin rabbitAdmin() {
        return new RabbitAdmin(connectionFactory);
    }
}
</code>```

In my another class, I have implemented the below method to read all messages from that queue

```<code>@Autowired
private RabbitAdmin rabbitAdmin;

private void getMessages() {
        int messageCount = rabbitAdmin.getQueueInfo("test_queue").getMessageCount();
        if(messageCount > 0) {
            System.out.println("Message Count :::: " + messageCount);
        }
    }
</code>```

Using this rabbitAdmin I can able to get the messages count, but how to read the actual messages? Is there any possibility available to read all the messages. I searched lot, but I couldn't find the solution

Please help me to resolve this. Thanks

Body:
I'm trying to consume all the messages from RabbitMQ queue, that queue contains N number of messages, I just want to read all the messages in my java code.

The below Approach I'm trying in my Project

I have defined the RabbitMQ configuration in my application.properties file, I didn't show it here

The below class is already exists in my my project

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.*;
import org.springframework.amqp.rabbit.transaction.RabbitTransactionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.*;

@Configuration
@ConditionalOnClass(EnableRabbit.class)
public class RabbitConfiguration {
    @Autowired
    private ConnectionFactory connectionFactory;
    @Bean
    public RabbitTransactionManager rabbitTransactionManager() {
        return new RabbitTransactionManager(connectionFactory);
    }
    @Bean
    public RabbitAdmin rabbitAdmin() {
        return new RabbitAdmin(connectionFactory);
    }
}

In my another class, I have implemented the below method to read all messages from that queue

@Autowired
private RabbitAdmin rabbitAdmin;

private void getMessages() {
        int messageCount = rabbitAdmin.getQueueInfo("test_queue").getMessageCount();
        if(messageCount > 0) {
            System.out.println("Message Count :::: " + messageCount);
        }
    }

Using this rabbitAdmin I can able to get the messages count, but how to read the actual messages? Is there any possibility available to read all the messages. I searched lot, but I couldn't find the solution

Please help me to resolve this. Thanks


问:
glTexSubImage2D with target: GL_TEXTURE_1D_ARRAY
(The same could be asked for: "glTexSubImage3D with target: GL_TEXTURE_2D_ARRAY")

Do i understand this correctly?

If you have allocate:

```<code>int levels = 1;
int width  = 5;
int layers = 3;
glTexStorage2D(GL_TEXTURE_1D_ARRAY, levels, GL_R8, width, layers);
</code>```

And upload:

```<code>int level = 0; // mipmap-level
int x_off = 2;
int y_off = 1;
int width = 3;
int height = 2;

byte[] data = {255, 255, 255, 255, 255, 255}; // (3 * 2) 6 pixels

glTexSubImage2D(GL_TEXTURE_1D_ARRAY,level,x_off,y_off,width,height,GL_RED,GL_UNSIGNED_BYTE,data);
</code>```

Will the "green slots" be the affected pixels of the transfer?

The bottom row (y = 0) is the first array.

This should also be the case if the target was: GL_TEXTURE_2D ?

Body:
(The same could be asked for: "glTexSubImage3D with target: GL_TEXTURE_2D_ARRAY")

Do i understand this correctly?

If you have allocate:

int levels = 1;
int width  = 5;
int layers = 3;
glTexStorage2D(GL_TEXTURE_1D_ARRAY, levels, GL_R8, width, layers);

And upload:

int level = 0; // mipmap-level
int x_off = 2;
int y_off = 1;
int width = 3;
int height = 2;

byte[] data = {255, 255, 255, 255, 255, 255}; // (3 * 2) 6 pixels

glTexSubImage2D(GL_TEXTURE_1D_ARRAY,level,x_off,y_off,width,height,GL_RED,GL_UNSIGNED_BYTE,data);

Will the "green slots" be the affected pixels of the transfer?

The bottom row (y = 0) is the first array.

This should also be the case if the target was: GL_TEXTURE_2D ?


问:
Adding two tabs to text in R string
I am replacing " o " with new line character, a carriage return and two tabs and the o. It works except I'm only getting one tab, why? How can I specify two tabs since \t\t does not work.</p>
```<code>data.frame(lapply(dfClean[,selectCols], gsub, pattern = " o ", replacement = "\r\n\t\to ", perl = TRUE))
</code>```

Title: Adding two tabs to text in R string

Body:
I am replacing " o " with new line character, a carriage return and two tabs and the o. It works except I'm only getting one tab, why? How can I specify two tabs since \t\t does not work.

data.frame(lapply(dfClean[,selectCols], gsub, pattern = " o ", replacement = "\r\n\t\to ", perl = TRUE))


问:
How to predict multiple attributes using XGboost in python?
I have a dataset with three input variables: lat, lon and angle. I would like to predict the same number of attributes, however, it only predicts the first attribute.

This is my code:

```<code>dat = np.array(gt2[['lat','lng']]/100000000)
dat=np.concatenate((dat,gt2[['angle']]),axis=1)

for num in range(10,101):
    raw= dat[0:num]
    X = raw[:-1]
    y = raw[1:]
    xg_reg = xgb.XGBRegressor()
    dist=[]
    for i in range (0,10):
        xg_reg.fit(X,y)  # training
        pred = xg_reg.predict([dat[(num-1)+i]])
        print(pred)
        dst=hs.haversine(( pred[0,0] , pred[0,1] ),( dat[num+i,0] , dat[num+i,1] ), unit=Unit.METERS)
        dist.append(dst)
        X = np.append(X, pred, axis=0)
        y = np.append(y, pred, axis=0)
    if ((dist[0]<dist[1])and(dist[1]<dist[2])and(dist[2]<dist[3])and(dist[3]<dist[4])and(dist[4]<dist[5])and(dist[0]<1)and(dist[1]<1)and(dist[2]<1)and(dist[3]<1)and(dist[4]<1)):
        print(num)
        print('1', dist[0],'2', dist[1],'3', dist[2],'4', dist[3],'5', dist[4])
</code>```

The content of pred is:

```<code>array([41.319782], dtype=float32)
</code>```

and the content of dat[(num-1)+i]:

```<code>array([ 41.32287833,   2.01513931, 133.2584301 ])
</code>```

Any idea?

Update

I've tried using a single value to use as train and label, below the example:

The dataframe is the following:

```<code><class 'pandas.core.series.Series'>
0    14215279993634829673
1    14215279993634774575
2    14215279993657262886
3    14215279993655650232
4    14215279993656041129
5    14215279993653034890
6    14215279993663569327
7    14215279993664053186
8    14215279993308738063
9    14215279993308129682
Name: gh, dtype: uint64
</code>```

However, it fails in the fit function with this error:

```<code>XGBoostError: [18:23:06] /workspace/src/objective/regression_obj.cu:65: Check failed: preds.Size() == info.labels_.Size() (1 vs. 9) : labels are not correctly providedpreds.size=1, label.size=9
Stack trace:
</code>```

Body:
I have a dataset with three input variables: lat, lon and angle. I would like to predict the same number of attributes, however, it only predicts the first attribute.

This is my code:

dat = np.array(gt2[['lat','lng']]/100000000)
dat=np.concatenate((dat,gt2[['angle']]),axis=1)

for num in range(10,101):
    raw= dat[0:num]
    X = raw[:-1]
    y = raw[1:]
    xg_reg = xgb.XGBRegressor()
    dist=[]
    for i in range (0,10):
        xg_reg.fit(X,y)  # training
        pred = xg_reg.predict([dat[(num-1)+i]])
        print(pred)
        dst=hs.haversine(( pred[0,0] , pred[0,1] ),( dat[num+i,0] , dat[num+i,1] ), unit=Unit.METERS)
        dist.append(dst)
        X = np.append(X, pred, axis=0)
        y = np.append(y, pred, axis=0)
    if ((dist[0]<dist[1])and(dist[1]<dist[2])and(dist[2]<dist[3])and(dist[3]<dist[4])and(dist[4]<dist[5])and(dist[0]<1)and(dist[1]<1)and(dist[2]<1)and(dist[3]<1)and(dist[4]<1)):
        print(num)
        print('1', dist[0],'2', dist[1],'3', dist[2],'4', dist[3],'5', dist[4])

The content of pred is:

array([41.319782], dtype=float32)

and the content of dat[(num-1)+i]:

array([ 41.32287833,   2.01513931, 133.2584301 ])

Any idea?

Update

I've tried using a single value to use as train and label, below the example:

The dataframe is the following:

<class 'pandas.core.series.Series'>
0    14215279993634829673
1    14215279993634774575
2    14215279993657262886
3    14215279993655650232
4    14215279993656041129
5    14215279993653034890
6    14215279993663569327
7    14215279993664053186
8    14215279993308738063
9    14215279993308129682
Name: gh, dtype: uint64

However, it fails in the fit function with this error:

XGBoostError: [18:23:06] /workspace/src/objective/regression_obj.cu:65: Check failed: preds.Size() == info.labels_.Size() (1 vs. 9) : labels are not correctly providedpreds.size=1, label.size=9
Stack trace:


问:
Connecting to local ElasticSearch and getting <ConnectionError: other side closed> despite beng able to access ES
This is the following code I'm using to connect to the ES

```<code>const client = new Client({
    node: 'http://localhost:9200',
    // caFingerprint: <caFingerprint>,
    auth: {
    username: <username>,
    password: <password>},
    tls: {
        rejectUnauthorized: false
    }
})
</code>```

I can connect to my local Elasticsearch server through my browser, but when I do so through code, I get a connection error saying the server has closed.

I'm using Elasticsearch 8.6.0 and running my ES on localhost:9200, and executing using:

npx ts-node src/index.ts

Body:
This is the following code I'm using to connect to the ES

const client = new Client({
    node: 'http://localhost:9200',
    // caFingerprint: <caFingerprint>,
    auth: {
    username: <username>,
    password: <password>},
    tls: {
        rejectUnauthorized: false
    }
})

I can connect to my local Elasticsearch server through my browser, but when I do so through code, I get a connection error saying the server has closed.

I'm using Elasticsearch 8.6.0 and running my ES on localhost:9200, and executing using:

npx ts-node src/index.ts


问:
How to predict and visualize the national daily vaccination count for the next three months?
First,we have the statistic of national daily vaccinations in the past three months even earlier if necessary.We are going to establish a prediction modal to predict the numbers in the next three months based on the statistics we already have.Secondly,to show the increasing trend clearly,we want to visualize the numbers of daily vaccinations in the next three months.

We've tried Time Series Models but find that they are not very suitable for these questions.
We need a Mathematical Model as detailed as possible to achieve this.THANK YOU!


问:
Has my application been started by CreateObject?
Can I find out whether my C++ MFC COM server has been started by hand or by a call of CreateObject()?


问:
Polar plot labels
I would like to build a polar plot and I used a script similar to one of another discussion. However I'm not able to increase the distance of the letters (representing the categories) from the border;
Below you can find the data and the script.

```<code>library(tidyverse)
dd <- tibble(category = c('A', 'B', 'C'), value = c(2, 7, 4))

coord_straightpolar <- function(theta = 'x', start = 0, direction = 1, clip = "on") {
theta <- match.arg(theta, c("x", "y"))
r <- if (theta == "x")
         "y"
     else "x"
ggproto(NULL, CoordPolar, theta = theta, r = r, start = start,
      direction = sign(direction), clip = clip,
      # This is the different bit
      is_linear = function(){TRUE})
}

ggplot(dd, aes(x = category, y = value, group=1)) +
coord_straightpolar(theta = 'x') +
geom_polygon(color = 'blue', alpha = 0.0001) +
scale_y_continuous(limits = c(0, NA)) +
geom_point() +
theme(panel.grid.major= element_line(color="grey", linewidth=0.6),
    axis.text.y = element_blank(),
    axis.ticks.y = element_blank(),
    axis.text.x = element_text(vjust = 10, size=13),
    legend.position = "none"
</code>```

)

To increase the distance of the letters I tried with axis.text = element_text(vjust=10) but without success.
Thank you for your help!

Title: Polar plot labels

Body:
I would like to build a polar plot and I used a script similar to one of another discussion. However I'm not able to increase the distance of the letters (representing the categories) from the border;
Below you can find the data and the script.

library(tidyverse)
dd <- tibble(category = c('A', 'B', 'C'), value = c(2, 7, 4))

coord_straightpolar <- function(theta = 'x', start = 0, direction = 1, clip = "on") {
theta <- match.arg(theta, c("x", "y"))
r <- if (theta == "x")
         "y"
     else "x"
ggproto(NULL, CoordPolar, theta = theta, r = r, start = start,
      direction = sign(direction), clip = clip,
      # This is the different bit
      is_linear = function(){TRUE})
}

ggplot(dd, aes(x = category, y = value, group=1)) +
coord_straightpolar(theta = 'x') +
geom_polygon(color = 'blue', alpha = 0.0001) +
scale_y_continuous(limits = c(0, NA)) +
geom_point() +
theme(panel.grid.major= element_line(color="grey", linewidth=0.6),
    axis.text.y = element_blank(),
    axis.ticks.y = element_blank(),
    axis.text.x = element_text(vjust = 10, size=13),
    legend.position = "none"

)

To increase the distance of the letters I tried with axis.text = element_text(vjust=10) but without success.
Thank you for your help!


问:
Python. Open file > read line > open URLS from file
I am newbie in Python, but i am trying create my own desktop app for massive screenshots creating from urls link in TXT or others file and i stuck.

I stuck in file dialoge.

```<code>from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import webbrowser
root = Tk()
root.title("Name")
root.geometry("700x400")
def open_file():
    filepath = filedialog.askopenfiles()
open_button = ttk.Button(text="Choose File", command=open_file)
open_button.grid(column=0, row=10, padx=295, pady=355, ipadx=10, ipady=10)
root.mainloop()
</code>```

So did i get it right. I have filedialog.askopenfiles() for file dialoge (choose files) and i need add line read from my file, coz i need python see URLS and read it, after that i need import webbrowser and loop all line for TXT or other files urls to open it on my browser.

But i really cant get it.. How i can link webbrowser+ urls from my txt file and open all web-site

After that i need make a screenchots for each website.

Can anybody help with, at least, with openingn all links from file i choose in file dialoge.

Sorry for my bad english, i hope you get it.

Body:
I am newbie in Python, but i am trying create my own desktop app for massive screenshots creating from urls link in TXT or others file and i stuck.

I stuck in file dialoge.

from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import webbrowser
root = Tk()
root.title("Name")
root.geometry("700x400")
def open_file():
    filepath = filedialog.askopenfiles()
open_button = ttk.Button(text="Choose File", command=open_file)
open_button.grid(column=0, row=10, padx=295, pady=355, ipadx=10, ipady=10)
root.mainloop()

So did i get it right. I have filedialog.askopenfiles() for file dialoge (choose files) and i need add line read from my file, coz i need python see URLS and read it, after that i need import webbrowser and loop all line for TXT or other files urls to open it on my browser.

But i really cant get it.. How i can link webbrowser+ urls from my txt file and open all web-site

After that i need make a screenchots for each website.

Can anybody help with, at least, with openingn all links from file i choose in file dialoge.

Sorry for my bad english, i hope you get it.


问:
Bundle with Buffer polyfill with TSUP (ESBUILD)
I've been struggling with bundlers for a while now. I'm working on a library built on top of another. It is a bunch of React components.

I'm currently using tsup and I managed to make a bundle correctly, but it requires some actions on Client side due the dependencies.

Any developer using my library currently has to add the polyfills necessary and also define global to be Window. I know that there is a huge debate about what libs supposed to bundle and most of the opinions are leaned to let the user handle the polyfills.

But I want, at least for now, bundle the dependencies in my package so no actions are required from whoever is using my lib.

I found a couple of ESBUILD plugins that claims to add the dependencies, but the problem still until the polifyll is added on the project using the lib. Any advices?


问:
Is it possible to have a docker image with Bachmann solution center configured?
Noob in both docker and PLC programming.

Just like how we configure dependencies in the dockerfile for SW programming ( for eg: python version, some packages), would it be possible to have a dockerfile with MBase / Bachmann solution center configured?
If yes, could any of you provide some hints?

Total beginner, please explain if the conceptual understanding of the topic is incorrect?


问:
How to change the color of a tkinter button by external means
I'm creating an application where buttons are created and deleted according to demand, I would like to find a way to change its theme, in case a new file is added to the folder that labels the button

```<code>import threading
from tkinter import*
from tkinter.ttk import *

root = tk.Tk()

def Hide_elemen(widget): # function to hide unused buttons

    widget.grid_forget()

def show_element(widget, colum, row):
    widget.grid(column=colum, row=row, sticky='nsew')

def update_buttons():

    buttons= sorted(glob.glob('data/*'))

    if len(buttons) >= 1:
        Name = buttons[0].replace('buttons\\','')
        show_element(button1, 0, 0)
        subfolder = sorted(glob.glob(f'{buttons[0]}\*'))
        if len(subfolder ) > 0:
            style = Style()
            style.configure('TButton', font = ('calibri', 10, 'bold', ), foreground = 'green')
            button1.configure(text=Name)
        else:
            style = Style()
            style.configure('TButton', font = ('calibri', 10), foreground = 'Black')
            button1.configure(text=Name)
    else:
        Hide_elemen(button1)

    if len(botoes) >= 2:
        Nome = botoes[1].replace('botoes\\','')
        Mostrar_elemento(Botao2, 1, 0)
        subpasta = sorted(glob.glob(f'{botoes[1]}\*'))
        if len(subpasta) > 0:
            style = Style()
            style.configure('TButton', font = ('calibri', 10, 'bold', ), foreground = 'green')
            Botao2.configure(text=Nome )
        else:
            style = Style()
            style.configure('TButton', font = ('calibri', 10), foreground = 'Black')
            Pista_2.configure(text=Nome)
    else:
        Hide_elemen(Botao2).configure(text=completo)

def monitor_events():
    while True:
        folders= sorted(glob.glob('folders\*'))
        update_buttons()
        while True:
            folders2 = sorted(glob.glob('folders\*'))
            if folders2 != folders:
                break
            for folder in folders2:
                subfolders = sorted(glob.glob(f'{folder}\*'))
                if len(subfolders) > 0:
                    return monitor_events()()

button1 = ttk.Button(frame, textvariable='', command=lambda: Esconder())
button1.grid(row=0, column=0)

button2 = ttk.Button(frame, textvariable='', command=lambda: Mostrar_elemento())
button2.grid(row=0, column=1)

threading.Thread(target=monitor_events).start()

root.mainloop()
</code>```

with this I want that, when a folder is created a button appears, if the folder is deleted the button is deleted, if a sub folder is created the style of the associated button is changed
this interface must work together with another application that automatically updates all folders and subfolders

Body:
I'm creating an application where buttons are created and deleted according to demand, I would like to find a way to change its theme, in case a new file is added to the folder that labels the button

import threading
from tkinter import*
from tkinter.ttk import *

root = tk.Tk()

def Hide_elemen(widget): # function to hide unused buttons

    widget.grid_forget()

def show_element(widget, colum, row):
    widget.grid(column=colum, row=row, sticky='nsew')

def update_buttons():

    buttons= sorted(glob.glob('data/*'))

    if len(buttons) >= 1:
        Name = buttons[0].replace('buttons\\','')
        show_element(button1, 0, 0)
        subfolder = sorted(glob.glob(f'{buttons[0]}\*'))
        if len(subfolder ) > 0:
            style = Style()
            style.configure('TButton', font = ('calibri', 10, 'bold', ), foreground = 'green')
            button1.configure(text=Name)
        else:
            style = Style()
            style.configure('TButton', font = ('calibri', 10), foreground = 'Black')
            button1.configure(text=Name)
    else:
        Hide_elemen(button1)

    if len(botoes) >= 2:
        Nome = botoes[1].replace('botoes\\','')
        Mostrar_elemento(Botao2, 1, 0)
        subpasta = sorted(glob.glob(f'{botoes[1]}\*'))
        if len(subpasta) > 0:
            style = Style()
            style.configure('TButton', font = ('calibri', 10, 'bold', ), foreground = 'green')
            Botao2.configure(text=Nome )
        else:
            style = Style()
            style.configure('TButton', font = ('calibri', 10), foreground = 'Black')
            Pista_2.configure(text=Nome)
    else:
        Hide_elemen(Botao2).configure(text=completo)

def monitor_events():
    while True:
        folders= sorted(glob.glob('folders\*'))
        update_buttons()
        while True:
            folders2 = sorted(glob.glob('folders\*'))
            if folders2 != folders:
                break
            for folder in folders2:
                subfolders = sorted(glob.glob(f'{folder}\*'))
                if len(subfolders) > 0:
                    return monitor_events()()

button1 = ttk.Button(frame, textvariable='', command=lambda: Esconder())
button1.grid(row=0, column=0)

button2 = ttk.Button(frame, textvariable='', command=lambda: Mostrar_elemento())
button2.grid(row=0, column=1)

threading.Thread(target=monitor_events).start()

root.mainloop()

with this I want that, when a folder is created a button appears, if the folder is deleted the button is deleted, if a sub folder is created the style of the associated button is changed
this interface must work together with another application that automatically updates all folders and subfolders


问:
Connecting to pyspark running in a container from other container without Java
I have a docker container which contains pyspark. It is working correctly but I want to connect to it and launch spark script from another container. I created small script to test the connection.

```<code>import pyspark
conf = pyspark.SparkConf().setAppName('MyApp').setMaster('spark://myspark:7077')
sc = pyspark.SparkContext(conf=conf)
</code>```

However I get error RuntimeError: Java gateway process exited before sending its port number.
This is probably because I don't have Java installed in my other container. Installing it in this container is not an option. Is there a way to connect to it and execute a pyspark script without Java?

Body:
I have a docker container which contains pyspark. It is working correctly but I want to connect to it and launch spark script from another container. I created small script to test the connection.

import pyspark
conf = pyspark.SparkConf().setAppName('MyApp').setMaster('spark://myspark:7077')
sc = pyspark.SparkContext(conf=conf)

However I get error RuntimeError: Java gateway process exited before sending its port number.
This is probably because I don't have Java installed in my other container. Installing it in this container is not an option. Is there a way to connect to it and execute a pyspark script without Java?


问:
How to remove/refuse to extract Nvidia geForce from 'Safely Remove Hardware'
I was installing Nvidia GeForce rtx 3050 ti laptop GPU driver yesterday, and I accidentally pressed the 'Extract' option instead of the 'Install' option while installing the driver for Windows 10. Now, the Nvidia GeForce is shown in 'Safely Remove Hardware' in the taskbar (right bottom corner). How to reject from it there?

...see the textenter image description here


问:
Switching transparency of webp images on and off on a website
I’ve got some images composed in Adobe Photoshop that contain a background layer and an object in a foreground layer. These images I would like to use in webp format in a website project:

The image should be displayed with transparency — i.e. the background of the image should be transparent, showing the underlying color of the html element — but when hovered over the image, the transparency should be disabled and therefore the background layer of the image is shown.

How can this reliably be done with JavaScript or any other web technology?
Note: I would like to avoid uploading two image versions


问:
403 status when attempting to connect to Sharepoint online using httr
I am attempting to use R to automate pulling some views from our company's Sharepoint online.  When I try to authenticate I get a 403 code with an error:

```<code>[1] "917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically."
</code>```

I don't have this problem when authenticating to our Sharepoint on-premise.

The code that works for pulling from my on-premise site is:

```<code>url<- "https://xx.xx.xx/sites/RAH/Lists/RCA/AllItems.aspx"
test <- GET(url, authenticate("user", "pass", "any")
</code>```

I've tried a few other ways as well such as:

```<code>test <- read.table(
  text = getURL(
    url,
    userpwd = paste0("user", ":", "pass")
  ),
  header = TRUE,
  sep = ","
)
</code>```

and

```<code>URL = "https://xx.xx.xx/sites/RAH/Lists/RCA/AllItems.aspx"
rawData = getURL(URL,userpwd="user:pass")
</code>```

and both of those return an error

```<code>schannel: CertGetCertificateChain trust error CERT_TRUST_IS_UNTRUSTED_ROOT
</code>```

I have very little Sharepoint knowledge and experience.  Anyone have any guidance on how to authenticate for me?

**Edit:  We have an Excel app written in VBA that does this just fine but I don't know VBA and the the guy who wrote it will be retiring soon.  Looking through his code it doesn't look like he has to authenticate at all, but I'm assuming that's because it's already been authenticated by being logged into 365.  Again, not my wheelhouse I'm just taking guesses here.

Body:
I am attempting to use R to automate pulling some views from our company's Sharepoint online.  When I try to authenticate I get a 403 code with an error:

[1] "917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically."

I don't have this problem when authenticating to our Sharepoint on-premise.

The code that works for pulling from my on-premise site is:

url<- "https://xx.xx.xx/sites/RAH/Lists/RCA/AllItems.aspx"
test <- GET(url, authenticate("user", "pass", "any")

I've tried a few other ways as well such as:

test <- read.table(
  text = getURL(
    url,
    userpwd = paste0("user", ":", "pass")
  ),
  header = TRUE,
  sep = ","
)

and

URL = "https://xx.xx.xx/sites/RAH/Lists/RCA/AllItems.aspx"
rawData = getURL(URL,userpwd="user:pass")

and both of those return an error

schannel: CertGetCertificateChain trust error CERT_TRUST_IS_UNTRUSTED_ROOT

I have very little Sharepoint knowledge and experience.  Anyone have any guidance on how to authenticate for me?

**Edit:  We have an Excel app written in VBA that does this just fine but I don't know VBA and the the guy who wrote it will be retiring soon.  Looking through his code it doesn't look like he has to authenticate at all, but I'm assuming that's because it's already been authenticated by being logged into 365.  Again, not my wheelhouse I'm just taking guesses here.


问:
"undefined named operand" error in C assembly
I'm trying to create a function using assembly like so :

```<code>void asm_loop ( int n ){

 register int *p1 asm ("r2") = &n;

    asm goto (
    " cmp r2 , #0 \n\t" // Compare n to "0"
    " beq %l[ stop]" // Abort if n=0
    :
    : [ num_repeats ] "r" ( p1 )
    :
    :stop);
stop:
    return ;

}

</code>```

I have the following error and don't understand why :

```<code>error: undefined named operand ' stop '

</code>```

I use gcc version upper than 4.5 so "asm goto" is included.

Does anyone have an idea on how to fix this? As it's a label i don't understand how i can define it.

Thank you in advance.

I tried searching for more information on https://gcc.gnu.org/onlinedocs/gcc-7.5.0/gcc/Extended-Asm.html#Extended-Asm.

But they seem to use this function the same way as I do :

```<code>int frob(int x)
{
  int y;
  asm goto ("frob %%r5, %1; jc %l[error]; mov (%2), %%r5"
            : /* No outputs. */
            : "r"(x), "r"(&y)
            : "r5", "memory"
            : error);
  return y;
error:
  return -1;
}
</code>```

Body:
I'm trying to create a function using assembly like so :

void asm_loop ( int n ){

 register int *p1 asm ("r2") = &n;

    asm goto (
    " cmp r2 , #0 \n\t" // Compare n to "0"
    " beq %l[ stop]" // Abort if n=0
    :
    : [ num_repeats ] "r" ( p1 )
    :
    :stop);
stop:
    return ;

}

I have the following error and don't understand why :

error: undefined named operand ' stop '

I use gcc version upper than 4.5 so "asm goto" is included.

Does anyone have an idea on how to fix this? As it's a label i don't understand how i can define it.

Thank you in advance.

I tried searching for more information on https://gcc.gnu.org/onlinedocs/gcc-7.5.0/gcc/Extended-Asm.html#Extended-Asm.

But they seem to use this function the same way as I do :

int frob(int x)
{
  int y;
  asm goto ("frob %%r5, %1; jc %l[error]; mov (%2), %%r5"
            : /* No outputs. */
            : "r"(x), "r"(&y)
            : "r5", "memory"
            : error);
  return y;
error:
  return -1;
}


问:
where can I find an entire list of Microsoft knowledge base IDs

I'd like to analyze the security issue of each version of Microsoft products.

My research shows that the Microsoft KB articles contains the update that fix certain vulnerabilities of some vers. of some MS products. I also notice that most old KBs are abandoned.

for example: KB5012170, in this page, MS provided fix some of vulns in some versions of Windows.

I can also search the KBid on this page.

Question: but I cannot find a full list of KBid or KB articles.

edited 20230112: I found this page: https://www.catalog.update.microsoft.com/home.aspx I can search by KBid here but it looks like a 20 year old website.


问:
Is Beam Search a deep learning tool?
I've been working on the Beam Search algorithm for a scheduling problem
I have a question about it, is a a Deep Learning tool (as it uses RNN) or an AI heuristic ?

Thank you

I still cannot understand fully the difference between AI and Deep learning

Title: Is Beam Search a deep learning tool?


问:
How to change the selection of the second picker after changing the first picker?
Here I'm trying to create the first little app that helps to convert a value from one unit of measurement to another.
The first conversion picker helps me to select data for the second picker(from which measure I'm going to converse) and the third picker(to which measure I'm going converse).
But when I'm changing the first picker - it doesn't change the @State value of the second and third pickers. I tried different approaches but the result is the same. Could you please help me?

```<code>struct ContentView: View {
    @State private var userInput = 0.0

    @State var selectionOfTypeOfConversion: Conversions = .temperature
    @State var selectionFromConversion: String = TemperatureConversions.celsius.rawValue
    @State var selectionToConversion: String = TemperatureConversions.celsius.rawValue
    @FocusState private var inputIsFocused: Bool

    var output: Double {
        //doing all counting
    }

    var body: some View {
        VStack {
            NavigationView {
                Form {
                    Section {
                        Picker("Type of conversion", selection: $selectionOfTypeOfConversion) {
                            ForEach(Conversions.allCases, id: \.self) {
                                Text($0.rawValue)

                            }
                        }.onSubmit {
                            checkConvention()
                        }
                        TextField("", value: $userInput, format: .number)
                            .keyboardType(.decimalPad)
                            .focused($inputIsFocused)
                        Picker("From conversion", selection: $selectionFromConversion) {
                            switch selectionOfTypeOfConversion {
                            case Conversions.temperature:
                                ForEach(TemperatureConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            case Conversions.length:
                                ForEach(LengthConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            case Conversions.volume:
                                ForEach(VolumeConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            }
                        }
                    } header: {
                        Text("From")
                    }

                    Section {
                        Picker("To conversion", selection: $selectionToConversion) {
                            switch selectionOfTypeOfConversion {
                            case Conversions.temperature:
                                ForEach(TemperatureConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            case Conversions.length:
                                ForEach(LengthConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            case Conversions.volume:
                                ForEach(VolumeConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            }
                        }
                        Text(output, format: .number)
                    } header: {
                        Text("To")
                    }
                }
                .toolbar {
                    ToolbarItemGroup(placement: .keyboard) {
                        Spacer()
                        Button("Done") {
                            inputIsFocused = false
                        }
                    }
                }
            }
        }
    }

    private func checkConvention() {
        if selectionOfTypeOfConversion == Conversions.temperature {
            selectionFromConversion = TemperatureConversions.celsius.rawValue
            selectionToConversion = TemperatureConversions.celsius.rawValue
        } else if selectionOfTypeOfConversion == Conversions.length{
            selectionFromConversion =  LengthConversions.meters.rawValue
            selectionToConversion = LengthConversions.meters.rawValue
        } else if selectionOfTypeOfConversion == Conversions.volume{
            selectionFromConversion =  VolumeConversions.milliliters.rawValue
            selectionToConversion = VolumeConversions.milliliters.rawValue
        }
    }

}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

enum Conversions: String, CaseIterable {
    case temperature = "temperature"
    case length = "length"
    case volume = "volume"
}

enum TemperatureConversions: String, CaseIterable {
    var id: Self { self }

    case celsius = "celsius"
    case fahrenheit = "fahrenheit"
    case kelvin = "kelvin"
}

enum LengthConversions: String, CaseIterable {
    var id: Self { self }

    case meters = "meters"
    case feet = "feet"
    case miles = "miles"
}

enum VolumeConversions: String, CaseIterable {
    var id: Self { self }

    case milliliters = "ml"
    case pints = "pints"
    case gallons = "gallons"
}

</code>```

Expecting: change the formula which counts input into output.

Body:
Here I'm trying to create the first little app that helps to convert a value from one unit of measurement to another.
The first conversion picker helps me to select data for the second picker(from which measure I'm going to converse) and the third picker(to which measure I'm going converse).
But when I'm changing the first picker - it doesn't change the @State value of the second and third pickers. I tried different approaches but the result is the same. Could you please help me?

struct ContentView: View {
    @State private var userInput = 0.0

    @State var selectionOfTypeOfConversion: Conversions = .temperature
    @State var selectionFromConversion: String = TemperatureConversions.celsius.rawValue
    @State var selectionToConversion: String = TemperatureConversions.celsius.rawValue
    @FocusState private var inputIsFocused: Bool

    var output: Double {
        //doing all counting
    }

    var body: some View {
        VStack {
            NavigationView {
                Form {
                    Section {
                        Picker("Type of conversion", selection: $selectionOfTypeOfConversion) {
                            ForEach(Conversions.allCases, id: \.self) {
                                Text($0.rawValue)

                            }
                        }.onSubmit {
                            checkConvention()
                        }
                        TextField("", value: $userInput, format: .number)
                            .keyboardType(.decimalPad)
                            .focused($inputIsFocused)
                        Picker("From conversion", selection: $selectionFromConversion) {
                            switch selectionOfTypeOfConversion {
                            case Conversions.temperature:
                                ForEach(TemperatureConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            case Conversions.length:
                                ForEach(LengthConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            case Conversions.volume:
                                ForEach(VolumeConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            }
                        }
                    } header: {
                        Text("From")
                    }

                    Section {
                        Picker("To conversion", selection: $selectionToConversion) {
                            switch selectionOfTypeOfConversion {
                            case Conversions.temperature:
                                ForEach(TemperatureConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            case Conversions.length:
                                ForEach(LengthConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            case Conversions.volume:
                                ForEach(VolumeConversions.allCases, id: \.self) {
                                    Text($0.rawValue).tag($0.rawValue)
                                }
                            }
                        }
                        Text(output, format: .number)
                    } header: {
                        Text("To")
                    }
                }
                .toolbar {
                    ToolbarItemGroup(placement: .keyboard) {
                        Spacer()
                        Button("Done") {
                            inputIsFocused = false
                        }
                    }
                }
            }
        }
    }

    private func checkConvention() {
        if selectionOfTypeOfConversion == Conversions.temperature {
            selectionFromConversion = TemperatureConversions.celsius.rawValue
            selectionToConversion = TemperatureConversions.celsius.rawValue
        } else if selectionOfTypeOfConversion == Conversions.length{
            selectionFromConversion =  LengthConversions.meters.rawValue
            selectionToConversion = LengthConversions.meters.rawValue
        } else if selectionOfTypeOfConversion == Conversions.volume{
            selectionFromConversion =  VolumeConversions.milliliters.rawValue
            selectionToConversion = VolumeConversions.milliliters.rawValue
        }
    }

}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

enum Conversions: String, CaseIterable {
    case temperature = "temperature"
    case length = "length"
    case volume = "volume"
}

enum TemperatureConversions: String, CaseIterable {
    var id: Self { self }

    case celsius = "celsius"
    case fahrenheit = "fahrenheit"
    case kelvin = "kelvin"
}

enum LengthConversions: String, CaseIterable {
    var id: Self { self }

    case meters = "meters"
    case feet = "feet"
    case miles = "miles"
}

enum VolumeConversions: String, CaseIterable {
    var id: Self { self }

    case milliliters = "ml"
    case pints = "pints"
    case gallons = "gallons"
}

Expecting: change the formula which counts input into output.


问:
dumpsys prints nothing for a service
I have a service that shows up in the list when I run dumpsys -l but when I run dumpsys <myServiceName> it prints nothing at all.  What does this tell me about <myServiceName>? Is the service not running? And if that is the case, why does it still show up in the output of dumpsys -l?

Title: dumpsys prints nothing for a service


问:
Docusaurus: Adding Coveo Search code. Where should these pieces go
I'm working through a Coveo Atomic tutorial here: https://levelup.coveo.com/learn/courses/atomic/lessons/lesson-0-setup-and-initializing-the-search-interface In their example they show setting up the initialization code in your index.html file like the following:

```<code><!DOCTYPE html>
<html>
  <head>
    <script
      type="module"
      src="https://static.cloud.coveo.com/atomic/v2/atomic.esm.js"
    ></script>
    <link
      rel="stylesheet"
      href="https://static.cloud.coveo.com/atomic/v2/themes/coveo.css"
    />
    <link
      rel="stylesheet"
      href="style.css"
    />
    <script>
      (async () => {
        await customElements.whenDefined("atomic-search-interface");
        const searchInterface = document.querySelector("#search");

        await searchInterface.initialize({
          accessToken: "xx29e62e9b-f739-4886-b433-c9326cc1b492",
          organizationId: "docsdemoslhkhaxyy",
        });
        searchInterface.executeFirstSearch();
      })();
    </script>
  </head>
  <body>
    <atomic-search-interface id="search">
      <atomic-search-layout>
      <!-- all Atomic components will go in here -->
      </atomic-search-layout>
    </atomic-search-interface>
  </body>
</html>
</code>```

For the code that goes in the head element, should i put that in the head element of the index.js file in the pages directory? For the code that goes into the body element, where should i put that, in the Docusaurus files? Is there an overall best practices when implementing something like this in Docusaurus? This is the first time I've tried this so I apologize up front for even more newbie questions than usual.

I would have thought that putting this code in the index.js file would be correct?

Body:
I'm working through a Coveo Atomic tutorial here: https://levelup.coveo.com/learn/courses/atomic/lessons/lesson-0-setup-and-initializing-the-search-interface In their example they show setting up the initialization code in your index.html file like the following:

<!DOCTYPE html>

    <link
      rel="stylesheet"
      href="https://static.cloud.coveo.com/atomic/v2/themes/coveo.css"
    />
    <link
      rel="stylesheet"
      href="style.css"
    />

    <atomic-search-interface id="search">
      <atomic-search-layout>

      </atomic-search-layout>
    </atomic-search-interface>

For the code that goes in the head element, should i put that in the head element of the index.js file in the pages directory? For the code that goes into the body element, where should i put that, in the Docusaurus files? Is there an overall best practices when implementing something like this in Docusaurus? This is the first time I've tried this so I apologize up front for even more newbie questions than usual.

I would have thought that putting this code in the index.js file would be correct?


问:
Django : What is the difference in the return output from the post method and form_valid method?
I have a form to upload a file. This file is stored in a azure blob storage without using media folders.

In the html, the form send the request to a specific FormView :

```<code><form action="{% url 'intervenant_upload' id_intervenant %}"
        method="post"
        enctype="multipart/form-data"
        id="form-file-upload">
    {% csrf_token %}
    {{ form|crispy }}
    <div class="row">
      <button
        type="submit"
        class="btn btn-primary btn-block"
        id="submitupload"
      >
        Charger
        <i class="bi bi-upload" style="font-size: 17px"></i>
      </button>
    </div>
  </form>
</code>```

The view (in Class Base View) works well, it fills the database and upload the file to the blob storage. However I have a problem when I do the return to end the process. I got this error :

```<code>didn't return an HttpResponse object. It returned None instead.
</code>```

I do not understand why because I have the impression to respect the structure of the FormView according thie website https://ccbv.co.uk/

Here is the my FormView that does not work :

```<code>class IntervenantFormUpload(FormView) :
    model       = FilesIntervenants
    form_class  = FilesIntervenantForm

    def get_success_url(self) :
        return reverse('intervenants_image_upload', kwargs={'pk': self.id_intervenant})

    def setup(self, request, *args, **kwargs) :
        self.id_intervenant = kwargs['pk']
        self.user = request.session.get('user')
        return super().setup(request, *args, **kwargs)

    def post(self, request, *args, **kwargs) :
        form = self.form_class(request.POST, request.FILES)

        if form.is_valid() :
            self.form_valid(form)
        else :
            self.form_invalid(form)

    def form_valid(self, form) :

        BLABLA-BLABLA-BLABLA
        return super(IntervenantFormUpload, self).form_valid(form)

    def form_invalid(self, request, form):
        context = self.get_context_data()
        context['form'] = form

        return render(request, 'upload/upload.html', context)
</code>```

However, when I do just a post method that return a redirect, it works. Here is the code that works :

```<code>class IntervenantFormUpload(FormView) :
    model       = FilesIntervenants
    form_class  = FilesIntervenantForm

    def post(self, request, *args, **kwargs) :
        form = self.form_class(request.POST, request.FILES)
        files_selected = self.request.FILES.getlist('Filename')

        if form.is_valid():
            return  redirect(reverse('intervenants_image_upload', kwargs={  'pk': self.id_intervenant}))
</code>```

So what is the difference ?

Thank you

Body:
I have a form to upload a file. This file is stored in a azure blob storage without using media folders.

In the html, the form send the request to a specific FormView :

<form action="{% url 'intervenant_upload' id_intervenant %}"
        method="post"
        enctype="multipart/form-data"
        id="form-file-upload">
    {% csrf_token %}
    {{ form|crispy }}

      <button
        type="submit"
        class="btn btn-primary btn-block"
        id="submitupload"
      >
        Charger

      </button>

  </form>

The view (in Class Base View) works well, it fills the database and upload the file to the blob storage. However I have a problem when I do the return to end the process. I got this error :

didn't return an HttpResponse object. It returned None instead.

I do not understand why because I have the impression to respect the structure of the FormView according thie website https://ccbv.co.uk/

Here is the my FormView that does not work :

class IntervenantFormUpload(FormView) :
    model       = FilesIntervenants
    form_class  = FilesIntervenantForm

    def get_success_url(self) :
        return reverse('intervenants_image_upload', kwargs={'pk': self.id_intervenant})

    def setup(self, request, *args, **kwargs) :
        self.id_intervenant = kwargs['pk']
        self.user = request.session.get('user')
        return super().setup(request, *args, **kwargs)

    def post(self, request, *args, **kwargs) :
        form = self.form_class(request.POST, request.FILES)

        if form.is_valid() :
            self.form_valid(form)
        else :
            self.form_invalid(form)

    def form_valid(self, form) :

        BLABLA-BLABLA-BLABLA
        return super(IntervenantFormUpload, self).form_valid(form)

    def form_invalid(self, request, form):
        context = self.get_context_data()
        context['form'] = form

        return render(request, 'upload/upload.html', context)

However, when I do just a post method that return a redirect, it works. Here is the code that works :

class IntervenantFormUpload(FormView) :
    model       = FilesIntervenants
    form_class  = FilesIntervenantForm

    def post(self, request, *args, **kwargs) :
        form = self.form_class(request.POST, request.FILES)
        files_selected = self.request.FILES.getlist('Filename')

        if form.is_valid():
            return  redirect(reverse('intervenants_image_upload', kwargs={  'pk': self.id_intervenant}))

So what is the difference ?

Thank you


问:
UnityEditor build errors
I am currently developing a VR application for Oculus Quest 2. Whenever I try to build and run I get this error message:

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors   at
UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer
(UnityEditor.BuildPlayerOptions options) [0x002da] in
<4e64905d831f4883a53259ef37fb023b>:0    at
UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean
askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions)
[0x00080] in <4e64905d831f4883a53259ef37fb023b>:0
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

Do anybody know what to do with this?

I dont know what to do about this issue. It works on my other projects with the same build settings.

Title: UnityEditor build errors