问:
How to navigate through pages within the website using Selenium and Python
I'm scraping this website( http://rera.rajasthan.gov.in/ProjectSearch) using Python and Selenium. I have the code working but it currently only scrapes the first page, I would like to iterate through all the pages and scrape all the VIEW present in them, but they handle pagination in a weird way how would I go through the pages and scrape them one by one?

My source code:

```<code>from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException, WebDriverException
import time

opt = webdriver.ChromeOptions()
opt.add_argument("--ignore-certificate-errors")
opt.add_argument("--start-maximized")

driver = webdriver.Chrome(executable_path=r"C:\Users\fit foodie\PycharmProjects\Selenium\Browser\chromedriver.exe", options=opt)

driver.get(url="http://rera.rajasthan.gov.in/")
search= driver.find_element_by_xpath("//*[@id='liSearch']/a").click()
proj_src=driver.find_element_by_xpath("//*[@id='liSearch']/ul/li[1]/a").click()

search_btn = driver.find_element_by_xpath('//*[@id="btn_SearchProjectSubmit"]').click()

def page():
    while True:
        try:
            driver.execute_script("return arguments[0].scrollIntoView(true);", WebDriverWait(driver, 20).until(
                EC.element_to_be_clickable((By.XPATH, "//*[@id='OuterProjectGrid']/div[4]/div[4]/a"))))
            driver.find_element_by_xpath("//*[@id='OuterProjectGrid']/div[4]/div[4]/a").click()
            print("Navigating to Next Page")
        except (TimeoutException, WebDriverException) as e:
            print("Last page reached")
            break
</code>```

unable to paginate through this

img:

this is the

答:
For Pagination Use the following css selector and provide delay after each click.

```<code>def page():
    i=2
    while True:
        try:
            driver.execute_script("arguments[0].scrollIntoView();", WebDriverWait(driver, 20).until(
                EC.element_to_be_clickable((By.CSS_SELECTOR, "a[data-p='{}']".format(i)))))
            driver.find_element_by_css_selector("a[data-p='{}']".format(i)).click()

            print("Navigating to Next Page " + str(i))
            i=i+1
            time.sleep(1)
        except (TimeoutException, WebDriverException) as e:
            print("Last page reached")
            break

page()
</code>```

Output: console snapshot

If your objectives to get all table data from all pages you can do that without selenium as well.You can try python requests module and use post request.

```<code>import requests
data={
    "PageSize" :1250,
    "page": 1
}
res=requests.post("http://rera.rajasthan.gov.in/Home/GetProjectsList",data=data).json()
for item in res['Data']['Items']:
    print(item['DistrictName'],item['ProjectName'],item['ProjectTypeName'],item['PromoterName'],item['ApplicationNo'],item['CertificateNo'])
</code>```

Output for all pages like that.

```<code>Jaipur ATHARV APPARTMENT Group Housing SHP HOME LLP Revoked Project Revoked Project
Jaipur JVJ DREAM RESIDENCY Group Housing JVJ DREAM DEVELOPERS LLP RAJ-RERA-APP-P-2020-2214 (19/03/2020) RAJ/P/2020/1262 (29/05/2020)
Chittorgarh SHARDA ROYAL GREENS Plotted Development Choudhary Infraheight Private Limited RAJ-RERA-APP-P-2020-2201 (17/03/2020) RAJ/P/2020/1261 (29/05/2020)
Tonk GREEN CITY-A BLOCK Plotted Development SUN INDIA REALHOME LLP RAJ-RERA-APP-P-2020-2173 (04/03/2020) RAJ/P/2020/1260 (29/05/2020)
Ajmer Dream Homz Group Housing G S DREAMHOME LLP RAJ-RERA-APP-P-2020-2188 (13/03/2020) RAJ/P/2020/1259 (20/05/2020)
Jaipur KEDIA'S AMARA Group Housing KEDIA BUILDERS AND COLONIZERS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2224 (13/05/2020) RAJ/P/2020/1258 (18/05/2020)
Jaipur Kuber Garden Group Housing PUNIT ESTATES PRIVATE LIMITED RAJ-RERA-APP-P-2020-2221 (29/04/2020) RAJ/P/2020/1257 (04/05/2020)
Kota SHUBH SAVERA Plotted Development SANTOSH  SAINI RAJ-RERA-APP-P-2020-2222 (29/04/2020) RAJ/P/2020/1256 (02/05/2020)
Udaipur MIRACLE Group Housing BHOOMISHIV BUILDERS LLP RAJ-RERA-APP-P-2020-2117 (15/02/2020) RAJ/P/2020/1255 (02/05/2020)
Jaipur NANDAN PRIME VILLAS Group Housing NARENDRA KUMAR AGARWAL RAJ-RERA-APP-P-2020-2184 (11/03/2020) RAJ/P/2020/1254 (28/04/2020)
Jaipur Akshat Kanota Estate-Phase 3 Group Housing AKSHAT APARTMENTS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2052 (24/01/2020) RAJ/P/2020/1253 (20/04/2020)
Jaipur SHREE RADHA KRISHNA APARTMENT Group Housing GURUSAIKRIPA BUILDERS LLP RAJ-RERA-APP-P-2020-2213 (19/03/2020) RAJ/P/2020/1252 (16/04/2020)
Jodhpur Mangaldeep Darshan Group Housing Mangaldeep DaRSHAN RAJ-RERA-APP-P-2020-2186 (12/03/2020) RAJ/P/2020/1251 (16/04/2020)
Sri Ganganagar SHREENATH ENCLAVE Plotted Development ANANDAM HEIGHTS DEVELOPERS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2144 (27/02/2020) RAJ/P/2020/1250 (16/04/2020)
Jaipur SHEKHAWAT CREST Group Housing M R S B INFRA PROJECT PRIVATE LIMITED RAJ-RERA-APP-P-2020-2181 (11/03/2020) RAJ/P/2020/1249 (12/04/2020)
Kota S.S. TIRUPATI TOWER Mixed (Residential And Commercial) S S TIRUPATI INFRAPROJECTS RAJ-RERA-APP-P-2020-2123 (18/02/2020) RAJ/P/2020/1248 (12/04/2020)
Jhalawar Green Villas Group Housing CHAUDHARY BHOORAMAL DEVELOPERS RAJ-RERA-APP-P-2020-2139 (25/02/2020) RAJ/P/2020/1247 (09/04/2020)
Ajmer Samriddhi's Dynasty Group Housing SANKALP REALMART PVT LTD RAJ-RERA-APP-P-2020-2073 (01/02/2020) RAJ/P/2020/1246 (27/03/2020)
Udaipur ARCHI'S  LOTUS PARK Group Housing ARCHI BUILDMART PRIVATE LIMITED RAJ-RERA-APP-P-2020-2171 (03/03/2020) RAJ/P/2020/1245 (27/03/2020)
Alwar KRISHAN KUNJ Plotted Development CHHOTE LAL MEENA RAJ-RERA-APP-P-2020-2067 (29/01/2020) RAJ/P/2020/1244 (27/03/2020)
Jodhpur SHANKHESHWAR NAGAR Plotted Development BALWANT  RAM RAJ-RERA-APP-P-2020-2095 (10/02/2020) RAJ/P/2020/1243 (27/03/2020)
Jodhpur VEERPRATAP INDUSTRIAL PARK Plotted Development VICTORIA INFRA HOLDINGS PRIVATE LIMITED RAJ-RERA-APP-P-2019-1699 (23/10/2019) RAJ/P/2020/1242 (27/03/2020)
Jaipur Ram Awas Group Housing Shubhashish Builders and Developers RAJ-RERA-APP-P-2020-2023 (17/01/2020) RAJ/P/2020/1241 (27/03/2020)
Sikar SHREE HANUMAN HEIGHTS Commercial MAHADEV BUILDERS AND DEVELOPERS RAJ-RERA-APP-P-2020-2166 (03/03/2020) RAJ/P/2020/1240 (27/03/2020)
Sikar MADHUVAN HOMES Group Housing RAJENDRA SINGH KHICHAR RAJ-RERA-APP-P-2020-2155 (02/03/2020) RAJ/P/2020/1239 (27/03/2020)
Baran SUMERU SOHAM Mixed (Residential And Commercial) SUMERU LIFE SPACE INDIA PRIVATE LIMITED RAJ-RERA-APP-P-2020-2172 (03/03/2020) RAJ/P/2020/1238 (27/03/2020)
Jodhpur ASHAPURNA ANMOL PHASE-I Group Housing ASHAPURNA BUILDCON LIMITED RAJ-RERA-APP-P-2020-2090 (07/02/2020) RAJ/P/2020/1237 (27/03/2020)
Sirohi AYODHYAPURAM SHEOGANJ Group Housing RAMBHADEEP BUILDCON PRIVATE LIMITED  RAJ-RERA-APP-P-2020-2111 (14/02/2020) RAJ/P/2020/1236 (27/03/2020)
Jaipur Bhavyaa Green Zenith Group Housing BHAVYAA GREEN BUILDERS RAJ-RERA-APP-P-2020-2163 (03/03/2020) RAJ/P/2020/1235 (20/03/2020)
Dholpur G.K. CITY Group Housing G K Builders RAJ-RERA-APP-P-2020-2065 (29/01/2020) RAJ/P/2020/1234 (20/03/2020)
Udaipur ARCHI'S PEARL PARADISE Group Housing ARCHI CIVIL CONSTRUCTION PRIVATE LIMITED RAJ-RERA-APP-P-2020-2142 (27/02/2020) RAJ/P/2020/1233 (20/03/2020)
Jaipur Stareef Suites 88 Group Housing Arihant Prime Buildtech LLP RAJ-RERA-APP-P-2020-2083 (05/02/2020) RAJ/P/2020/1232 (20/03/2020)
Jaipur HARITWAL CITY - D Plotted Development BHARURAM  JAT RAJ-RERA-APP-P-2020-2119 (17/02/2020) RAJ/P/2020/1231 (19/03/2020)
Jodhpur CMJAY LORDI PANDIT JI PACKAGE-10 JODHPUR Group Housing JODHPUR DEVELOPMENT AUTHORITY RAJ-RERA-APP-P-2020-2191 (13/03/2020) RAJ/P/2020/1230 (18/03/2020)
Jaipur Vedic Villas Phase- II Group Housing KEDIA BUILDERS AND COLONIZERS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2169 (03/03/2020) RAJ/P/2020/1229 (12/03/2020)
Tonk SHREE GANESH VATIKA Plotted Development RAM KRISHAN COLONIZERS AND DEVELOPEPRS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2158 (02/03/2020) RAJ/P/2020/1228 (11/03/2020)
Jaipur Vinayak Residency A+B+C (Extension) Plotted Development Vinayak Developers RAJ-RERA-APP-P-2020-2092 (10/02/2020) RAJ/P/2020/1226 (11/03/2020)
Jaipur NIRANJAN VIHAR EXTENSION Plotted Development SHRI GOVARDHAN ESTATES PRIVATE LIMITED  RAJ-RERA-APP-P-2020-2099 (11/02/2020) RAJ/P/2020/1225 (11/03/2020)
Jaipur SHREE PARSHVANATH ENCLAVE Group Housing PARSHVANATH INFRA PROJECT RAJ-RERA-APP-P-2020-2030 (21/01/2020) RAJ/P/2020/1224 (11/03/2020)
Jaipur Vrinda Gardens Phase V Group Housing Vista Housing RAJ-RERA-APP-P-2020-2097 (11/02/2020) RAJ/P/2020/1223 (06/03/2020)
Jaipur Ashiana Amantran Phase II Group Housing Ashiana Housing Limited RAJ-RERA-APP-P-2020-2125 (19/02/2020) RAJ/P/2020/1221 (06/03/2020)
Jaipur MANGLAM AANANDA PHASE III (B) Group Housing MANGLAM BUILD DEVELOPERS LIMITED RAJ-RERA-APP-P-2020-2152 (29/02/2020) RAJ/P/2020/1220 (06/03/2020)
Sirohi Karan Heights Group Housing Samdarshi Builders RAJ-RERA-APP-P-2020-2043 (23/01/2020) RAJ/P/2020/1219 (04/03/2020)
Alwar Krish City Centre Commercial Narmada Asbestos Pipes Private Limited RAJ-RERA-APP-P-2020-2021 (16/01/2020) RAJ/P/2020/1218 (04/03/2020)
Bhilwara OSTWAL EMPIRE-1 Plotted Development KULDEEP UMRAOSINGH OSTWAL RAJ-RERA-APP-P-2020-2040 (22/01/2020) RAJ/P/2020/1217 (04/03/2020)
Bhilwara OSTWAL EMPIRE-2 Plotted Development UMRAOSINGH PRITHVIRAJ OSTWAL RAJ-RERA-APP-P-2020-2039 (22/01/2020) RAJ/P/2020/1216 (04/03/2020)
Kota AKANSHA DEEP HEIGHTS Group Housing AKANSHA INFRA HOUSING PROJECTS RAJ-RERA-APP-P-2020-2122 (17/02/2020) RAJ/P/2020/1215 (04/03/2020)
Jodhpur NAKSHATRA Group Housing VISION ASSOCIATES RAJ-RERA-APP-P-2020-2070 (31/01/2020) RAJ/P/2020/1214 (03/03/2020)
Jodhpur CMJAY CHOKHA JODHPUR Group Housing JODHPUR DEVELOPMENT AUTHORITY RAJ-RERA-APP-P-2019-1514 (26/07/2019) RAJ/P/2020/1213 (02/03/2020)
Bikaner Shanti Nilay Group Housing Shanti Infrapromoters Private Limited RAJ-RERA-APP-P-2020-2036 (22/01/2020) RAJ/P/2020/1212 (02/03/2020)
Jaipur GOVINDAM TOWER Group Housing BRIJHARI HOMES LLP RAJ-RERA-APP-P-2020-2089 (07/02/2020) RAJ/P/2020/1208 (24/02/2020)
Jaipur Mukhya Mantri Rajya Sahayak Awasiya Karamchari Yojana Group Housing RAJASTHAN HOUSING BOARD RAJ-RERA-APP-P-2020-2126 (19/02/2020) RAJ/P/2020/1207 (21/02/2020)
Jaipur Ayush Market Plotted Development RAJASTHAN HOUSING BOARD RAJ-RERA-APP-P-2020-2128 (20/02/2020) RAJ/P/2020/1206 (21/02/2020)
Jaipur Kedia's The Oxygen Phase II Group Housing Radha Govind Colonizers RAJ-RERA-APP-P-2020-2103 (11/02/2020) RAJ/P/2020/1205 (19/02/2020)
Alwar Terra Aashray Group Housing Terra Realcon Private Limited RAJ-RERA-APP-P-2019-1530 (31/07/2019) RAJ/P/2020/1204 (19/02/2020)
Jodhpur EWS-335&LIG-153 Houses at Barli Scheme, Jodhpur under MGSY Group Housing RAJASTHAN HOUSING BOARD RAJ-RERA-APP-P-2020-2121 (17/02/2020) RAJ/P/2020/1203 (18/02/2020)
Jaipur GANESH VIHAR Plotted Development BIRDA RAM MEENA RAJ-RERA-APP-P-2019-1801 (24/12/2019) RAJ/P/2020/1202 (18/02/2020)
Jaipur SUMAN ENCLAVE H-BLOCK Plotted Development MS SAMRIDHI BUILDDEV PVT LTD RAJ-RERA-APP-P-2019-1802 (24/12/2019) RAJ/P/2020/1201 (18/02/2020)
Jaipur SOMYA SKY CREST Group Housing SOMYA BUILDHOME LLP RAJ-RERA-APP-P-2020-2062 (28/01/2020) RAJ/P/2020/1200 (17/02/2020)
Kota Neelkanth Residency Plotted Development Kailash Chand Malviya RAJ-RERA-APP-P-2019-1684 (09/10/2019) RAJ/P/2020/1199 (12/02/2020)
Jaipur VEDIC VILLAS PHASE-I Group Housing KEDIA BUILDERS AND COLONIZERS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2072 (31/01/2020) RAJ/P/2020/1198 (12/02/2020)
Jaipur GOVINDAM PARADISE Group Housing BRIJHARI BUILDHOME LLP RAJ-RERA-APP-P-2020-2068 (29/01/2020) RAJ/P/2020/1197 (12/02/2020)
</code>```

