问:
I can't save the multi-salect as I want
When I tried to save the transLanguage list, I have this issue: enter image description here, enter image description here

When I tested in Postman, it showed this:  enter image description here

All I need is I can save the list into laravel in any way, object or array is okay. So what should I do? This is my ReactJS code (which only have the translate list part):

```<code>import '../../css/style.css';
import { useEffect } from "react";
import { useState, useSelector } from "react";
import { ajaxCallGetUrlDemo, ajaxCallPost } from "../libs/base";
import Select from 'react-select'
import { Const_Libs } from "../libs/Const_Libs";
import languagesList from "./languageList/country";
import { get } from 'jquery';

const ModalAddNgonNgu = (props) => {
const { handleGetLanguage } = props;
const [langName, setLangName] = useState("");
const [mainLang, setMainLang] = useState("");
const [titleLang, setTitleLang] = useState("");
const [describeLang, setDescribeLang] = useState("");
const [authorLang, setAuthorLang] = useState("");
const [rateLang, setRateLang] = useState("");
const [reviewsLang, setReviewsLang] = useState("");
const [translateList, setTranslateList] = useState([]);

const mainLangOptions = [
    { value: 'vi', label: 'Vietnamese' },
    { value: 'en', label: 'English' },
    { value: 'zh', label: 'Chinese' },
    { value: 'ja', label: 'Japanese' },
    { value: 'de', label: 'German' },
];
const handleMainLang=(e)=>{
    setMainLang(e.value);
}

const handleTransList=(e)=>{
    setTranslateList(e.map(x=>x.value));
}

const handleSubmit = () => {
    let arr = [{
        nameLanguage: langName,
        mainLanguage: mainLang,
        titleLanguage: titleLang,
        descriptionLanguage: describeLang,
        authorLanguage: authorLang,
        rateLanguage: rateLang,
        reviewsLanguage: reviewsLang,
        transLanguage: translateList
    }]
    console.log(arr);
    resetData();
    props.saveLang(arr);
}

const resetData = () => {
    setLangName("");
    setMainLang("");
    setTitleLang("");
    setDescribeLang("");
    setAuthorLang("");
    setRateLang("");
    setReviewsLang("");
    setTranslateList([]);
}

return (
    <>
        <button type="button" className="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModalAddNgonNgu" style={{ fontSize: '14px' }}>
            Thêm
        </button>
        <div>
            <div className="modal fade" id="myModalAddNgonNgu">
                <div className="modal-dialog modal-dialog-centered" style={{ minWidth: '700px' }}>
                    <div className="modal-content">
                        <div className="modal-header">
                            <h4 className="modal-title">Thêm ngôn ngữ</h4>
                            <button type="button" className="btn-close" data-bs-dismiss="modal" />
                        </div>
                        <div className="modal-body">
                            <form>
                                <div className="col">
                                    <div className="row-2">
                                        <label htmlFor="name-campaign" className="form-label fs-6 fw-bolder">Tên ngôn ngữ</label>
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập tên ngôn ngữ...."
                                            // value={langName}
                                            onChange={(e) => setLangName(e.target.value)}
                                        />
                                    </div>
                                    <div className="row-2">
                                        <label htmlFor="name-campaign" className="form-label fs-6 fw-bolder">Tiêu đề</label>
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập tiêu đề...."
                                            // value={titleLang}
                                            onChange={(e) => setTitleLang(e.target.value)}
                                        />
                                    </div>
                                    <div className="row-2">
                                        <label htmlFor="name-campaign" className="form-label fs-6 fw-bolder">Mô tả</label>
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập mô tả...."
                                            // value={describeLang}
                                            onChange={(e) => setDescribeLang(e.target.value)}
                                        />
                                    </div>
                                    <div className="row-2">
                                        <label htmlFor="name-campaign" className="form-label fs-6 fw-bolder">Tác giả</label>
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập tác giả (VD: Author)"
                                            // value={authorLang}
                                            onChange={(e) => setAuthorLang(e.target.value)}
                                        />
                                    </div>
                                    <div className="row-2">
                                        <label htmlFor="name-campaign" className="form-label fs-6 fw-bolder">Đánh giá</label>
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập đánh giá (VD: Rate)"
                                            // value={rateLang}
                                            onChange={(e) => setRateLang(e.target.value)}
                                        />
                                    </div>
                                    <div className="row-2">
                                        <label htmlFor="name-campaign" className="form-label fs-6 fw-bolder">Lượt đánh giá</label>
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập lượt đánh giá (VD: reviews)"
                                            // value={reviewsLang}
                                            onChange={(e) => setReviewsLang(e.target.value)}
                                        />
                                    </div>
                                </div>
                                <div className="col">
                                    <div className="row-2">
                                        <label htmlFor="name-campaign" className="form-label fs-6 fw-bolder">Ngôn ngữ chính</label>
                                         <Select
                                            onChange={handleMainLang}
                                            options={mainLangOptions}
                                        />
                                    </div>
                                    <div className="row-2">
                                        <label htmlFor="name-campaign" className="form-label fs-6 fw-bolder">Những ngôn ngữ dịch</label>
                                        <Select
                                            onChange={handleTransList}
                                            isMulti
                                            isSearchable={true}
                                            options={languagesList}
                                        />
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div className="modal-footer">
                            <button type="button" className="btn btn-success" data-bs-dismiss="modal" onClick={handleSubmit}>Submit</button>
                            <button type="button" className="btn btn-danger" data-bs-dismiss="modal">Close</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </>
);
}

export default ModalAddNgonNgu;
</code>```

Title: I can't save the multi-salect as I want

Body:
When I tried to save the transLanguage list, I have this issue: enter image description here, enter image description here

When I tested in Postman, it showed this:  enter image description here

All I need is I can save the list into laravel in any way, object or array is okay. So what should I do? This is my ReactJS code (which only have the translate list part):

import '../../css/style.css';
import { useEffect } from "react";
import { useState, useSelector } from "react";
import { ajaxCallGetUrlDemo, ajaxCallPost } from "../libs/base";
import Select from 'react-select'
import { Const_Libs } from "../libs/Const_Libs";
import languagesList from "./languageList/country";
import { get } from 'jquery';

const ModalAddNgonNgu = (props) => {
const { handleGetLanguage } = props;
const [langName, setLangName] = useState("");
const [mainLang, setMainLang] = useState("");
const [titleLang, setTitleLang] = useState("");
const [describeLang, setDescribeLang] = useState("");
const [authorLang, setAuthorLang] = useState("");
const [rateLang, setRateLang] = useState("");
const [reviewsLang, setReviewsLang] = useState("");
const [translateList, setTranslateList] = useState([]);

const mainLangOptions = [
    { value: 'vi', label: 'Vietnamese' },
    { value: 'en', label: 'English' },
    { value: 'zh', label: 'Chinese' },
    { value: 'ja', label: 'Japanese' },
    { value: 'de', label: 'German' },
];
const handleMainLang=(e)=>{
    setMainLang(e.value);
}

const handleTransList=(e)=>{
    setTranslateList(e.map(x=>x.value));
}

const handleSubmit = () => {
    let arr = [{
        nameLanguage: langName,
        mainLanguage: mainLang,
        titleLanguage: titleLang,
        descriptionLanguage: describeLang,
        authorLanguage: authorLang,
        rateLanguage: rateLang,
        reviewsLanguage: reviewsLang,
        transLanguage: translateList
    }]
    console.log(arr);
    resetData();
    props.saveLang(arr);
}

const resetData = () => {
    setLangName("");
    setMainLang("");
    setTitleLang("");
    setDescribeLang("");
    setAuthorLang("");
    setRateLang("");
    setReviewsLang("");
    setTranslateList([]);
}

return (
    <>
        <button type="button" className="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModalAddNgonNgu" style={{ fontSize: '14px' }}>
            Thêm
        </button>

Thêm ngôn ngữ

                            <button type="button" className="btn-close" data-bs-dismiss="modal" />

                            <form>

                                        Tên ngôn ngữ
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập tên ngôn ngữ...."
                                            // value={langName}
                                            onChange={(e) => setLangName(e.target.value)}
                                        />

                                        Tiêu đề
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập tiêu đề...."
                                            // value={titleLang}
                                            onChange={(e) => setTitleLang(e.target.value)}
                                        />

                                        Mô tả
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập mô tả...."
                                            // value={describeLang}
                                            onChange={(e) => setDescribeLang(e.target.value)}
                                        />

                                        Tác giả
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập tác giả (VD: Author)"
                                            // value={authorLang}
                                            onChange={(e) => setAuthorLang(e.target.value)}
                                        />

                                        Đánh giá
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập đánh giá (VD: Rate)"
                                            // value={rateLang}
                                            onChange={(e) => setRateLang(e.target.value)}
                                        />

                                        Lượt đánh giá
                                        <input type="text"
                                            className="form-control" id="name-campaign"
                                            placeholder="Nhập lượt đánh giá (VD: reviews)"
                                            // value={reviewsLang}
                                            onChange={(e) => setReviewsLang(e.target.value)}
                                        />

                                        Ngôn ngữ chính
                                         <Select
                                            onChange={handleMainLang}
                                            options={mainLangOptions}
                                        />

                                        Những ngôn ngữ dịch
                                        <Select
                                            onChange={handleTransList}
                                            isMulti
                                            isSearchable={true}
                                            options={languagesList}
                                        />

                            </form>

                            <button type="button" className="btn btn-success" data-bs-dismiss="modal" onClick={handleSubmit}>Submit</button>
                            <button type="button" className="btn btn-danger" data-bs-dismiss="modal">Close</button>

    </>
);
}

