问:
Redis search with index giving inconsistent results
We are not able to get consistent searches to redis.

```<code>Redis server v=7.0.7 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=2260280010e18db8
</code>```
```<code>root@redis01:~# redis-cli
127.0.0.1:6379> info modules

module:name=ReJSON,ver=20008,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors]
module:name=search,ver=20405,api=1,filters=0,usedby=[],using=[ReJSON],options=[]
</code>```

We have exactly 5022786 key/value pairs, the same number of entries are on our 'idx36' index. There is no incoming traffic, so this dataset of 5022786 entries remains constant all the time.

```<code>127.0.0.1:6379> info keyspace

db0:keys=5022786,expires=5022786,avg_ttl=257039122
</code>```
```<code>127.0.0.1:6379> ft.info idx36
 1) index_name
 2) idx36
 3) index_options
 4) 1) "NOFREQS"
 5) index_definition
 6) 1) key_type
    2) HASH
    3) prefixes
    4) 1) 36|
    5) default_score
    6) "1"
 7) attributes
 8) 1) 1) identifier
       2) CheckIn
       3) attribute
       4) CheckIn
       5) type
       6) NUMERIC
    2) 1) identifier
       2) HotelCode
       3) attribute
       4) HotelCode
       5) type
       6) TAG
       7) SEPARATOR
       8)
 9) num_docs
10) "5022786"
11) max_doc_id
12) "12729866"
13) num_terms
14) "0"
15) num_records
16) "1.8446744073526942e+19"
17) inverted_sz_mb
18) "162.96730041503906"
19) vector_index_sz_mb
20) "0"
21) total_inverted_index_blocks
22) "17965200"
23) offset_vectors_sz_mb
24) "0"
25) doc_table_size_mb
26) "1843.12548828125"
27) sortable_values_size_mb
28) "0"
29) key_table_size_mb
30) "194.14376831054688"
31) records_per_doc_avg
32) "3672612012032"
33) bytes_per_record_avg
34) "9.2636185181071973e-12"
35) offsets_per_term_avg
36) "0"
37) offset_bits_per_record_avg
38) "-nan"
39) hash_indexing_failures
40) "333006"
41) indexing
42) "0"
43) percent_indexed
44) "1"
45) gc_stats
46)  1) bytes_collected
     2) "264321009"
     3) total_ms_run
     4) "1576438"
     5) total_cycles
     6) "5"
     7) average_cycle_time_ms
     8) "315287.59999999998"
     9) last_run_time_ms
    10) "706929"
    11) gc_numeric_trees_missed
    12) "0"
    13) gc_blocks_denied
    14) "23251"
47) cursor_stats
48) 1) global_idle
    2) (integer) 0
    3) global_total
    4) (integer) 0
    5) index_capacity
    6) (integer) 128
    7) index_total
    8) (integer) 0
</code>```

This index has a tag called 'HotelCode' and a numeric field called 'CheckIn'.

Now we try to search all entries that contain the string 'AO-B0' within 'HotelCode' (should be all):

```<code>127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2708499
</code>```

And now try to search all entries that don't contain the string 'AO-B0' within 'HotelCode' (should be 0):

```<code>127.0.0.1:6379> ft.search idx36 '-(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 0
</code>```

But these two searches don't sum the total number of entries. Even if I'm wrong and not all entries contain the 'AO-B0' string, If I repeat the first search the result changes every time:

```<code>127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2615799
(0.50s)
</code>```
```<code>127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2442799
(0.50s)
</code>```
```<code>127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2626299
(0.50s)
</code>```
```<code>127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2694899
(0.50s)
</code>```
```<code>127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2516699
(0.50s)
</code>```

If now I try this search, less restrictive, I should get more entries ... but not:

```<code>127.0.0.1:6379> ft.search idx36 '@HotelCode:{AO\-B*}' limit 0 0
1) (integer) 1806899
</code>```

Maybe I'm doing something wrong ... if someone can point me to the right way ...

Body:
We are not able to get consistent searches to redis.

Redis server v=7.0.7 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=2260280010e18db8

root@redis01:~# redis-cli
127.0.0.1:6379> info modules

module:name=ReJSON,ver=20008,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors]
module:name=search,ver=20405,api=1,filters=0,usedby=[],using=[ReJSON],options=[]

We have exactly 5022786 key/value pairs, the same number of entries are on our 'idx36' index. There is no incoming traffic, so this dataset of 5022786 entries remains constant all the time.

127.0.0.1:6379> info keyspace

db0:keys=5022786,expires=5022786,avg_ttl=257039122

127.0.0.1:6379> ft.info idx36
 1) index_name
 2) idx36
 3) index_options
 4) 1) "NOFREQS"
 5) index_definition
 6) 1) key_type
    2) HASH
    3) prefixes
    4) 1) 36|
    5) default_score
    6) "1"
 7) attributes
 8) 1) 1) identifier
       2) CheckIn
       3) attribute
       4) CheckIn
       5) type
       6) NUMERIC
    2) 1) identifier
       2) HotelCode
       3) attribute
       4) HotelCode
       5) type
       6) TAG
       7) SEPARATOR
       8)
 9) num_docs
10) "5022786"
11) max_doc_id
12) "12729866"
13) num_terms
14) "0"
15) num_records
16) "1.8446744073526942e+19"
17) inverted_sz_mb
18) "162.96730041503906"
19) vector_index_sz_mb
20) "0"
21) total_inverted_index_blocks
22) "17965200"
23) offset_vectors_sz_mb
24) "0"
25) doc_table_size_mb
26) "1843.12548828125"
27) sortable_values_size_mb
28) "0"
29) key_table_size_mb
30) "194.14376831054688"
31) records_per_doc_avg
32) "3672612012032"
33) bytes_per_record_avg
34) "9.2636185181071973e-12"
35) offsets_per_term_avg
36) "0"
37) offset_bits_per_record_avg
38) "-nan"
39) hash_indexing_failures
40) "333006"
41) indexing
42) "0"
43) percent_indexed
44) "1"
45) gc_stats
46)  1) bytes_collected
     2) "264321009"
     3) total_ms_run
     4) "1576438"
     5) total_cycles
     6) "5"
     7) average_cycle_time_ms
     8) "315287.59999999998"
     9) last_run_time_ms
    10) "706929"
    11) gc_numeric_trees_missed
    12) "0"
    13) gc_blocks_denied
    14) "23251"
47) cursor_stats
48) 1) global_idle
    2) (integer) 0
    3) global_total
    4) (integer) 0
    5) index_capacity
    6) (integer) 128
    7) index_total
    8) (integer) 0

This index has a tag called 'HotelCode' and a numeric field called 'CheckIn'.

Now we try to search all entries that contain the string 'AO-B0' within 'HotelCode' (should be all):

127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2708499

And now try to search all entries that don't contain the string 'AO-B0' within 'HotelCode' (should be 0):

127.0.0.1:6379> ft.search idx36 '-(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 0

But these two searches don't sum the total number of entries. Even if I'm wrong and not all entries contain the 'AO-B0' string, If I repeat the first search the result changes every time:

127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2615799
(0.50s)

127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2442799
(0.50s)

127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2626299
(0.50s)

127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2694899
(0.50s)

127.0.0.1:6379> ft.search idx36 '(@HotelCode:{AO\-B0})' limit 0 0
1) (integer) 2516699
(0.50s)

If now I try this search, less restrictive, I should get more entries ... but not:

127.0.0.1:6379> ft.search idx36 '@HotelCode:{AO\-B*}' limit 0 0
1) (integer) 1806899

Maybe I'm doing something wrong ... if someone can point me to the right way ...


来源: stackexchange

问:
AttributeError: 'Service' object has no attribute 'process'
I'm trying to take screenshot of a webpage using Selenium webdriver, but cannot get it to work. I've added firefox as a Path environment variable and rebooted my system, added specified the path of the Geckodriver, even tried doing the same with Chromedriver, but nothing seems to work. The code I've used is added below

```<code>from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary('C:\Program Files\Mozilla Firefox')
browser = webdriver.Firefox(executable_path=r'C:\Users\ris09\Desktop\ChessReader\geckodriver-v0.32.0-win32', firefox_binary=binary)
</code>```

Here's the error message that I'm getting:

AttributeError                            Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_15324\3615299261.py in
2
3 binary = FirefoxBinary('C:\Program Files\Mozilla Firefox')
----> 4 browser = webdriver.Firefox(executable_path=r'C:\Users\ris09\Desktop\ChessReader\geckodriver-v0.32.0-win32', firefox_binary=binary)

C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py in init(self, firefox_profile, firefox_binary, capabilities, proxy, executable_path, options, service_log_path, service_args, service, desired_capabilities, log_path, keep_alive)
190         if not self.service:
191             self.service = Service(executable_path, service_args=service_args, log_path=service_log_path)
--> 192         self.service.start()
193
194         executor = FirefoxRemoteConnection(

C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self)
102         count = 0
103         while True:
--> 104             self.assert_process_still_running()
105             if self.is_connectable():
106                 break

C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in assert_process_still_running(self)
113     def assert_process_still_running(self) -> None:
114         """Check if the underlying process is still running."""
--> 115         return_code = self.process.poll()
116         if return_code:
117             raise WebDriverException(f"Service {self.path} unexpectedly exited. Status code was: {return_code}")

AttributeError: 'Service' object has no attribute 'process'

ContentLicense: CC BY-SA 4.0

Body:
I'm trying to take screenshot of a webpage using Selenium webdriver, but cannot get it to work. I've added firefox as a Path environment variable and rebooted my system, added specified the path of the Geckodriver, even tried doing the same with Chromedriver, but nothing seems to work. The code I've used is added below

from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary('C:\Program Files\Mozilla Firefox')
browser = webdriver.Firefox(executable_path=r'C:\Users\ris09\Desktop\ChessReader\geckodriver-v0.32.0-win32', firefox_binary=binary)

Here's the error message that I'm getting:

AttributeError                            Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_15324\3615299261.py in
2
3 binary = FirefoxBinary('C:\Program Files\Mozilla Firefox')
----> 4 browser = webdriver.Firefox(executable_path=r'C:\Users\ris09\Desktop\ChessReader\geckodriver-v0.32.0-win32', firefox_binary=binary)