Body:
I'm scraping this website( http://rera.rajasthan.gov.in/ProjectSearch) using Python and Selenium. I have the code working but it currently only scrapes the first page, I would like to iterate through all the pages and scrape all the VIEW present in them, but they handle pagination in a weird way how would I go through the pages and scrape them one by one?

My source code:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException, WebDriverException
import time

opt = webdriver.ChromeOptions()
opt.add_argument("--ignore-certificate-errors")
opt.add_argument("--start-maximized")

driver = webdriver.Chrome(executable_path=r"C:\Users\fit foodie\PycharmProjects\Selenium\Browser\chromedriver.exe", options=opt)

driver.get(url="http://rera.rajasthan.gov.in/")
search= driver.find_element_by_xpath("//*[@id='liSearch']/a").click()
proj_src=driver.find_element_by_xpath("//*[@id='liSearch']/ul/li[1]/a").click()

search_btn = driver.find_element_by_xpath('//*[@id="btn_SearchProjectSubmit"]').click()

def page():
    while True:
        try:
            driver.execute_script("return arguments[0].scrollIntoView(true);", WebDriverWait(driver, 20).until(
                EC.element_to_be_clickable((By.XPATH, "//*[@id='OuterProjectGrid']/div[4]/div[4]/a"))))
            driver.find_element_by_xpath("//*[@id='OuterProjectGrid']/div[4]/div[4]/a").click()
            print("Navigating to Next Page")
        except (TimeoutException, WebDriverException) as e:
            print("Last page reached")
            break

unable to paginate through this

img:

this is the

Body:
For Pagination Use the following css selector and provide delay after each click.

def page():
    i=2
    while True:
        try:
            driver.execute_script("arguments[0].scrollIntoView();", WebDriverWait(driver, 20).until(
                EC.element_to_be_clickable((By.CSS_SELECTOR, "a[data-p='{}']".format(i)))))
            driver.find_element_by_css_selector("a[data-p='{}']".format(i)).click()

            print("Navigating to Next Page " + str(i))
            i=i+1
            time.sleep(1)
        except (TimeoutException, WebDriverException) as e:
            print("Last page reached")
            break

page()

Output: console snapshot

If your objectives to get all table data from all pages you can do that without selenium as well.You can try python requests module and use post request.

import requests
data={
    "PageSize" :1250,
    "page": 1
}
res=requests.post("http://rera.rajasthan.gov.in/Home/GetProjectsList",data=data).json()
for item in res['Data']['Items']:
    print(item['DistrictName'],item['ProjectName'],item['ProjectTypeName'],item['PromoterName'],item['ApplicationNo'],item['CertificateNo'])

Output for all pages like that.

