In SQL Server, data returned by sys.dm_os_performance_counters for “SQLServer:Broker Statistics” is not changing over time

In SQL Server (Microsoft SQL Server 2016 (SP2-CU10) (KB4524334) – 13.0.5492.2 (X64)), I’m trying to determine just how much activity our Service Broker queues are processing. One tactic is to use sys.dm_os_performance_counters, and the stats in “SQLServer:Broker Statistics”.

I am definitely getting data (no “zero rows” problem), and there is definitely significant activity on the queues… but the values returned are not changing over time.

For example, over the past 12+ hours, counter_name Enqueued TransmissionQ Msgs/sec returns 12502, and this number has not changed.

I haven’t been able to find any references on this online. Any idea what might cause this?

sql server – Need help with JOIN I should be using as values are in columns are changing to find difference in tables

how can i compare text info using joins here as parentid & id of node will be the identifying factor for difference and also the text ?

columns are

RID  ConfigFileID  ID(xml child node)  ParentID(xml parent node)  Path  Text

My query showing wrong results . Ideally should show 2 rows for which text is missing or addition:

select * from XML_table a 
left join xml_table b
where a.ConfigFileInfoID = 55187765 and b.ConfigFileInfoID = 55205283
    and =
    and a.text != b.text 
    and a.parentid ! = b.parentid
    and a.path ! = b.path

(data in xml table is just english text for which i need to find difference)

RID ConfigID ID parentId Path


RID ConfigID ID parentid Path Text

333570 55187765 36 28 configuration/system.web/customErrors NULL

347804 55205283 36 0 configuration/system.serviceModel NULL

My final query should display the difference this way ..the path is different and ID & parent ID should be different to identify that there is a difference. RID & Config ID will keep changing anyway .The path is almost the same but changes in the final file.the key is to know what changed in path and I need to find difference in text too( here null but sometimes there are different texts)

How can I make dynamically changing functions?

I am trying to do transfer matrix calculations (optics), where I have a layered sample and want to calculate how light propagates through it, depending on some parameters:

enter image description here

The charm of the method is that you can do a matrix multiplication for every subsequent layer, no matter how many layers you have; you just need a transition matrix T between every layer and a propagation matrix P for passing through the layer, which can be easily defined. An exemplary transfer matrix of a single layer with air on both sides would look like this:
M(some properties) := T(air properties,layer properties).P(layer properties).T(layer properties,air properties)

What I want to do now is a script, where you can give a number of layers such as n=3 and the transfer matrix will be automatically generated (of course you have to give a list of parameters as well).
I thought of doing this recursively with a for-loop, such as:

For(i=1, i<n+1, i++, M(..) := M(..).P(properties i).T(properties i, properties i+1));

but this does not seem to work, probably because I am declaring a function M and then overwrite it (M is initialized as a unity matrix before this function).

The thing is, for a higher number of layers the transition matrix becomes a bit unhandy, and even more so if you want to edit it manually. I was hoping to generate this function dynamically from the input of n and a list of material properties and then store it in a file, to be able to transfer it to a different script later.

Is there a way to do this? Where did I go wrong? I know that := is used to delay the calculation of the value (effectively making the thing left of it a function) and that does not seem suited for recursive use… but I also tried different variations and nothing worked.
Also, the input parameters of the function in the brackets M(...) will probably be a problem, because it will be more parameters for each layer. Can I bridge this? I know that I can input anything into a function but I need to name it, because I need the values at specific points of the function.

Somehow I can’t believe that Mathematica does not support the dynamic generation of functions depending on input, it seems like such an obvious thing to me. I tried to search for solutions but the name of the Dynamic() function interferes with my search and I couldn’t think of a better word to describe the type of function that I want.

Any help would be greatly appreciated!

python – Changing the dimension (axis) of the dataframe

I know the community hate people uploading a image, but it is hard to explain without showing the dataframe I have.
enter image description here

is there any way that I can group the data by the columns ‘Open’,’High’,’Low’,’Close’,’Adj Close’,’Volume’ ,’Symbol’ like this:
enter image description here

Have been browsing through pandas documentation for days and tried plenty methods but still dont work. Thank you and sorry for uploading image.

associations – Mapping on changing list

for those who have seen it, I have deleted my previous question, as suggested by @Αλέξανδρος Ζεγγ,

The goal :

Modifying dynamically the association on which a mapping is done

I try to give you a concrete example:

When I do this :

 S = Association();
AssociateTo(S, {1 -> "one", 2 -> "two", 3 -> "three"})

While(Length(S) > 0,
 (KeyDropFrom(S, Keys(S)((#)));
    Print(S);) & /@ Range(Length(Keys(S))))

The output is :

    Out(19)= <|1 -> "one", 2 -> "two", 3 -> "three"|>

During evaluation of In(18):= <|2->two,3->three|>

During evaluation of In(18):= <|2->two|>

During evaluation of In(18):= Part::partw: Part 3 of {2} does not exist.

During evaluation of In(18):= <|2->two|>

During evaluation of In(18):= <||>

As you can see, mathematica does not understand that I want S to be modfied dynamically, S is only evaluated once a the beginning of the mapping :
the desired output would be just <||>, with no errors.
I just want to modify dynamically the association on which the mapping is done, my goal is not to delete all the keys of an association

Can anyone help me ?

thank you in advance.

rust – changing values in a vector

Collect the iterator into the new vector

You don’t need to loop over a range to populate a vector with elements. The collect method has enough information to construct a Vec<u64> on the spot. This also makes the result variable unnecessary.

    pub fn new(length: u64) -> QuickFind {
        QuickFind {
            items: (0..length).collect(),


The convention for getter names is without the prefix get_, unless get makes up the entire method name. get_items(&self) becomes items(&self).

Reconsider usize as the index type.

There appear to be multiple conversions from u64 to usize in the code. Indeed, usize is the common integral type for referring to a relative (non-negative) position of a value in memory. With that done, the only integer cast is in new, so as to turn the range (0..length) into a range of values rather than a range of indices.

The final code:


pub struct QuickFind {
    items: Vec<u64>,

impl QuickFind {
    pub fn new(length: usize) -> QuickFind {
        QuickFind {
            items: (0..length as u64).collect(),

    pub fn union(&mut self, left_index: usize, right_index: usize) {
        let left_group_id = self.items(left_index);

        self.items(right_index) = left_group_id;

    pub fn items(&self) -> &(u64) {

    pub fn is_connected(&self, left_index: usize, right_index: usize) -> bool {
        self.items(left_index) == self.items(right_index)