C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py in init(self, firefox_profile, firefox_binary, capabilities, proxy, executable_path, options, service_log_path, service_args, service, desired_capabilities, log_path, keep_alive)
190         if not self.service:
191             self.service = Service(executable_path, service_args=service_args, log_path=service_log_path)
--> 192         self.service.start()
193
194         executor = FirefoxRemoteConnection(

C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self)
102         count = 0
103         while True:
--> 104             self.assert_process_still_running()
105             if self.is_connectable():
106                 break

C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in assert_process_still_running(self)
113     def assert_process_still_running(self) -> None:
114         """Check if the underlying process is still running."""
--> 115         return_code = self.process.poll()
116         if return_code:
117             raise WebDriverException(f"Service {self.path} unexpectedly exited. Status code was: {return_code}")

AttributeError: 'Service' object has no attribute 'process'


问:
I need to change the colour of my CoreUI tooltip and also the width of it .reactJS
All the details are displaying correctly. I want to change the background colour and the width of the tooltip.

```<code>css file code for the tooltip
</code>```

```<code>> .discountTooltip {
  $tooltip-max-width: 250px;
  $tooltip-bg:white
}
</code>```

reactJS file code for the tooltip.Here please let me know whether I can change those using the CSS file or in another way

```<code> >   <CTooltip className="discountTooltip"
                                content={
                                  <>
                                    <CTable align="right" className="mb-0 mt-3 border-1" hover responsive bordered>
                                      <CTableHead color="dark">
                                        <CTableRow className="bannerItemsHeader">
                                          <CTableHeaderCell className="text-start">
                                            All Rules
                                          </CTableHeaderCell>
                                        </CTableRow>
                                      </CTableHead>

                                      <CTableBody>
                                        {item?.data?.map((rule, index) => (
                                          <CTableRow v-for="item in tableItems" key={index}>
                                            {rule?.discountType === 'FLAT_RATE' ? (
                                              <CTableDataCell className="text-center p-0">
                                                <CRow className="m-0 p-0 ">
                                                  <CCol className="p-0"></CCol>
                                                  {`${rule.trxStartAmount}-${rule.trxEndAmount} Rs ${props.rewardType === 'Discount'
                                                    ? rule.discountValue
                                                    : rule.bonusValue
                                                    }.00`}
                                                </CRow>
                                              </CTableDataCell>
                                            ) : (
                                              <CTableDataCell className="text-center p-0">
                                                <CRow className="m-0 p-0 ">
                                                  <CCol className="p-0"></CCol>
                                                  {`${rule.trxStartAmount}-${rule.trxEndAmount}  ${props.rewardType === 'Discount'
                                                    ? rule.discountValue
                                                    : rule.bonusValue
                                                    }% Max Rs ${props.rewardType === 'Discount'
                                                      ? rule.maxDiscountValue
                                                      : rule.maxBonusValue
                                                    }.00`}
                                                </CRow>
                                              </CTableDataCell>
                                            )}
                                          </CTableRow>
                                        ))}
                                      </CTableBody>
                                    </CTable>
                                  </>
                                }
                                placement="bottom"
                              >
                                <CCol>{item.type} </CCol>
                                {/* <span className="template-content">{item.discountType}</span>
                                 */}
                              </CTooltip>
</code>```

Body:
All the details are displaying correctly. I want to change the background colour and the width of the tooltip.

css file code for the tooltip

> .discountTooltip {
  $tooltip-max-width: 250px;
  $tooltip-bg:white
}

reactJS file code for the tooltip.Here please let me know whether I can change those using the CSS file or in another way

 >   <CTooltip className="discountTooltip"
                                content={
                                  <>
                                    <CTable align="right" className="mb-0 mt-3 border-1" hover responsive bordered>
                                      <CTableHead color="dark">
                                        <CTableRow className="bannerItemsHeader">
                                          <CTableHeaderCell className="text-start">
                                            All Rules
                                          </CTableHeaderCell>
                                        </CTableRow>
                                      </CTableHead>

                                      <CTableBody>
                                        {item?.data?.map((rule, index) => (
                                          <CTableRow v-for="item in tableItems" key={index}>
                                            {rule?.discountType === 'FLAT_RATE' ? (
                                              <CTableDataCell className="text-center p-0">
                                                <CRow className="m-0 p-0 ">
                                                  <CCol className="p-0"></CCol>
                                                  {`${rule.trxStartAmount}-${rule.trxEndAmount} Rs ${props.rewardType === 'Discount'
                                                    ? rule.discountValue
                                                    : rule.bonusValue
                                                    }.00`}
                                                </CRow>
                                              </CTableDataCell>
                                            ) : (
                                              <CTableDataCell className="text-center p-0">
                                                <CRow className="m-0 p-0 ">
                                                  <CCol className="p-0"></CCol>
                                                  {`${rule.trxStartAmount}-${rule.trxEndAmount}  ${props.rewardType === 'Discount'
                                                    ? rule.discountValue
                                                    : rule.bonusValue
                                                    }% Max Rs ${props.rewardType === 'Discount'
                                                      ? rule.maxDiscountValue
                                                      : rule.maxBonusValue
                                                    }.00`}
                                                </CRow>
                                              </CTableDataCell>
                                            )}
                                          </CTableRow>
                                        ))}
                                      </CTableBody>
                                    </CTable>
                                  </>
                                }
                                placement="bottom"
                              >
                                <CCol>{item.type} </CCol>
                                {/* {item.discountType}
                                 */}
                              </CTooltip>


问:
Maven executing all testng suites instead of single testng suite
In below folder
src/test/resources/testngsuites,

I have three testng xml file. I am passing specific testng xml during execution as below:

mvn clean test -DdefaultSuiteFiles=src/test/resources/testngsuites/UserIdentification.xml

But it is running all testng xml files available in that path.

My POM file:

```<code>
    <properties\>
    <defaultSuiteFiles\>sampletestng.xml\</defaultSuiteFiles\>
    <suiteFile\>${defaultSuiteFiles}\</suiteFile\>
    </properties\>

`<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${maven-surefire-plugin.version}</version>
    <configuration>
     <systemPropertyVariables>
                    <allure.results.directory>target/allure-results</allure.results.directory>
     </systemPropertyVariables>

     <suiteXmlFiles>
                    <suiteXmlFile>${defaultSuiteFiles}</suiteXmlFile>
     </suiteXmlFiles>

     <argLine>
                    -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
     </argLine>
      </configuration>
  <dependencies>
 <dependency>
 <groupId>org.aspectj</groupId>
 <artifactId>aspectjweaver</artifactId>
 <version>${aspectj.version}</version>
 </dependency>
 </dependencies>
  </plugin>`
</code>```

I have played with different options like directly defining parameter in plugin instead of properties and passed from command line but no luck.

```<code>`<suiteXmlFiles\>

 <!-- Pass testng.xml files as argument from command line -->

    <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>

</suiteXmlFiles\>`
</code>```

Tried this :

mvn clean test -Dsurefire.suiteXmlFiles=src/test/resources/testngsuites/UserIdentification.xml

And tried this:

mvn clean test -DsuiteXmlFile=src/test/resources/testngsuites/UserIdentification.xml

I have downgraded maven allure and maven  compile plugin and tried but not luck.

Body:
In below folder
src/test/resources/testngsuites,

I have three testng xml file. I am passing specific testng xml during execution as below:

mvn clean test -DdefaultSuiteFiles=src/test/resources/testngsuites/UserIdentification.xml

But it is running all testng xml files available in that path.

My POM file:

    <properties\>
    <defaultSuiteFiles\>sampletestng.xml\</defaultSuiteFiles\>
    <suiteFile\>${defaultSuiteFiles}\</suiteFile\>
    </properties\>

`<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${maven-surefire-plugin.version}</version>
    <configuration>
     <systemPropertyVariables>
                    <allure.results.directory>target/allure-results</allure.results.directory>
     </systemPropertyVariables>

     <suiteXmlFiles>
                    <suiteXmlFile>${defaultSuiteFiles}</suiteXmlFile>
     </suiteXmlFiles>

     <argLine>
                    -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
     </argLine>
      </configuration>
  <dependencies>
 <dependency>
 <groupId>org.aspectj</groupId>
 <artifactId>aspectjweaver</artifactId>
 <version>${aspectj.version}</version>
 </dependency>
 </dependencies>
  </plugin>`

I have played with different options like directly defining parameter in plugin instead of properties and passed from command line but no luck.

`<suiteXmlFiles\>

    <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>

</suiteXmlFiles\>`

Tried this :

mvn clean test -Dsurefire.suiteXmlFiles=src/test/resources/testngsuites/UserIdentification.xml

And tried this:

mvn clean test -DsuiteXmlFile=src/test/resources/testngsuites/UserIdentification.xml

I have downgraded maven allure and maven  compile plugin and tried but not luck.


问:
how to click the popwindow in the actionbar?
I have created action bar.in that when i click on one of the menu a pop window should be displayed.I have done that.But after the pop up window displays i am not able to perform other function in my action bar.howw can i acheive that.I have posted my code.</p>