Jaipur ATHARV APPARTMENT Group Housing SHP HOME LLP Revoked Project Revoked Project
Jaipur JVJ DREAM RESIDENCY Group Housing JVJ DREAM DEVELOPERS LLP RAJ-RERA-APP-P-2020-2214 (19/03/2020) RAJ/P/2020/1262 (29/05/2020)
Chittorgarh SHARDA ROYAL GREENS Plotted Development Choudhary Infraheight Private Limited RAJ-RERA-APP-P-2020-2201 (17/03/2020) RAJ/P/2020/1261 (29/05/2020)
Tonk GREEN CITY-A BLOCK Plotted Development SUN INDIA REALHOME LLP RAJ-RERA-APP-P-2020-2173 (04/03/2020) RAJ/P/2020/1260 (29/05/2020)
Ajmer Dream Homz Group Housing G S DREAMHOME LLP RAJ-RERA-APP-P-2020-2188 (13/03/2020) RAJ/P/2020/1259 (20/05/2020)
Jaipur KEDIA'S AMARA Group Housing KEDIA BUILDERS AND COLONIZERS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2224 (13/05/2020) RAJ/P/2020/1258 (18/05/2020)
Jaipur Kuber Garden Group Housing PUNIT ESTATES PRIVATE LIMITED RAJ-RERA-APP-P-2020-2221 (29/04/2020) RAJ/P/2020/1257 (04/05/2020)
Kota SHUBH SAVERA Plotted Development SANTOSH  SAINI RAJ-RERA-APP-P-2020-2222 (29/04/2020) RAJ/P/2020/1256 (02/05/2020)
Udaipur MIRACLE Group Housing BHOOMISHIV BUILDERS LLP RAJ-RERA-APP-P-2020-2117 (15/02/2020) RAJ/P/2020/1255 (02/05/2020)
Jaipur NANDAN PRIME VILLAS Group Housing NARENDRA KUMAR AGARWAL RAJ-RERA-APP-P-2020-2184 (11/03/2020) RAJ/P/2020/1254 (28/04/2020)
Jaipur Akshat Kanota Estate-Phase 3 Group Housing AKSHAT APARTMENTS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2052 (24/01/2020) RAJ/P/2020/1253 (20/04/2020)
Jaipur SHREE RADHA KRISHNA APARTMENT Group Housing GURUSAIKRIPA BUILDERS LLP RAJ-RERA-APP-P-2020-2213 (19/03/2020) RAJ/P/2020/1252 (16/04/2020)
Jodhpur Mangaldeep Darshan Group Housing Mangaldeep DaRSHAN RAJ-RERA-APP-P-2020-2186 (12/03/2020) RAJ/P/2020/1251 (16/04/2020)
Sri Ganganagar SHREENATH ENCLAVE Plotted Development ANANDAM HEIGHTS DEVELOPERS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2144 (27/02/2020) RAJ/P/2020/1250 (16/04/2020)
Jaipur SHEKHAWAT CREST Group Housing M R S B INFRA PROJECT PRIVATE LIMITED RAJ-RERA-APP-P-2020-2181 (11/03/2020) RAJ/P/2020/1249 (12/04/2020)
Kota S.S. TIRUPATI TOWER Mixed (Residential And Commercial) S S TIRUPATI INFRAPROJECTS RAJ-RERA-APP-P-2020-2123 (18/02/2020) RAJ/P/2020/1248 (12/04/2020)
Jhalawar Green Villas Group Housing CHAUDHARY BHOORAMAL DEVELOPERS RAJ-RERA-APP-P-2020-2139 (25/02/2020) RAJ/P/2020/1247 (09/04/2020)
Ajmer Samriddhi's Dynasty Group Housing SANKALP REALMART PVT LTD RAJ-RERA-APP-P-2020-2073 (01/02/2020) RAJ/P/2020/1246 (27/03/2020)
Udaipur ARCHI'S  LOTUS PARK Group Housing ARCHI BUILDMART PRIVATE LIMITED RAJ-RERA-APP-P-2020-2171 (03/03/2020) RAJ/P/2020/1245 (27/03/2020)
Alwar KRISHAN KUNJ Plotted Development CHHOTE LAL MEENA RAJ-RERA-APP-P-2020-2067 (29/01/2020) RAJ/P/2020/1244 (27/03/2020)
Jodhpur SHANKHESHWAR NAGAR Plotted Development BALWANT  RAM RAJ-RERA-APP-P-2020-2095 (10/02/2020) RAJ/P/2020/1243 (27/03/2020)
Jodhpur VEERPRATAP INDUSTRIAL PARK Plotted Development VICTORIA INFRA HOLDINGS PRIVATE LIMITED RAJ-RERA-APP-P-2019-1699 (23/10/2019) RAJ/P/2020/1242 (27/03/2020)
Jaipur Ram Awas Group Housing Shubhashish Builders and Developers RAJ-RERA-APP-P-2020-2023 (17/01/2020) RAJ/P/2020/1241 (27/03/2020)
Sikar SHREE HANUMAN HEIGHTS Commercial MAHADEV BUILDERS AND DEVELOPERS RAJ-RERA-APP-P-2020-2166 (03/03/2020) RAJ/P/2020/1240 (27/03/2020)
Sikar MADHUVAN HOMES Group Housing RAJENDRA SINGH KHICHAR RAJ-RERA-APP-P-2020-2155 (02/03/2020) RAJ/P/2020/1239 (27/03/2020)
Baran SUMERU SOHAM Mixed (Residential And Commercial) SUMERU LIFE SPACE INDIA PRIVATE LIMITED RAJ-RERA-APP-P-2020-2172 (03/03/2020) RAJ/P/2020/1238 (27/03/2020)
Jodhpur ASHAPURNA ANMOL PHASE-I Group Housing ASHAPURNA BUILDCON LIMITED RAJ-RERA-APP-P-2020-2090 (07/02/2020) RAJ/P/2020/1237 (27/03/2020)
Sirohi AYODHYAPURAM SHEOGANJ Group Housing RAMBHADEEP BUILDCON PRIVATE LIMITED  RAJ-RERA-APP-P-2020-2111 (14/02/2020) RAJ/P/2020/1236 (27/03/2020)
Jaipur Bhavyaa Green Zenith Group Housing BHAVYAA GREEN BUILDERS RAJ-RERA-APP-P-2020-2163 (03/03/2020) RAJ/P/2020/1235 (20/03/2020)
Dholpur G.K. CITY Group Housing G K Builders RAJ-RERA-APP-P-2020-2065 (29/01/2020) RAJ/P/2020/1234 (20/03/2020)
Udaipur ARCHI'S PEARL PARADISE Group Housing ARCHI CIVIL CONSTRUCTION PRIVATE LIMITED RAJ-RERA-APP-P-2020-2142 (27/02/2020) RAJ/P/2020/1233 (20/03/2020)
Jaipur Stareef Suites 88 Group Housing Arihant Prime Buildtech LLP RAJ-RERA-APP-P-2020-2083 (05/02/2020) RAJ/P/2020/1232 (20/03/2020)
Jaipur HARITWAL CITY - D Plotted Development BHARURAM  JAT RAJ-RERA-APP-P-2020-2119 (17/02/2020) RAJ/P/2020/1231 (19/03/2020)
Jodhpur CMJAY LORDI PANDIT JI PACKAGE-10 JODHPUR Group Housing JODHPUR DEVELOPMENT AUTHORITY RAJ-RERA-APP-P-2020-2191 (13/03/2020) RAJ/P/2020/1230 (18/03/2020)
Jaipur Vedic Villas Phase- II Group Housing KEDIA BUILDERS AND COLONIZERS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2169 (03/03/2020) RAJ/P/2020/1229 (12/03/2020)
Tonk SHREE GANESH VATIKA Plotted Development RAM KRISHAN COLONIZERS AND DEVELOPEPRS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2158 (02/03/2020) RAJ/P/2020/1228 (11/03/2020)
Jaipur Vinayak Residency A+B+C (Extension) Plotted Development Vinayak Developers RAJ-RERA-APP-P-2020-2092 (10/02/2020) RAJ/P/2020/1226 (11/03/2020)
Jaipur NIRANJAN VIHAR EXTENSION Plotted Development SHRI GOVARDHAN ESTATES PRIVATE LIMITED  RAJ-RERA-APP-P-2020-2099 (11/02/2020) RAJ/P/2020/1225 (11/03/2020)
Jaipur SHREE PARSHVANATH ENCLAVE Group Housing PARSHVANATH INFRA PROJECT RAJ-RERA-APP-P-2020-2030 (21/01/2020) RAJ/P/2020/1224 (11/03/2020)
Jaipur Vrinda Gardens Phase V Group Housing Vista Housing RAJ-RERA-APP-P-2020-2097 (11/02/2020) RAJ/P/2020/1223 (06/03/2020)
Jaipur Ashiana Amantran Phase II Group Housing Ashiana Housing Limited RAJ-RERA-APP-P-2020-2125 (19/02/2020) RAJ/P/2020/1221 (06/03/2020)
Jaipur MANGLAM AANANDA PHASE III (B) Group Housing MANGLAM BUILD DEVELOPERS LIMITED RAJ-RERA-APP-P-2020-2152 (29/02/2020) RAJ/P/2020/1220 (06/03/2020)
Sirohi Karan Heights Group Housing Samdarshi Builders RAJ-RERA-APP-P-2020-2043 (23/01/2020) RAJ/P/2020/1219 (04/03/2020)
Alwar Krish City Centre Commercial Narmada Asbestos Pipes Private Limited RAJ-RERA-APP-P-2020-2021 (16/01/2020) RAJ/P/2020/1218 (04/03/2020)
Bhilwara OSTWAL EMPIRE-1 Plotted Development KULDEEP UMRAOSINGH OSTWAL RAJ-RERA-APP-P-2020-2040 (22/01/2020) RAJ/P/2020/1217 (04/03/2020)
Bhilwara OSTWAL EMPIRE-2 Plotted Development UMRAOSINGH PRITHVIRAJ OSTWAL RAJ-RERA-APP-P-2020-2039 (22/01/2020) RAJ/P/2020/1216 (04/03/2020)
Kota AKANSHA DEEP HEIGHTS Group Housing AKANSHA INFRA HOUSING PROJECTS RAJ-RERA-APP-P-2020-2122 (17/02/2020) RAJ/P/2020/1215 (04/03/2020)
Jodhpur NAKSHATRA Group Housing VISION ASSOCIATES RAJ-RERA-APP-P-2020-2070 (31/01/2020) RAJ/P/2020/1214 (03/03/2020)
Jodhpur CMJAY CHOKHA JODHPUR Group Housing JODHPUR DEVELOPMENT AUTHORITY RAJ-RERA-APP-P-2019-1514 (26/07/2019) RAJ/P/2020/1213 (02/03/2020)
Bikaner Shanti Nilay Group Housing Shanti Infrapromoters Private Limited RAJ-RERA-APP-P-2020-2036 (22/01/2020) RAJ/P/2020/1212 (02/03/2020)
Jaipur GOVINDAM TOWER Group Housing BRIJHARI HOMES LLP RAJ-RERA-APP-P-2020-2089 (07/02/2020) RAJ/P/2020/1208 (24/02/2020)
Jaipur Mukhya Mantri Rajya Sahayak Awasiya Karamchari Yojana Group Housing RAJASTHAN HOUSING BOARD RAJ-RERA-APP-P-2020-2126 (19/02/2020) RAJ/P/2020/1207 (21/02/2020)
Jaipur Ayush Market Plotted Development RAJASTHAN HOUSING BOARD RAJ-RERA-APP-P-2020-2128 (20/02/2020) RAJ/P/2020/1206 (21/02/2020)
Jaipur Kedia's The Oxygen Phase II Group Housing Radha Govind Colonizers RAJ-RERA-APP-P-2020-2103 (11/02/2020) RAJ/P/2020/1205 (19/02/2020)
Alwar Terra Aashray Group Housing Terra Realcon Private Limited RAJ-RERA-APP-P-2019-1530 (31/07/2019) RAJ/P/2020/1204 (19/02/2020)
Jodhpur EWS-335&LIG-153 Houses at Barli Scheme, Jodhpur under MGSY Group Housing RAJASTHAN HOUSING BOARD RAJ-RERA-APP-P-2020-2121 (17/02/2020) RAJ/P/2020/1203 (18/02/2020)
Jaipur GANESH VIHAR Plotted Development BIRDA RAM MEENA RAJ-RERA-APP-P-2019-1801 (24/12/2019) RAJ/P/2020/1202 (18/02/2020)
Jaipur SUMAN ENCLAVE H-BLOCK Plotted Development MS SAMRIDHI BUILDDEV PVT LTD RAJ-RERA-APP-P-2019-1802 (24/12/2019) RAJ/P/2020/1201 (18/02/2020)
Jaipur SOMYA SKY CREST Group Housing SOMYA BUILDHOME LLP RAJ-RERA-APP-P-2020-2062 (28/01/2020) RAJ/P/2020/1200 (17/02/2020)
Kota Neelkanth Residency Plotted Development Kailash Chand Malviya RAJ-RERA-APP-P-2019-1684 (09/10/2019) RAJ/P/2020/1199 (12/02/2020)
Jaipur VEDIC VILLAS PHASE-I Group Housing KEDIA BUILDERS AND COLONIZERS PRIVATE LIMITED RAJ-RERA-APP-P-2020-2072 (31/01/2020) RAJ/P/2020/1198 (12/02/2020)
Jaipur GOVINDAM PARADISE Group Housing BRIJHARI BUILDHOME LLP RAJ-RERA-APP-P-2020-2068 (29/01/2020) RAJ/P/2020/1197 (12/02/2020)


来源: stackexchange

问:
wrapping JavaScript tracking code
I have following tracking code from Piwik.

```<code><!-- Tracking Code -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://example.com/" : "http://example.com/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
  var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 29);
  piwikTracker.trackPageView();
  piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://example.com/piwik.php?idsite=29" style="border:0" alt="" /></p></noscript>
<!-- Tracking Code -->
</code>```

I want to hide following code, so I think I can put this code in some js file, and load it using following code.

But I don't know how can I do it. Help required here.

Secondly, I need to change site id (in above example, is 29), which will be different for different site.

How can I pass site-id to custom file that I will make, and execute above code.

答:
Put this in piwik_loader.js:

```<code>    var pkBaseURL = (("https:" == document.location.protocol) ? "https://example.com/" : "http://example.com/");
    var piwik_js = document.createElement('script');
    piwik_js.setAttribute("type","text/javascript");
    piwik_js.setAttribute("src", pkBaseURL + "piwik.js");
    var executor = function ()
    {
       try {
      var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", piwik_page_id);
      piwikTracker.trackPageView();
      piwikTracker.enableLinkTracking();
      } catch( err ) {}

    }

    piwik_js.onreadystatechange= function ()
    {
       if (this.readyState == 'complete')
       executor();
    }
    piwik_js.onload = executor;

    document.getElementsByTagName('head')[0].insertBefore(piwik_js, document.getElementsByTagName('head')[0].firstChild);
</code>```

And this into your html file:

```<code><!-- Tracking Code -->
<script type="text/javascript"> var piwik_page_id = '29'; </script>
<script type="text/javascript" src="piwik_loader.js"></script>

<noscript><p><img src="http://example.com/piwik.php?idsite=29" style="border:0" alt="" /></p></noscript>
<!-- Tracking Code -->
</code>```

ContentLicense: CC BY-SA 3.0

Title: wrapping JavaScript tracking code

Body:
I have following tracking code from Piwik.

I want to hide following code, so I think I can put this code in some js file, and load it using following code.

But I don't know how can I do it. Help required here.

Secondly, I need to change site id (in above example, is 29), which will be different for different site.

How can I pass site-id to custom file that I will make, and execute above code.

Body:
Put this in piwik_loader.js:

    var pkBaseURL = (("https:" == document.location.protocol) ? "https://example.com/" : "http://example.com/");
    var piwik_js = document.createElement('script');
    piwik_js.setAttribute("type","text/javascript");
    piwik_js.setAttribute("src", pkBaseURL + "piwik.js");
    var executor = function ()
    {
       try {
      var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", piwik_page_id);
      piwikTracker.trackPageView();
      piwikTracker.enableLinkTracking();
      } catch( err ) {}

    }

    piwik_js.onreadystatechange= function ()
    {
       if (this.readyState == 'complete')
       executor();
    }
    piwik_js.onload = executor;

    document.getElementsByTagName('head')[0].insertBefore(piwik_js, document.getElementsByTagName('head')[0].firstChild);