export default ModalAddNgonNgu;


来源: stackexchange

问:
How to change Python dataframe with rows having names to quantitative values while names go to column headers?
Sorry if the question is a bit unclear. I will try to explain with examples of what I am trying to achieve.

I presently have a larger dataset that looks like this.

original data

I want to convert it to a quantitative dataframe like this

What I want to get

The reason to change to this format is to eventually cumsum to get a dataset like this

ultimate data form

I tried many different ways including pivot tables and groupby. However, I think the best way is to create an empty dataframe like below and then use for loops to iterate through the df with categorical rows and add 1 to below df if the name exists at that certain date.

current thought process

Please guide me if there is a better way to do this that I am missing or if the approach I am using is good, I will really appreciate if you can help me on that front too. Thanks a lot.

ContentLicense: CC BY-SA 4.0


问:
zsh autocomplete suggestion
I have a docs command in my project and a docs folder in my root directory

"scripts": {
    "docs": "pnpm -C docs dev"
 },
```
<p>When I type</p>
<pre class="lang-bash prettyprint-override"><code>pnpm docs
</code>```

Press Enter and zsh will complete

pnpm docs/
```

Trying to turn off the zsh-autosuggestions plugin won't help either

Title: zsh autocomplete suggestion

Body:
I have a docs command in my project and a docs folder in my root directory

"scripts": {
    "docs": "pnpm -C docs dev"
 },

When I type

pnpm docs

Press Enter and zsh will complete

pnpm docs/

Trying to turn off the zsh-autosuggestions plugin won't help either


问:
Field to connect between Child BC and Parent BC
this is a question related to Siebel

I am trying to query a field in Parent BC from a Child BC. The thing is, I am not sure which field in the child BC is connected to the parent BC. I have checked the Link between these BC, there is no value in source field and destination field. However, there is an intertable and there are values in the inter child and parent column.

Do I need to use the value there as the connection ? If no, where else should I check for the connected field ?

Thank you.


问:
Auth0 Callback component redirecting to home before executing subscriptions
In our Angular app, we use auth0 loginWithRedirect which calls the following callback component in our application. Here, we need to get the appState and the user claims to do some actions so that the app is ready to serve the right content.

```<code>@Component({
  selector: 'app-callback',
  templateUrl: './callback.component.html',
  styleUrls: ['./callback.component.scss'],
})

export class CallbackComponent implements OnInit {
  private user: Profile;
  buttonType: any;
  isFirstLogin: boolean;

  constructor(
    private readonly auth: AuthService,
    private router: Router
  ) {}