```<code>public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

}

public void onTabSelected(Tab tab, FragmentTransaction ft) {

        mDisplayMode = tab.getPosition();
        System.out.println("text");

        // Do stuff based on new tab selected

    }

public void onTabUnselected(Tab tab, FragmentTransaction ft) {
    // Do Nothing

}

public void onTabReselected(Tab tab, FragmentTransaction ft) {
    // Do nothing

}*/

        ActionBar bar = getActionBar();

        bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        ActionBar.Tab tabA = bar.newTab().setText("Home");
        ActionBar.Tab tabB = bar.newTab().setText("Listings");
        ActionBar.Tab tabC = bar.newTab().setText("Remote");
        Fragment fragmentA = new ATab();
        Fragment fragmentB = new BTab();
        Fragment fragmentC = new CTab();
        bar.setDisplayShowHomeEnabled(true);
        tabA.setTabListener(new MyTabsListener(fragmentA));
        tabB.setTabListener(new MyTabsListener(fragmentB));
        tabC.setTabListener(new MyTabsListener(fragmentC));
        bar.addTab(tabA);
        bar.addTab(tabB);
        bar.addTab(tabC);

    }

    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.option, menu);

        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
        case R.id.settings:
            newGame();
            return true;
        case R.id.help:
            // showHelp();
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }

    private void newGame() {

         LayoutInflater inflater = (LayoutInflater)
           this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        PopupWindow pw = new PopupWindow(
           inflater.inflate(R.layout.settings, null, true), 300, 600, true);

        // The code below assumes that the root container has an id called 'main'

        pw.showAtLocation(this.findViewById(R.id.settings), Gravity.RIGHT, 0, 0);

    }

    protected class MyTabsListener implements ActionBar.TabListener {
        private Fragment mfragment;

        public MyTabsListener(Fragment fragment) {
            this.mfragment = fragment;

        }

        @Override
        public void onTabSelected(Tab tab, FragmentTransaction ft) {
            ft.add(R.id.fragment_place, mfragment, null);

        }

        @Override
        public void onTabReselected(Tab tab, FragmentTransaction ft) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onTabUnselected(Tab tab, FragmentTransaction ft) {
            // TODO Auto-generated method stub
            ft.remove(mfragment);

        }
    }
}
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I have created action bar.in that when i click on one of the menu a pop window should be displayed.I have done that.But after the pop up window displays i am not able to perform other function in my action bar.howw can i acheive that.I have posted my code.

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

}

public void onTabSelected(Tab tab, FragmentTransaction ft) {

        mDisplayMode = tab.getPosition();
        System.out.println("text");

        // Do stuff based on new tab selected

    }

public void onTabUnselected(Tab tab, FragmentTransaction ft) {
    // Do Nothing

}

public void onTabReselected(Tab tab, FragmentTransaction ft) {
    // Do nothing

}*/

        ActionBar bar = getActionBar();

        bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        ActionBar.Tab tabA = bar.newTab().setText("Home");
        ActionBar.Tab tabB = bar.newTab().setText("Listings");
        ActionBar.Tab tabC = bar.newTab().setText("Remote");
        Fragment fragmentA = new ATab();
        Fragment fragmentB = new BTab();
        Fragment fragmentC = new CTab();
        bar.setDisplayShowHomeEnabled(true);
        tabA.setTabListener(new MyTabsListener(fragmentA));
        tabB.setTabListener(new MyTabsListener(fragmentB));
        tabC.setTabListener(new MyTabsListener(fragmentC));
        bar.addTab(tabA);
        bar.addTab(tabB);
        bar.addTab(tabC);

    }

    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.option, menu);

        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
        case R.id.settings:
            newGame();
            return true;
        case R.id.help:
            // showHelp();
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }

    private void newGame() {

         LayoutInflater inflater = (LayoutInflater)
           this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        PopupWindow pw = new PopupWindow(
           inflater.inflate(R.layout.settings, null, true), 300, 600, true);

        // The code below assumes that the root container has an id called 'main'

        pw.showAtLocation(this.findViewById(R.id.settings), Gravity.RIGHT, 0, 0);

    }

    protected class MyTabsListener implements ActionBar.TabListener {
        private Fragment mfragment;

        public MyTabsListener(Fragment fragment) {
            this.mfragment = fragment;

        }

        @Override
        public void onTabSelected(Tab tab, FragmentTransaction ft) {
            ft.add(R.id.fragment_place, mfragment, null);

        }

        @Override
        public void onTabReselected(Tab tab, FragmentTransaction ft) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onTabUnselected(Tab tab, FragmentTransaction ft) {
            // TODO Auto-generated method stub
            ft.remove(mfragment);

        }
    }
}


问:
Add tabstops dynamically with HyperSnips
I am looking for a way to use HyperSnips to create tabstops dynamically. An example of what I would like to achieve is to write the following:

```<code>def(2)
</code>```

that would trigger the snippet below:

```<code>def ${1:func_name}(${2:arg0}, ${3:arg1}):
   """
   ${4:Function description}

   Args:
      ${2:arg0}: ${5:arg0_description}
      ${3:arg1}: ${6:arg1_description}

   Returns:
      ${7:Output_description}
   """
</code>```

My problem is that I could not find a way to dynamically create tabstops. The closest I could get to this result is this:

```<code>snippet `def\(\d+\)` "Function definition" A
def ${1:func_name}(``
let render = "";
let howMany = parseInt(m[1]);
for (let i = 0; i < howMany; i++) {
  render += "${"+parseInt(i+2)+": arg"+parseInt(i)+"}, ";
}
rv = render;
``):
    """
    """
    $0
endsnippet
</code>```

but tab stops do not occur when triggered. How could I overcome this behavior and achieve my goal?

Body:
I am looking for a way to use HyperSnips to create tabstops dynamically. An example of what I would like to achieve is to write the following:

def(2)

that would trigger the snippet below:

def ${1:func_name}(${2:arg0}, ${3:arg1}):
   """
   ${4:Function description}

   Args:
      ${2:arg0}: ${5:arg0_description}
      ${3:arg1}: ${6:arg1_description}

   Returns:
      ${7:Output_description}
   """

My problem is that I could not find a way to dynamically create tabstops. The closest I could get to this result is this:

snippet `def\(\d+\)` "Function definition" A
def ${1:func_name}(``
let render = "";
let howMany = parseInt(m[1]);
for (let i = 0; i < howMany; i++) {
  render += "${"+parseInt(i+2)+": arg"+parseInt(i)+"}, ";
}
rv = render;
``):
    """
    """
    $0
endsnippet

but tab stops do not occur when triggered. How could I overcome this behavior and achieve my goal?


问:
Multiple db connections symfony
I work with multiple db connections
should i use multiple  entity managers ?, and what can i do with mapping ?
i use the same entity folder but i need to connect to many DBs.

This is the file : config/packages/doctrine.yaml dbal

```<code>doctrine:
  dbal:
    default_connection: default
    connections:
      default:
        server_version: "%server_version%"
        driver: pdo_mysql
        url: '%env(resolve:DATABASE_URL)%'
      slave:
        server_version: "%server_version%"
        driver: pdo_mysql
        url: '%env(resolve:DATABASE_SLAVE_URL)%'
</code>```

orm part

```<code>  orm:
    auto_generate_proxy_classes: false
    default_entity_manager: default
    entity_managers:
      default:
        connection: default
        mappings:
          App:
            is_bundle: false
            type: annotation
            dir: '%kernel.project_dir%/src/Entity'
            prefix: 'App\Entity'
     slave:
       connection: default
</code>```

Title: Multiple db connections symfony

Body:
I work with multiple db connections
should i use multiple  entity managers ?, and what can i do with mapping ?
i use the same entity folder but i need to connect to many DBs.

This is the file : config/packages/doctrine.yaml dbal

doctrine:
  dbal:
    default_connection: default
    connections:
      default:
        server_version: "%server_version%"
        driver: pdo_mysql
        url: '%env(resolve:DATABASE_URL)%'
      slave:
        server_version: "%server_version%"
        driver: pdo_mysql
        url: '%env(resolve:DATABASE_SLAVE_URL)%'

orm part

  orm:
    auto_generate_proxy_classes: false
    default_entity_manager: default
    entity_managers:
      default:
        connection: default
        mappings:
          App:
            is_bundle: false
            type: annotation
            dir: '%kernel.project_dir%/src/Entity'
            prefix: 'App\Entity'
     slave:
       connection: default


问:
How do I post requests to GasBuddy's GraphQL API?
I saw that there was a way to request data by using a website's GraphQL API, but I'm unable to successfully query the data. Following this tutorial I'm unable to map the API via Apollo since they seem to have introspection disabled, but I pieced together what I've seen elsewhere using the Network data through Chrome's Inspect tool. Additionally, the ZIP_CODE is filled in with one I'm interested in.

Edit: The data I'm trying to extract is the Address of the station and the reported Price of regular gas.

Currently, I'm running the following script via Python:

```<code>import requests

url = "https://gasbuddy.com/graphql"
query = {
    "operationName": "LocationBySearchTerm",
    "variables": {
        "fuel": 1,
        "maxAge": 0,
        "search": "ZIP_CODE"
    },
     "query": """
query LocationBySearchTerm($brandId: Int, $cursor: String, $fuel: Int, $lat: Float, $lng: Float, $maxAge: Int, $search: String) {
  locationBySearchTerm(lat: $lat, lng: $lng, search: $search) {
    countryCode
    displayName
    latitude
    longitude
    regionCode
    stations(brandId: $brandId, cursor: $cursor, fuel: $fuel, maxAge: $maxAge) {
      count
      cursor {
        next
        __typename
      }
      results {
        address {
          country
          line1
          line2
          locality
          postalCode
          region
          __typename
        }
        badges {
          badgeId
          callToAction
          campaignId
          clickTrackingUrl
          description
          detailsImageUrl
          detailsImpressionTrackingUrls
          imageUrl
          impressionTrackingUrls
          targetUrl
          title
          __typename
        }
        brandings {
          brand_id
          branding_type
          __typename
        }
        brands {
          brand_id
          image_url
          name
          __typename
        }
        emergency_status {
          has_diesel {
            nick_name
            report_status
            update_date
            __typename
          }
          has_gas {
            nick_name
            report_status
            update_date
            __typename
          }
          has_power {
            nick_name
            report_status
            update_date
            __typename
          }
          __typename
        }
        enterprise
        fuels
        id
        name
        offers {
          discounts {
            grades
            highlight
            pwgbDiscount
            receiptDiscount
            __typename
          }
          highlight
          id
          types
          use
          __typename
        }
        pay_status {
          is_pay_available
          __typename
        }
        prices {
          cash {
            nickname
            posted_time
            price
            __typename
          }
          credit {
            nickname
            posted_time
            price
            __typename
          }
          discount
          fuel_product
          __typename
        }
        ratings_count
        star_rating
        __typename
      }
      __typename
    }
    trends {
      areaName
      country
      today
      todayLow
      trend
      __typename
    }
    __typename
}""",
}