And this into your html file:

<!-- Tracking Code -->
<script type="text/javascript"> var piwik_page_id = '29'; </script>
<script type="text/javascript" src="piwik_loader.js"></script>

<noscript><p><img src="http://example.com/piwik.php?idsite=29" style="border:0" alt="" /></p></noscript>
<!-- Tracking Code -->


问:
What to answer an AWS Lambda when answering Alexa Smart Home Skill asynchronous via event gateway?
I am developing a smart home skill for Alexa. So all requests from Alexa are sent to my AWS Lambda function which then forwards the requests to our servers which contacts the individual smart home devices.
So according to the Alexa documentation (https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-response.html#response) I can answer these requests Synchronously, meaning I wait all the way till the operation on the device has completed (while the http connection between the lambda and our servers remain open -> causing charges as lambda is running longer) and send the response via the lambda back to Alexa.

The other option is to answer Asynchronously by sending the answer as a new http request to the Alexa event gateway.

As some operations take some time (considering the way from our servers to the smart home devices, performing the operation, answering etc.) I'd prefer the async method, as it also saves the time on the lambda. I already implemented all the necessary components to answer async but I don't know what I should answer the lambda in case I'll answer async.

My Lambda currently looks somewhat like this:

```<code>const https = require('https');

exports.handler = function (request, context) {

    function handleServerRequest(request, context) {

        const doPostRequest = () => {

            const data = request;

            return new Promise((resolve, reject) => {
                const options = {
                    host: 'xxx.ngrok.io',
                    path: '/dyn/alexa/request',
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    }
                };

                /* ... perform https request and resolve promise*/
            });
        };

        doPostRequest().then((response) => {

            log("DEBUG", "Server Response: ", JSON.stringify(response));

            // in case the server decides to answer async (via event gateway) it
            // immediately answers the https request with a flag "async: true".

            if(response.async) {
                // -> WHAT TO TELL THE LAMBDA HERE?
                //context.succeed();
                return;
            }
            context.succeed(response);
        });

    }

    handleServerRequest(request, context, "");

</code>```

When I just do a context.succeed() without a proper response I'll get an error in the Alexa app, telling me "the device is not reacting", followed by indicating the correct status as quickly after that Alexa receives a valid StateReport directive via the event gateway.

How do I properly end the lambda function in case I'll answer asynchronously?

答:
From my experience, you can either send synchronous or asynchronous responses (not both) and this needs to be set up before hand.

To set up asynchronous responses, refer to this doc, which mentions:

On the PERMISSIONS page, slide Send Alexa Events to indicate your skill will send asynchronous responses and/or change report events.

ContentLicense: CC BY-SA 4.0

Body:
I am developing a smart home skill for Alexa. So all requests from Alexa are sent to my AWS Lambda function which then forwards the requests to our servers which contacts the individual smart home devices.
So according to the Alexa documentation (https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-response.html#response) I can answer these requests Synchronously, meaning I wait all the way till the operation on the device has completed (while the http connection between the lambda and our servers remain open -> causing charges as lambda is running longer) and send the response via the lambda back to Alexa.

The other option is to answer Asynchronously by sending the answer as a new http request to the Alexa event gateway.

As some operations take some time (considering the way from our servers to the smart home devices, performing the operation, answering etc.) I'd prefer the async method, as it also saves the time on the lambda. I already implemented all the necessary components to answer async but I don't know what I should answer the lambda in case I'll answer async.

My Lambda currently looks somewhat like this:

const https = require('https');

exports.handler = function (request, context) {

    function handleServerRequest(request, context) {

        const doPostRequest = () => {

            const data = request;

            return new Promise((resolve, reject) => {
                const options = {
                    host: 'xxx.ngrok.io',
                    path: '/dyn/alexa/request',
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    }
                };

                /* ... perform https request and resolve promise*/
            });
        };

        doPostRequest().then((response) => {

            log("DEBUG", "Server Response: ", JSON.stringify(response));

            // in case the server decides to answer async (via event gateway) it
            // immediately answers the https request with a flag "async: true".

            if(response.async) {
                // -> WHAT TO TELL THE LAMBDA HERE?
                //context.succeed();
                return;
            }
            context.succeed(response);
        });

    }

    handleServerRequest(request, context, "");

When I just do a context.succeed() without a proper response I'll get an error in the Alexa app, telling me "the device is not reacting", followed by indicating the correct status as quickly after that Alexa receives a valid StateReport directive via the event gateway.

How do I properly end the lambda function in case I'll answer asynchronously?


问:
I'm trying to make model in django. but error. why?
I'm newbie coder.
I'm trying to make model.
but when i make superuser, always error appear
this is my code.
i use abstractbaseuser and create account.
my account contain username, userid, company, company_code.
not use password. but i don't know how to fix this error
bold

```<code>from django.contrib.auth.models import(BaseUserManager, AbstractBaseUser, PermissionsMixin)
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _

class UserManager(BaseUserManager):
    def create_account(self, username, userid, company, company_code, password=None):
        if not username:
            raise ValueError(_('Users must have an name!'))

        user = self.model(
            Name=username,
            UserId = userid,
            Company= company,
            Code = company_code,
        )

        user.set_password(password)
        user.save(self._db)
        return user

    def create_superuser(self, username, userid, company, company_code, password):
        user = self.create_user(
            Name=username,
            UserId = userid,
            Company = company,
            Code = company_code,
            password=password,
        )
        user.Name = True
        user.is_superuser = True
        user.is_admin = True
        user.is_staff = True
        user.save(self._db)
        return user

class User(AbstractBaseUser):
    Name = models.CharField(max_length=10, unique=True)
    UserId = models.CharField(max_length=100, unique=True)
    Company = models.CharField(max_length=10)
    Code = models.CharField(max_length=100)
    Created_date = models.DateTimeField(auto_now_add=True)
    is_admin = models.BooleanField(default=False)
    is_active = models.BooleanField(default=True)

    class Meta:
        db_table = 'user'

    objects = UserManager()
    USERNAME_FIELD = 'Name'
    REQUIRED_FIELDS = ['UserId', 'Company', 'Code']

    def __str__(self):
        return self.Name
    def get_full_name(self):
        return self.Name
    def get_short_name(self):
        return self.Name

    @property
    def is_staff(self):
        "Is the user a member of staff?"
        return self.is_superuser
</code>```

this is error when i commmand createsuperuser

```<code>  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 328, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 79, in execute
    return super().execute(*args, **options)
  File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 189, in handle
    self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
TypeError: create_superuser() got an unexpected keyword argument 'Name'

</code>```

答:
You call it with the wrong parameters. In you create_superuser, you write:

```<code>def create_superuser(self, username, userid, company, company_code, password):
    user = self.create_user(
        <s>Name</s>=username,
        <s>UserId</s>=userid,
        <s>Company</s>=company,
        <s>Code</s>=company_code,
        password=password,
    )
    # …</code>```

But your create_user method has no Name parameter, etc. You pass these as username, userid, etc.:

```<code>def create_superuser(self, username, userid, company, company_code, password):
    user = self.create_user(
        <b>username</b>=username,
        <b>userid</b>=userid,
        <b>bompany</b>=company,
        <b>company_code</b>=company_code,
        password=password,
    )
    # …</code>```

Note: normally the name of the fields in a Django model are written in snake_case, not PerlCase, so it should be: UserId instead of <s>user_id</s>.

Body:
I'm newbie coder.
I'm trying to make model.
but when i make superuser, always error appear
this is my code.
i use abstractbaseuser and create account.
my account contain username, userid, company, company_code.
not use password. but i don't know how to fix this error
bold

from django.contrib.auth.models import(BaseUserManager, AbstractBaseUser, PermissionsMixin)
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _

class UserManager(BaseUserManager):
    def create_account(self, username, userid, company, company_code, password=None):
        if not username:
            raise ValueError(_('Users must have an name!'))

        user = self.model(
            Name=username,
            UserId = userid,
            Company= company,
            Code = company_code,
        )

        user.set_password(password)
        user.save(self._db)
        return user

    def create_superuser(self, username, userid, company, company_code, password):
        user = self.create_user(
            Name=username,
            UserId = userid,
            Company = company,
            Code = company_code,
            password=password,
        )
        user.Name = True
        user.is_superuser = True
        user.is_admin = True
        user.is_staff = True
        user.save(self._db)
        return user

class User(AbstractBaseUser):
    Name = models.CharField(max_length=10, unique=True)
    UserId = models.CharField(max_length=100, unique=True)
    Company = models.CharField(max_length=10)
    Code = models.CharField(max_length=100)
    Created_date = models.DateTimeField(auto_now_add=True)
    is_admin = models.BooleanField(default=False)
    is_active = models.BooleanField(default=True)

    class Meta:
        db_table = 'user'

    objects = UserManager()
    USERNAME_FIELD = 'Name'
    REQUIRED_FIELDS = ['UserId', 'Company', 'Code']

    def __str__(self):
        return self.Name
    def get_full_name(self):
        return self.Name
    def get_short_name(self):
        return self.Name

    @property
    def is_staff(self):
        "Is the user a member of staff?"
        return self.is_superuser

this is error when i commmand createsuperuser

  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 328, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 79, in execute
    return super().execute(*args, **options)
  File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 189, in handle
    self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
TypeError: create_superuser() got an unexpected keyword argument 'Name'

Body:
You call it with the wrong parameters. In you create_superuser, you write:

def create_superuser(self, username, userid, company, company_code, password):
    user = self.create_user(
        <s>Name</s>=username,
        <s>UserId</s>=userid,
        <s>Company</s>=company,
        <s>Code</s>=company_code,
        password=password,
    )
    # …

But your create_user method has no Name parameter, etc. You pass these as username, userid, etc.:

def create_superuser(self, username, userid, company, company_code, password):
    user = self.create_user(
        username=username,
        userid=userid,
        bompany=company,
        company_code=company_code,
        password=password,
    )
    # …

Note: normally the name of the fields in a Django model are written in snake_case, not PerlCase, so it should be: UserId instead of <s>user_id</s>.


问:
Unable to login Spring Security - always redirects me back to login page
Could you please advise what is wrong in configuration. I can't login with correct credentials, it always redirects me back to login page (code 302). When type http://localhost:8080 - Spring Security redirects to /login, after form submitting redirects back to /login.</p>

```<code>protected void configure (AuthenticationManagerBuilder builder) throws Exception {
    builder.inMemoryAuthentication().withUser("user").password("{noop}12345").roles("USER");
}

protected void configure (HttpSecurity http) throws Exception {

    http.authorizeRequests().anyRequest().authenticated()
            .and()
            .formLogin()
            .loginPage("/login").permitAll().defaultSuccessUrl("/start.html").loginProcessingUrl("/authenticateMe");
</code>```

```<code>@GetMapping("/login")
    public String showLogin () {
        return "index";
    }

    @PostMapping("/authenticateMe")
    public String login () {
        return "start";
    }
</code>```

```<code><body>

  <form method="post" th:action="@{/authenticateMe}"  class="login">
    <p>
        <label th:for="username">Username: </label>
        <input type="text" th:name="username" id="username"/>
    </p>

    <p>
        <label th:for="password">Password: </label>
        <input type="password" th:name="password" id="password"/>
    </p>

</code>```

答: Removing loginProcessingUrl() should work.

Body:
Could you please advise what is wrong in configuration. I can't login with correct credentials, it always redirects me back to login page (code 302). When type http://localhost:8080 - Spring Security redirects to /login, after form submitting redirects back to /login.

protected void configure (AuthenticationManagerBuilder builder) throws Exception {
    builder.inMemoryAuthentication().withUser("user").password("{noop}12345").roles("USER");
}

protected void configure (HttpSecurity http) throws Exception {

    http.authorizeRequests().anyRequest().authenticated()
            .and()
            .formLogin()
            .loginPage("/login").permitAll().defaultSuccessUrl("/start.html").loginProcessingUrl("/authenticateMe");

@GetMapping("/login")
    public String showLogin () {
        return "index";
    }

    @PostMapping("/authenticateMe")
    public String login () {
        return "start";
    }

  <form method="post" th:action="@{/authenticateMe}"  class="login">

        Username:
        <input type="text" th:name="username" id="username"/>

        Password:
        <input type="password" th:name="password" id="password"/>


问:
Parsing out data using Beautifulsoup ignoring part of the tag
I'm learning Beautifulsoup... and so far my code has been working fine till i find out this tag.

```<code>oldPrice = soup.find('p', class_='old-price')
print(oldPrice.prettify())
</code>```

I get the following response:

```<code><p class="old-price">
 <span class="price-label">
  Antes:
 </span>
 <span class="price" id="old-price-355952">
  $ 295
 </span>
</p>
</code>```

I don't know how to find all ( id="old-price-355952 ) since i'm looking for the price ($ 295) but ignoring the number, since they change on every single item.

答:
No need to use regex, BeautifulSoup supports CSS selectors too:

```<code>txt = '''<p class="old-price">
 <span class="price-label">
  Antes:
 </span>
 <span class="price" id="old-price-355952">
  $ 295
 </span>
</p>'''

soup = BeautifulSoup(txt, 'html.parser')

print(soup.select_one('span[id^="old-price"]').text)
</code>```

Prints:

```<code>  $ 295
</code>```

More on CSS selectors here.

EDIT: For multiple selectors:

```<code>txt = '''<p class="old-price">
 <span class="price-label">
  Antes:
 </span>
 <span class="price" id="old-price-355952">
  $ 295
 </span>
 <span class="price" id="special-price-45345">
  $ 199
 </span>

</p>'''

soup = BeautifulSoup(txt, 'html.parser')

for price in soup.select('span[id^="old-price"], span[id^="special-price"]'):
    print(price.get_text(strip=True))
</code>```

Prints:

```<code>$ 295
$ 199
</code>```

OR:

```<code>for old_price, special_price in zip(soup.select('span[id^="old-price"]'),
                                    soup.select('span[id^="special-price"]')):
    print('Old price = {} Special price = {}'.format(old_price.text.strip(), special_price.text.strip()))
</code>```

Prints:

```<code>Old price = $ 295 Special price = $ 199
</code>```

Body:
I'm learning Beautifulsoup... and so far my code has been working fine till i find out this tag.

oldPrice = soup.find('p', class_='old-price')
print(oldPrice.prettify())

I get the following response:

  Antes:

  $ 295

I don't know how to find all ( id="old-price-355952 ) since i'm looking for the price ($ 295) but ignoring the number, since they change on every single item.

Body:
No need to use regex, BeautifulSoup supports CSS selectors too:

txt = '''<p class="old-price">
 <span class="price-label">
  Antes:
 </span>
 <span class="price" id="old-price-355952">
  $ 295
 </span>
</p>'''

soup = BeautifulSoup(txt, 'html.parser')

print(soup.select_one('span[id^="old-price"]').text)

Prints:

  $ 295

More on CSS selectors here.

EDIT: For multiple selectors:

txt = '''<p class="old-price">
 <span class="price-label">
  Antes:
 </span>
 <span class="price" id="old-price-355952">
  $ 295
 </span>
 <span class="price" id="special-price-45345">
  $ 199
 </span>

</p>'''

soup = BeautifulSoup(txt, 'html.parser')

for price in soup.select('span[id^="old-price"], span[id^="special-price"]'):
    print(price.get_text(strip=True))

Prints:

$ 295
$ 199

OR:

for old_price, special_price in zip(soup.select('span[id^="old-price"]'),
                                    soup.select('span[id^="special-price"]')):
    print('Old price = {} Special price = {}'.format(old_price.text.strip(), special_price.text.strip()))

Prints:

Old price = $ 295 Special price = $ 199


问:
To get Id of selected item in spinner android
Here, It is my java file

```<code>public class Create_Event extends SherlockFragment
implements OnClickListener {

    class Organizer extends AsyncTask<Void, Void, Object> {

        private ProgressDialog pdia;

        protected void onPreExecute() {
            super.onPreExecute();
            pdia = new ProgressDialog(getActivity());
            pdia.setMessage("Loading...");
            pdia.show();
        }

        @Override
        protected Object doInBackground(Void... params) {

            try {
                HttpClient httpclient1 = new DefaultHttpClient();
                HttpPost httppost1 = new HttpPost(Constants.BASE_URL
                        + "mobile_logins/all_my_event");
                List<NameValuePair> nameValuePairs1 = new ArrayList<NameValuePair>(1);
                nameValuePairs1.add(new BasicNameValuePair("id", Constants.id));
                httppost1.setEntity(new UrlEncodedFormEntity(nameValuePairs1));
                HttpResponse response1 = httpclient1.execute(httppost1);
                String _response1 = EntityUtils.toString(response1.getEntity());
                Log.e("test", _response1);
                jsobj1 = new JSONObject(_response1);
                orr = jsobj1.getJSONArray("organizers");
                String orggg = orr.toString();
                Log.e("Organization", orggg);
                return jsobj1;

            } catch (Exception e) {
                e.printStackTrace();
                Log.e("Fail 1", e.toString());
                return e;
            }
        }

        protected void onPostExecute(Object jsobj) {
            pdia.dismiss();

            String post = jsobj.toString();
            Log.e("event_rese", post);
            int len = orr.length();

            Log.e("json_posexe", orr.toString());
            Log.e("Onpostexe_arrlength", String.valueOf(len));

            try {
                JSONArray JA = orr;
                JSONObject json1 = null;
                final String[] host1 = new String[orr.length()];
                final String[] host_id=new String[orr.length()];

                for(int i = 0; i < len; i++) {
                    json1 = JA.getJSONObject(i);
                    host1[i] = json1.getString("name");
                    host_id[i] = json1.getString("id");
                }

                List<String> list = new ArrayList<String>();
                for(int i = 0; i < host1.length; i++) {
                    list.add(host1[i]);
                }
                Log.e("onpostexe_list",list.toString());

                ArrayAdapter<String> adapter =
                        new ArrayAdapter<String>(getActivity().getApplicationContext(),
                                 android.R.layout.simple_spinner_item,list);
                adapter.setDropDownViewResource(
                        android.R.layout.simple_spinner_dropdown_item);
                sp.setAdapter(adapter);
                sp.setOnItemSelectedListener(new OnItemSelectedListener() {
                    @Override
                    public void onItemSelected(AdapterView<?> arg0, View arg1,
                            int position, long id) {
                        organization=sp.getSelectedItem().toString();
                    }

                    @Override
                    public void onNothingSelected(AdapterView<?> arg0) {
                        // TODO Auto-generated method stub
                    }
                });

            } catch(Exception e) {
                Log.e("Fail 3", e.toString());
            }

            if (json instanceof JSONObject) {
                asyncrun = true;
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {

                } else {
                    ExecptionHandler.register(getActivity(), (Exception) jsobj);
                }
            }

        }

    }
}
</code>```

Here, I need id of the selected organization from spinner. The id and organization name came from Jsonobject(here jsobj1). How to get id of selected item from jsonobject? Is it possible?? Please Help...

答:
Create a Organization bean as below with method @Override toString()

```<code>public class Organization {

    private Integer orgId; // Long etc.

    private String orgName;

    // more properties if you need

    @Override  // Mandatory
    public String toString() {
        return orgName; // Return anything, what you want to show in spinner
    }

    // Getter & Setter
}
</code>```

Then Create a java.util.List<Organization> organizationList; from your API response JSONArray or any other way. And make and set ArrayAdapter<Organization> to load Spinner options.

```<code>List<Organization> organizationList = ... // init using JSON Data OR any how;

ArrayAdapter<Organization> orgAdapter = new ArrayAdapter<Organization>(this, android.R.layout.simple_spinner_item, organizationList);
orgAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

Spinner mySpinner = findViewById(R.id.orgSpinner);
mySpinner.setAdapter(orgAdapter);
</code>```

Now get selected Organization and its Properties in any Click/Change Event like below

```<code>// In any OnClick / OnSelect event
Organization selectedOrganization = (Organization) mySpinner.getSelectedItem();
Integer orgId = selectedOrganization.getOrgId();
String orgName = selectedOrganization.getOrgName();
// and if you have more properties
</code>```

Body:
Here, It is my java file

public class Create_Event extends SherlockFragment
implements OnClickListener {

    class Organizer extends AsyncTask<Void, Void, Object> {

        private ProgressDialog pdia;

        protected void onPreExecute() {
            super.onPreExecute();
            pdia = new ProgressDialog(getActivity());
            pdia.setMessage("Loading...");
            pdia.show();
        }

        @Override
        protected Object doInBackground(Void... params) {

            try {
                HttpClient httpclient1 = new DefaultHttpClient();
                HttpPost httppost1 = new HttpPost(Constants.BASE_URL
                        + "mobile_logins/all_my_event");
                List<NameValuePair> nameValuePairs1 = new ArrayList<NameValuePair>(1);
                nameValuePairs1.add(new BasicNameValuePair("id", Constants.id));
                httppost1.setEntity(new UrlEncodedFormEntity(nameValuePairs1));
                HttpResponse response1 = httpclient1.execute(httppost1);
                String _response1 = EntityUtils.toString(response1.getEntity());
                Log.e("test", _response1);
                jsobj1 = new JSONObject(_response1);
                orr = jsobj1.getJSONArray("organizers");
                String orggg = orr.toString();
                Log.e("Organization", orggg);
                return jsobj1;

            } catch (Exception e) {
                e.printStackTrace();
                Log.e("Fail 1", e.toString());
                return e;
            }
        }

        protected void onPostExecute(Object jsobj) {
            pdia.dismiss();

            String post = jsobj.toString();
            Log.e("event_rese", post);
            int len = orr.length();

            Log.e("json_posexe", orr.toString());
            Log.e("Onpostexe_arrlength", String.valueOf(len));

            try {
                JSONArray JA = orr;
                JSONObject json1 = null;
                final String[] host1 = new String[orr.length()];
                final String[] host_id=new String[orr.length()];

                for(int i = 0; i < len; i++) {
                    json1 = JA.getJSONObject(i);
                    host1[i] = json1.getString("name");
                    host_id[i] = json1.getString("id");
                }

                List<String> list = new ArrayList<String>();
                for(int i = 0; i < host1.length; i++) {
                    list.add(host1[i]);
                }
                Log.e("onpostexe_list",list.toString());

                ArrayAdapter<String> adapter =
                        new ArrayAdapter<String>(getActivity().getApplicationContext(),
                                 android.R.layout.simple_spinner_item,list);
                adapter.setDropDownViewResource(
                        android.R.layout.simple_spinner_dropdown_item);
                sp.setAdapter(adapter);
                sp.setOnItemSelectedListener(new OnItemSelectedListener() {
                    @Override
                    public void onItemSelected(AdapterView<?> arg0, View arg1,
                            int position, long id) {
                        organization=sp.getSelectedItem().toString();
                    }

                    @Override
                    public void onNothingSelected(AdapterView<?> arg0) {
                        // TODO Auto-generated method stub
                    }
                });

            } catch(Exception e) {
                Log.e("Fail 3", e.toString());
            }

            if (json instanceof JSONObject) {
                asyncrun = true;
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {

                } else {
                    ExecptionHandler.register(getActivity(), (Exception) jsobj);
                }
            }

        }

    }
}

Here, I need id of the selected organization from spinner. The id and organization name came from Jsonobject(here jsobj1). How to get id of selected item from jsonobject? Is it possible?? Please Help...

Body:
Create a Organization bean as below with method @Override toString()

public class Organization {

    private Integer orgId; // Long etc.

    private String orgName;

    // more properties if you need

    @Override  // Mandatory
    public String toString() {
        return orgName; // Return anything, what you want to show in spinner
    }

    // Getter & Setter
}

Then Create a java.util.List<Organization> organizationList; from your API response JSONArray or any other way. And make and set ArrayAdapter<Organization> to load Spinner options.

List<Organization> organizationList = ... // init using JSON Data OR any how;

ArrayAdapter<Organization> orgAdapter = new ArrayAdapter<Organization>(this, android.R.layout.simple_spinner_item, organizationList);
orgAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

Spinner mySpinner = findViewById(R.id.orgSpinner);
mySpinner.setAdapter(orgAdapter);

Now get selected Organization and its Properties in any Click/Change Event like below

// In any OnClick / OnSelect event
Organization selectedOrganization = (Organization) mySpinner.getSelectedItem();
Integer orgId = selectedOrganization.getOrgId();
String orgName = selectedOrganization.getOrgName();
// and if you have more properties


问:
Creating an array of IDs and randomize their age
I have to generate 160k of IDs in a text file and have to randomize their age.
I have generated the IDs using an array but I don't know how to randomize their age into the text file.

There is also a criteria to randomize the age :

10% from 160000 IDs are 60-90 years old,

30% for 25-60

25% for 13-24

35% for 1-12

here are the code for my random ID generate :

```<code>public class Citizenid {
    public static void main(String[] args) {

         try{
             try (PrintWriter p = new PrintWriter("citizen id.txt")) {

                    int totalAgesToGenerate = 160000;
                    int ages60To90 = (int) (totalAgesToGenerate * 0.1);
                    int ages25To59 = (int) (totalAgesToGenerate * 0.3);
                    int ages13To24 = (int) (totalAgesToGenerate * 0.25);
                    int ages1To12 = (int) (totalAgesToGenerate * 0.35);

                    Random r = new Random();
                    int age;
                    int index=0;
                    int []agearray;
                    agearray = new int[160000];

                    //generating age for 60-90 age group
                    for (int i = 0; i < ages60To90; i++) {
                        age = r.nextInt(31) + 60;
                        agearray[index]=age;
                        index++;
                    }
                    //generating age for 25-59 age group
                    for (int i = 0; i < ages25To59; i++) {
                        age = r.nextInt(35) + 25;
                        agearray[index]=age;
                        index++;
                    }
                    //generating age for 13-24 age group
                    for (int i = 0; i < ages13To24; i++) {
                        age = r.nextInt(12) + 13;
                        agearray[index]=age;
                        index++;
                    }
                     //generating age for 1-12 age group
                    for (int i = 0; i < ages1To12; i++) {
                        age = r.nextInt(12) + 1;
                        agearray[index]=age;
                        index++;
                    }

                 int a=1;
                 int[]arrayid = new int[160000];
                 for(int i=0;i<arrayid.length;i++){
                     p.printf("%06d , %d \n",a,agearray[r.nextInt(1600001)]);
                     a++;
                 }
                 p.close();
             }
            }
        catch(Exception e)
        {

             System.out.println("No such file exist");
        }
    }
}
</code>```

I have solved the age problem but I wonder why the output is "No such file exist". It doesn't write on the textile

答:
you can use Math.random() as follow (Math.random() * (max_value - min_value)) + min_value)

```<code>int size = 160000;
int[]ageid=new int[size];
for(int i=0;i<ageid.length;i++){
    if(i<(size*0.1))// 10%
       ageid[i]=(Math.random() * (90- 60)) + 60); //age 60-90
    else if(i<(size*0.4))  // 30%
       ageid[i]=(Math.random() * (60- 25)) + 25);//age 25-60
    else if(i<(size*0.65))// 25%
       ageid[i]=(Math.random() * (24- 13)) + 13);//age 13-24
    else // the rest which is 35%
       ageid[i]=(Math.random() * (12- 1) + 1);//age 1-12
}
</code>```

Body:
I have to generate 160k of IDs in a text file and have to randomize their age.
I have generated the IDs using an array but I don't know how to randomize their age into the text file.

There is also a criteria to randomize the age :

10% from 160000 IDs are 60-90 years old,

30% for 25-60

25% for 13-24

35% for 1-12

here are the code for my random ID generate :

public class Citizenid {
    public static void main(String[] args) {

         try{
             try (PrintWriter p = new PrintWriter("citizen id.txt")) {

                    int totalAgesToGenerate = 160000;
                    int ages60To90 = (int) (totalAgesToGenerate * 0.1);
                    int ages25To59 = (int) (totalAgesToGenerate * 0.3);
                    int ages13To24 = (int) (totalAgesToGenerate * 0.25);
                    int ages1To12 = (int) (totalAgesToGenerate * 0.35);

                    Random r = new Random();
                    int age;
                    int index=0;
                    int []agearray;
                    agearray = new int[160000];

                    //generating age for 60-90 age group
                    for (int i = 0; i < ages60To90; i++) {
                        age = r.nextInt(31) + 60;
                        agearray[index]=age;
                        index++;
                    }
                    //generating age for 25-59 age group
                    for (int i = 0; i < ages25To59; i++) {
                        age = r.nextInt(35) + 25;
                        agearray[index]=age;
                        index++;
                    }
                    //generating age for 13-24 age group
                    for (int i = 0; i < ages13To24; i++) {
                        age = r.nextInt(12) + 13;
                        agearray[index]=age;
                        index++;
                    }
                     //generating age for 1-12 age group
                    for (int i = 0; i < ages1To12; i++) {
                        age = r.nextInt(12) + 1;
                        agearray[index]=age;
                        index++;
                    }

                 int a=1;
                 int[]arrayid = new int[160000];
                 for(int i=0;i<arrayid.length;i++){
                     p.printf("%06d , %d \n",a,agearray[r.nextInt(1600001)]);
                     a++;
                 }
                 p.close();
             }
            }
        catch(Exception e)
        {

             System.out.println("No such file exist");
        }
    }
}

I have solved the age problem but I wonder why the output is "No such file exist". It doesn't write on the textile

Body:
you can use Math.random() as follow (Math.random() * (max_value - min_value)) + min_value)

int size = 160000;
int[]ageid=new int[size];
for(int i=0;i<ageid.length;i++){
    if(i<(size*0.1))// 10%
       ageid[i]=(Math.random() * (90- 60)) + 60); //age 60-90
    else if(i<(size*0.4))  // 30%
       ageid[i]=(Math.random() * (60- 25)) + 25);//age 25-60
    else if(i<(size*0.65))// 25%
       ageid[i]=(Math.random() * (24- 13)) + 13);//age 13-24
    else // the rest which is 35%
       ageid[i]=(Math.random() * (12- 1) + 1);//age 1-12
}