  ngOnInit(): void {

    console.log("callback ngOnInit");

 this.auth.appState$.subscribe((appState) => {
      console.log(appState)
      this.callbackData.buttonType = appState.buttonType;
      this.auth.user$.subscribe((result) => {
        this.callbackData.profile = <Profile>result;

        this.auth.idTokenClaims$.subscribe(async (claims) => {
          let idToken = claims.__raw;
          this.callbackData.profile.idToken = idToken;
          this.callbackData.profile.user_type = appState.user_type;
          this.callbackData.inviteId = appState.invitationId

          getIdfromCognitoIdentityPool(
            environment.identityPoolId,
            environment.region,
            environment.auth.domain,
            idToken
          ).then( result => {
            let identityId = result;
            this.callbackData.profile.expert_id = identityId;
          });

          UserStateGlobalService.setIdpProfile(this.callbackData.profile);
...

      });
    });
  });
</code>```

While it works sometimes but there are times the app doesn't execute the subscriptions and moves to the home page and the  console.log(appState) doesn't get executed. I have also tried to subscribing to this.auth.user$ first with no luck.

I have tried moving this logic into a Route Resolver but that also had a similar issue as I had to return an observable from the resolver and the home page starts to load before the route is fully resolved.

I have searched through the forum but couldn't figure out any ways to get this working.

Please share your ideas as I have spent a lot of time on this.

Body:
In our Angular app, we use auth0 loginWithRedirect which calls the following callback component in our application. Here, we need to get the appState and the user claims to do some actions so that the app is ready to serve the right content.

@Component({
  selector: 'app-callback',
  templateUrl: './callback.component.html',
  styleUrls: ['./callback.component.scss'],
})

export class CallbackComponent implements OnInit {
  private user: Profile;
  buttonType: any;
  isFirstLogin: boolean;

  constructor(
    private readonly auth: AuthService,
    private router: Router
  ) {}

  ngOnInit(): void {

    console.log("callback ngOnInit");

 this.auth.appState$.subscribe((appState) => {
      console.log(appState)
      this.callbackData.buttonType = appState.buttonType;
      this.auth.user$.subscribe((result) => {
        this.callbackData.profile = <Profile>result;

        this.auth.idTokenClaims$.subscribe(async (claims) => {
          let idToken = claims.__raw;
          this.callbackData.profile.idToken = idToken;
          this.callbackData.profile.user_type = appState.user_type;
          this.callbackData.inviteId = appState.invitationId

          getIdfromCognitoIdentityPool(
            environment.identityPoolId,
            environment.region,
            environment.auth.domain,
            idToken
          ).then( result => {
            let identityId = result;
            this.callbackData.profile.expert_id = identityId;
          });

          UserStateGlobalService.setIdpProfile(this.callbackData.profile);
...

      });
    });
  });

While it works sometimes but there are times the app doesn't execute the subscriptions and moves to the home page and the  console.log(appState) doesn't get executed. I have also tried to subscribing to this.auth.user$ first with no luck.

I have tried moving this logic into a Route Resolver but that also had a similar issue as I had to return an observable from the resolver and the home page starts to load before the route is fully resolved.

I have searched through the forum but couldn't figure out any ways to get this working.

Please share your ideas as I have spent a lot of time on this.


问:
Error in unikn::usecol(pal = pal_pinky, n = 12): object 'pal_pinky' not found
I'm facing an error in R. It's just started occurring due to a change I must have inadvertently made. The issue is that it runs fine on my desktop machine. But fails when running in a docker image in the cloud.

```<code>options(TEMP_COLOURS = unikn::usecol(pal = pal_pinky, n = 5))
options(HUM_COLOURS = unikn::usecol(pal = pal_seeblau, n = 5))
</code>```

Gives the error: Error in unikn::usecol(pal = pal_pinky, n = 5): object 'pal_pinky' not found. I've added in

```<code>library(unikn)
</code>```

to make sure the library is installed and available. Sorry it's not much to go on. Any R experts out there who can decipher this error or suggest a mechanism to capture the cause?

Body:
I'm facing an error in R. It's just started occurring due to a change I must have inadvertently made. The issue is that it runs fine on my desktop machine. But fails when running in a docker image in the cloud.

options(TEMP_COLOURS = unikn::usecol(pal = pal_pinky, n = 5))
options(HUM_COLOURS = unikn::usecol(pal = pal_seeblau, n = 5))

Gives the error: Error in unikn::usecol(pal = pal_pinky, n = 5): object 'pal_pinky' not found. I've added in

library(unikn)

to make sure the library is installed and available. Sorry it's not much to go on. Any R experts out there who can decipher this error or suggest a mechanism to capture the cause?


问:
Jest Test suite failed to run Cannot find module after update to 29.xxx
This is my config :

```<code>module.exports = {
  globalSetup: '<rootDir>/config/jest/setupEnv.js',
  setupFiles: ['<rootDir>/jest.setup.js'],
  transform: {
    '^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }],
  },
  testPathIgnorePatterns: [
    '<rootDir>/.next/',
    '<rootDir>/node_modules/',
    '<rootDir>/src/styles',
  ],
  collectCoverageFrom: [
    'src/components/**/*.{js,jsx,ts,tsx}',
    'src/containers/**/*.{js,jsx,ts,tsx}',
    '!**/node_modules/**',
    '!**/vendor/**',
  ],
  coverageDirectory: './coverage',
  moduleNameMapper: {
    '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
      '<rootDir>/__mocks__/fileMock.js',
    '.+\\.(css|sass|scss)$': 'identity-obj-proxy',
  },
  testEnvironment: 'jsdom',
}

</code>```

Can you guys help me ? , I think jest cannot read relative path and always broken if I test it but in old version it not happen.

I try some config but still got error.

Body:
This is my config :

module.exports = {
  globalSetup: '<rootDir>/config/jest/setupEnv.js',
  setupFiles: ['<rootDir>/jest.setup.js'],
  transform: {
    '^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }],
  },
  testPathIgnorePatterns: [
    '<rootDir>/.next/',
    '<rootDir>/node_modules/',
    '<rootDir>/src/styles',
  ],
  collectCoverageFrom: [
    'src/components/**/*.{js,jsx,ts,tsx}',
    'src/containers/**/*.{js,jsx,ts,tsx}',
    '!**/node_modules/**',
    '!**/vendor/**',
  ],
  coverageDirectory: './coverage',
  moduleNameMapper: {
    '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
      '<rootDir>/__mocks__/fileMock.js',
    '.+\\.(css|sass|scss)$': 'identity-obj-proxy',
  },
  testEnvironment: 'jsdom',
}

Can you guys help me ? , I think jest cannot read relative path and always broken if I test it but in old version it not happen.

I try some config but still got error.


问:
UICollectionView with async api data load
I use search bar to get api (movie api).
After I search with api, I get ImageURl, image title.

Then I want to update my uicollectioncell.

But the problem is that now I make my own custom collectionViewCell, How can I pass the api's imageURL to CustomCell?

```<code>import UIKit

class TabBarViewController: UITabBarController {

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
    print("Start")

    let vc1 = SearchViewController()
    let vc2 = FavoriteViewController()

    vc1.navigationItem.largeTitleDisplayMode = .never
    vc2.navigationItem.largeTitleDisplayMode = .always

    let nav1 = UINavigationController(rootViewController: vc1)
    let nav2 = UINavigationController(rootViewController: vc2)

    nav1.navigationBar.prefersLargeTitles = true
    nav2.navigationBar.prefersLargeTitles = true

    setViewControllers([nav1, nav2], animated: false)
}
</code>```

}

```<code>class SearchViewController: UIViewController {

var imageURLs: [URL] = []

override func viewDidLoad() {
    super.viewDidLoad()
    print("Start : SearchViewController")

    view.backgroundColor = .lightGray

    makeSearchBar()

    let initialLabel = UILabel()
    initialLabel.text = "Not Found."

    view.addSubview(initialLabel)

    initialLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 20).isActive = true
    initialLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 50).isActive = true

    initialLabel.translatesAutoresizingMaskIntoConstraints = false

}

func makeSearchBar() {
    let searchBar = UISearchBar()
    searchBar.sizeToFit()
    navigationItem.titleView = searchBar
    searchBar.delegate = self
}

func makeCollectionView() {
    let collectionView: UICollectionView = {
        let layout = UICollectionViewFlowLayout()
        layout.scrollDirection = .vertical
        let cv = UICollectionView(frame: .zero, collectionViewLayout: layout)
        cv.translatesAutoresizingMaskIntoConstraints = false
        cv.register(CustomCollectionViewCell.self, forCellWithReuseIdentifier: CustomCollectionViewCell.identifier)
        return cv
    }()

    view.addSubview(collectionView)
    collectionView.backgroundColor = .blue
    collectionView.dataSource = self
    collectionView.delegate = self
    collectionView.topAnchor.constraint(equalTo: view.topAnchor, constant: 40).isActive = true
    collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 40).isActive = true
    collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -40).isActive = true
    collectionView.heightAnchor.constraint(equalToConstant: view.frame.height/2).isActive = true
}
</code>```

}

```<code>extension SearchViewController: UISearchBarDelegate {

func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
    print("***************")
    print("TAPTAP")
    print("\(searchBar.text!)")
    print("***************")

        let session = URLSession(configuration: .default)
        guard let testURL = URL(string: "https://www.omdbapi.com/?apikey=92e32667&s=\(searchBar.text!)&page=1") else {return}

    DispatchQueue.global().async {
        let task = session.dataTask(with: testURL) { data, response, error in
            guard let data = data, error == nil else {
                return
            }
            let decoder = JSONDecoder()
            guard let decodedData = try? decoder.decode(MovieModel.self, from: data) else {
                return
            }
            print(decodedData)

            for i in 0..<10 {
                self.imageURLs.append(URL(string: decodedData.search[i].poster)!)
            }
            print(self.imageURLs)

            DispatchQueue.main.async {
                self.makeCollectionView()
            }
        }
        task.resume()
    }
}
</code>```

}

```<code>extension SearchViewController: UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
    return CGSize(width: collectionView.frame.width / 3, height: collectionView.frame.width / 2)
}

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    return imageURLs.count
(**This makes total cells' count match fetched data**)
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CustomCollectionViewCell.identifier, for: indexPath)

    cell.contentView.backgroundColor = .systemBlue
    print(indexPath)
    return cell
}
</code>```

}

```<code>class CustomCollectionViewCell: UICollectionViewCell {

static let identifier = "CustomCollectionViewCell"

let imageURL: URL

lazy private var myImageView: UIImageView = {
    let imageView = UIImageView()
    imageView.load(url: imageURL)
    return imageView
}()

override init(frame: CGRect) {
    super.init(frame: frame)
    contentView.backgroundColor = .systemRed
}

required init?(coder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}
</code>```

}

The problem is last below..
I want to show each cell to represent different image using imageurl.
I have all image urls downloaded by api, but how can I pass it to customCell which I define?

Body:
I use search bar to get api (movie api).
After I search with api, I get ImageURl, image title.

Then I want to update my uicollectioncell.

But the problem is that now I make my own custom collectionViewCell, How can I pass the api's imageURL to CustomCell?

import UIKit

class TabBarViewController: UITabBarController {

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
    print("Start")

    let vc1 = SearchViewController()
    let vc2 = FavoriteViewController()

    vc1.navigationItem.largeTitleDisplayMode = .never
    vc2.navigationItem.largeTitleDisplayMode = .always

    let nav1 = UINavigationController(rootViewController: vc1)
    let nav2 = UINavigationController(rootViewController: vc2)

    nav1.navigationBar.prefersLargeTitles = true
    nav2.navigationBar.prefersLargeTitles = true

    setViewControllers([nav1, nav2], animated: false)
}

}

class SearchViewController: UIViewController {

var imageURLs: [URL] = []

override func viewDidLoad() {
    super.viewDidLoad()
    print("Start : SearchViewController")

    view.backgroundColor = .lightGray

    makeSearchBar()

    let initialLabel = UILabel()
    initialLabel.text = "Not Found."

    view.addSubview(initialLabel)

    initialLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 20).isActive = true
    initialLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 50).isActive = true

    initialLabel.translatesAutoresizingMaskIntoConstraints = false

}

func makeSearchBar() {
    let searchBar = UISearchBar()
    searchBar.sizeToFit()
    navigationItem.titleView = searchBar
    searchBar.delegate = self
}

func makeCollectionView() {
    let collectionView: UICollectionView = {
        let layout = UICollectionViewFlowLayout()
        layout.scrollDirection = .vertical
        let cv = UICollectionView(frame: .zero, collectionViewLayout: layout)
        cv.translatesAutoresizingMaskIntoConstraints = false
        cv.register(CustomCollectionViewCell.self, forCellWithReuseIdentifier: CustomCollectionViewCell.identifier)
        return cv
    }()

    view.addSubview(collectionView)
    collectionView.backgroundColor = .blue
    collectionView.dataSource = self
    collectionView.delegate = self
    collectionView.topAnchor.constraint(equalTo: view.topAnchor, constant: 40).isActive = true
    collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 40).isActive = true
    collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -40).isActive = true
    collectionView.heightAnchor.constraint(equalToConstant: view.frame.height/2).isActive = true
}

}

extension SearchViewController: UISearchBarDelegate {

func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
    print("***************")
    print("TAPTAP")
    print("\(searchBar.text!)")
    print("***************")

        let session = URLSession(configuration: .default)
        guard let testURL = URL(string: "https://www.omdbapi.com/?apikey=92e32667&s=\(searchBar.text!)&page=1") else {return}

    DispatchQueue.global().async {
        let task = session.dataTask(with: testURL) { data, response, error in
            guard let data = data, error == nil else {
                return
            }
            let decoder = JSONDecoder()
            guard let decodedData = try? decoder.decode(MovieModel.self, from: data) else {
                return
            }
            print(decodedData)

            for i in 0..<10 {
                self.imageURLs.append(URL(string: decodedData.search[i].poster)!)
            }
            print(self.imageURLs)

            DispatchQueue.main.async {
                self.makeCollectionView()
            }
        }
        task.resume()
    }
}

}

extension SearchViewController: UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
    return CGSize(width: collectionView.frame.width / 3, height: collectionView.frame.width / 2)
}

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    return imageURLs.count
(**This makes total cells' count match fetched data**)
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CustomCollectionViewCell.identifier, for: indexPath)

    cell.contentView.backgroundColor = .systemBlue
    print(indexPath)
    return cell
}

}

class CustomCollectionViewCell: UICollectionViewCell {

static let identifier = "CustomCollectionViewCell"

let imageURL: URL

lazy private var myImageView: UIImageView = {
    let imageView = UIImageView()
    imageView.load(url: imageURL)
    return imageView
}()

override init(frame: CGRect) {
    super.init(frame: frame)
    contentView.backgroundColor = .systemRed
}

required init?(coder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}

}

The problem is last below..
I want to show each cell to represent different image using imageurl.
I have all image urls downloaded by api, but how can I pass it to customCell which I define?


问:
Active call checking bore dialling in. swift using CallKit
can we check any active call or ongoing calls are there in CallKit, VOIP call from any other applications(same as what WhatsApp and Telegram doing)

Scenario: consider you have an application you're about start a call, before you connect to the call you supposed to check any active call or ongoing calls are there.

so far, what I have done is I have used below mentioned code before I make the call, I will check this case in the dialling event itself

```<code>            if  let call = CXCallObserver().calls.first{
            if !call.hasEnded{
                print("Active call is onGoing")
            }
        }
</code>```

but what the problem I'm facing is , sometimes even if the active call is ended or Dailed call is ended but  CXCallObserver().calls.first will return one call with status of call.hasEnded as false

any help ?

Body:
can we check any active call or ongoing calls are there in CallKit, VOIP call from any other applications(same as what WhatsApp and Telegram doing)

Scenario: consider you have an application you're about start a call, before you connect to the call you supposed to check any active call or ongoing calls are there.

so far, what I have done is I have used below mentioned code before I make the call, I will check this case in the dialling event itself

            if  let call = CXCallObserver().calls.first{
            if !call.hasEnded{
                print("Active call is onGoing")
            }
        }

but what the problem I'm facing is , sometimes even if the active call is ended or Dailed call is ended but  CXCallObserver().calls.first will return one call with status of call.hasEnded as false

any help ?


问:
This page isn’t working right now localhost can't currently handle this request. HTTP ERROR 500
I am trying to access a function in CodeIgniter some pages(function) are working but some are showing error like that

controller

i am also trying to redirect function in dummy view page but still it shows this page......

```<code> public function search() {
  $this->load->view('dummy');
    }
</code>```

view

```<code><?php
            if ($this->module_lib->hasActive('OPD')) {
                if ($this->rbac->hasPrivilege('opd_income_widget', 'can_view')) {
                    ?>

                    <div class="col-lg-2 col-md-3 col-sm-6 col20
                         ">
                        <div class="info-box">
                            <a href="<?php echo site_url('admin/patient/search') ?>">
                                <span class="info-box-icon bg-green"></span>
                                <div class="info-box-content">
                                    <span class="info-box-text"><?php echo $this->lang->line('opd') . " " . $this->lang->line('income'); ?></span>
                                    <span class="info-box-number"><?php
                                        if (!empty($opd_income)) {
                                            echo $currency_symbol . $opd_income;
                                        } else {
                                            echo "0";
                                        }
                                        ?></span>
                                </div>
                            </a>
                        </div>
                    </div><!--./col-lg-2-->
                    <?php
                }
</code>```
```<code># .htaccess

</code>```
```<code>                     <ifModule mode_env.c>
                      SetEnv CI_ENV development
                     </IfModule>

                       RewriteEngine On
                       RewriteCond %{REQUEST_FILENAME} !-f
                       RewriteCond %{REQUEST_FILENAME} !-d
                       RewriteRule ^(.*)$ index.php/$1 [L]

                     ```
```
<p>look at code above and and Thankyou in Advance for your valuable time                     ```

Body:
I am trying to access a function in CodeIgniter some pages(function) are working but some are showing error like that

controller

i am also trying to redirect function in dummy view page but still it shows this page......

 public function search() {
  $this->load->view('dummy');
    }

view

<?php
            if ($this->module_lib->hasActive('OPD')) {
                if ($this->rbac->hasPrivilege('opd_income_widget', 'can_view')) {
                    ?>

                            <a href="<?php echo site_url('admin/patient/search') ?>">

                                    <?php echo $this->lang->line('opd') . " " . $this->lang->line('income'); ?>
                                    <?php
                                        if (!empty($opd_income)) {
                                            echo $currency_symbol . $opd_income;
                                        } else {
                                            echo "0";
                                        }
                                        ?>

                    <?php
                }

# .htaccess

                     <ifModule mode_env.c>
                      SetEnv CI_ENV development
                     </IfModule>

                       RewriteEngine On
                       RewriteCond %{REQUEST_FILENAME} !-f
                       RewriteCond %{REQUEST_FILENAME} !-d
                       RewriteRule ^(.*)$ index.php/$1 [L]

                     ```
</code></pre>
<p>look at code above and and Thankyou in Advance for your valuable time                     ```


问:
GitHub Actions "User input" step
Is there a way (perhaps custom step/job on the marketplace) that prompts the user for input in the middle of a workflow?

I know it is possible to define user input fields when the workflow is triggered manually - workflow_dispatch event.

However, in my environment, the workflows need to be triggered by pull requests.
The logic is something like:

automated start -> wait for user input -> automated action based on the input

Is it possible to have a user input or survey step when the workflow is started automatically?
I would appreciate any help on this matter!

Title: GitHub Actions "User input" step


问:
React Native Google Mobile Ads Displaying Ads but Not Getting Money
My rewarded ads are displaying perfectly fine on users phones. No issues there. However, when checking my google ad mob account, the metrics are not updated. There is no increase in estimated earnings or in the number of impressions.

I had made around $0.1 prior but nothing for this entire day despite users watching ~60 rewarded ads. Ad mob displays my app as "ready" for the approval status so not sure what is going on.

This is my first time working with react-native-google-mobile-ads and ad mob in general so any help would be greatly appreciated.


问:
How to call a middleware from another middleware in Express JS?
I am working on a middleware restructuring where I am not able to call a middleware from another middleware. This is to avoid messy lines of code in the router level and move them to the function or design pattern level. Below is the example of a router code:

```<code>router.post("/v1/user", jwt.auth(), common.checkBasicValidations, auth.checkRBACAccess([auth.access.user], [auth.operation.create, auth.operation.update], auth.checkDomainAccessFromUserEmail, ["email"]), auth.checkRBACAccess([auth.access.user], [auth.operation.create, auth.operation.update], auth.checkDomainAccessFromUserId, ["_id"]), auth.checkAuthorized(), users.postUser);
</code>```

jwt.auth(), common.checkBasicValidations, auth.checkAuthorized() is repeating almost in every router. To get rid of the above code I did something like this:

```<code>router.get("/v1/user", policy.validatePolicies("course"), users.getLoginguserInfo);
</code>```

policy.validatePolicies("course") is a function which is handling all the above functions sequentially.

```<code>const validatePolicies = (category) => async (req, res, next) => {
    try {
        // validate JWT Token
        jwt.auth();

        //fetch users info by email
        req.user = users.sessionUserInfo(req, res, next)

        // validate Payload

        //Validate RBAC Accsess
        rbac.checkRBACAccess();

        //Validate Resourse access
        resource.checkResourceAccess(category)

    } catch (err) {
        log.warn("Problem in validatePolicies: ", err);
        return next(ApiError.internal("Something went wrong")) && next(e.message);
    }
    next();
}
</code>```

I don't know why jwt.auth() isn't getting call. If you have any suggestions for using a different design pattern or improving the current flow, please share them with me.

```<code>const auth = () => (req, res, next) => {
// varify jwt token
}

module.exports = {
  auth
}
</code>```

Body:
I am working on a middleware restructuring where I am not able to call a middleware from another middleware. This is to avoid messy lines of code in the router level and move them to the function or design pattern level. Below is the example of a router code:

router.post("/v1/user", jwt.auth(), common.checkBasicValidations, auth.checkRBACAccess([auth.access.user], [auth.operation.create, auth.operation.update], auth.checkDomainAccessFromUserEmail, ["email"]), auth.checkRBACAccess([auth.access.user], [auth.operation.create, auth.operation.update], auth.checkDomainAccessFromUserId, ["_id"]), auth.checkAuthorized(), users.postUser);

jwt.auth(), common.checkBasicValidations, auth.checkAuthorized() is repeating almost in every router. To get rid of the above code I did something like this:

router.get("/v1/user", policy.validatePolicies("course"), users.getLoginguserInfo);

policy.validatePolicies("course") is a function which is handling all the above functions sequentially.

const validatePolicies = (category) => async (req, res, next) => {
    try {
        // validate JWT Token
        jwt.auth();

        //fetch users info by email
        req.user = users.sessionUserInfo(req, res, next)

        // validate Payload

        //Validate RBAC Accsess
        rbac.checkRBACAccess();

        //Validate Resourse access
        resource.checkResourceAccess(category)

    } catch (err) {
        log.warn("Problem in validatePolicies: ", err);
        return next(ApiError.internal("Something went wrong")) && next(e.message);
    }
    next();
}

I don't know why jwt.auth() isn't getting call. If you have any suggestions for using a different design pattern or improving the current flow, please share them with me.

const auth = () => (req, res, next) => {
// varify jwt token
}

module.exports = {
  auth
}


问:
RequireJS - config a module with the same name in both paths and slim, which one will be finally imported?
There is a code snippet of build.js that defines the config for RequireJS:

{
  appDir: "public",
  baseUrl: "javascripts",
  fileExclusionRegExp: /(^coffee)|(^components)|(^less)|(^sass)|(^\.)/,
  preserveLicenseComments: false,
  keepBuildDir: true,
  dir: "build",

  shim: {
    underscore: {
      exports: "_"
    },

    layoutmanager: {
      deps: ["backbone"],
      exports: "Backbone.Layout"
    },

    layout: {
      deps: ["layoutmanager"],
      exports: "Backbone.Layout"
    }
  },

  paths: {
    "layoutmanager": "../components/layoutmanager/backbone.layoutmanager",
    "layout": "globals/layout",
  }
```
<p>I defined <code>layoutmanager</code> and <code>layout</code> in both shim and paths at the same time. If I import them into a define block. Like this,</p>
<pre class="lang-coffee prettyprint-override"><code>define "views/dashboard"
, [
    "module", "app", "backbone", "layout", "app.bus", "app.events",
    "react", "backbone-react-component"
]
, (
  module, app, Backbone, Layout, Bus, Events,
  React, BackboneMixin
) ->

</code>```

Which layout module I defined in build.js will be finally imported?

Body:
There is a code snippet of build.js that defines the config for RequireJS:

{
  appDir: "public",
  baseUrl: "javascripts",
  fileExclusionRegExp: /(^coffee)|(^components)|(^less)|(^sass)|(^\.)/,
  preserveLicenseComments: false,
  keepBuildDir: true,
  dir: "build",

  shim: {
    underscore: {
      exports: "_"
    },

    layoutmanager: {
      deps: ["backbone"],
      exports: "Backbone.Layout"
    },

    layout: {
      deps: ["layoutmanager"],
      exports: "Backbone.Layout"
    }
  },

  paths: {
    "layoutmanager": "../components/layoutmanager/backbone.layoutmanager",
    "layout": "globals/layout",
  }

I defined layoutmanager and layout in both shim and paths at the same time. If I import them into a define block. Like this,

define "views/dashboard"
, [
    "module", "app", "backbone", "layout", "app.bus", "app.events",
    "react", "backbone-react-component"
]
, (
  module, app, Backbone, Layout, Bus, Events,
  React, BackboneMixin
) ->

Which layout module I defined in build.js will be finally imported?


问:
C# Dependency Injection - When is the DI instance created in the Mediatr handler?
I was going through some Mediatr programs and I notice that some of the handlers had several DI services injected but only 1 or 2 are used.  My concern is that if they are not used, then the program is incurring unnecessary overhead. I understand that the instance created depends on scoped, transient or singleton options.  So I guess my concern is relevant only to scoped and transient.

Specifically, when is the DI instance created ?  When the handler is invoked or when the DI services is called inside the handler ?  And if it's during invocation of handler, the handler would be creating the DI instance and not using it, thus creating unnecessary overheads, right ?

Further, is this concern valid ?  ie, if there is overhead, is it significant ?  Depends on the service or injecting DI itself has overhead that should be avoided ?

Thanks.

PS: I didn't add program samples as it's a general DI question.


问:
fast ways to clip buffered images in java.awt
i need a way to draw a part of a buffered image. luckily the part of it i need to draw is very simple, i just need to draw a horizontal slice of it- some band of the image from a lower bound to a higher bound. other graphics languages have functions to draw 'clips' of images, or sometimes functions to copy images onto new images with different sizes

i looked into those kinds of clip functions for java.awt but ended up just going with this manual function that just draws right onto the canvas. it looks like this

```<code>public void clipImage(BufferedImage img,int ixa,int iya,int ixb,int iyb,int cxa,int cya,int cxb,int cyb){
        float wr = ((float)img.getWidth()/(1f+ixb-ixa));
        float hr = ((float)img.getHeight()/(1f+iyb-iya));
        for(int x = Math.max(ixa+1,cxa);x <= Math.min(ixb,cxb);x ++){
            for(int y = Math.max(iya+1,cya);y <= Math.min(iyb,cyb);y ++){
                int px = (int)((x-ixa)* wr);
                int py = (int)((y-iya)* hr);
                Color c = new Color(img.getRGB(px,py),true);
                if(c.getAlpha()>0){
                    g2.setColor(c);
                    g2.fillRect(x-1,y-1,1,1);
                }
            }
        }
    }
</code>```

this works, but it's slow. it seems slower to draw a part of an image using this function than to draw the entire image normally, which is bad. is there a better way to do this? thanks

Body:
i need a way to draw a part of a buffered image. luckily the part of it i need to draw is very simple, i just need to draw a horizontal slice of it- some band of the image from a lower bound to a higher bound. other graphics languages have functions to draw 'clips' of images, or sometimes functions to copy images onto new images with different sizes

i looked into those kinds of clip functions for java.awt but ended up just going with this manual function that just draws right onto the canvas. it looks like this

public void clipImage(BufferedImage img,int ixa,int iya,int ixb,int iyb,int cxa,int cya,int cxb,int cyb){
        float wr = ((float)img.getWidth()/(1f+ixb-ixa));
        float hr = ((float)img.getHeight()/(1f+iyb-iya));
        for(int x = Math.max(ixa+1,cxa);x <= Math.min(ixb,cxb);x ++){
            for(int y = Math.max(iya+1,cya);y <= Math.min(iyb,cyb);y ++){
                int px = (int)((x-ixa)* wr);
                int py = (int)((y-iya)* hr);
                Color c = new Color(img.getRGB(px,py),true);
                if(c.getAlpha()>0){
                    g2.setColor(c);
                    g2.fillRect(x-1,y-1,1,1);
                }
            }
        }
    }

this works, but it's slow. it seems slower to draw a part of an image using this function than to draw the entire image normally, which is bad. is there a better way to do this? thanks


问:
Spinning UP pyglet.gl.ContextException: Could not create GL context over ssh
I tried to run spinningup code on ubuntu server and render a locally stored video, but it failed with this error.

https://spinningup.openai.com/en/latest/user/installation.html

```<code>python -m spinup.run ppo --hid "[32,32]" --env LunarLander-v2 --exp_name installtest --gamma 0.999

</code>```

it seems working well

```<code>python -m spinup.run test_policy data/installtest/installtest_s0
</code>```

but it doesn't work well with following errors

```<code>/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/gym/logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
  warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
Logging data to /tmp/experiments/1672370368/progress.txt
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Traceback (most recent call last):
  File "/workspace/spinningup/spinup/utils/test_policy.py", line 153, in <module>
    run_policy(env, get_action, args.len, args.episodes, not(args.norender))
  File "/workspace/spinningup/spinup/utils/test_policy.py", line 121, in run_policy
    env.render()
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/gym/core.py", line 235, in render
    return self.env.render(mode, **kwargs)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/gym/envs/box2d/lunar_lander.py", line 320, in render
    from gym.envs.classic_control import rendering
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/gym/envs/classic_control/rendering.py", line 27, in <module>
    from pyglet.gl import *
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/__init__.py", line 244, in <module>
    import pyglet.window
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/window/__init__.py", line 1880, in <module>
    gl._create_shadow_window()
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/__init__.py", line 220, in _create_shadow_window
    _shadow_window = Window(width=1, height=1, visible=False)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/window/xlib/__init__.py", line 165, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/window/__init__.py", line 591, in __init__
    context = config.create_context(gl.current_context)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/xlib.py", line 206, in create_context
    return XlibContext13(self, share)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/xlib.py", line 314, in __init__
    super(XlibContext13, self).__init__(config, share)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/xlib.py", line 218, in __init__
    raise gl.ContextException('Could not create GL context')
pyglet.gl.ContextException: Could not create GL context
Traceback (most recent call last):
  File "/root/anaconda3/envs/spinningup/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/workspace/spinningup/spinup/run.py", line 243, in <module>
    subprocess.check_call(args, env=os.environ)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/root/anaconda3/envs/spinningup/bin/python', '/workspace/spinningup/spinup/utils/test_policy.py', 'data/installtest/installtest_s0']' returned non-zero exit status 1.
</code>```

libGL errors are fixed with

```<code>export LIBGL_ALWAYS_INDIRECT=1
</code>```

But other than that, most errors still occur.

I'm using SSH in ubuntu-based docker server (not localhost)

with SSH -X command and vscode ssh extension in local MAC OS (not M1 or M2)

both is working fine with x-apps like xeyes, xclock but that errors still occur

using xvfb is the best solutions? i don't know exactly what to use and how to use.

i tried in local server but tensorflow doesn't work well, so i want to fix that error in server

Body:
I tried to run spinningup code on ubuntu server and render a locally stored video, but it failed with this error.

https://spinningup.openai.com/en/latest/user/installation.html

python -m spinup.run ppo --hid "[32,32]" --env LunarLander-v2 --exp_name installtest --gamma 0.999

it seems working well

python -m spinup.run test_policy data/installtest/installtest_s0

but it doesn't work well with following errors

/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/gym/logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
  warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
Logging data to /tmp/experiments/1672370368/progress.txt
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Traceback (most recent call last):
  File "/workspace/spinningup/spinup/utils/test_policy.py", line 153, in <module>
    run_policy(env, get_action, args.len, args.episodes, not(args.norender))
  File "/workspace/spinningup/spinup/utils/test_policy.py", line 121, in run_policy
    env.render()
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/gym/core.py", line 235, in render
    return self.env.render(mode, **kwargs)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/gym/envs/box2d/lunar_lander.py", line 320, in render
    from gym.envs.classic_control import rendering
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/gym/envs/classic_control/rendering.py", line 27, in <module>
    from pyglet.gl import *
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/__init__.py", line 244, in <module>
    import pyglet.window
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/window/__init__.py", line 1880, in <module>
    gl._create_shadow_window()
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/__init__.py", line 220, in _create_shadow_window
    _shadow_window = Window(width=1, height=1, visible=False)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/window/xlib/__init__.py", line 165, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/window/__init__.py", line 591, in __init__
    context = config.create_context(gl.current_context)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/xlib.py", line 206, in create_context
    return XlibContext13(self, share)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/xlib.py", line 314, in __init__
    super(XlibContext13, self).__init__(config, share)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/site-packages/pyglet/gl/xlib.py", line 218, in __init__
    raise gl.ContextException('Could not create GL context')
pyglet.gl.ContextException: Could not create GL context
Traceback (most recent call last):
  File "/root/anaconda3/envs/spinningup/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/workspace/spinningup/spinup/run.py", line 243, in <module>
    subprocess.check_call(args, env=os.environ)
  File "/root/anaconda3/envs/spinningup/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/root/anaconda3/envs/spinningup/bin/python', '/workspace/spinningup/spinup/utils/test_policy.py', 'data/installtest/installtest_s0']' returned non-zero exit status 1.

libGL errors are fixed with

export LIBGL_ALWAYS_INDIRECT=1

But other than that, most errors still occur.

I'm using SSH in ubuntu-based docker server (not localhost)

with SSH -X command and vscode ssh extension in local MAC OS (not M1 or M2)

both is working fine with x-apps like xeyes, xclock but that errors still occur

using xvfb is the best solutions? i don't know exactly what to use and how to use.

i tried in local server but tensorflow doesn't work well, so i want to fix that error in server


问:
how to disabled button drop to bottom in responsive table bootstrap?
enter image description here
my buttons always drop to bottom on a smaller screen

I have tried styling  with width: 300px but it still doesn't work

```<code><div class="table-responsive">
        <table class="table ">
            <tr class="bg-black text-light">
                <th>NO</th>
                <th>NAMA</th>
                <th>NIS</th>
                <th>GENDER</th>
                <th>AKSI</th>
            </tr>
      @forelse ($students as $student)
          <tr>
            <td>{{ $loop->iteration }}</td>
            <td>{{ $student->name }}</td>
            <td>{{ $student->nis }}</td>
            <td>{{ $student->gender }}</td>
            <td class="" style="width:300px">
                <a href=""  class="text-decoration-none ">
                    <button class="btn btn-primary btn-sm">Lihat</button>
                </a>
                <a href="" class="text-decoration-none ">
                    <button class="btn btn-warning btn-sm">Edit</button>
                </a>
                <a href=""  class="text-decoration-none ">
                    <button class="btn btn-danger btn-sm">Hapus</button>
                </a>
            </td>
          </tr>
      @empty
          <tr>
            <td colspan="4" class="bg-danger text-light"> Tidak ada data</td>
          </tr>
      @endforelse
        </table>
        </div>
</code>```

I have tried to style the  with a display: flex but it causes excess spacing in the button column

Body:
enter image description here
my buttons always drop to bottom on a smaller screen

I have tried styling  with width: 300px but it still doesn't work

                NO
                NAMA
                NIS
                GENDER
                AKSI

      @forelse ($students as $student)

            {{ $loop->iteration }}
            {{ $student->name }}
            {{ $student->nis }}
            {{ $student->gender }}

                    <button class="btn btn-primary btn-sm">Lihat</button>

                    <button class="btn btn-warning btn-sm">Edit</button>

                    <button class="btn btn-danger btn-sm">Hapus</button>

      @empty

             Tidak ada data

      @endforelse

I have tried to style the  with a display: flex but it causes excess spacing in the button column


问:
Error with Installing OpenStack via DevStack using ./stack.sh where TypeError deprecated() got an unexpected keyword 'name'
I am trying to install OpenStack on Linux Ubuntu 20.04 LTS via DevStack, and am encountering errors with the ./stack.sh script where it keeps throwing:

TypeError: deprecated() got an unexpected keyword 'name'.

The output in bash terminal is:

```<code>Using python 3.8 to install /opt/stack/devstack/tools/dbcounter
+inc/python:pip_install:190                sudo -H LC_ALL=en_US.UTF-8 SETUPTOOLS_USE_DISTUTILS=stdlib http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= python3.8 -m pip install -c /opt/stack/requirements/upper-constraints.txt --ignore-installed /opt/stack/devstack/tools/dbcounter
Processing ./tools/dbcounter
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.8 /usr/lib/python3/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-54bgvsxp/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- sqlalchemy 'setuptools>=42'
       cwd: None
  Complete output (151 lines):
  Traceback (most recent call last):
    File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "/usr/lib/python3/dist-packages/pip/__main__.py", line 16, in <module>
      from pip._internal.cli.main import main as _main  # isort:skip # noqa
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in <module>
      from pip._internal.cli.autocompletion import autocomplete
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
      from pip._internal.cli.main_parser import create_main_parser
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
      from pip._internal.cli import cmdoptions
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
      from pip._internal.exceptions import CommandError
    File "/usr/lib/python3/dist-packages/pip/_internal/exceptions.py", line 10, in <module>
      from pip._vendor.six import iteritems
    File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 65, in <module>
      vendored("cachecontrol")
    File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
      __import__(modulename, globals(), locals(), level=0)
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>

    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/adapter.py", line 5, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/__init__.py", line 95, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in <module>
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/__init__.py", line 8, in <module>
      from OpenSSL import SSL, crypto
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/SSL.py", line 19, in <module>
      from OpenSSL.crypto import (
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/crypto.py", line 3224, in <module>
      utils.deprecated(
  TypeError: deprecated() got an unexpected keyword argument 'name'
  Error in sys.excepthook:
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook
      from apport.fileutils import likely_packaged, get_recent_crashes
    File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
      from apport.report import Report
    File "/usr/lib/python3/dist-packages/apport/report.py", line 32, in <module>
      import apport.fileutils
    File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 12, in <module>
      import os, glob, subprocess, os.path, time, pwd, sys, requests_unixsocket
    File "/usr/lib/python3/dist-packages/requests_unixsocket/__init__.py", line 1, in <module>
      import requests
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/__init__.py", line 95, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in <module>
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/__init__.py", line 8, in <module>
      from OpenSSL import SSL, crypto
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/SSL.py", line 19, in <module>
      from OpenSSL.crypto import (
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/crypto.py", line 3224, in <module>
      utils.deprecated(
  TypeError: deprecated() got an unexpected keyword argument 'name'

  Original exception was:
  Traceback (most recent call last):
    File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "/usr/lib/python3/dist-packages/pip/__main__.py", line 16, in <module>
      from pip._internal.cli.main import main as _main  # isort:skip # noqa
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in <module>
      from pip._internal.cli.autocompletion import autocomplete
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
      from pip._internal.cli.main_parser import create_main_parser
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
      from pip._internal.cli import cmdoptions
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
      from pip._internal.exceptions import CommandError
    File "/usr/lib/python3/dist-packages/pip/_internal/exceptions.py", line 10, in <module>
      from pip._vendor.six import iteritems
    File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 65, in <module>
      vendored("cachecontrol")
    File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
      __import__(modulename, globals(), locals(), level=0)
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>

    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/adapter.py", line 5, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/__init__.py", line 95, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in <module>
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/__init__.py", line 8, in <module>
      from OpenSSL import SSL, crypto
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/SSL.py", line 19, in <module>
      from OpenSSL.crypto import (
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/crypto.py", line 3224, in <module>
      utils.deprecated(
  TypeError: deprecated() got an unexpected keyword argument 'name'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.8 /usr/lib/python3/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-54bgvsxp/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- sqlalchemy 'setuptools>=42' Check the logs for full command output.
+inc/python:pip_install:1                  exit_trap
+./stack.sh:exit_trap:525                  local r=1
++./stack.sh:exit_trap:526                  jobs -p
+./stack.sh:exit_trap:526                  jobs=1599194
+./stack.sh:exit_trap:529                  [[ -n 1599194 ]]
+./stack.sh:exit_trap:529                  [[ -n /opt/stack/logs/stack.sh.log.2022-12-30-110555 ]]
+./stack.sh:exit_trap:529                  [[ True == \T\r\u\e ]]
+./stack.sh:exit_trap:530                  echo 'exit_trap: cleaning up child processes'
exit_trap: cleaning up child processes
+./stack.sh:exit_trap:531                  kill 1599194
+./stack.sh:exit_trap:535                  '[' -f /tmp/tmp.0DriNqASpj ']'
+./stack.sh:exit_trap:536                  rm /tmp/tmp.0DriNqASpj
+./stack.sh:exit_trap:540                  kill_spinner
+./stack.sh:kill_spinner:435               '[' '!' -z '' ']'
+./stack.sh:exit_trap:542                  [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:543                  echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:545                  type -p generate-subunit
+./stack.sh:exit_trap:546                  generate-subunit 1672369549 298 fail
+./stack.sh:exit_trap:548                  [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:551                  /usr/bin/python3.8 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
+./stack.sh:exit_trap:560                  exit 1
</code>```

I have already tried running ./clean.sh -> ./stack.sh, as well as ./unstack.sh into ./stack.sh. Despite unstacking and rerunning ./stack.sh, it did not help. Otherwise, is this a incompatibility with pip and it's libraries?

I have also tried running it on python 2.7.10, but it did not work.

Furthur details of the server I am installing on:

Ubuntu Version: 20.04.5 LTS Codename: focal

Python Version: 3.8.10

Body:
I am trying to install OpenStack on Linux Ubuntu 20.04 LTS via DevStack, and am encountering errors with the ./stack.sh script where it keeps throwing:

TypeError: deprecated() got an unexpected keyword 'name'.

The output in bash terminal is:

Using python 3.8 to install /opt/stack/devstack/tools/dbcounter
+inc/python:pip_install:190                sudo -H LC_ALL=en_US.UTF-8 SETUPTOOLS_USE_DISTUTILS=stdlib http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= python3.8 -m pip install -c /opt/stack/requirements/upper-constraints.txt --ignore-installed /opt/stack/devstack/tools/dbcounter
Processing ./tools/dbcounter
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.8 /usr/lib/python3/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-54bgvsxp/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- sqlalchemy 'setuptools>=42'
       cwd: None
  Complete output (151 lines):
  Traceback (most recent call last):
    File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "/usr/lib/python3/dist-packages/pip/__main__.py", line 16, in <module>
      from pip._internal.cli.main import main as _main  # isort:skip # noqa
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in <module>
      from pip._internal.cli.autocompletion import autocomplete
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
      from pip._internal.cli.main_parser import create_main_parser
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
      from pip._internal.cli import cmdoptions
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
      from pip._internal.exceptions import CommandError
    File "/usr/lib/python3/dist-packages/pip/_internal/exceptions.py", line 10, in <module>
      from pip._vendor.six import iteritems
    File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 65, in <module>
      vendored("cachecontrol")
    File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
      __import__(modulename, globals(), locals(), level=0)
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>

    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/adapter.py", line 5, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/__init__.py", line 95, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in <module>
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/__init__.py", line 8, in <module>
      from OpenSSL import SSL, crypto
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/SSL.py", line 19, in <module>
      from OpenSSL.crypto import (
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/crypto.py", line 3224, in <module>
      utils.deprecated(
  TypeError: deprecated() got an unexpected keyword argument 'name'
  Error in sys.excepthook:
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook
      from apport.fileutils import likely_packaged, get_recent_crashes
    File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
      from apport.report import Report
    File "/usr/lib/python3/dist-packages/apport/report.py", line 32, in <module>
      import apport.fileutils
    File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 12, in <module>
      import os, glob, subprocess, os.path, time, pwd, sys, requests_unixsocket
    File "/usr/lib/python3/dist-packages/requests_unixsocket/__init__.py", line 1, in <module>
      import requests
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/__init__.py", line 95, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in <module>
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/__init__.py", line 8, in <module>
      from OpenSSL import SSL, crypto
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/SSL.py", line 19, in <module>
      from OpenSSL.crypto import (
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/crypto.py", line 3224, in <module>
      utils.deprecated(
  TypeError: deprecated() got an unexpected keyword argument 'name'

  Original exception was:
  Traceback (most recent call last):
    File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "/usr/lib/python3/dist-packages/pip/__main__.py", line 16, in <module>
      from pip._internal.cli.main import main as _main  # isort:skip # noqa
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in <module>
      from pip._internal.cli.autocompletion import autocomplete
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
      from pip._internal.cli.main_parser import create_main_parser
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
      from pip._internal.cli import cmdoptions
    File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
      from pip._internal.exceptions import CommandError
    File "/usr/lib/python3/dist-packages/pip/_internal/exceptions.py", line 10, in <module>
      from pip._vendor.six import iteritems
    File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 65, in <module>
      vendored("cachecontrol")
    File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
      __import__(modulename, globals(), locals(), level=0)
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>

    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/adapter.py", line 5, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/__init__.py", line 95, in <module>
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
    File "<frozen zipimport>", line 259, in load_module
    File "/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in <module>
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/__init__.py", line 8, in <module>
      from OpenSSL import SSL, crypto
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/SSL.py", line 19, in <module>
      from OpenSSL.crypto import (
    File "/usr/local/lib/python3.8/dist-packages/OpenSSL/crypto.py", line 3224, in <module>
      utils.deprecated(
  TypeError: deprecated() got an unexpected keyword argument 'name'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.8 /usr/lib/python3/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-54bgvsxp/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- sqlalchemy 'setuptools>=42' Check the logs for full command output.
+inc/python:pip_install:1                  exit_trap
+./stack.sh:exit_trap:525                  local r=1
++./stack.sh:exit_trap:526                  jobs -p
+./stack.sh:exit_trap:526                  jobs=1599194
+./stack.sh:exit_trap:529                  [[ -n 1599194 ]]
+./stack.sh:exit_trap:529                  [[ -n /opt/stack/logs/stack.sh.log.2022-12-30-110555 ]]
+./stack.sh:exit_trap:529                  [[ True == \T\r\u\e ]]
+./stack.sh:exit_trap:530                  echo 'exit_trap: cleaning up child processes'
exit_trap: cleaning up child processes
+./stack.sh:exit_trap:531                  kill 1599194
+./stack.sh:exit_trap:535                  '[' -f /tmp/tmp.0DriNqASpj ']'
+./stack.sh:exit_trap:536                  rm /tmp/tmp.0DriNqASpj
+./stack.sh:exit_trap:540                  kill_spinner
+./stack.sh:kill_spinner:435               '[' '!' -z '' ']'
+./stack.sh:exit_trap:542                  [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:543                  echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:545                  type -p generate-subunit
+./stack.sh:exit_trap:546                  generate-subunit 1672369549 298 fail
+./stack.sh:exit_trap:548                  [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:551                  /usr/bin/python3.8 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
+./stack.sh:exit_trap:560                  exit 1

I have already tried running ./clean.sh -> ./stack.sh, as well as ./unstack.sh into ./stack.sh. Despite unstacking and rerunning ./stack.sh, it did not help. Otherwise, is this a incompatibility with pip and it's libraries?

I have also tried running it on python 2.7.10, but it did not work.

Furthur details of the server I am installing on:

Ubuntu Version: 20.04.5 LTS Codename: focal

Python Version: 3.8.10


问:
Generated code is not picked up by the compiler
I have a source generator like this:

```<code>    [Generator]
    public class BuilderGenerator : ISourceGenerator
    {
        public void Initialize(GeneratorInitializationContext context)
        {
            var code = @"
            namespace Generator
            {
                public class Builder<T>
                {
                    protected T _instance;

                    public T Build()
                    {
                        return _instance;
                    }
                }
            }
";
            context.RegisterForPostInitialization(ctx => ctx.AddSource("Builder.g.cs", code));
        }

        public void Execute(GeneratorExecutionContext context)
        {

        }
    }
</code>```

I am using this code generator in a console app project by referencing the code generator project. In the console app project I can see the code is generated in my IDE:

Then I use the generated code in a class in console app project like this:

```<code>// Test.cs

using Generator;

namespace ConsoleApp;
public class Person
{

}

public class PersonBuilder : Builder<Person>
{

}
</code>```

But when I compile the solution I get this error:

```<code>  Test.cs(1, 7): [CS0246] The type or namespace name 'Generator' could not be found (are you missing a using directive or an assembly reference?)
  Test.cs(9, 30): [CS0246] The type or namespace name 'Builder<>' could not be found (are you missing a using directive or an assembly reference?)
</code>```

Body:
I have a source generator like this:

    [Generator]
    public class BuilderGenerator : ISourceGenerator
    {
        public void Initialize(GeneratorInitializationContext context)
        {
            var code = @"
            namespace Generator
            {
                public class Builder<T>
                {
                    protected T _instance;

                    public T Build()
                    {
                        return _instance;
                    }
                }
            }
";
            context.RegisterForPostInitialization(ctx => ctx.AddSource("Builder.g.cs", code));
        }

        public void Execute(GeneratorExecutionContext context)
        {

        }
    }

I am using this code generator in a console app project by referencing the code generator project. In the console app project I can see the code is generated in my IDE:

Then I use the generated code in a class in console app project like this:

// Test.cs

using Generator;

namespace ConsoleApp;
public class Person
{

}

public class PersonBuilder : Builder<Person>
{

}

But when I compile the solution I get this error:

  Test.cs(1, 7): [CS0246] The type or namespace name 'Generator' could not be found (are you missing a using directive or an assembly reference?)
  Test.cs(9, 30): [CS0246] The type or namespace name 'Builder<>' could not be found (are you missing a using directive or an assembly reference?)


问:
How to download data from Google Scholar?
I want to do some analysis on the keywords and the titles of papers from a specific period of time and with particular keywords used. Let's say I want to download all the papers published between 2010 and 2020 that contain the keywords soccer and economics in Google Scholar. I don't want to download all the papers, just their titles, authors, date, journals - basically info about them. Is there a way to download this data from the search in Google Search? Do I need to use some external software or something like that?

Thanks!


问:
Setting Character encoding for a project in Visual Studio
In a C# application I am building in Visual Studio v15.4.4 in which I download text from a web api, which is UTF8, but it is rendered by my app in ASCII (I think, e.g. text like "&#39"). I have tried to find a setting to fix this, but failed. Any help would be appreciated.

Tried to find a setting...