response = requests.post(url, json=query)
print(response.json())
</code>```

I receive a JSONDecodeError: Expecting value: line 1 column 1 (char 0) error, and the response is 403. Can anyone see if my requet is formatted incorrectly?

Edit: An example of part of one of the response bodies when using the zip code 78015 is:

```<code>{
    "data": {
        "locationBySearchTerm": {
            "countryCode": "US",
            "displayName": "78015",
            "latitude": 29.7469487986786,
            "longitude": -98.6554815781517,
            "regionCode": "TX",
            "stations": {
                "count": 2,
                "cursor": {
                    "next": "1",
                    "__typename": "Cursor"
                },
                "results": [
                    {
                        "address": {
                            "country": "US",
                            "line1": "29202 Ralph Fair Rd",
                            "line2": "",
                            "locality": "Boerne",
                            "postalCode": "78015-4223",
                            "region": "TX",
                            "__typename": "Address"
                        },
                        "badges": [],
                        "brandings": [
                            {
                                "brand_id": "122",
                                "branding_type": "fuel",
                                "__typename": "Branding"
                            }
                        ],
                        "brands": [
                            {
                                "brand_id": "122",
                                "image_url": "https://images.gasbuddy.io/b/122.png",
                                "name": "Shell",
                                "__typename": "Brand"
                            }
                        ],
                        "emergency_status": null,
                        "enterprise": false,
                        "fuels": [
                            "regular_gas",
                            "midgrade_gas",
                            "premium_gas",
                            "diesel"
                        ],
                        "id": "64158",
                        "name": "Shell",
                        "offers": [
                            {
                                "discounts": [
                                    {
                                        "grades": [
                                            "regular_gas",
                                            "diesel"
                                        ],
                                        "highlight": "Deal Alert: Save 5¢ per gallon",
                                        "pwgbDiscount": "0.05",
                                        "receiptDiscount": "0.01",
                                        "__typename": "Discount"
                                    },
                                    {
                                        "grades": [
                                            "midgrade_gas"
                                        ],
                                        "highlight": "Deal Alert: Save 5¢ per gallon",
                                        "pwgbDiscount": "0.05",
                                        "receiptDiscount": "0.01",
                                        "__typename": "Discount"
                                    },
                                    {
                                        "grades": [
                                            "premium_gas"
                                        ],
                                        "highlight": "Deal Alert: Save 5¢ per gallon",
                                        "pwgbDiscount": "0.05",
                                        "receiptDiscount": "0.01",
                                        "__typename": "Discount"
                                    }
                                ],
                                "highlight": "Deal Alert: Save up to 5¢ per gallon",
                                "id": "H464158-4-4-4-5-G2-a010fa0a-1ffd-4566-9fae-2f89d3f849f0",
                                "types": [
                                    "gasbuddy",
                                    "getupside"
                                ],
                                "use": [
                                    "strike",
                                    "banner",
                                    "sort"
                                ],
                                "__typename": "Offer"
                            }
                        ],
                        "pay_status": {
                            "is_pay_available": true,
                            "__typename": "PayStatus"
                        },
                        "prices": [
                            {
                                "cash": null,
                                "credit": {
                                    "nickname": "Buddy_qdx3kktn",
                                    "posted_time": "2023-01-12T13:47:29.825Z",
                                    "price": 2.85,
                                    "__typename": "FuelPrice"
                                },
                                "discount": 0,
                                "fuel_product": "regular_gas",
                                "__typename": "PriceReport"
                            },
                            {
                                "cash": null,
                                "credit": {
                                    "nickname": "MoriSeiki",
                                    "posted_time": "2023-01-11T00:56:21.856Z",
                                    "price": 3.05,
                                    "__typename": "FuelPrice"
                                },
                                "discount": 0,
                                "fuel_product": "midgrade_gas",
                                "__typename": "PriceReport"
                            },
                            {
                                "cash": null,
                                "credit": {
                                    "nickname": "Buddy_qdx3kktn",
                                    "posted_time": "2023-01-12T13:47:29.841Z",
                                    "price": 3.49,
                                    "__typename": "FuelPrice"
                                },
                                "discount": 0,
                                "fuel_product": "premium_gas",
                                "__typename": "PriceReport"
                            },
                            {
                                "cash": null,
                                "credit": {
                                    "nickname": "ACTRAT",
                                    "posted_time": "2023-01-12T15:58:58.163Z",
                                    "price": 3.99,
                                    "__typename": "FuelPrice"
                                },
                                "discount": 0,
                                "fuel_product": "diesel",
                                "__typename": "PriceReport"
                            }
                        ],
                        "ratings_count": 61,
                        "star_rating": 4.4,
                        "__typename": "Station"
                    },...
</code>```

Body:
I saw that there was a way to request data by using a website's GraphQL API, but I'm unable to successfully query the data. Following this tutorial I'm unable to map the API via Apollo since they seem to have introspection disabled, but I pieced together what I've seen elsewhere using the Network data through Chrome's Inspect tool. Additionally, the ZIP_CODE is filled in with one I'm interested in.

Edit: The data I'm trying to extract is the Address of the station and the reported Price of regular gas.

Currently, I'm running the following script via Python:

import requests

url = "https://gasbuddy.com/graphql"
query = {
    "operationName": "LocationBySearchTerm",
    "variables": {
        "fuel": 1,
        "maxAge": 0,
        "search": "ZIP_CODE"
    },
     "query": """
query LocationBySearchTerm($brandId: Int, $cursor: String, $fuel: Int, $lat: Float, $lng: Float, $maxAge: Int, $search: String) {
  locationBySearchTerm(lat: $lat, lng: $lng, search: $search) {
    countryCode
    displayName
    latitude
    longitude
    regionCode
    stations(brandId: $brandId, cursor: $cursor, fuel: $fuel, maxAge: $maxAge) {
      count
      cursor {
        next
        __typename
      }
      results {
        address {
          country
          line1
          line2
          locality
          postalCode
          region
          __typename
        }
        badges {
          badgeId
          callToAction
          campaignId
          clickTrackingUrl
          description
          detailsImageUrl
          detailsImpressionTrackingUrls
          imageUrl
          impressionTrackingUrls
          targetUrl
          title
          __typename
        }
        brandings {
          brand_id
          branding_type
          __typename
        }
        brands {
          brand_id
          image_url
          name
          __typename
        }
        emergency_status {
          has_diesel {
            nick_name
            report_status
            update_date
            __typename
          }
          has_gas {
            nick_name
            report_status
            update_date
            __typename
          }
          has_power {
            nick_name
            report_status
            update_date
            __typename
          }
          __typename
        }
        enterprise
        fuels
        id
        name
        offers {
          discounts {
            grades
            highlight
            pwgbDiscount
            receiptDiscount
            __typename
          }
          highlight
          id
          types
          use
          __typename
        }
        pay_status {
          is_pay_available
          __typename
        }
        prices {
          cash {
            nickname
            posted_time
            price
            __typename
          }
          credit {
            nickname
            posted_time
            price
            __typename
          }
          discount
          fuel_product
          __typename
        }
        ratings_count
        star_rating
        __typename
      }
      __typename
    }
    trends {
      areaName
      country
      today
      todayLow
      trend
      __typename
    }
    __typename
}""",
}

response = requests.post(url, json=query)
print(response.json())

I receive a JSONDecodeError: Expecting value: line 1 column 1 (char 0) error, and the response is 403. Can anyone see if my requet is formatted incorrectly?

Edit: An example of part of one of the response bodies when using the zip code 78015 is:

{
    "data": {
        "locationBySearchTerm": {
            "countryCode": "US",
            "displayName": "78015",
            "latitude": 29.7469487986786,
            "longitude": -98.6554815781517,
            "regionCode": "TX",
            "stations": {
                "count": 2,
                "cursor": {
                    "next": "1",
                    "__typename": "Cursor"
                },
                "results": [
                    {
                        "address": {
                            "country": "US",
                            "line1": "29202 Ralph Fair Rd",
                            "line2": "",
                            "locality": "Boerne",
                            "postalCode": "78015-4223",
                            "region": "TX",
                            "__typename": "Address"
                        },
                        "badges": [],
                        "brandings": [
                            {
                                "brand_id": "122",
                                "branding_type": "fuel",
                                "__typename": "Branding"
                            }
                        ],
                        "brands": [
                            {
                                "brand_id": "122",
                                "image_url": "https://images.gasbuddy.io/b/122.png",
                                "name": "Shell",
                                "__typename": "Brand"
                            }
                        ],
                        "emergency_status": null,
                        "enterprise": false,
                        "fuels": [
                            "regular_gas",
                            "midgrade_gas",
                            "premium_gas",
                            "diesel"
                        ],
                        "id": "64158",
                        "name": "Shell",
                        "offers": [
                            {
                                "discounts": [
                                    {
                                        "grades": [
                                            "regular_gas",
                                            "diesel"
                                        ],
                                        "highlight": "Deal Alert: Save 5¢ per gallon",
                                        "pwgbDiscount": "0.05",
                                        "receiptDiscount": "0.01",
                                        "__typename": "Discount"
                                    },
                                    {
                                        "grades": [
                                            "midgrade_gas"
                                        ],
                                        "highlight": "Deal Alert: Save 5¢ per gallon",
                                        "pwgbDiscount": "0.05",
                                        "receiptDiscount": "0.01",
                                        "__typename": "Discount"
                                    },
                                    {
                                        "grades": [
                                            "premium_gas"
                                        ],
                                        "highlight": "Deal Alert: Save 5¢ per gallon",
                                        "pwgbDiscount": "0.05",
                                        "receiptDiscount": "0.01",
                                        "__typename": "Discount"
                                    }
                                ],
                                "highlight": "Deal Alert: Save up to 5¢ per gallon",
                                "id": "H464158-4-4-4-5-G2-a010fa0a-1ffd-4566-9fae-2f89d3f849f0",
                                "types": [
                                    "gasbuddy",
                                    "getupside"
                                ],
                                "use": [
                                    "strike",
                                    "banner",
                                    "sort"
                                ],
                                "__typename": "Offer"
                            }
                        ],
                        "pay_status": {
                            "is_pay_available": true,
                            "__typename": "PayStatus"
                        },
                        "prices": [
                            {
                                "cash": null,
                                "credit": {
                                    "nickname": "Buddy_qdx3kktn",
                                    "posted_time": "2023-01-12T13:47:29.825Z",
                                    "price": 2.85,
                                    "__typename": "FuelPrice"
                                },
                                "discount": 0,
                                "fuel_product": "regular_gas",
                                "__typename": "PriceReport"
                            },
                            {
                                "cash": null,
                                "credit": {
                                    "nickname": "MoriSeiki",
                                    "posted_time": "2023-01-11T00:56:21.856Z",
                                    "price": 3.05,
                                    "__typename": "FuelPrice"
                                },
                                "discount": 0,
                                "fuel_product": "midgrade_gas",
                                "__typename": "PriceReport"
                            },
                            {
                                "cash": null,
                                "credit": {
                                    "nickname": "Buddy_qdx3kktn",
                                    "posted_time": "2023-01-12T13:47:29.841Z",
                                    "price": 3.49,
                                    "__typename": "FuelPrice"
                                },
                                "discount": 0,
                                "fuel_product": "premium_gas",
                                "__typename": "PriceReport"
                            },
                            {
                                "cash": null,
                                "credit": {
                                    "nickname": "ACTRAT",
                                    "posted_time": "2023-01-12T15:58:58.163Z",
                                    "price": 3.99,
                                    "__typename": "FuelPrice"
                                },
                                "discount": 0,
                                "fuel_product": "diesel",
                                "__typename": "PriceReport"
                            }
                        ],
                        "ratings_count": 61,
                        "star_rating": 4.4,
                        "__typename": "Station"
                    },...


问:
Should shell aliases be substituted when parsed or when executed?
Consider the script:

```<code>alias al='echo A'
foo(){ echo $(al);}
alias al='echo B'
foo
</code>```

bash, ksh, and zsh prints B, while dash and yash prints A.

Which is correct? Or both?

According to the POSIX standard (Vol. Shell & Utilities) 2.3.1 Alias Substitution,

After a token has been delimited, but before applying the grammatical rules in Shell Grammar, a resulting word that is identified to be the command name word of a simple command shall be examined to determine whether it is an unquoted, valid alias name.

It seems aliases should be resolved when the function id defined, as you don't know this is in a function before applying the grammatical rules. However, this doesn't make much sense to me, as you can't identify a word to be the command name word ebfore applying the grammatical rules, either.

Body:
Consider the script:

alias al='echo A'
foo(){ echo $(al);}
alias al='echo B'
foo

bash, ksh, and zsh prints B, while dash and yash prints A.

Which is correct? Or both?

According to the POSIX standard (Vol. Shell & Utilities) 2.3.1 Alias Substitution,

After a token has been delimited, but before applying the grammatical rules in Shell Grammar, a resulting word that is identified to be the command name word of a simple command shall be examined to determine whether it is an unquoted, valid alias name.

It seems aliases should be resolved when the function id defined, as you don't know this is in a function before applying the grammatical rules. However, this doesn't make much sense to me, as you can't identify a word to be the command name word ebfore applying the grammatical rules, either.


问:
Hover is not applied

&__img{
   height: 100%;
   transform:translate(-4rem) scale(1.4)
}
&__caption{
    position: absolute;
    top: 50%;
    left:50%;
    font-size: 1.6rem;
    color:#f7f7f7;
    text-align: center;
    text-transform: uppercase;
    transform: translate(-50% ,20%);
    opacity: 0;
    transition: all .5s;
    backface-visibility: hidden;

}
&:hover &__caption{
    opacity: 1;
    transform: translate(-50%,-50%);
}
&:hover &__img{

}
```
<pre class="lang-html prettyprint-override"><code><div class="row">
    <div class="story">
        <figure class="story__shape">
                 <figure-caption class="story__caption">
                       mary smith
                 </figure-caption>
                <img src="img/nat-8.jpg" alt="Customer Profile" class="story__img">
        </figure>
        <div class="story__text">
            <h3 class="heading-teritiary u-margin-bottom-small">I have best weekend </h3>
            <p >Lorem ipsum dolor, sit amet consectetur adipisicing elit. Rem incidunt illo harum nam. Nesciunt dolores commodi aliquid, asperiores animi quo illum impedit itaque in optio iure, totam, illo ipsum tempore.</p>
        </div>
    </div>
</div>
</code>```

The hover effect is not applied. It hides the caption and the text. When I hover it is supposed to show them.
Also the scale doesn't change. I can't figure out what is happening.

Title: Hover is not applied

Body:
&__img{
   height: 100%;
   transform:translate(-4rem) scale(1.4)
}
&__caption{
    position: absolute;
    top: 50%;
    left:50%;
    font-size: 1.6rem;
    color:#f7f7f7;
    text-align: center;
    text-transform: uppercase;
    transform: translate(-50% ,20%);
    opacity: 0;
    transition: all .5s;
    backface-visibility: hidden;

}
&:hover &__caption{
    opacity: 1;
    transform: translate(-50%,-50%);
}
&:hover &__img{

}

                       mary smith

I have best weekend

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Rem incidunt illo harum nam. Nesciunt dolores commodi aliquid, asperiores animi quo illum impedit itaque in optio iure, totam, illo ipsum tempore.

The hover effect is not applied. It hides the caption and the text. When I hover it is supposed to show them.
Also the scale doesn't change. I can't figure out what is happening.


问:
Chakra Uİ . I give hex code to chakra ui checkbox. how do i do this
```<code><Checkbox colorScheme='red' defaultChecked>
    Checkbox
  </Checkbox>
</code>```

ı dont give colorScheme='77008d'. how to do that

Body:
<Checkbox colorScheme='red' defaultChecked>
    Checkbox
  </Checkbox>

ı dont give colorScheme='77008d'. how to do that


问:
Python matplotlib plot background
I want to compare a plot from a paper to my simulation results.
Therefore it would be convenient to plot my results with the ref pic in the background.

the x value range i choose to be the same as the ref pic
y should also be close to the ref pic.
Or i can set the y range also to the same values as the ref pic.

i tryed

        x=range(len(P))
        plt.plot(x,P)
        img=plt.imread("REF.jpg")
        plt.imshow(img)
        plt.show()
```

But it chooses the scale i think according to pixels?
and my other plot was a miniature on it.
if i use extend and one dimension is much larger then the other, one can see nothing on the pic because of the bad aspect ratio

Title: Python matplotlib plot background

Body:
I want to compare a plot from a paper to my simulation results.
Therefore it would be convenient to plot my results with the ref pic in the background.

the x value range i choose to be the same as the ref pic
y should also be close to the ref pic.
Or i can set the y range also to the same values as the ref pic.

i tryed

        x=range(len(P))
        plt.plot(x,P)
        img=plt.imread("REF.jpg")
        plt.imshow(img)
        plt.show()

But it chooses the scale i think according to pixels?
and my other plot was a miniature on it.
if i use extend and one dimension is much larger then the other, one can see nothing on the pic because of the bad aspect ratio


问:
FCM Admin SDK SendAllAsync occasionally returns error 'Service unavailable' for single entries
I frequently send batches of up to 100 PushNotifications via the SendAllAsync() method. FCM sends a list that contains a result for each entry sent.
I have noticed that sometimes individual results from the list contain the error message "The service is currently unavailable.".
How can it be that most PushNotifications from one request are successful, but individual ones return an "Unavailable"? Shouldn't all PushNotifications from a request be faulty then?

Do I have to pay attention to each individual result in my error handling to see if I have to make a retry for it? I would have thought that such an error would be a superordinate one, which is why you have to retry the entire request.

```<code>BatchResponse result = FirebaseMessaging.DefaultInstance.SendAllAsync(messageBatch);
</code>```

Body:
I frequently send batches of up to 100 PushNotifications via the SendAllAsync() method. FCM sends a list that contains a result for each entry sent.
I have noticed that sometimes individual results from the list contain the error message "The service is currently unavailable.".
How can it be that most PushNotifications from one request are successful, but individual ones return an "Unavailable"? Shouldn't all PushNotifications from a request be faulty then?

Do I have to pay attention to each individual result in my error handling to see if I have to make a retry for it? I would have thought that such an error would be a superordinate one, which is why you have to retry the entire request.

BatchResponse result = FirebaseMessaging.DefaultInstance.SendAllAsync(messageBatch);


问:
JPGraph xaxis set dates
I want the xaxis to contain all the possible dates within a month.
For example, if the month is February I want it to contain 28 or 29 ticks.
If it is January I want it to contain 31 ticks, 30 for March etc.

I want to graph data from an SQL Query but the entries are sporadic. One entry is at 2022-10-08, another at 2022-15-09 etc.

How can I force the graph to contain all the dates within a month and have the bars show up on the respective dates?

Here is the code:

```<code>try {
    $prosforesMay = collect($prosforesMay);
    $prosforesJune = collect($prosforesJune);
    $prosforesJuly = collect($prosforesJuly);
    $prosforesAugust = collect($prosforesAugust);
    $prosforesSeptember = collect($prosforesSeptember);
    $prosforesOctober = collect($prosforesOctober);
    $prosforesNovember = collect($prosforesNovember);
    $prosforesDecember = collect($prosforesDecember);

    $naytiliakesMay = collect($naytiliakesMay);
    $naytiliakesJune = collect($naytiliakesJune);
    $naytiliakesJuly = collect($naytiliakesJuly);
    $naytiliakesAugust = collect($naytiliakesAugust);
    $naytiliakesSeptember = collect($naytiliakesSeptember);
    $naytiliakesOctober = collect($naytiliakesOctober);
    $naytiliakesNovember = collect($naytiliakesNovember);
    $naytiliakesDecember = collect($naytiliakesDecember);

    $prosfores = $prosforesMay->merge($prosforesJune);
    $prosfores = $prosfores->merge($prosforesJuly);
    $prosfores = $prosfores->merge($prosforesAugust);
    $prosfores = $prosfores->merge($prosforesSeptember);
    $prosfores = $prosfores->merge($prosforesOctober);
    $prosfores = $prosfores->merge($prosforesNovember);
    $prosfores = $prosfores->merge($prosforesDecember);

    $naytiliakes = $naytiliakesMay->merge($naytiliakesJune);
    $naytiliakes = $naytiliakes->merge($naytiliakesJuly);
    $naytiliakes = $naytiliakes->merge($naytiliakesAugust);
    $naytiliakes = $naytiliakes->merge($naytiliakesSeptember);
    $naytiliakes = $naytiliakes->merge($naytiliakesOctober);
    $naytiliakes = $naytiliakes->merge($naytiliakesNovember);
    $naytiliakes = $naytiliakes->merge($naytiliakesDecember);

    $synolikaProsfores = $naytiliakes->merge($prosfores);

    $groupSynolikaProsforesByMonth = $synolikaProsfores->groupBy('month');

    $graphs = array();
    $graphsTwo = array();

    foreach($groupSynolikaProsforesByMonth as $prosforesByMonth) {
        $prosforesBySalesperson = $prosforesByMonth->groupBy('salesperson');
        $prosforesBySalesperson->forget('Teamwork OS');

        foreach($prosforesBySalesperson as $prosforaBySalesperson) {
            $prosforaTypeGroup = $prosforaBySalesperson->groupBy('quote_type');
            $plots = array();
            $plotsTwo = array();
            $colors = array('#cc1111', '#cccc11', '#cc11cc', '#111111');
            $i = -1;
            $salesperson = '';
            $salespersonTwo = '';

            $month = '';
            $monthTwo = '';

            foreach($prosforaTypeGroup as $prosforaTypes) {
                $i++;

                $values = $prosforaTypes->pluck('total_quote_revenue_per_salesperson')->toArray();

                $plot = new Amenadiel\JpGraph\Plot\BarPlot($values);
                $plot->SetLegend($prosforaTypes->first()->quote_type);

                $salesperson = $prosforaTypes->pluck('salesperson');
                $month = $prosforaTypes->pluck('month');

                $plot->SetColor('white');
                $plot->SetFillColor($colors[$i]);

                array_push($plots, $plot);
            }

            $i = -1;

            foreach($prosforaTypeGroup as $prosforaTypes) {
                $i++;

                $valuesTwo = $prosforaTypes->pluck('no_of_quotes')->toArray();

                $plotTwo = new Amenadiel\JpGraph\Plot\BarPlot($valuesTwo);
                $plotTwo->SetLegend($prosforaTypes->first()->quote_type);

                $salespersonTwo = $prosforaTypes->pluck('salesperson');
                $monthTwo = $prosforaTypes->pluck('month');

                $plotTwo->SetColor('white');
                $plotTwo->SetFillColor($colors[$i]);

                array_push($plotsTwo, $plotTwo);
            }

            $gbplot = new Amenadiel\JpGraph\Plot\GroupBarPlot($plots);

            $gbplotTwo = new Amenadiel\JpGraph\Plot\GroupBarPlot($plotsTwo);

            // Create the graph. These two calls are always required
            $graph = new Amenadiel\JpGraph\Graph\Graph(1500, 600, 'auto');
            $graph->SetScale('datlin');

            $graph->SetBox(false);
            $graph->SetMargin(60, 20, 36, 63);
            $graph->ygrid->SetFill(false);
            $graph->xaxis->scale->SetDateFormat( 'h:i' );
            $graph->xaxis->scale->SetDateAlign(DAYADJ_1);
            //$graph->xaxis->SetTickLabels($prosforaBySalesperson->pluck('day')->toArray());

            $graph->yaxis->HideLine(false);
            $graph->yaxis->HideTicks(false, false);
            $graph->xaxis->SetLabelAngle(90);
            $graph->title->Set($salesperson[0].' '.$month[0]);
            $graph->Add($gbplot);

            $graphTwo = new Amenadiel\JpGraph\Graph\Graph(1500, 600, 'auto');
            $graphTwo->SetScale('datlin');

            $graphTwo->SetBox(false);
            $graphTwo->SetMargin(60, 20, 36, 63);
            $graphTwo->ygrid->SetFill(false);
            $graphTwo->xaxis->scale->SetDateFormat( 'h:i' );
            $graphTwo->xaxis->scale->SetDateAlign(DAYADJ_1);
            //$graphTwo->xaxis->SetTickLabels($prosforaBySalesperson->pluck('day')->toArray());

            $graphTwo->yaxis->HideLine(false);
            $graphTwo->yaxis->HideTicks(false, false);
            $graphTwo->xaxis->SetLabelAngle(90);
            $graphTwo->title->Set($salespersonTwo[0].' '.$monthTwo[0]);
            $graphTwo->Add($gbplotTwo);

            $img = $graph->Stroke(_IMG_HANDLER);
            ob_start();
            imagepng($img);
            $img_data = ob_get_contents();
            ob_end_clean();
            $percategory = base64_encode($img_data);
            array_push($graphs, $percategory);

            $imgTwo = $graphTwo->Stroke(_IMG_HANDLER);
            ob_start();
            imagepng($imgTwo);
            $img_dataTwo = ob_get_contents();
            ob_end_clean();
            $percategoryTwo = base64_encode($img_dataTwo);
            array_push($graphsTwo, $percategoryTwo);
        }
    }
}

catch (Throwable $e) {
    echo $e->__toString();
}
</code>```

Title: JPGraph xaxis set dates

Body:
I want the xaxis to contain all the possible dates within a month.
For example, if the month is February I want it to contain 28 or 29 ticks.
If it is January I want it to contain 31 ticks, 30 for March etc.

I want to graph data from an SQL Query but the entries are sporadic. One entry is at 2022-10-08, another at 2022-15-09 etc.

How can I force the graph to contain all the dates within a month and have the bars show up on the respective dates?

Here is the code:

try {
    $prosforesMay = collect($prosforesMay);
    $prosforesJune = collect($prosforesJune);
    $prosforesJuly = collect($prosforesJuly);
    $prosforesAugust = collect($prosforesAugust);
    $prosforesSeptember = collect($prosforesSeptember);
    $prosforesOctober = collect($prosforesOctober);
    $prosforesNovember = collect($prosforesNovember);
    $prosforesDecember = collect($prosforesDecember);

    $naytiliakesMay = collect($naytiliakesMay);
    $naytiliakesJune = collect($naytiliakesJune);
    $naytiliakesJuly = collect($naytiliakesJuly);
    $naytiliakesAugust = collect($naytiliakesAugust);
    $naytiliakesSeptember = collect($naytiliakesSeptember);
    $naytiliakesOctober = collect($naytiliakesOctober);
    $naytiliakesNovember = collect($naytiliakesNovember);
    $naytiliakesDecember = collect($naytiliakesDecember);

    $prosfores = $prosforesMay->merge($prosforesJune);
    $prosfores = $prosfores->merge($prosforesJuly);
    $prosfores = $prosfores->merge($prosforesAugust);
    $prosfores = $prosfores->merge($prosforesSeptember);
    $prosfores = $prosfores->merge($prosforesOctober);
    $prosfores = $prosfores->merge($prosforesNovember);
    $prosfores = $prosfores->merge($prosforesDecember);

    $naytiliakes = $naytiliakesMay->merge($naytiliakesJune);
    $naytiliakes = $naytiliakes->merge($naytiliakesJuly);
    $naytiliakes = $naytiliakes->merge($naytiliakesAugust);
    $naytiliakes = $naytiliakes->merge($naytiliakesSeptember);
    $naytiliakes = $naytiliakes->merge($naytiliakesOctober);
    $naytiliakes = $naytiliakes->merge($naytiliakesNovember);
    $naytiliakes = $naytiliakes->merge($naytiliakesDecember);

    $synolikaProsfores = $naytiliakes->merge($prosfores);

    $groupSynolikaProsforesByMonth = $synolikaProsfores->groupBy('month');

    $graphs = array();
    $graphsTwo = array();

    foreach($groupSynolikaProsforesByMonth as $prosforesByMonth) {
        $prosforesBySalesperson = $prosforesByMonth->groupBy('salesperson');
        $prosforesBySalesperson->forget('Teamwork OS');

        foreach($prosforesBySalesperson as $prosforaBySalesperson) {
            $prosforaTypeGroup = $prosforaBySalesperson->groupBy('quote_type');
            $plots = array();
            $plotsTwo = array();
            $colors = array('#cc1111', '#cccc11', '#cc11cc', '#111111');
            $i = -1;
            $salesperson = '';
            $salespersonTwo = '';

            $month = '';
            $monthTwo = '';

            foreach($prosforaTypeGroup as $prosforaTypes) {
                $i++;

                $values = $prosforaTypes->pluck('total_quote_revenue_per_salesperson')->toArray();

                $plot = new Amenadiel\JpGraph\Plot\BarPlot($values);
                $plot->SetLegend($prosforaTypes->first()->quote_type);

                $salesperson = $prosforaTypes->pluck('salesperson');
                $month = $prosforaTypes->pluck('month');

                $plot->SetColor('white');
                $plot->SetFillColor($colors[$i]);

                array_push($plots, $plot);
            }

            $i = -1;

            foreach($prosforaTypeGroup as $prosforaTypes) {
                $i++;

                $valuesTwo = $prosforaTypes->pluck('no_of_quotes')->toArray();

                $plotTwo = new Amenadiel\JpGraph\Plot\BarPlot($valuesTwo);
                $plotTwo->SetLegend($prosforaTypes->first()->quote_type);

                $salespersonTwo = $prosforaTypes->pluck('salesperson');
                $monthTwo = $prosforaTypes->pluck('month');

                $plotTwo->SetColor('white');
                $plotTwo->SetFillColor($colors[$i]);

                array_push($plotsTwo, $plotTwo);
            }

            $gbplot = new Amenadiel\JpGraph\Plot\GroupBarPlot($plots);

            $gbplotTwo = new Amenadiel\JpGraph\Plot\GroupBarPlot($plotsTwo);

            // Create the graph. These two calls are always required
            $graph = new Amenadiel\JpGraph\Graph\Graph(1500, 600, 'auto');
            $graph->SetScale('datlin');

            $graph->SetBox(false);
            $graph->SetMargin(60, 20, 36, 63);
            $graph->ygrid->SetFill(false);
            $graph->xaxis->scale->SetDateFormat( 'h:i' );
            $graph->xaxis->scale->SetDateAlign(DAYADJ_1);
            //$graph->xaxis->SetTickLabels($prosforaBySalesperson->pluck('day')->toArray());

            $graph->yaxis->HideLine(false);
            $graph->yaxis->HideTicks(false, false);
            $graph->xaxis->SetLabelAngle(90);
            $graph->title->Set($salesperson[0].' '.$month[0]);
            $graph->Add($gbplot);

            $graphTwo = new Amenadiel\JpGraph\Graph\Graph(1500, 600, 'auto');
            $graphTwo->SetScale('datlin');

            $graphTwo->SetBox(false);
            $graphTwo->SetMargin(60, 20, 36, 63);
            $graphTwo->ygrid->SetFill(false);
            $graphTwo->xaxis->scale->SetDateFormat( 'h:i' );
            $graphTwo->xaxis->scale->SetDateAlign(DAYADJ_1);
            //$graphTwo->xaxis->SetTickLabels($prosforaBySalesperson->pluck('day')->toArray());

            $graphTwo->yaxis->HideLine(false);
            $graphTwo->yaxis->HideTicks(false, false);
            $graphTwo->xaxis->SetLabelAngle(90);
            $graphTwo->title->Set($salespersonTwo[0].' '.$monthTwo[0]);
            $graphTwo->Add($gbplotTwo);

            $img = $graph->Stroke(_IMG_HANDLER);
            ob_start();
            imagepng($img);
            $img_data = ob_get_contents();
            ob_end_clean();
            $percategory = base64_encode($img_data);
            array_push($graphs, $percategory);

            $imgTwo = $graphTwo->Stroke(_IMG_HANDLER);
            ob_start();
            imagepng($imgTwo);
            $img_dataTwo = ob_get_contents();
            ob_end_clean();
            $percategoryTwo = base64_encode($img_dataTwo);
            array_push($graphsTwo, $percategoryTwo);
        }
    }
}

catch (Throwable $e) {
    echo $e->__toString();
}


问:
Migrating Web API project from .NET Framework 4.6.1 to 4.8
I am working on a huge web application with multiple Libraries nearly 50+. Currently this application targeting .NET Framework 4.6.1 and now I want to convert this complete application targeting .NET Framework 4.8.

Do we have any migration tool or script which will take care of finding and resolving all the dependent components? as converting each and every project is a tedious process.

Please suggest me the best process.

Thanks You.


问:
unable to dynamically maintain a list of no trade zones and avoid trading when closure of candle happens in the NTZ
i am trying to develop for a strategy that tries to take trade on support and resistance. I want to create a no trade zone (NTZ) 40 pips on either side of the last HH/LL/LH/LL on a higher time frame or the range of the insider/outsider bar, which ever is lower. my trading time frame is 1 hr and the NTZ time frame is 4 hrs. although i have  identified the HH/LL/HL/LH points, i am unable to dynamically maintain the NTZ. please can some body help me do the same</p>


问:
OpenCV and mediapipe pushup counter project in PYTHON
I am trying this OpenCV project of pushup counter but when I try to run this code the camera window is not opening please help me to solve this.
The camera light gets turned ON but the window of Camera is not opening.</p>
```<code>import cv2
import mediapipe as md

md_drawing=md.solutions.drawing_utils
md_drawing_styles=md.solutions.drawing_styles
md_pose=md.solutions.pose

count = 0

position=None

cap=cv2.VideoCapture(0)

with md_pose.Pose(
    min_detection_confidence=0.7,
    min_tracking_confidence=0.7) as pose:
    while cap.isOpened():
        success,image=cap.read()
        if not success:
            print("empty camera")
            break

            image=cv2.cvtColor(cv2.flip(image,1),cv2.COLOR_BGR2RGB)
            result=pose.process(image)

            imlist=[]

            if result.pose_landmarks:
                md_drawing.draw_landmarks(
                    image,result.pose_landmarks,md_pose.POSE_CONNECTIONS)
                for id,im in enumerate(result.pose_landmarks.landmark):
                    h,w,_=image.shape
                    X,Y=int(im.x*w),int(im.y*h)
                    imlist.append([id,X,Y])
            #print(imlist)

            if Len(imlist) != 0:
                if((imlist[12][2]-imlisit[14][2]) >= 15 and (imlist[11][2]-imlist[13][2])>=15):
                    position="down"
                if((imlist[12][2]-imlisit[14][2]) <= 5 and (imlist[11][2]-imlist[13][2])<=5) and position == "down":
                    position="up"
                    count+=1
                    print(count)

            cv2.imshow("Push-up counter",cv2.flip(image,1))
            key=cv2.waitKey(1)
            if key==ord('q'):
                break

cap.release()
</code>```

Body:
I am trying this OpenCV project of pushup counter but when I try to run this code the camera window is not opening please help me to solve this.
The camera light gets turned ON but the window of Camera is not opening.

import cv2
import mediapipe as md

md_drawing=md.solutions.drawing_utils
md_drawing_styles=md.solutions.drawing_styles
md_pose=md.solutions.pose

count = 0

position=None

cap=cv2.VideoCapture(0)

with md_pose.Pose(
    min_detection_confidence=0.7,
    min_tracking_confidence=0.7) as pose:
    while cap.isOpened():
        success,image=cap.read()
        if not success:
            print("empty camera")
            break

            image=cv2.cvtColor(cv2.flip(image,1),cv2.COLOR_BGR2RGB)
            result=pose.process(image)

            imlist=[]

            if result.pose_landmarks:
                md_drawing.draw_landmarks(
                    image,result.pose_landmarks,md_pose.POSE_CONNECTIONS)
                for id,im in enumerate(result.pose_landmarks.landmark):
                    h,w,_=image.shape
                    X,Y=int(im.x*w),int(im.y*h)
                    imlist.append([id,X,Y])
            #print(imlist)

            if Len(imlist) != 0:
                if((imlist[12][2]-imlisit[14][2]) >= 15 and (imlist[11][2]-imlist[13][2])>=15):
                    position="down"
                if((imlist[12][2]-imlisit[14][2]) <= 5 and (imlist[11][2]-imlist[13][2])<=5) and position == "down":
                    position="up"
                    count+=1
                    print(count)

            cv2.imshow("Push-up counter",cv2.flip(image,1))
            key=cv2.waitKey(1)
            if key==ord('q'):
                break

cap.release()


问:
Dropbox menu with excel data from determinate columns python
I wrote a program.py with a dropbox menu that contains data from a certain column of an excel file.

I can not, once selected the data from the dropbox menu, read and write to a new . txt file the data of its line of the selected data.

For sample:

I selected from dropbox menu the data "600"

I need a new .txt file contents the complete lines 7 ("margaret blue street 6 margaret@6.com 6 600")

Thanks

This is the dropbox menu sample
Dropbox menu with columns F6 to F1000 for sample

This is a sample excel file:
excel file

```<code>from openpyxl import load_workbook
from tkinter import *
import tkinter.ttk as ttk

# Load the xlsx file, then store the value of each column in the "elements" list
wb = load_workbook(filename=r"C:\Users\...\Sample.xlsm")
ws = wb['Page1']
xlsx_range = ws['F6':'F1000']
elements = []

for cell in xlsx_range:
    for x in cell:
        y = x.value
        if y!=None:
           elements.append(y)
           print(y)

# Tkinter stuff
win = Tk()
clicked = StringVar()

win.title('Intestazione')
win.geometry("300x110+400+400")
combodata = ttk.Combobox(win, width=15,state='readonly', values=elements)
combodata.pack(pady=10)
btn=Button(win,  text="           Ok           ",    fg='black', command=None)
btn.place(x=90,y=45)

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

I expect a new file with written line corresponding to the data selected in the dropbox menu

Body:
I wrote a program.py with a dropbox menu that contains data from a certain column of an excel file.

I can not, once selected the data from the dropbox menu, read and write to a new . txt file the data of its line of the selected data.

For sample:

I selected from dropbox menu the data "600"

I need a new .txt file contents the complete lines 7 ("margaret blue street 6 margaret@6.com 6 600")

Thanks

This is the dropbox menu sample
Dropbox menu with columns F6 to F1000 for sample

This is a sample excel file:
excel file

from openpyxl import load_workbook
from tkinter import *
import tkinter.ttk as ttk

# Load the xlsx file, then store the value of each column in the "elements" list
wb = load_workbook(filename=r"C:\Users\...\Sample.xlsm")
ws = wb['Page1']
xlsx_range = ws['F6':'F1000']
elements = []

for cell in xlsx_range:
    for x in cell:
        y = x.value
        if y!=None:
           elements.append(y)
           print(y)

# Tkinter stuff
win = Tk()
clicked = StringVar()

win.title('Intestazione')
win.geometry("300x110+400+400")
combodata = ttk.Combobox(win, width=15,state='readonly', values=elements)
combodata.pack(pady=10)
btn=Button(win,  text="           Ok           ",    fg='black', command=None)
btn.place(x=90,y=45)

win.mainloop()

I expect a new file with written line corresponding to the data selected in the dropbox menu


问:
Convert Java object to flattened json using Jackson
I have a class as UserPayload.java

```<code>package com.pulse.org.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import lombok.Data;

@JsonInclude(value = JsonInclude.Include.NON_EMPTY, content = JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"id", "firstName", "middleName", "lastName", "email", "countryCode", "mobileNumber", "orgId"})
@Data
@Schema(description = "details of a user")
public class UserPayload {

  /**
   * id of a user
   */
  @JsonProperty("id")
  @Schema(name = "id of a user")
  private UUID id;

  /*
   * first name of a user
   */
  @NotNull(message = "1020")
  @Schema(name = "first name of a user")
  private String firstName;

  /*
   * middle name of a user
   */
  @Schema(name = "middle name of a user")
  private String middleName;

  /*
   * last name of a user
   */
  @NotNull(message = "1021")
  @Schema(name = "last name of a user")
  private String lastName;

  /*
   * email of a user
   */
  @NotNull(message = "1022")
  @Schema(name = "email of a user")
  private String email;

  /*
   * country code of a user
   */
  @Schema(name = "country code of a user")
  private Integer countryCode;

  /*
   * mobile number of a user
   */
  @Schema(name = "mobile number of a user")
  private Long mobileNumber;

  /*
   * organization id of a user's organization
   */
  @NotNull(message = "1023")
  @Schema(name = "organization id of a user's organization")
  private UUID orgId;

  /**
   * extra details of an user
   */
  @JsonUnwrapped

  private UserExtraPayload userExtraPayload;
}
</code>```

and a class which is UserExtraPayload.java as a child of UserExtraPayload.

```<code>package com.pulse.org.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import lombok.Data;
import lombok.NoArgsConstructor;

@JsonInclude(value = JsonInclude.Include.NON_EMPTY, content = JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"id", "supervisorId", "secondaryEmail", "department", "subDepartment"})
@Data
@NoArgsConstructor
@Schema(description = "details of a user")
public class UserExtraPayload {

  /**
   * id of the user
   */
  @Schema(name = "id of the user")
  private UUID id;

  /*
   * supervisor's id of a user
   */
  @Schema(name = "supervisor's id of a user")
  private UUID supervisorId;

  /*
   * secondary email of a user
   */
  @Schema(name = "secondary email of a user")
  private String secondaryEmail;

  /*
   * department of a user
   */
  @Schema(name = "department of a user")
  private String department;

  /*
   * sub department of a user
   */
  @Schema(name = "sub department of a user")
  private String subDepartment;
}
</code>```

expected json

```<code>{
        "id": "0125d290-9519-4170-89a8-0beeb6543055",
        "firstName": "ritesh",
        "lastName": "shakya",
        "email": "abbs@xyz.com",
        "orgId": "761eda6a-9a17-4047-b64b-2ce6c624fb8d",
        "supervisorId": "761eda6a-9a17-4047-b64b-2ce6c624fb8d",
        "secondaryEmail": "pqr@xyz",
        "department": "ENG",
        "subDepartment": "IT"
    }
</code>```

But I need to map same id which is in UserPayload and UserExtraPayload

I tried using @JsonUnwrap but it's not working.

I want to map a single id in both payload in UserExtra and UserPayload......

Body:
I have a class as UserPayload.java

package com.pulse.org.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import lombok.Data;

@JsonInclude(value = JsonInclude.Include.NON_EMPTY, content = JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"id", "firstName", "middleName", "lastName", "email", "countryCode", "mobileNumber", "orgId"})
@Data
@Schema(description = "details of a user")
public class UserPayload {

  /**
   * id of a user
   */
  @JsonProperty("id")
  @Schema(name = "id of a user")
  private UUID id;

  /*
   * first name of a user
   */
  @NotNull(message = "1020")
  @Schema(name = "first name of a user")
  private String firstName;

  /*
   * middle name of a user
   */
  @Schema(name = "middle name of a user")
  private String middleName;

  /*
   * last name of a user
   */
  @NotNull(message = "1021")
  @Schema(name = "last name of a user")
  private String lastName;

  /*
   * email of a user
   */
  @NotNull(message = "1022")
  @Schema(name = "email of a user")
  private String email;

  /*
   * country code of a user
   */
  @Schema(name = "country code of a user")
  private Integer countryCode;

  /*
   * mobile number of a user
   */
  @Schema(name = "mobile number of a user")
  private Long mobileNumber;

  /*
   * organization id of a user's organization
   */
  @NotNull(message = "1023")
  @Schema(name = "organization id of a user's organization")
  private UUID orgId;

  /**
   * extra details of an user
   */
  @JsonUnwrapped

  private UserExtraPayload userExtraPayload;
}

and a class which is UserExtraPayload.java as a child of UserExtraPayload.

package com.pulse.org.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import lombok.Data;
import lombok.NoArgsConstructor;

@JsonInclude(value = JsonInclude.Include.NON_EMPTY, content = JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"id", "supervisorId", "secondaryEmail", "department", "subDepartment"})
@Data
@NoArgsConstructor
@Schema(description = "details of a user")
public class UserExtraPayload {

  /**
   * id of the user
   */
  @Schema(name = "id of the user")
  private UUID id;

  /*
   * supervisor's id of a user
   */
  @Schema(name = "supervisor's id of a user")
  private UUID supervisorId;

  /*
   * secondary email of a user
   */
  @Schema(name = "secondary email of a user")
  private String secondaryEmail;

  /*
   * department of a user
   */
  @Schema(name = "department of a user")
  private String department;

  /*
   * sub department of a user
   */
  @Schema(name = "sub department of a user")
  private String subDepartment;
}

expected json

{
        "id": "0125d290-9519-4170-89a8-0beeb6543055",
        "firstName": "ritesh",
        "lastName": "shakya",
        "email": "abbs@xyz.com",
        "orgId": "761eda6a-9a17-4047-b64b-2ce6c624fb8d",
        "supervisorId": "761eda6a-9a17-4047-b64b-2ce6c624fb8d",
        "secondaryEmail": "pqr@xyz",
        "department": "ENG",
        "subDepartment": "IT"
    }

But I need to map same id which is in UserPayload and UserExtraPayload

I tried using @JsonUnwrap but it's not working.

I want to map a single id in both payload in UserExtra and UserPayload......


问:
If make_heap is slowing down a path planning program, are there solutions or alternatives to solve it?
Quick version of the issue:

I've worked with a D* Lite path planner in C++ but it takes a lot longer than I hoped when it encounters an obstacle. During a test on a 2560x2560 map I discovered that re-planning around an obstacle that appears at the start takes approximately 49.5 seconds, but 42.8 seconds of that is spent in the function that inserts new nodes into the heap, a function that looks like this:

```<code>void DstarPlanner::insertHeap(unsigned int id, HeapKey k) {
  U.push_back({ k, id });
  make_heap(U.begin(), U.end(), KeyCompare());
}
</code>```

The keys and other variables used in the function are as such:

```<code>using Cost = float;
using Edge = pair<unsigned int, unsigned int>;
using HeapKey = pair<Cost, Cost>;
using KeyCompare = std::greater<std::pair<HeapKey, unsigned int>>;
vector<pair<HeapKey, unsigned int>> U;
</code>```

Basically I'm wondering if there's some solution to this I can implement to get those faster times D* Lite is supposed to have? Some quick line of code, or other function that solves everything is always a nice fantasy, but ready to try whatever, I just don't have time to rebuild the entire program. So if make_heap is as fast as it gets, well, I guess I'll just run with that.

More details regarding the issue:

I've studied the issue a bit and apparently the 'time complexity of insertion in heap' is a thing. My tests shows that D* Lite replanning is faster than making a new plan with my program, however, I dusted off an old A* planner I made and while it can't do a map of similar size, it is faster than my D* Lite on smaller maps when an obstacle appear at [1][1]. When the obstacle disappears my D* Lite is faster than A*, but I had hoped it would be faster in both cases.

My A* uses cells in an openlist defined by:

```<code>struct cells {
  int currentCell;
  float fCost;
};

multiset<cells> OPL;
</code>```

Instead of a heap. I found an D* Lite program online that used:

```<code>ds_pq openList;
</code>```

Where ds_pq is defined as:

```<code>typedef std::priority_queue<state, std::vector<state>, std::greater<state>> dq_pq
</code>```

But whether this is better or faster I don't know as I haven't been able to run the program.

Body:
Quick version of the issue:

I've worked with a D* Lite path planner in C++ but it takes a lot longer than I hoped when it encounters an obstacle. During a test on a 2560x2560 map I discovered that re-planning around an obstacle that appears at the start takes approximately 49.5 seconds, but 42.8 seconds of that is spent in the function that inserts new nodes into the heap, a function that looks like this:

void DstarPlanner::insertHeap(unsigned int id, HeapKey k) {
  U.push_back({ k, id });
  make_heap(U.begin(), U.end(), KeyCompare());
}

The keys and other variables used in the function are as such:

using Cost = float;
using Edge = pair<unsigned int, unsigned int>;
using HeapKey = pair<Cost, Cost>;
using KeyCompare = std::greater<std::pair<HeapKey, unsigned int>>;
vector<pair<HeapKey, unsigned int>> U;

Basically I'm wondering if there's some solution to this I can implement to get those faster times D* Lite is supposed to have? Some quick line of code, or other function that solves everything is always a nice fantasy, but ready to try whatever, I just don't have time to rebuild the entire program. So if make_heap is as fast as it gets, well, I guess I'll just run with that.

More details regarding the issue:

I've studied the issue a bit and apparently the 'time complexity of insertion in heap' is a thing. My tests shows that D* Lite replanning is faster than making a new plan with my program, however, I dusted off an old A* planner I made and while it can't do a map of similar size, it is faster than my D* Lite on smaller maps when an obstacle appear at [1][1]. When the obstacle disappears my D* Lite is faster than A*, but I had hoped it would be faster in both cases.

My A* uses cells in an openlist defined by:

struct cells {
  int currentCell;
  float fCost;
};

multiset<cells> OPL;

Instead of a heap. I found an D* Lite program online that used:

ds_pq openList;

Where ds_pq is defined as:

typedef std::priority_queue<state, std::vector<state>, std::greater<state>> dq_pq

But whether this is better or faster I don't know as I haven't been able to run the program.


问:
R markdown preview
I hstarted using RMarkdown today. When I first knitted, I managed to close the preview window. Now I can't reopen the preview window. Even if I change to preview in Viewer Pane, there is no preview.

I have tried to close and restart Rstudio and to make new Rmarkdown documents, but nothing works. How can I see the preview again?

Title: R markdown preview


问:
ranking scores in R
I have a dataset with multiple columns of scores I would rank from 1 to 10.

My ds is like this

```<code>     col1  col2
AA   5.64  2.33
BB   8.95  12
Cc   1.3   0.3
DD   2.55  7.66
EE   19.2  9.555
FF   88    42
GG   88    12
</code>```

My expected result is

```<code>   col1  col2
AA   3    2
BB   4    5
CC   1    1
DD   2    3
EE   5    4
FF   6    6
GG   6    5
</code>```

Attacked the df of scores and the wrong output

I tried this, where rankCols is the name of columns (col1, col2) and x is the name of rows (AA, BB, CC, DD) with the values.

```<code>setDT(df)[, c(rankCols):=lapply(.SD, \(x) frank(-x)), .SDcols=rankCols]
</code>```

but the result is not really working, jumping, for examples from 4 to repeated 7s. I have no idea why.

This is my script. "matrixes" is a list containing 3 data.frame

```<code>for(gg in 1:length(matrixes)){
df=data.frame(t(matrixes[[gg]]))  #trasponse the data.frame
names=rownames(df)
rankCols <- colnames(df)
setDT(df)[, c(rankCols):=lapply(.SD, \(x) frank(-x)), .SDcols=rankCols]  #this I think does not work
df=as.data.frame(df)
rownames(df) = names
dflist[[gg]]= df  #this save the df in a new list named dflist
}
</code>```

Title: ranking scores in R

Body:
I have a dataset with multiple columns of scores I would rank from 1 to 10.

My ds is like this

     col1  col2
AA   5.64  2.33
BB   8.95  12
Cc   1.3   0.3
DD   2.55  7.66
EE   19.2  9.555
FF   88    42
GG   88    12

My expected result is

   col1  col2
AA   3    2
BB   4    5
CC   1    1
DD   2    3
EE   5    4
FF   6    6
GG   6    5

Attacked the df of scores and the wrong output

I tried this, where rankCols is the name of columns (col1, col2) and x is the name of rows (AA, BB, CC, DD) with the values.

setDT(df)[, c(rankCols):=lapply(.SD, \(x) frank(-x)), .SDcols=rankCols]

but the result is not really working, jumping, for examples from 4 to repeated 7s. I have no idea why.

This is my script. "matrixes" is a list containing 3 data.frame

for(gg in 1:length(matrixes)){
df=data.frame(t(matrixes[[gg]]))  #trasponse the data.frame
names=rownames(df)
rankCols <- colnames(df)
setDT(df)[, c(rankCols):=lapply(.SD, \(x) frank(-x)), .SDcols=rankCols]  #this I think does not work
df=as.data.frame(df)
rownames(df) = names
dflist[[gg]]= df  #this save the df in a new list named dflist
}


问:
React and DRF on Different subdomains
I am trying to figure out why I am getting 405(NOT ALLOWED) on all pages. I assume that somewhere I missed something but I cannot figure out what exactly. Both of them are via NGINX.

NOTE: I would like to mention that backend was tested via postman and is working well.

Title: React and DRF on Different subdomains