问:
Custom Action Won't Run in WIX Installer
I am attempting to create an MSI, who's sole purpose is to install the 'Microsoft Root Certificate Authority 2011' certificate on a Windows 7 machine before running the .NET Framework installer as part of a WIX boostrapper. As I have not found another way to install this certificate from the bootstrapper before the .NET 4.8 installation, I decided to create an MSI that included a custom action to install the certificate, then add it to the chain to the MSIPackage call. I'm testing the installer separately right now. So, basically I've built the custom action, and added it to the WIX setup project. However, after building, when I run the msi, the cert is not installed. I have added a file to be created, as part of the custom action, just to see if it's running, but the file is never created either.

My custom action is as follows:

```<code>[CustomAction]
        public static ActionResult CheckForExistingCertificate(Session session)
        {
            session.Log("Starting CheckForExistingCertificate");

            var logFile = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
                          @"\CertificateInstallInfo";

            if (!File.Exists(logFile))
                File.Create(logFile);

            try
            {
                session.Log("***** Beginning LocalMachine Certificate Store Search...");
                X509Store lmStore = new X509Store(StoreName.CertificateAuthority,
StoreLocation.LocalMachine);
                lmStore.Open(OpenFlags.ReadOnly);
                session.Log("***** lmStore.Certificates.Count = " + lmStore.Certificates.Count);
                foreach (X509Certificate2 cert in lmStore.Certificates)
                {
                    session.Log("lmCertificate Listing : " + cert.FriendlyName);
                    if (cert.FriendlyName == "Microsoft Root Certificate Authority 2011")
                    {
                        session["INTERMEDIATECERTIFICATEALREADYINSTALLED"] = "TRUE";
                    }
                }

                session.Log("***** Beginning CurrentUser Certificate Store Search...");
                X509Store cuStore = new X509Store(StoreName.CertificateAuthority, StoreLocation.CurrentUser);
                cuStore.Open(OpenFlags.ReadOnly);
                session.Log("***** cuStore.Certificates.Count = " + cuStore.Certificates.Count);
                foreach (X509Certificate2 cert in cuStore.Certificates)
                {
                    session.Log("cuCertificate Listing : " + cert.FriendlyName);
                    if (cert.FriendlyName == "Microsoft Root Certificate Authority 2011")
                    {
                        session["INTERMEDIATECERTIFICATEALREADYINSTALLED"] = "TRUE";
                    }
                }

                if (session["INTERMEDIATECERTIFICATEALREADYINSTALLED"] == "FALSE")
                {
                    X509Certificate2 certificate = new X509Certificate2("MicrosoftRootCertificateAuthority2011.cer");
                    X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);

                    store.Open(OpenFlags.ReadWrite);
                    store.Add(certificate);
                    store.Close();
                }

            }
            catch (Exception ex)
            {
                File.WriteAllText(logFile, ex.ToString());
                session.Log("CheckForExistingCertificate - in catch");
            }

            session.Log("Ending CheckForExistingCertificate - end of function");
            return ActionResult.Success;
        }
</code>```

And my WIX setup Product.wxs file is:

```<code><?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="Install Certificates" Language="1033" Version="1.0.0.0" Manufacturer="Just Joe Applications" UpgradeCode="68d00e98-21a2-480f-bb3a-be3049995f3c">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

        <!--<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />-->
        <MediaTemplate />

        <Binary Id="CustomActionBinary" SourceFile="$(var.InstallCertificateAction.TargetDir)$(var.InstallCertificateAction.TargetName).CA.dll" />
        <CustomAction Id="InstallCert" Impersonate="no" BinaryKey="CustomActionBinary" DllEntry="CheckForExistingCertificate" Execute="deferred" Return="check" />

        <InstallExecuteSequence>
            <Custom Action="InstallCert" After="InstallInitialize"/>
        </InstallExecuteSequence>

        <Feature Id="ProductFeature" Title="Install Certificates" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="Install Certificates" />
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
        </ComponentGroup>
    </Fragment>
</Wix>
</code>```

答:
If you want to do this as an MSI Package in your bootstrapper bundle, just use the WiX IIS Extension to install the certificate(s) into the proper certificate store.

If I was going to do this using my own code, I would just author it as a windowless console application and wire it up to the bootstrapper as an EXE Package.  You could write a registry value to use in a detect condition also but if you don't bother it's probably not harmful to run the program over and over.

Body:
I am attempting to create an MSI, who's sole purpose is to install the 'Microsoft Root Certificate Authority 2011' certificate on a Windows 7 machine before running the .NET Framework installer as part of a WIX boostrapper. As I have not found another way to install this certificate from the bootstrapper before the .NET 4.8 installation, I decided to create an MSI that included a custom action to install the certificate, then add it to the chain to the MSIPackage call. I'm testing the installer separately right now. So, basically I've built the custom action, and added it to the WIX setup project. However, after building, when I run the msi, the cert is not installed. I have added a file to be created, as part of the custom action, just to see if it's running, but the file is never created either.

My custom action is as follows:

[CustomAction]
        public static ActionResult CheckForExistingCertificate(Session session)
        {
            session.Log("Starting CheckForExistingCertificate");

            var logFile = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
                          @"\CertificateInstallInfo";

            if (!File.Exists(logFile))
                File.Create(logFile);

            try
            {
                session.Log("***** Beginning LocalMachine Certificate Store Search...");
                X509Store lmStore = new X509Store(StoreName.CertificateAuthority,
StoreLocation.LocalMachine);
                lmStore.Open(OpenFlags.ReadOnly);
                session.Log("***** lmStore.Certificates.Count = " + lmStore.Certificates.Count);
                foreach (X509Certificate2 cert in lmStore.Certificates)
                {
                    session.Log("lmCertificate Listing : " + cert.FriendlyName);
                    if (cert.FriendlyName == "Microsoft Root Certificate Authority 2011")
                    {
                        session["INTERMEDIATECERTIFICATEALREADYINSTALLED"] = "TRUE";
                    }
                }

                session.Log("***** Beginning CurrentUser Certificate Store Search...");
                X509Store cuStore = new X509Store(StoreName.CertificateAuthority, StoreLocation.CurrentUser);
                cuStore.Open(OpenFlags.ReadOnly);
                session.Log("***** cuStore.Certificates.Count = " + cuStore.Certificates.Count);
                foreach (X509Certificate2 cert in cuStore.Certificates)
                {
                    session.Log("cuCertificate Listing : " + cert.FriendlyName);
                    if (cert.FriendlyName == "Microsoft Root Certificate Authority 2011")
                    {
                        session["INTERMEDIATECERTIFICATEALREADYINSTALLED"] = "TRUE";
                    }
                }

                if (session["INTERMEDIATECERTIFICATEALREADYINSTALLED"] == "FALSE")
                {
                    X509Certificate2 certificate = new X509Certificate2("MicrosoftRootCertificateAuthority2011.cer");
                    X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);

                    store.Open(OpenFlags.ReadWrite);
                    store.Add(certificate);
                    store.Close();
                }

            }
            catch (Exception ex)
            {
                File.WriteAllText(logFile, ex.ToString());
                session.Log("CheckForExistingCertificate - in catch");
            }

            session.Log("Ending CheckForExistingCertificate - end of function");
            return ActionResult.Success;
        }

And my WIX setup Product.wxs file is:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="Install Certificates" Language="1033" Version="1.0.0.0" Manufacturer="Just Joe Applications" UpgradeCode="68d00e98-21a2-480f-bb3a-be3049995f3c">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

        <MediaTemplate />

        <Binary Id="CustomActionBinary" SourceFile="$(var.InstallCertificateAction.TargetDir)$(var.InstallCertificateAction.TargetName).CA.dll" />
        <CustomAction Id="InstallCert" Impersonate="no" BinaryKey="CustomActionBinary" DllEntry="CheckForExistingCertificate" Execute="deferred" Return="check" />

        <InstallExecuteSequence>
            <Custom Action="InstallCert" After="InstallInitialize"/>
        </InstallExecuteSequence>

        <Feature Id="ProductFeature" Title="Install Certificates" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="Install Certificates" />
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
        </ComponentGroup>
    </Fragment>
</Wix>


问:
What is the loading precedence for properties from Spring Cloud Config?
Spring has an explicit order for the loading of externalized configurations.

Devtools global settings properties on your home directory (~/.spring-boot-devtools.properties when devtools is active).

@TestPropertySource annotations on your tests.

@SpringBootTest#properties annotation attribute on your tests.

Command line arguments.

Properties from SPRING_APPLICATION_JSON (inline JSON embedded in an environment variable or system property).

ServletConfig init parameters.

ServletContext init parameters.

JNDI attributes from java:comp/env.

Java System properties (System.getProperties()).

OS environment variables.

A RandomValuePropertySource that has properties only in random.*.

Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants).

Profile-specific application properties packaged inside your jar (application-{profile}.properties and YAML variants).

Application properties outside of your packaged jar (application.properties and YAML variants).

Application properties packaged inside your jar (application.properties and YAML variants).

@PropertySource annotations on your @Configuration classes.

Default properties (specified by setting SpringApplication.setDefaultProperties).

However, there seems to be a glaring omission for configurations coming from Spring Cloud Config. Does anyone know where Spring Cloud Config fit above

答:
Points 12 and 14 cover Spring Cloud Config.

12.Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants).

14.Application properties outside of your packaged jar (application.properties and YAML variants).


问:
How to manipulate date with a different timezone then convert it to UTC?
So, I live in Philippines (GMT+8) my current time is June 1, 2020, 3:20 PM

The current UTC time is June 1 2020, 7:20 AM.

I want it so I can manipulate the date using Pacific/Honolulu (GMT-10) and the current time there is 31 May 2020, 9:20 PM like:

```<code>const date = new Date();
date.setDate(l.getDate() + 1)
console.log(date)
// ...further manipulation of date

date.getTime() //unix timestamp
</code>```

this will show the local timezone which is GMT+8.

So I want to choose a timezone, manipulate the date, then get the UTC timestamp of that manipulated date.

I tried various method like converting it first to UTC, but no luck - still can't seem to find any workaround to this.

I'm using timezone-support and date-fns (if this helps) in my project (sorry I can't use moment js) as the project is already quite big and is using date-fns for a long time.

答:
So I ended up doing this since was using timezone-support:

first I imported and initialized the data:

```<code>import {
  populateTimeZones,
  listTimeZones,
  getZonedTime,
  findTimeZone,
  getUnixTime,
  setTimeZone,
  convertTimeToDate,
} from 'timezone-support/dist/lookup-convert';

import timezoneData from 'timezone-support/dist/data-2012-2022';

// get the timezone support ready
populateTimeZones(timezoneData);
</code>```

Then I created this helper function:

```<code>const dateConvertToTimezone = (fromTimeZone, toTimeZone, date = new Date()) => {
  const tz = findTimeZone(fromTimeZone);

  const time = {
    hours: date.getHours(),
    minutes: date.getMinutes(),
    day: date.getDate(),
    month: date.getMonth() + 1,
    year: date.getFullYear(),
  };

  // set the timezone to get the time object for the selected timezone
  const selectedTime = setTimeZone(time, tz);

  // convert the timezone to local one
  const convertedToLocal = convertTimeToDate(selectedTime);

  const utc = findTimeZone(toTimeZone);
  const convertedTime = getZonedTime(convertedToLocal, utc);

  return convertedTime;
};
</code>```

Then I can do something like:

```<code>const selectedTime = dateConvertToTimezone(
 'Etc/UTC',
 'Pacific/Honolulu',
 new Date('May 31 2020, 21:20')
);
</code>```

This will return the UTC for Honolulu time and not my local time.

Body:
So, I live in Philippines (GMT+8) my current time is June 1, 2020, 3:20 PM

The current UTC time is June 1 2020, 7:20 AM.

I want it so I can manipulate the date using Pacific/Honolulu (GMT-10) and the current time there is 31 May 2020, 9:20 PM like:

const date = new Date();
date.setDate(l.getDate() + 1)
console.log(date)
// ...further manipulation of date

date.getTime() //unix timestamp

this will show the local timezone which is GMT+8.

So I want to choose a timezone, manipulate the date, then get the UTC timestamp of that manipulated date.

I tried various method like converting it first to UTC, but no luck - still can't seem to find any workaround to this.

I'm using timezone-support and date-fns (if this helps) in my project (sorry I can't use moment js) as the project is already quite big and is using date-fns for a long time.

Body:
So I ended up doing this since was using timezone-support:

first I imported and initialized the data:

import {
  populateTimeZones,
  listTimeZones,
  getZonedTime,
  findTimeZone,
  getUnixTime,
  setTimeZone,
  convertTimeToDate,
} from 'timezone-support/dist/lookup-convert';

import timezoneData from 'timezone-support/dist/data-2012-2022';

// get the timezone support ready
populateTimeZones(timezoneData);

Then I created this helper function:

const dateConvertToTimezone = (fromTimeZone, toTimeZone, date = new Date()) => {
  const tz = findTimeZone(fromTimeZone);

  const time = {
    hours: date.getHours(),
    minutes: date.getMinutes(),
    day: date.getDate(),
    month: date.getMonth() + 1,
    year: date.getFullYear(),
  };

  // set the timezone to get the time object for the selected timezone
  const selectedTime = setTimeZone(time, tz);

  // convert the timezone to local one
  const convertedToLocal = convertTimeToDate(selectedTime);

  const utc = findTimeZone(toTimeZone);
  const convertedTime = getZonedTime(convertedToLocal, utc);

  return convertedTime;
};

Then I can do something like:

const selectedTime = dateConvertToTimezone(
 'Etc/UTC',
 'Pacific/Honolulu',
 new Date('May 31 2020, 21:20')
);

This will return the UTC for Honolulu time and not my local time.


问:
Changing the colour of the grey "border" on input[type=text]
Is it possible to change the colour of the grey "border" around a text input without changing the border thickness using CSS?

I initially thought that using border-color would allow me to change the colour, however, as seen in the image / code example below, changing the colour also appears to make the border thicker. I would like to keep the default width (2px) but change the colour of the border.

The image is a zoomed in screenshot of the code snippet below to highlight the apparent change in border thickness when the colour is changed.

* {
  box-sizing: border-box;
}

.container {
  display: flex;
  flex-direction: column;
}

input[type=text] {
  flex: 1 1 0;
  margin-bottom: 2px;
}

.different_color {
  border-color: red;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="container">
  <input type="text">
  <input type="text" class="different_color">
</div></code>```

Edit

To clarify, the default border, which according to the developer console has a border-width of 2px appears to be rendered as only part of the 2px whilst still essentially padding the content in by a fixed 2px. However, when I set a colour on the border, it no longer renders only this small part, but the whole 2px. The image below shows this with the left side of the image being the default border and the right side of the image being the border with the border-color set to red.

答:
As @sergiu reznicencu said,

it seems that setting the color also resets the width.

By setting the color it resets to 2.

Different browsers also seem to show different values for browser width. Some say 1px and some 2px while border is actually less than 1px wide.

Default value, according to W3schools and Mozilla developers, initial (default value) is medium. If you do set a border with border-width: medium, it will be thicker than default one.

input {
  width: 100%;
  margin-bottom: 5px;
}

.custom-clr-only {
  border-color: red;
}

.custom {
  border: medium solid green;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><input type="text">
<input type="text" class="custom-clr-only">
<input type="text" class="custom"></code>```

Body:
Is it possible to change the colour of the grey "border" around a text input without changing the border thickness using CSS?

I initially thought that using border-color would allow me to change the colour, however, as seen in the image / code example below, changing the colour also appears to make the border thicker. I would like to keep the default width (2px) but change the colour of the border.

The image is a zoomed in screenshot of the code snippet below to highlight the apparent change in border thickness when the colour is changed.

* {
  box-sizing: border-box;
}

.container {
  display: flex;
  flex-direction: column;
}

input[type=text] {
  flex: 1 1 0;
  margin-bottom: 2px;
}

.different_color {
  border-color: red;
}

  <input type="text">
  <input type="text" class="different_color">

Edit

To clarify, the default border, which according to the developer console has a border-width of 2px appears to be rendered as only part of the 2px whilst still essentially padding the content in by a fixed 2px. However, when I set a colour on the border, it no longer renders only this small part, but the whole 2px. The image below shows this with the left side of the image being the default border and the right side of the image being the border with the border-color set to red.

Body:
As @sergiu reznicencu said,

it seems that setting the color also resets the width.

By setting the color it resets to 2.

Different browsers also seem to show different values for browser width. Some say 1px and some 2px while border is actually less than 1px wide.

Default value, according to W3schools and Mozilla developers, initial (default value) is medium. If you do set a border with border-width: medium, it will be thicker than default one.

input {
  width: 100%;
  margin-bottom: 5px;
}

.custom-clr-only {
  border-color: red;
}

.custom {
  border: medium solid green;
}

<input type="text">
<input type="text" class="custom-clr-only">
<input type="text" class="custom">


问:
Laravel 7, use auth guard only
I am using PHP Laravel 7, I'm working on a project for which i have to use authentication from outer source, API's are provided for signup and login. I just want to know is it possible that i can use the authentication of Laravel and use my custom login and signup and can i use authentication guard for stopping the URL routes.

I had already created pages for login and register so far but haven't added authentication yet.

```<code>    if (Auth::check()) {
    // The user is logged in...
}
</code>```

I want something like this for custom login in.

答:
You can receive all the data from your API and then manually create a user and login them.

A piece of example from a real application

$user = User::firstOrCreate(['vk_id' => $data['user_id']]);
auth()->login($user, true); //true is to remember them

```

<p>After that you can add any data to any field you want:</p>

<pre class="lang-php prettyprint-override"><code>$user->position = 'ceo';
$user->save();
</code>```

Or any other logic you want.

You can add this logic to your auth register or login controller, or create a separate one.
Virtually, built-in Auth controllers are the same controller with their own logic to work with a database and sessions.

But login the user manually using ->login() function.

Title: Laravel 7, use auth guard only

Body:
I am using PHP Laravel 7, I'm working on a project for which i have to use authentication from outer source, API's are provided for signup and login. I just want to know is it possible that i can use the authentication of Laravel and use my custom login and signup and can i use authentication guard for stopping the URL routes.

I had already created pages for login and register so far but haven't added authentication yet.

    if (Auth::check()) {
    // The user is logged in...
}

I want something like this for custom login in.

Body:
You can receive all the data from your API and then manually create a user and login them.

A piece of example from a real application

$user = User::firstOrCreate(['vk_id' => $data['user_id']]);
auth()->login($user, true); //true is to remember them

After that you can add any data to any field you want:

$user->position = 'ceo';
$user->save();

Or any other logic you want.

You can add this logic to your auth register or login controller, or create a separate one.
Virtually, built-in Auth controllers are the same controller with their own logic to work with a database and sessions.

But login the user manually using ->login() function.


问:
react native flat list how to force list items to be the same height?
I have a React-Native application where I am using FlatList to display a list of items obtained from the server.  The list has 2 columns and I need my list items to be the same height.  I put a border around the code rendering my list items but the list items are not the same height. I have tried using flexbox settings to make the view fill the container, but everything I try makes no difference.

I have created a simplified version of my app to illustrate the issue:

See that the red bordered areas are NOT the same height. I need to get these to be the same height.

The grey border is added in the view wrapping the component responsible for a list item and the red border is the root view of the component responsible for a list item.  See the code below for clarity.

I can not use the grey border in my application because my application shows empty boxes whilst the component responsible for a list item is getting additional information from the server before it renders itself

Furthermore I can not used fixed sizes for heights.

Application Project structure and code

My code is split up in a manner where the files ending in "container.js" get the data from the server and pass it to its matching rendering component.  For example, "MainListContainer" would be getting the list from the server and then pass the list data to "MainList", and "ListItemContainer" would get additional information about the single list item from the server and pass it to "ListItem" to render the actual item.  I have kept this model in my simplified application so its as close to my real application as possible.

index.js

```<code>import {AppRegistry} from 'react-native';
import MainListContainer from './app/components/MainListContainer';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => MainListContainer);
</code>```

MainListContainer.js

```<code>import React from 'react';
import MainList from './MainList';

const data = [
  {id: '1', title: 'Item 1', subtitle: 'A', description: 'This is the first item.'},
  {id: '2', title: 'Item 2', subtitle: 'B', description: 'The Big Brown Fox Jumped over the lazy dogs. The Big Brown Fox Jumped over the lazy dogs.',},
];

const MainListContainer = () => {
  return ( <MainList items={data} /> );
};

export default MainListContainer;
</code>```

MainList.js

```<code>import React from 'react';
import {StyleSheet, FlatList, View} from 'react-native';
import ListItemContainer from './ListItemContainer';

export default class MainList extends React.Component {
  constructor(props) {
    super(props);
    this.state = { numColumns: 2};
    this.renderItem = this.renderItem.bind(this);
  }

  renderItem({item, index}) {
    return (
      <View style={styles.flatListItemContainer}>  <!-- THIS IS WHERE THE GREY BORDER IS ADDED -->
        <ListItemContainer key={index} item={item} />
      </View>
    );
  }

  render() {
    const {items} = this.props;
    const {numColumns} = this.state;

    return (
      <View>
        <FlatList
          data={items}
          renderItem={this.renderItem}
          numColumns={numColumns}
          key={numColumns}
          keyExtractor={(item) => item.id}
        />
      </View>
    );
  }
};

const styles = StyleSheet.create({

  flatListItemContainer: {
    flex: 1,
    margin: 10,

    borderColor: '#ccc',
    borderWidth: 1,
  },

});
</code>```

ListItemContainer.js

```<code>import React from 'react';
import ListItem from './ListItem';

const ListItemContainer = (props) => {
    const { item } = props;

    return (
        <ListItem item={item} />
    );
};

export default ListItemContainer;
</code>```

ListItem.js

```<code>import React from 'react';
import {TouchableHighlight, View, StyleSheet, Image, Text} from 'react-native';

const ListItem = (props) => {
  const { item } = props;

  return (
    <TouchableHighlight
      underlayColor="white"
    >
      <View style={styles.containerView}> <!-- THIS IS WHERE THE RED BORDER IS ADDED -->

        <View style={styles.top_row}>
          <Image style={styles.image} source={require('../images/placeholder.png')} />
          <View style={styles.title_texts}>
            <Text style={{fontWeight:'bold'}}>{item.title}</Text>
            <Text style={{color: 'rgb(115, 115, 115)'}}>{item.subtitle}</Text>
          </View>
        </View>

        <Text>{item.description}</Text>

      </View>
    </TouchableHighlight>
  );
};

export default ListItem;

const styles = StyleSheet.create({
  containerView: {
    padding: 14,

    borderColor: 'red',
    borderWidth: 1,
  },

  top_row: {
    flex: 1,
    flexDirection: 'row',
    marginBottom: 10,
  },

  title_texts: {
    flex: 1,
    flexDirection: 'column',
  },

  image: {
    alignSelf: 'flex-end',
    resizeMode: 'cover',
    height: 40,
    width: 40,
    marginRight: 20
  },

});
</code>```

What I have tried

ListItem.js : move the style onto the "TouchableHighlight" view

ListItem.js : add a view wrapping "TouchableHighlight" view and adding style there

ListItem.js : added "alignItems:'stretch' on the "TouchableHighlight,  added it to the "containerView" style, tried it on the description field too

same as "alignItems" but used "alignedSelf" instead

same as "alignItems" but used "alignedContent" instead

tried using "flexGrow" on different views (container, description)

答: You are missing a very basic concept of giving fixed height to the flatlist items, in your ListItem.js, try to set height:200 in containerView. Let me know if that works for you

Body:
I have a React-Native application where I am using FlatList to display a list of items obtained from the server.  The list has 2 columns and I need my list items to be the same height.  I put a border around the code rendering my list items but the list items are not the same height. I have tried using flexbox settings to make the view fill the container, but everything I try makes no difference.

I have created a simplified version of my app to illustrate the issue:

See that the red bordered areas are NOT the same height. I need to get these to be the same height.

The grey border is added in the view wrapping the component responsible for a list item and the red border is the root view of the component responsible for a list item.  See the code below for clarity.

I can not use the grey border in my application because my application shows empty boxes whilst the component responsible for a list item is getting additional information from the server before it renders itself

Furthermore I can not used fixed sizes for heights.

Application Project structure and code

My code is split up in a manner where the files ending in "container.js" get the data from the server and pass it to its matching rendering component.  For example, "MainListContainer" would be getting the list from the server and then pass the list data to "MainList", and "ListItemContainer" would get additional information about the single list item from the server and pass it to "ListItem" to render the actual item.  I have kept this model in my simplified application so its as close to my real application as possible.

index.js

import {AppRegistry} from 'react-native';
import MainListContainer from './app/components/MainListContainer';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => MainListContainer);

MainListContainer.js

import React from 'react';
import MainList from './MainList';

const data = [
  {id: '1', title: 'Item 1', subtitle: 'A', description: 'This is the first item.'},
  {id: '2', title: 'Item 2', subtitle: 'B', description: 'The Big Brown Fox Jumped over the lazy dogs. The Big Brown Fox Jumped over the lazy dogs.',},
];

const MainListContainer = () => {
  return ( <MainList items={data} /> );
};

export default MainListContainer;

MainList.js

import React from 'react';
import {StyleSheet, FlatList, View} from 'react-native';
import ListItemContainer from './ListItemContainer';

export default class MainList extends React.Component {
  constructor(props) {
    super(props);
    this.state = { numColumns: 2};
    this.renderItem = this.renderItem.bind(this);
  }

  renderItem({item, index}) {
    return (
      <View style={styles.flatListItemContainer}>
        <ListItemContainer key={index} item={item} />
      </View>
    );
  }

  render() {
    const {items} = this.props;
    const {numColumns} = this.state;

    return (
      <View>
        <FlatList
          data={items}
          renderItem={this.renderItem}
          numColumns={numColumns}
          key={numColumns}
          keyExtractor={(item) => item.id}
        />
      </View>
    );
  }
};

const styles = StyleSheet.create({

  flatListItemContainer: {
    flex: 1,
    margin: 10,

    borderColor: '#ccc',
    borderWidth: 1,
  },

});

ListItemContainer.js

import React from 'react';
import ListItem from './ListItem';

const ListItemContainer = (props) => {
    const { item } = props;

    return (
        <ListItem item={item} />
    );
};

export default ListItemContainer;

ListItem.js

import React from 'react';
import {TouchableHighlight, View, StyleSheet, Image, Text} from 'react-native';

const ListItem = (props) => {
  const { item } = props;

  return (
    <TouchableHighlight
      underlayColor="white"
    >
      <View style={styles.containerView}>

        <View style={styles.top_row}>
          <Image style={styles.image} source={require('../images/placeholder.png')} />
          <View style={styles.title_texts}>
            <Text style={{fontWeight:'bold'}}>{item.title}</Text>
            <Text style={{color: 'rgb(115, 115, 115)'}}>{item.subtitle}</Text>
          </View>
        </View>

        <Text>{item.description}</Text>

      </View>
    </TouchableHighlight>
  );
};

export default ListItem;

const styles = StyleSheet.create({
  containerView: {
    padding: 14,

    borderColor: 'red',
    borderWidth: 1,
  },

  top_row: {
    flex: 1,
    flexDirection: 'row',
    marginBottom: 10,
  },

  title_texts: {
    flex: 1,
    flexDirection: 'column',
  },

  image: {
    alignSelf: 'flex-end',
    resizeMode: 'cover',
    height: 40,
    width: 40,
    marginRight: 20
  },

});

What I have tried

ListItem.js : move the style onto the "TouchableHighlight" view

ListItem.js : add a view wrapping "TouchableHighlight" view and adding style there

ListItem.js : added "alignItems:'stretch' on the "TouchableHighlight,  added it to the "containerView" style, tried it on the description field too

same as "alignItems" but used "alignedSelf" instead

same as "alignItems" but used "alignedContent" instead

tried using "flexGrow" on different views (container, description)