问:
How to Change /SignIn, /SignOut , and /Account pages parent page or Add these page to a child of custom page instead of Home?
I'm using a PowerApps portal that has login and logout pages which has parent page as home. But I need to change the parent page to my custom page. Is it possible to change the parent page?

Because in our scenario all page URLs should be derived from a custom page. Can you please help as soon as possible.

Now the URL is https://xxxxx.powerappsportals.com/en-US/SignIn
I want to achieve like https://xxxxx.powerappsportals.com/en-US/yyy/SignIn - yyy should be my custom page partial URL.


来源: stackexchange

问:
Add global variables with node commands inside
I am trying to add one global variable to be accessible by all jobs inside my gitlab.yml file:

```<code>variables:
  VERSION: $(node -p "require('./package.json').version")
</code>```

Which is meant to fetch the node version of the package.json file but the issue here is that when I try to access the variable $VERSION, it does nothing but print the value as a string and not implement it in the release job below:

```<code>release-job:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  script:
    - echo "running release-job for $TAG"
  release:
  tag_name: 'v0.$CI_PIPELINE_IID'
  description: 'This is the new version: v0.$CI_PIPELINE_IID and
  package.json = $VERSION'
  ref: '$CI_COMMIT_SHA' # The tag is created from the pipeline SHA.
  tags:
  - SharedRunner
</code>```

Any help?

Thanks in advance.

ContentLicense: CC BY-SA 4.0

Body:
I am trying to add one global variable to be accessible by all jobs inside my gitlab.yml file:

variables:
  VERSION: $(node -p "require('./package.json').version")

Which is meant to fetch the node version of the package.json file but the issue here is that when I try to access the variable $VERSION, it does nothing but print the value as a string and not implement it in the release job below:

release-job:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  script:
    - echo "running release-job for $TAG"
  release:
  tag_name: 'v0.$CI_PIPELINE_IID'
  description: 'This is the new version: v0.$CI_PIPELINE_IID and
  package.json = $VERSION'
  ref: '$CI_COMMIT_SHA' # The tag is created from the pipeline SHA.
  tags:
  - SharedRunner

Any help?

Thanks in advance.


问:
Multitenancy architecture with test and real data
Now we are tasked with making a demo version of our project for potential clients with test data. The frontend is on React and the backend is on Django Rest Framework. The way I see it:

Users log in to the demo version.

We send a request (GET) to the backend.

In the middleware we check the request:

3.1 If it is a demo query, user connects to the sql-lite database with the test data

3.2 Otherwise, we connect to the main database

If it is PUT, PATCH, DELETE, then we just show a popup that the action has occurred

Do you know of examples of this kind of functionality, or maybe see pitfalls along the way?


问:
React url changes, but the component doesn't load until the page didn't refresh manually
so basically I am using the react-router 6.4.2 version in my project and I have a dynamic route called detail/:id and also I made a page for it that loads dynamic data from API and on that page, there is a section that loads similar products to it from API and moreover, each similar products is linked to its URL(detail/productID) so whenever I navigate from any other route like from home to detail/productID then it successfully loads the component but when it's on the same URL/route and I clicked on any similar product the URL is changed but component did not load until I don't refresh the whole page physically

so this is my app.js

```<code>import { BrowserRouter, Routes, Route } from "react-router-dom";
import Main from "./Layout/Main";
import Home from "./Pages/Home";
import Detail from "./Pages/Detail";
import Cart from "./Pages/Cart";
import Checkout from "./Pages/Checkout";
import Login from "./Pages/Login";
import Register from "./Pages/Register";
import Forgot from "./Pages/Forgot";
import Thankyou from "./Pages/Thankyou";
import MyAccount from "./Pages/MyAccount";
import OtpVerification from "./Pages/OtpVerification";
// Start Artists pages
import Sidebarlayout from "./Layout/Sidebarlayout";
import Full_layout from "./Layout/Full_layout";
import Artistregister from "./Artists/Register/Artistregister";
import Artistaddress from "./Artists/Register/Artistaddress";
import Artistthanks from "./Artists/Register/Artistthanks";
import Artistverified from "./Artists/Register/Artistverified";
import Artistlogin from "./Artists/Login/Artistlogin";
import Artistforgotpassword from "./Artists/Login/Artistforgotpassword";
import Artistresetpassword from "./Artists/Login/Artistresetpassword";
import Overview from "./Artists/Dashboard/Overview";
import ArtistImages from "./Artists/Dashboard/ArtistImages";
import ArtistVideos from "./Artists/Dashboard/ArtistVideos";
import ArtistMyAccount from "./Artists/Dashboard/MyAccount";
import ArtistEarnings from "./Artists/Dashboard/Earnings";
// admin
import Adminlayout from "./Layout/Adminlayout";
import Adminlogin from "./Admin/Adminlogin";
import Dashboard from "./Admin/Dashboard";
import Customers from "./Admin/Customers";
import Artist from "./Admin/Artist";
import Orders from "./Admin/Orders";
import Adminimages from "./Admin/Adminimages";
import Categories from "./Admin/Categories";
import { useLayoutEffect } from "react";
import Search from "./Pages/Search";
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
function App() {
  return (
    <BrowserRouter>
    <ToastContainer />
      <Routes>
        <Route path="/" element={<Main />}>
          <Route index element={<Home />} />
          <Route path="/" element={<Home />} />
          <Route path="detail/:id" element={<Detail />} />
          <Route path="cart" element={<Cart />} />
          <Route path="checkout" element={<Checkout />} />
          <Route path="login" element={<Login />} />
          <Route path="register" element={<Register />} />
          <Route path="otp_verification" element={<OtpVerification />} />
          <Route path="forgot" element={<Forgot />} />
          <Route path="myaccount" element={<MyAccount />} />
          <Route path="thankyou" element={<Thankyou />} />
          <Route path="searched-result" element={<Search/>} />
        </Route>
        <Route element={<Full_layout />}>
          {/* artist start */}
          <Route path="/artist/register" element={<Artistregister />} />
          <Route path="/artist/thanks" element={<Artistthanks />} />
          <Route path="/artist/verified" element={<Artistverified />} />
          <Route path="/artist/address" element={<Artistaddress />} />
          <Route path="/artist/login" element={<Artistlogin />} />
          <Route
            path="/artist/forgotpassword"
            element={<Artistforgotpassword />}
          />
          <Route
            path="/artist/resetpassword"
            element={<Artistresetpassword />}
          />
          {/* artist end */}
          {/* admin */}
          <Route path="/admin/login" element={<Adminlogin />} />
        </Route>
        <Route element={<Adminlayout />}>

          {/* admin */}

          <Route path="/admin/dashboard" element={<Dashboard />} />
          <Route path="/admin/customers" element={<Customers />} />
          <Route path="/admin/artist" element={<Artist />} />
          <Route path="/admin/orders" element={<Orders />} />
          <Route path="/admin/images" element={<Adminimages />} />
          <Route path="/admin/categories" element={<Categories />} />
        </Route>
        <Route element={<Sidebarlayout />}>
          <Route path="/artist/overview" element={<Overview />} />
          <Route path="/artist/images" element={<ArtistImages />} />
          <Route path="/artist/videos" element={<ArtistVideos />} />
          <Route path="/artist/myaccount" element={<ArtistMyAccount />} />
          <Route path="/artist/earnings" element={<ArtistEarnings />} />
        </Route>
      </Routes>
    </BrowserRouter>
  );
}

export default App;

</code>```

and this is detail page

```<code>import React, { useContext, useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import { Link } from "react-router-dom";
import { toast } from "react-toastify";
import viewImage from "../assets/images/purchase-image.jpg";
import similar1 from "../assets/images/viewall/view1.jpg";
import similar2 from "../assets/images/viewall/view2.jpg";
import similar3 from "../assets/images/viewall/view3.jpg";
import similar4 from "../assets/images/viewall/view4.jpg";
import similar5 from "../assets/images/viewall/view5.jpg";
import similar6 from "../assets/images/viewall/view6.jpg";
import similar7 from "../assets/images/viewall/view7.jpg";
import similar8 from "../assets/images/viewall/view8.jpg";
import { rootStore } from "../Store";
const Detail = () => {
  const [provideData, setData] = useState([]);
  const [Loading, setLoading] = useState(false);
  const [isAddToCart, setisAddToCart] = useState(false);
  const parms = useParams();
  const { cart, setCart, TotalItems, setTotalItems, subTotal, setsubTotal } = useContext(rootStore);
  //fetch perticular user data to show in fields.
  useEffect(() => {
    async function fetchData() {
      let apiBaseUrl = window.location.hostname;
      if (apiBaseUrl == "localhost") {
        apiBaseUrl = "";
      } else {
        apiBaseUrl = "https://example.com/api";
      }
      const settings = {
        method: "POST",
        headers: {
          "Accept": "application/json",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          u_id: parms.id,
        }),
      };
      setLoading(true);
      await fetch(apiBaseUrl + "/image/get_single_home_image_by_u_id", settings)
        .then((response) => {
          return response.json();
        })
        .then((res) => {
          const provideData = res.data;
          setData(provideData);
          setLoading(false);
          console.log(provideData)
        });
    }
    fetchData();
  }, []);

  const detail_img = "https://example.com/" + provideData.home_image;
  return (
    <section className="section detail-section">
      <section className="search-images">
        <div className="container">
          <div className="rows">
            <div className="image-box">
              <img src={detail_img} alt="view image" width={854} height={564} />
              <div className="save-box">
                <span><b>{provideData.image_title}</b>, {provideData.image_description}</span>
                <button>+save</button>
              </div>
            </div>
            <div className="purchase-box">
              <div className="purchase-top">
                <h2>PURCHASE A LICENCE {Loading ? 'Loading...' : 'Not Loading'}</h2>
                <p>
                  All Royalty-Free licences include global use rights,
                  comprehensive protection, and simple pricing with volume
                  discounts available.
                </p>
              </div>
              {/* <div className="radio-box">
                <div>
                  <input
                    type="radio"
                    id="extraSmall"
                    name="price"
                    value="extraSmall"
                  />
                  <label htmlFor="extraSmall">
                    Extra small<span>₹2,000.00</span>
                  </label>
                </div>
                <div>
                  <input type="radio" id="small" name="price" value="small" />
                  <label htmlFor="small">
                    Small<span>₹7,000.00</span>
                  </label>
                </div>
                <div>
                  <input type="radio" id="medium" name="price" value="medium" />
                  <label htmlFor="medium">
                    Medium<span>₹14,000.00</span>
                  </label>
                </div>
                <div>
                  <input type="radio" id="large" name="price" value="large" />
                  <label htmlFor="large">
                    Large<span>₹23,000.00</span>
                  </label>
                </div>
              </div>
              <div className="inr-box">₹23,000.00INR</div> */}
              <div className="cart-box">
                <div className="get-this">GET THIS IMAGE FOR ₹20,500</div>
                {Loading == false &&<button className="add-cart-btn" onClick={() => { addToCart(provideData) }}>
                  {isAddToCart !==false ? isAddToCart : 'ADD TO CART'}
                </button>}
                <Link className="add-cart-btn" to="/cart">
                  View Cart ({TotalItems == '' ? 0 : TotalItems})
                </Link>
              </div>
            </div>
          </div>
        </div>
      </section>
      <section className="viewmore-section">
        <div className="container">
          <h3 className="similar-images">
            Similar images
          </h3>
          <div className="similar-container grid" id="viewbox">
             <Link to={"/detail/7"} >
              <div className="grid-item">

                <img src={similar1} alt="similar" width={300} height={300} />
              </div>
            </Link>
            <Link to={"/detail/106"} >
              <div className="grid-item">

                <img src={similar2} alt="similar" width={300} height={300} />
              </div>
            </Link>
            <Link to={"/detail/107"} >
              <div className="grid-item">

                <img src={similar3} alt="similar" width={300} height={300} />
              </div>
            </Link>
            <Link to={"/detail/108"} >
              <div className="grid-item">

                <img src={similar4} alt="similar" width={300} height={300} />
              </div>
            </Link>
          </div>
          <div className="img-tags">
            <ul>
              <li>
                <Link to="/searched-result?tags=mountain">Mountain</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=mountain-pea">Mountain Pea</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=mountaineering">Mountaineering</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=on-top">On Top</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=hiking">Hiking</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=men">Men</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=freedom">Freedom</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=climbing">Climbing</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=cloud-sky">Cloud - Sky</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=people-one-person">People One Person</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=rock">Rock - Object</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=sunset">Sunset</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=nature">Nature</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=sky">Sky</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=success">Success</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=outdoors">Outdoors</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=travel">Travel</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=majestic">Majestic</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=dolomites">Dolomites</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=photography">Photography</Link>
              </li>
              <li>
                <Link to="/searched-result?tags=sunrise-dawn">Sunrise - Dawn</Link>
              </li>
            </ul>
          </div>
        </div>
      </section>
    </section>
  );
};

export default Detail;
</code>```

Body:
so basically I am using the react-router 6.4.2 version in my project and I have a dynamic route called detail/:id and also I made a page for it that loads dynamic data from API and on that page, there is a section that loads similar products to it from API and moreover, each similar products is linked to its URL(detail/productID) so whenever I navigate from any other route like from home to detail/productID then it successfully loads the component but when it's on the same URL/route and I clicked on any similar product the URL is changed but component did not load until I don't refresh the whole page physically

so this is my app.js

import { BrowserRouter, Routes, Route } from "react-router-dom";
import Main from "./Layout/Main";
import Home from "./Pages/Home";
import Detail from "./Pages/Detail";
import Cart from "./Pages/Cart";
import Checkout from "./Pages/Checkout";
import Login from "./Pages/Login";
import Register from "./Pages/Register";
import Forgot from "./Pages/Forgot";
import Thankyou from "./Pages/Thankyou";
import MyAccount from "./Pages/MyAccount";
import OtpVerification from "./Pages/OtpVerification";
// Start Artists pages
import Sidebarlayout from "./Layout/Sidebarlayout";
import Full_layout from "./Layout/Full_layout";
import Artistregister from "./Artists/Register/Artistregister";
import Artistaddress from "./Artists/Register/Artistaddress";
import Artistthanks from "./Artists/Register/Artistthanks";
import Artistverified from "./Artists/Register/Artistverified";
import Artistlogin from "./Artists/Login/Artistlogin";
import Artistforgotpassword from "./Artists/Login/Artistforgotpassword";
import Artistresetpassword from "./Artists/Login/Artistresetpassword";
import Overview from "./Artists/Dashboard/Overview";
import ArtistImages from "./Artists/Dashboard/ArtistImages";
import ArtistVideos from "./Artists/Dashboard/ArtistVideos";
import ArtistMyAccount from "./Artists/Dashboard/MyAccount";
import ArtistEarnings from "./Artists/Dashboard/Earnings";
// admin
import Adminlayout from "./Layout/Adminlayout";
import Adminlogin from "./Admin/Adminlogin";
import Dashboard from "./Admin/Dashboard";
import Customers from "./Admin/Customers";
import Artist from "./Admin/Artist";
import Orders from "./Admin/Orders";
import Adminimages from "./Admin/Adminimages";
import Categories from "./Admin/Categories";
import { useLayoutEffect } from "react";
import Search from "./Pages/Search";
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
function App() {
  return (
    <BrowserRouter>
    <ToastContainer />
      <Routes>
        <Route path="/" element={}>
          <Route index element={<Home />} />
          <Route path="/" element={<Home />} />
          <Route path="detail/:id" element={<Detail />} />
          <Route path="cart" element={<Cart />} />
          <Route path="checkout" element={<Checkout />} />
          <Route path="login" element={<Login />} />
          <Route path="register" element={<Register />} />
          <Route path="otp_verification" element={<OtpVerification />} />
          <Route path="forgot" element={<Forgot />} />
          <Route path="myaccount" element={<MyAccount />} />
          <Route path="thankyou" element={<Thankyou />} />
          <Route path="searched-result" element={<Search/>} />
        </Route>
        <Route element={<Full_layout />}>
          {/* artist start */}
          <Route path="/artist/register" element={<Artistregister />} />
          <Route path="/artist/thanks" element={<Artistthanks />} />
          <Route path="/artist/verified" element={<Artistverified />} />
          <Route path="/artist/address" element={<Artistaddress />} />
          <Route path="/artist/login" element={<Artistlogin />} />
          <Route
            path="/artist/forgotpassword"
            element={<Artistforgotpassword />}
          />
          <Route
            path="/artist/resetpassword"
            element={<Artistresetpassword />}
          />
          {/* artist end */}
          {/* admin */}
          <Route path="/admin/login" element={<Adminlogin />} />
        </Route>
        <Route element={<Adminlayout />}>

          {/* admin */}

          <Route path="/admin/dashboard" element={<Dashboard />} />
          <Route path="/admin/customers" element={<Customers />} />
          <Route path="/admin/artist" element={<Artist />} />
          <Route path="/admin/orders" element={<Orders />} />
          <Route path="/admin/images" element={<Adminimages />} />
          <Route path="/admin/categories" element={<Categories />} />
        </Route>
        <Route element={<Sidebarlayout />}>
          <Route path="/artist/overview" element={<Overview />} />
          <Route path="/artist/images" element={<ArtistImages />} />
          <Route path="/artist/videos" element={<ArtistVideos />} />
          <Route path="/artist/myaccount" element={<ArtistMyAccount />} />
          <Route path="/artist/earnings" element={<ArtistEarnings />} />
        </Route>
      </Routes>
    </BrowserRouter>
  );
}

export default App;

and this is detail page

import React, { useContext, useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import { Link } from "react-router-dom";
import { toast } from "react-toastify";
import viewImage from "../assets/images/purchase-image.jpg";
import similar1 from "../assets/images/viewall/view1.jpg";
import similar2 from "../assets/images/viewall/view2.jpg";
import similar3 from "../assets/images/viewall/view3.jpg";
import similar4 from "../assets/images/viewall/view4.jpg";
import similar5 from "../assets/images/viewall/view5.jpg";
import similar6 from "../assets/images/viewall/view6.jpg";
import similar7 from "../assets/images/viewall/view7.jpg";
import similar8 from "../assets/images/viewall/view8.jpg";
import { rootStore } from "../Store";
const Detail = () => {
  const [provideData, setData] = useState([]);
  const [Loading, setLoading] = useState(false);
  const [isAddToCart, setisAddToCart] = useState(false);
  const parms = useParams();
  const { cart, setCart, TotalItems, setTotalItems, subTotal, setsubTotal } = useContext(rootStore);
  //fetch perticular user data to show in fields.
  useEffect(() => {
    async function fetchData() {
      let apiBaseUrl = window.location.hostname;
      if (apiBaseUrl == "localhost") {
        apiBaseUrl = "";
      } else {
        apiBaseUrl = "https://example.com/api";
      }
      const settings = {
        method: "POST",
        headers: {
          "Accept": "application/json",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          u_id: parms.id,
        }),
      };
      setLoading(true);
      await fetch(apiBaseUrl + "/image/get_single_home_image_by_u_id", settings)
        .then((response) => {
          return response.json();
        })
        .then((res) => {
          const provideData = res.data;
          setData(provideData);
          setLoading(false);
          console.log(provideData)
        });
    }
    fetchData();
  }, []);

  const detail_img = "https://example.com/" + provideData.home_image;
  return (

                {provideData.image_title}, {provideData.image_description}
                <button>+save</button>

PURCHASE A LICENCE {Loading ? 'Loading...' : 'Not Loading'}

                  All Royalty-Free licences include global use rights,
                  comprehensive protection, and simple pricing with volume
                  discounts available.

              {/*

                  <input
                    type="radio"
                    id="extraSmall"
                    name="price"
                    value="extraSmall"
                  />

                    Extra small₹2,000.00

                  <input type="radio" id="small" name="price" value="small" />

                    Small₹7,000.00

                  <input type="radio" id="medium" name="price" value="medium" />

                    Medium₹14,000.00

                  <input type="radio" id="large" name="price" value="large" />

                    Large₹23,000.00

₹23,000.00INR
 */}

GET THIS IMAGE FOR ₹20,500

                {Loading == false &&<button className="add-cart-btn" onClick={() => { addToCart(provideData) }}>
                  {isAddToCart !==false ? isAddToCart : 'ADD TO CART'}
                </button>}
                <Link className="add-cart-btn" to="/cart">
                  View Cart ({TotalItems == '' ? 0 : TotalItems})
                </Link>

            Similar images

             <Link to={"/detail/7"} >

            </Link>
            <Link to={"/detail/106"} >

            </Link>
            <Link to={"/detail/107"} >

            </Link>
            <Link to={"/detail/108"} >

            </Link>

                <Link to="/searched-result?tags=mountain">Mountain</Link>

                <Link to="/searched-result?tags=mountain-pea">Mountain Pea</Link>

                <Link to="/searched-result?tags=mountaineering">Mountaineering</Link>

                <Link to="/searched-result?tags=on-top">On Top</Link>

                <Link to="/searched-result?tags=hiking">Hiking</Link>

                <Link to="/searched-result?tags=men">Men</Link>

                <Link to="/searched-result?tags=freedom">Freedom</Link>

                <Link to="/searched-result?tags=climbing">Climbing</Link>

                <Link to="/searched-result?tags=cloud-sky">Cloud - Sky</Link>

                <Link to="/searched-result?tags=people-one-person">People One Person</Link>

                <Link to="/searched-result?tags=rock">Rock - Object</Link>

                <Link to="/searched-result?tags=sunset">Sunset</Link>

                <Link to="/searched-result?tags=nature">Nature</Link>

                <Link to="/searched-result?tags=sky">Sky</Link>

                <Link to="/searched-result?tags=success">Success</Link>

                <Link to="/searched-result?tags=outdoors">Outdoors</Link>

                <Link to="/searched-result?tags=travel">Travel</Link>

                <Link to="/searched-result?tags=majestic">Majestic</Link>

                <Link to="/searched-result?tags=dolomites">Dolomites</Link>

                <Link to="/searched-result?tags=photography">Photography</Link>

                <Link to="/searched-result?tags=sunrise-dawn">Sunrise - Dawn</Link>

  );
};

export default Detail;


问:
I'm trying to make a program that makes card prototypes. Having trouble drawing text to the cards themselves
I'm trying to find a way to draw text to the displayed card in such a way that it can be easily undone.

I've tried using a canvas for the cards, but I can't lift it to the top layer.
The checkbox on the Item card is supposed to print the word 'Starter' on the card if it is checked, but it runs add_text even when not checked and doesn't add the text anyway.
2 days of google has turned up nothing.

```<code># import everything from tkinter module
import tkinter as tk
import os
root = tk.Tk()
root.geometry('600x500')

fraItem = tk.Frame(root, height=500, width=600)
fraEnvi = tk.Frame(root, height=500, width=600)
fraMons = tk.Frame(root, height=500, width=600)
fraBoss = tk.Frame(root, height=500, width=600)
fraRace = tk.Frame(root, height=500, width=600)
fraClas = tk.Frame(root, height=500, width=600)

imgItem = tk.PhotoImage(file="ItemTemplate.gif")
imgEnvi = tk.PhotoImage(file="EnvironmentTemplate.gif")
imgMons = tk.PhotoImage(file="MonsterTemplate.gif")
imgBoss = tk.PhotoImage(file="BossTemplate.gif")
imgRace = tk.PhotoImage(file="RaceTemplate.gif")
imgClas = tk.PhotoImage(file="ClassTemplate.gif")

cardOverlay = tk.Canvas(root, height=400, width=300)
cardOverlay.place(x=250, y=20)

CARD_TYPES = ["Item", "Environment", "Monster", "Boss", "Race", "Class"]
currentType = tk.StringVar(root)
currentType.set("Item")

def make_card():
    print("Generating Card")

def clear_fields():
    print("Clear Fields")

def add_text(textStr, x, y):
    cardOverlay.create_text(x,y, text=textStr, fill="black", font=('Arial 15 bold'))
    print("put text on card")

def raise_buttons():
    lstTemplate.lift()
    butGenerate.lift()
    butClear.lift()

def card_changed(currentType):
    match currentType:
        case "Item":
            fraItem.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgItem
        case "Environment":
            fraEnvi.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgEnvi
        case "Monster":
            fraMons.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgMons
        case "Boss":
            fraBoss.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgBoss
        case "Race":
            fraRace.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgRace
        case "Class":
            fraClas.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgClas

#fraItem
lblItemName = tk.Label(fraItem, text="Card Name:").place(x=5, y=100)
txtItemName = tk.Entry(fraItem, text="enter card name").place(x=80, y=100)

lblItemStart = tk.Label(fraItem, text="Starting Item?:").place(x=5, y=125)
chkItemStart = tk.Checkbutton(fraItem, command=add_text('Starter', 200, 300)).place(x=80, y=125)

lblItemStats = tk.Label(fraItem, text="Stat Number:").place(x=5, y=150)
txtItemStats = tk.Entry(fraItem).place(x=80, y=150)

lblItemStatType = tk.Label(fraItem, text="Stat Type:").place(x=5, y=175)
txtStatType = tk.Entry(fraItem).place(x=80, y=175)

lblItemType = tk.Label(fraItem, text="Equip Type:").place(x=5, y=200)
txtItemType = tk.Entry(fraItem).place(x=80, y=200)

lblItemText = tk.Label(fraItem, text="Card Text:").place(x=5, y=225)
txtItemText = tk.Entry(fraItem).place(x=80, y=225)

lblItemPicture = tk.Label(fraItem, text="Complete Card:").place(x=250, y=5)
lblItemPicture = tk.Label(fraItem, height=400, image=imgItem).place(x=250, y=20)

#fraEnvi
lblEnviName = tk.Label(fraEnvi, text="Card Name:").place(x=5, y=100)
txtEnviName = tk.Entry(fraEnvi, text="enter room name").place(x=80, y=100)

lblEnviDeck = tk.Label(fraEnvi, text="Deck ID:").place(x=5, y=125)
txtEnviDeck = tk.Entry(fraEnvi, text="enter deck").place(x=80, y=125)

lblEnviType = tk.Label(fraEnvi, text="Card Type:").place(x=5, y=150)
txtEnviType = tk.Entry(fraEnvi, text="enter room type").place(x=80, y=150)

lblEnviText = tk.Label(fraEnvi, text="Card Text:").place(x=5, y=175)
txtEnviText = tk.Entry(fraEnvi, text="enter room text").place(x=80, y=175)

lblItemPicture = tk.Label(fraEnvi, text="Complete Card:").place(x=250, y=5)
lblItemPicture = tk.Label(fraEnvi, height=400, image=imgEnvi).place(x=250, y=20)

#fraMons
lblMonsName = tk.Label(fraMons, text="Name:").place(x=5, y=100)
txtMonsName = tk.Entry(fraMons, text="enter monster name").place(x=80, y=100)

lblMonsAtk = tk.Label(fraMons, text="Attack #:").place(x=5, y=125)
txtMonsAtk = tk.Entry(fraMons, text="enter attack").place(x=80, y=125)

lblMonsDef = tk.Label(fraMons, text="Defense #:").place(x=5, y=150)
txtMonsDef = tk.Entry(fraMons, text="enter defense").place(x=80, y=150)

lblMonsMag = tk.Label(fraMons, text="Magic #:").place(x=5, y=175)
txtMonsMag = tk.Entry(fraMons, text="enter magic").place(x=80, y=175)

lblMonsSpd = tk.Label(fraMons, text="Speed #:").place(x=5, y=200)
txtMonsSpd = tk.Entry(fraMons, text="enter speed").place(x=80, y=200)

lblMonsTarget = tk.Label(fraMons, text="Target:").place(x=5, y=225)
txtMonsTarget = tk.Entry(fraMons, text="enter target").place(x=80, y=225)

lblMonsType = tk.Label(fraMons, text="Type:").place(x=5, y=250)
txtMonsType = tk.Entry(fraMons, text="enter type").place(x=80, y=250)

lblMonsWound = tk.Label(fraMons, text="Wound Text:").place(x=5, y=275)
txtMonsWound = tk.Entry(fraMons, text="enter wound ability").place(x=80, y=275)

lblMonsText = tk.Label(fraMons, text="Main Text:").place(x=5, y=300)
txtMonsText = tk.Entry(fraMons, text="enter main text").place(x=80, y=300)

lblItemPicture = tk.Label(fraMons, text="Complete Card:").place(x=250, y=5)
lblItemPicture = tk.Label(fraMons, height=400, image=imgMons).place(x=250, y=20)

#fraBoss
lblBossName = tk.Label(fraBoss, text="Card Name:").place(x=5, y=100)
txtBossName = tk.Entry(fraBoss, text="enter boss name").place(x=80, y=100)

lblBossAtk = tk.Label(fraBoss, text="Attack #:").place(x=5, y=125)
txtBossAtk = tk.Entry(fraBoss, text="enter boss attack").place(x=80, y=125)

lblBossDef = tk.Label(fraBoss, text="Defense #:").place(x=5, y=150)
txtBossDef = tk.Entry(fraBoss, text="enter boss defense").place(x=80, y=150)

lblBossMag = tk.Label(fraBoss, text="Magic #:").place(x=5, y=175)
txtBossMag = tk.Entry(fraBoss, text="enter boss magic").place(x=80, y=175)

lblBossSpd = tk.Label(fraBoss, text="Speed #:").place(x=5, y=200)
txtBossSpd = tk.Entry(fraBoss, text="enter boss speed").place(x=80, y=200)

lblBossCombat = tk.Label(fraBoss, text="Combat:").place(x=5, y=225)
txtBossCombat = tk.Entry(fraBoss, text="enter combat effect").place(x=80, y=225)

lblBossEnvironment = tk.Label(fraBoss, text="Environment:").place(x=5, y=250)
txtBossEnvironment = tk.Entry(fraBoss, text="enter Environment effect").place(x=80, y=250)

lblBossMonster = tk.Label(fraBoss, text="Monster:").place(x=5, y=275)
txtBossMonster = tk.Entry(fraBoss, text="enter monster effect").place(x=80, y=275)

lblBossAct1 = tk.Label(fraBoss, text="Action 1:").place(x=5, y=300)
txtBossAct1 = tk.Entry(fraBoss, text="enter action 1").place(x=80, y=300)

lblBossAct2 = tk.Label(fraBoss, text="Action 2:").place(x=5, y=325)
txtBossAct2 = tk.Entry(fraBoss, text="enter action 2").place(x=80, y=325)

lblBossAct3 = tk.Label(fraBoss, text="Action 3:").place(x=5, y=350)
txtBossAct3 = tk.Entry(fraBoss, text="enter action 3").place(x=80, y=350)

lblBossAct4 = tk.Label(fraBoss, text="Action 4:").place(x=5, y=375)
txtBossAct4 = tk.Entry(fraBoss, text="enter action 4").place(x=80, y=375)

lblBossAct5 = tk.Label(fraBoss, text="Action 5:").place(x=5, y=400)
txtBossAct5 = tk.Entry(fraBoss, text="enter action 5").place(x=80, y=400)

lblBossPicture = tk.Label(fraBoss, text="Complete Card:").place(x=250, y=5)
lblBossPicture = tk.Label(fraBoss, height=400, image=imgBoss).place(x=250, y=20)

#fraRace
lblRaceName = tk.Label(fraRace, text="Card Name:").place(x=5, y=100)
txtRaceName = tk.Entry(fraRace, text="enter race name").place(x=80, y=100)

lblRaceAtk = tk.Label(fraRace, text="Attack #:").place(x=5, y=125)
txtRaceAtk = tk.Entry(fraRace, text="enter race attack").place(x=80, y=125)

lblRaceDef = tk.Label(fraRace, text="Defense #:").place(x=5, y=150)
txtRaceDef = tk.Entry(fraRace, text="enter Race defense").place(x=80, y=150)

lblRaceMag = tk.Label(fraRace, text="Magic #:").place(x=5, y=175)
txtRaceMag = tk.Entry(fraRace, text="enter Race magic").place(x=80, y=175)

lblRaceSpd = tk.Label(fraRace, text="Speed #:").place(x=5, y=200)
txtRaceSpd = tk.Entry(fraRace, text="enter Race speed").place(x=80, y=200)

lblRaceBonus = tk.Label(fraRace, text="Bonus:").place(x=5, y=225)
txtRaceBonus = tk.Entry(fraRace, text="enter Bonus").place(x=80, y=225)

lblRaceFlaw = tk.Label(fraRace, text="Flaw:").place(x=5, y=250)
txtRaceFlaw = tk.Entry(fraRace, text="enter Flaw").place(x=80, y=250)

lblRacePicture = tk.Label(fraRace, text="Complete Card:").place(x=250, y=5)
lblRacePicture = tk.Label(fraRace, height=400, image=imgRace).place(x=250, y=20)

#fraClas
lblClasName = tk.Label(fraClas, text="Card Name:").place(x=5, y=100)
txtClasName = tk.Entry(fraClas, text="enter class name").place(x=80, y=100)

lblClasAtk = tk.Label(fraClas, text="Attack #:").place(x=5, y=125)
txtClasAtk = tk.Entry(fraClas, text="enter Class attack").place(x=80, y=125)

lblClasDef = tk.Label(fraClas, text="Defense #:").place(x=5, y=150)
txtClasDef = tk.Entry(fraClas, text="enter Class defense").place(x=80, y=150)

lblClasMag = tk.Label(fraClas, text="Magic #:").place(x=5, y=175)
txtClasMag = tk.Entry(fraClas, text="enter Class magic").place(x=80, y=175)

lblClasSpd = tk.Label(fraClas, text="Speed #:").place(x=5, y=200)
txtClasSpd = tk.Entry(fraClas, text="enter Class speed").place(x=80, y=200)

lblClasAct = tk.Label(fraClas, text="Active:").place(x=5, y=225)
txtClasAct = tk.Entry(fraClas, text="enter Active").place(x=80, y=225)

lblClasPass = tk.Label(fraClas, text="Passive:").place(x=5, y=250)
txtClasPass = tk.Entry(fraClas, text="enter Passive").place(x=80, y=250)

lblClasPicture = tk.Label(fraClas, text="Complete Card:").place(x=250, y=5)
lblClasPicture = tk.Label(fraClas, height=400, image=imgClas).place(x=250, y=20)

#card choice dropdown and buttons
lstTemplate = tk.OptionMenu(root, currentType, *CARD_TYPES, command=card_changed)
lstTemplate.place(x=50, y=20)
butGenerate = tk.Button(root, text="Generate", command=make_card)
butGenerate.place(x=200, y=450)
butClear = tk.Button(root, text="Clear",fg="red", command=clear_fields)
butClear.place(x=350, y=450)

fraEnvi.place(x=0, y=0)
fraMons.place(x=0, y=0)
fraBoss.place(x=0, y=0)
fraRace.place(x=0, y=0)
fraClas.place(x=0, y=0)
fraItem.place(x=0, y=0)
card_changed("Item")
#window will not appear until mainloop is called
root.mainloop()

</code>```

Body:
I'm trying to find a way to draw text to the displayed card in such a way that it can be easily undone.

I've tried using a canvas for the cards, but I can't lift it to the top layer.
The checkbox on the Item card is supposed to print the word 'Starter' on the card if it is checked, but it runs add_text even when not checked and doesn't add the text anyway.
2 days of google has turned up nothing.

# import everything from tkinter module
import tkinter as tk
import os
root = tk.Tk()
root.geometry('600x500')

fraItem = tk.Frame(root, height=500, width=600)
fraEnvi = tk.Frame(root, height=500, width=600)
fraMons = tk.Frame(root, height=500, width=600)
fraBoss = tk.Frame(root, height=500, width=600)
fraRace = tk.Frame(root, height=500, width=600)
fraClas = tk.Frame(root, height=500, width=600)

imgItem = tk.PhotoImage(file="ItemTemplate.gif")
imgEnvi = tk.PhotoImage(file="EnvironmentTemplate.gif")
imgMons = tk.PhotoImage(file="MonsterTemplate.gif")
imgBoss = tk.PhotoImage(file="BossTemplate.gif")
imgRace = tk.PhotoImage(file="RaceTemplate.gif")
imgClas = tk.PhotoImage(file="ClassTemplate.gif")

cardOverlay = tk.Canvas(root, height=400, width=300)
cardOverlay.place(x=250, y=20)

CARD_TYPES = ["Item", "Environment", "Monster", "Boss", "Race", "Class"]
currentType = tk.StringVar(root)
currentType.set("Item")

def make_card():
    print("Generating Card")

def clear_fields():
    print("Clear Fields")

def add_text(textStr, x, y):
    cardOverlay.create_text(x,y, text=textStr, fill="black", font=('Arial 15 bold'))
    print("put text on card")

def raise_buttons():
    lstTemplate.lift()
    butGenerate.lift()
    butClear.lift()

def card_changed(currentType):
    match currentType:
        case "Item":
            fraItem.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgItem
        case "Environment":
            fraEnvi.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgEnvi
        case "Monster":
            fraMons.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgMons
        case "Boss":
            fraBoss.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgBoss
        case "Race":
            fraRace.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgRace
        case "Class":
            fraClas.tkraise()
            raise_buttons()
            print(currentType)
            cardOverlay.image = imgClas

#fraItem
lblItemName = tk.Label(fraItem, text="Card Name:").place(x=5, y=100)
txtItemName = tk.Entry(fraItem, text="enter card name").place(x=80, y=100)

lblItemStart = tk.Label(fraItem, text="Starting Item?:").place(x=5, y=125)
chkItemStart = tk.Checkbutton(fraItem, command=add_text('Starter', 200, 300)).place(x=80, y=125)

lblItemStats = tk.Label(fraItem, text="Stat Number:").place(x=5, y=150)
txtItemStats = tk.Entry(fraItem).place(x=80, y=150)

lblItemStatType = tk.Label(fraItem, text="Stat Type:").place(x=5, y=175)
txtStatType = tk.Entry(fraItem).place(x=80, y=175)

lblItemType = tk.Label(fraItem, text="Equip Type:").place(x=5, y=200)
txtItemType = tk.Entry(fraItem).place(x=80, y=200)

lblItemText = tk.Label(fraItem, text="Card Text:").place(x=5, y=225)
txtItemText = tk.Entry(fraItem).place(x=80, y=225)

lblItemPicture = tk.Label(fraItem, text="Complete Card:").place(x=250, y=5)
lblItemPicture = tk.Label(fraItem, height=400, image=imgItem).place(x=250, y=20)

#fraEnvi
lblEnviName = tk.Label(fraEnvi, text="Card Name:").place(x=5, y=100)
txtEnviName = tk.Entry(fraEnvi, text="enter room name").place(x=80, y=100)

lblEnviDeck = tk.Label(fraEnvi, text="Deck ID:").place(x=5, y=125)
txtEnviDeck = tk.Entry(fraEnvi, text="enter deck").place(x=80, y=125)

lblEnviType = tk.Label(fraEnvi, text="Card Type:").place(x=5, y=150)
txtEnviType = tk.Entry(fraEnvi, text="enter room type").place(x=80, y=150)

lblEnviText = tk.Label(fraEnvi, text="Card Text:").place(x=5, y=175)
txtEnviText = tk.Entry(fraEnvi, text="enter room text").place(x=80, y=175)

lblItemPicture = tk.Label(fraEnvi, text="Complete Card:").place(x=250, y=5)
lblItemPicture = tk.Label(fraEnvi, height=400, image=imgEnvi).place(x=250, y=20)

#fraMons
lblMonsName = tk.Label(fraMons, text="Name:").place(x=5, y=100)
txtMonsName = tk.Entry(fraMons, text="enter monster name").place(x=80, y=100)

lblMonsAtk = tk.Label(fraMons, text="Attack #:").place(x=5, y=125)
txtMonsAtk = tk.Entry(fraMons, text="enter attack").place(x=80, y=125)

lblMonsDef = tk.Label(fraMons, text="Defense #:").place(x=5, y=150)
txtMonsDef = tk.Entry(fraMons, text="enter defense").place(x=80, y=150)

lblMonsMag = tk.Label(fraMons, text="Magic #:").place(x=5, y=175)
txtMonsMag = tk.Entry(fraMons, text="enter magic").place(x=80, y=175)

lblMonsSpd = tk.Label(fraMons, text="Speed #:").place(x=5, y=200)
txtMonsSpd = tk.Entry(fraMons, text="enter speed").place(x=80, y=200)

lblMonsTarget = tk.Label(fraMons, text="Target:").place(x=5, y=225)
txtMonsTarget = tk.Entry(fraMons, text="enter target").place(x=80, y=225)

lblMonsType = tk.Label(fraMons, text="Type:").place(x=5, y=250)
txtMonsType = tk.Entry(fraMons, text="enter type").place(x=80, y=250)

lblMonsWound = tk.Label(fraMons, text="Wound Text:").place(x=5, y=275)
txtMonsWound = tk.Entry(fraMons, text="enter wound ability").place(x=80, y=275)

lblMonsText = tk.Label(fraMons, text="Main Text:").place(x=5, y=300)
txtMonsText = tk.Entry(fraMons, text="enter main text").place(x=80, y=300)

lblItemPicture = tk.Label(fraMons, text="Complete Card:").place(x=250, y=5)
lblItemPicture = tk.Label(fraMons, height=400, image=imgMons).place(x=250, y=20)

#fraBoss
lblBossName = tk.Label(fraBoss, text="Card Name:").place(x=5, y=100)
txtBossName = tk.Entry(fraBoss, text="enter boss name").place(x=80, y=100)

lblBossAtk = tk.Label(fraBoss, text="Attack #:").place(x=5, y=125)
txtBossAtk = tk.Entry(fraBoss, text="enter boss attack").place(x=80, y=125)

lblBossDef = tk.Label(fraBoss, text="Defense #:").place(x=5, y=150)
txtBossDef = tk.Entry(fraBoss, text="enter boss defense").place(x=80, y=150)

lblBossMag = tk.Label(fraBoss, text="Magic #:").place(x=5, y=175)
txtBossMag = tk.Entry(fraBoss, text="enter boss magic").place(x=80, y=175)

lblBossSpd = tk.Label(fraBoss, text="Speed #:").place(x=5, y=200)
txtBossSpd = tk.Entry(fraBoss, text="enter boss speed").place(x=80, y=200)

lblBossCombat = tk.Label(fraBoss, text="Combat:").place(x=5, y=225)
txtBossCombat = tk.Entry(fraBoss, text="enter combat effect").place(x=80, y=225)

lblBossEnvironment = tk.Label(fraBoss, text="Environment:").place(x=5, y=250)
txtBossEnvironment = tk.Entry(fraBoss, text="enter Environment effect").place(x=80, y=250)

lblBossMonster = tk.Label(fraBoss, text="Monster:").place(x=5, y=275)
txtBossMonster = tk.Entry(fraBoss, text="enter monster effect").place(x=80, y=275)

lblBossAct1 = tk.Label(fraBoss, text="Action 1:").place(x=5, y=300)
txtBossAct1 = tk.Entry(fraBoss, text="enter action 1").place(x=80, y=300)

lblBossAct2 = tk.Label(fraBoss, text="Action 2:").place(x=5, y=325)
txtBossAct2 = tk.Entry(fraBoss, text="enter action 2").place(x=80, y=325)

lblBossAct3 = tk.Label(fraBoss, text="Action 3:").place(x=5, y=350)
txtBossAct3 = tk.Entry(fraBoss, text="enter action 3").place(x=80, y=350)

lblBossAct4 = tk.Label(fraBoss, text="Action 4:").place(x=5, y=375)
txtBossAct4 = tk.Entry(fraBoss, text="enter action 4").place(x=80, y=375)

lblBossAct5 = tk.Label(fraBoss, text="Action 5:").place(x=5, y=400)
txtBossAct5 = tk.Entry(fraBoss, text="enter action 5").place(x=80, y=400)

lblBossPicture = tk.Label(fraBoss, text="Complete Card:").place(x=250, y=5)
lblBossPicture = tk.Label(fraBoss, height=400, image=imgBoss).place(x=250, y=20)

#fraRace
lblRaceName = tk.Label(fraRace, text="Card Name:").place(x=5, y=100)
txtRaceName = tk.Entry(fraRace, text="enter race name").place(x=80, y=100)

lblRaceAtk = tk.Label(fraRace, text="Attack #:").place(x=5, y=125)
txtRaceAtk = tk.Entry(fraRace, text="enter race attack").place(x=80, y=125)

lblRaceDef = tk.Label(fraRace, text="Defense #:").place(x=5, y=150)
txtRaceDef = tk.Entry(fraRace, text="enter Race defense").place(x=80, y=150)

lblRaceMag = tk.Label(fraRace, text="Magic #:").place(x=5, y=175)
txtRaceMag = tk.Entry(fraRace, text="enter Race magic").place(x=80, y=175)

lblRaceSpd = tk.Label(fraRace, text="Speed #:").place(x=5, y=200)
txtRaceSpd = tk.Entry(fraRace, text="enter Race speed").place(x=80, y=200)

lblRaceBonus = tk.Label(fraRace, text="Bonus:").place(x=5, y=225)
txtRaceBonus = tk.Entry(fraRace, text="enter Bonus").place(x=80, y=225)

lblRaceFlaw = tk.Label(fraRace, text="Flaw:").place(x=5, y=250)
txtRaceFlaw = tk.Entry(fraRace, text="enter Flaw").place(x=80, y=250)

lblRacePicture = tk.Label(fraRace, text="Complete Card:").place(x=250, y=5)
lblRacePicture = tk.Label(fraRace, height=400, image=imgRace).place(x=250, y=20)

#fraClas
lblClasName = tk.Label(fraClas, text="Card Name:").place(x=5, y=100)
txtClasName = tk.Entry(fraClas, text="enter class name").place(x=80, y=100)

lblClasAtk = tk.Label(fraClas, text="Attack #:").place(x=5, y=125)
txtClasAtk = tk.Entry(fraClas, text="enter Class attack").place(x=80, y=125)

lblClasDef = tk.Label(fraClas, text="Defense #:").place(x=5, y=150)
txtClasDef = tk.Entry(fraClas, text="enter Class defense").place(x=80, y=150)

lblClasMag = tk.Label(fraClas, text="Magic #:").place(x=5, y=175)
txtClasMag = tk.Entry(fraClas, text="enter Class magic").place(x=80, y=175)

lblClasSpd = tk.Label(fraClas, text="Speed #:").place(x=5, y=200)
txtClasSpd = tk.Entry(fraClas, text="enter Class speed").place(x=80, y=200)

lblClasAct = tk.Label(fraClas, text="Active:").place(x=5, y=225)
txtClasAct = tk.Entry(fraClas, text="enter Active").place(x=80, y=225)

lblClasPass = tk.Label(fraClas, text="Passive:").place(x=5, y=250)
txtClasPass = tk.Entry(fraClas, text="enter Passive").place(x=80, y=250)

lblClasPicture = tk.Label(fraClas, text="Complete Card:").place(x=250, y=5)
lblClasPicture = tk.Label(fraClas, height=400, image=imgClas).place(x=250, y=20)

#card choice dropdown and buttons
lstTemplate = tk.OptionMenu(root, currentType, *CARD_TYPES, command=card_changed)
lstTemplate.place(x=50, y=20)
butGenerate = tk.Button(root, text="Generate", command=make_card)
butGenerate.place(x=200, y=450)
butClear = tk.Button(root, text="Clear",fg="red", command=clear_fields)
butClear.place(x=350, y=450)

fraEnvi.place(x=0, y=0)
fraMons.place(x=0, y=0)
fraBoss.place(x=0, y=0)
fraRace.place(x=0, y=0)
fraClas.place(x=0, y=0)
fraItem.place(x=0, y=0)
card_changed("Item")
#window will not appear until mainloop is called
root.mainloop()


问:
Mongodb server connection error after fresh installation
```<code>$ mongod
{"t":{"$date":"2022-12-19T20:46:42.143+05:30"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2022-12-19T20:46:43.782+05:30"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"thread1","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true}}}
{"t":{"$date":"2022-12-19T20:46:43.783+05:30"},"s":"I",  "c":"NETWORK",  "id":4648602, "ctx":"thread1","msg":"Implicit TCP FastOpen in use."}
{"t":{"$date":"2022-12-19T20:46:43.785+05:30"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","namespace":"config.tenantMigrationDonors"}}
{"t":{"$date":"2022-12-19T20:46:43.786+05:30"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","namespace":"config.tenantMigrationRecipients"}}
{"t":{"$date":"2022-12-19T20:46:43.786+05:30"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"ShardSplitDonorService","namespace":"config.tenantSplitDonors"}}
{"t":{"$date":"2022-12-19T20:46:43.786+05:30"},"s":"I",  "c":"CONTROL",  "id":5945603, "ctx":"thread1","msg":"Multi threading initialized"}
{"t":{"$date":"2022-12-19T20:46:43.787+05:30"},"s":"I",  "c":"CONTROL",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":8520,"port":27017,"dbPath":"C:/data/db/","architecture":"64-bit","host":"Jatin"}}
{"t":{"$date":"2022-12-19T20:46:43.788+05:30"},"s":"I",  "c":"CONTROL",  "id":23398,   "ctx":"initandlisten","msg":"Target operating system minimum version","attr":{"targetMinOS":"Windows 7/Windows Server 2008 R2"}}
{"t":{"$date":"2022-12-19T20:46:43.788+05:30"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"6.0.3","gitVersion":"f803681c3ae19817d31958965850193de067c516","modules":[],"allocator":"tcmalloc","environment":{"distmod":"windows","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2022-12-19T20:46:43.788+05:30"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Microsoft Windows 10","version":"10.0 (build 22621)"}}}
{"t":{"$date":"2022-12-19T20:46:43.789+05:30"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{}}}
{"t":{"$date":"2022-12-19T20:46:43.791+05:30"},"s":"I",  "c":"STORAGE",  "id":22270,   "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"C:/data/db/","storageEngine":"wiredTiger"}}
{"t":{"$date":"2022-12-19T20:46:43.791+05:30"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=3405M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,remove=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=2000),statistics_log=(wait=0),json_output=(error,message),verbose=[recovery_progress:1,checkpoint_progress:1,compact_progress:1,backup:0,checkpoint:0,compact:0,evict:0,history_store:0,recovery:0,rts:0,salvage:0,tiered:0,timestamp:0,transaction:0,verify:0,log:0],"}}
{"t":{"$date":"2022-12-19T20:46:44.237+05:30"},"s":"I",  "c":"STORAGE",  "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":445}}
{"t":{"$date":"2022-12-19T20:46:44.237+05:30"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2022-12-19T20:46:44.245+05:30"},"s":"W",  "c":"CONTROL",  "id":22120,   "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
{"t":{"$date":"2022-12-19T20:46:44.245+05:30"},"s":"W",  "c":"CONTROL",  "id":22140,   "ctx":"initandlisten","msg":"This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. If this behavior is desired, start the server with --bind_ip 127.0.0.1 to disable this warning","tags":["startupWarnings"]}
{"t":{"$date":"2022-12-19T20:46:44.250+05:30"},"s":"I",  "c":"NETWORK",  "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":17,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true}}}
{"t":{"$date":"2022-12-19T20:46:44.250+05:30"},"s":"I",  "c":"REPL",     "id":5853300, "ctx":"initandlisten","msg":"current featureCompatibilityVersion value","attr":{"featureCompatibilityVersion":"6.0","context":"startup"}}
{"t":{"$date":"2022-12-19T20:46:44.251+05:30"},"s":"I",  "c":"STORAGE",  "id":5071100, "ctx":"initandlisten","msg":"Clearing temp directory"}
{"t":{"$date":"2022-12-19T20:46:44.252+05:30"},"s":"I",  "c":"CONTROL",  "id":20536,   "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
{"t":{"$date":"2022-12-19T20:46:44.603+05:30"},"s":"I",  "c":"FTDC",     "id":20625,   "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"C:/data/db/diagnostic.data"}}
{"t":{"$date":"2022-12-19T20:46:44.609+05:30"},"s":"I",  "c":"REPL",     "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}}
{"t":{"$date":"2022-12-19T20:46:44.610+05:30"},"s":"I",  "c":"STORAGE",  "id":22262,   "ctx":"initandlisten","msg":"Timestamp monitor starting"}
{"t":{"$date":"2022-12-19T20:46:44.613+05:30"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"127.0.0.1"}}
{"t":{"$date":"2022-12-19T20:46:44.614+05:30"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
</code>```

Tried to connect to mongodb server after fresh installation but failed and I don't know about the problem and it's cause.

Body:
$ mongod
{"t":{"$date":"2022-12-19T20:46:42.143+05:30"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2022-12-19T20:46:43.782+05:30"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"thread1","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true}}}
{"t":{"$date":"2022-12-19T20:46:43.783+05:30"},"s":"I",  "c":"NETWORK",  "id":4648602, "ctx":"thread1","msg":"Implicit TCP FastOpen in use."}
{"t":{"$date":"2022-12-19T20:46:43.785+05:30"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","namespace":"config.tenantMigrationDonors"}}
{"t":{"$date":"2022-12-19T20:46:43.786+05:30"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","namespace":"config.tenantMigrationRecipients"}}
{"t":{"$date":"2022-12-19T20:46:43.786+05:30"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"ShardSplitDonorService","namespace":"config.tenantSplitDonors"}}
{"t":{"$date":"2022-12-19T20:46:43.786+05:30"},"s":"I",  "c":"CONTROL",  "id":5945603, "ctx":"thread1","msg":"Multi threading initialized"}
{"t":{"$date":"2022-12-19T20:46:43.787+05:30"},"s":"I",  "c":"CONTROL",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":8520,"port":27017,"dbPath":"C:/data/db/","architecture":"64-bit","host":"Jatin"}}
{"t":{"$date":"2022-12-19T20:46:43.788+05:30"},"s":"I",  "c":"CONTROL",  "id":23398,   "ctx":"initandlisten","msg":"Target operating system minimum version","attr":{"targetMinOS":"Windows 7/Windows Server 2008 R2"}}
{"t":{"$date":"2022-12-19T20:46:43.788+05:30"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"6.0.3","gitVersion":"f803681c3ae19817d31958965850193de067c516","modules":[],"allocator":"tcmalloc","environment":{"distmod":"windows","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2022-12-19T20:46:43.788+05:30"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Microsoft Windows 10","version":"10.0 (build 22621)"}}}
{"t":{"$date":"2022-12-19T20:46:43.789+05:30"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{}}}
{"t":{"$date":"2022-12-19T20:46:43.791+05:30"},"s":"I",  "c":"STORAGE",  "id":22270,   "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"C:/data/db/","storageEngine":"wiredTiger"}}
{"t":{"$date":"2022-12-19T20:46:43.791+05:30"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=3405M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,remove=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=2000),statistics_log=(wait=0),json_output=(error,message),verbose=[recovery_progress:1,checkpoint_progress:1,compact_progress:1,backup:0,checkpoint:0,compact:0,evict:0,history_store:0,recovery:0,rts:0,salvage:0,tiered:0,timestamp:0,transaction:0,verify:0,log:0],"}}
{"t":{"$date":"2022-12-19T20:46:44.237+05:30"},"s":"I",  "c":"STORAGE",  "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":445}}
{"t":{"$date":"2022-12-19T20:46:44.237+05:30"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2022-12-19T20:46:44.245+05:30"},"s":"W",  "c":"CONTROL",  "id":22120,   "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
{"t":{"$date":"2022-12-19T20:46:44.245+05:30"},"s":"W",  "c":"CONTROL",  "id":22140,   "ctx":"initandlisten","msg":"This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. If this behavior is desired, start the server with --bind_ip 127.0.0.1 to disable this warning","tags":["startupWarnings"]}
{"t":{"$date":"2022-12-19T20:46:44.250+05:30"},"s":"I",  "c":"NETWORK",  "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":17,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true}}}
{"t":{"$date":"2022-12-19T20:46:44.250+05:30"},"s":"I",  "c":"REPL",     "id":5853300, "ctx":"initandlisten","msg":"current featureCompatibilityVersion value","attr":{"featureCompatibilityVersion":"6.0","context":"startup"}}
{"t":{"$date":"2022-12-19T20:46:44.251+05:30"},"s":"I",  "c":"STORAGE",  "id":5071100, "ctx":"initandlisten","msg":"Clearing temp directory"}
{"t":{"$date":"2022-12-19T20:46:44.252+05:30"},"s":"I",  "c":"CONTROL",  "id":20536,   "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
{"t":{"$date":"2022-12-19T20:46:44.603+05:30"},"s":"I",  "c":"FTDC",     "id":20625,   "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"C:/data/db/diagnostic.data"}}
{"t":{"$date":"2022-12-19T20:46:44.609+05:30"},"s":"I",  "c":"REPL",     "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}}
{"t":{"$date":"2022-12-19T20:46:44.610+05:30"},"s":"I",  "c":"STORAGE",  "id":22262,   "ctx":"initandlisten","msg":"Timestamp monitor starting"}
{"t":{"$date":"2022-12-19T20:46:44.613+05:30"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"127.0.0.1"}}
{"t":{"$date":"2022-12-19T20:46:44.614+05:30"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}

Tried to connect to mongodb server after fresh installation but failed and I don't know about the problem and it's cause.


问:
How to merge two dataframes by two or more unique identifiers
I would like to merge two data frames, A and B based on two variables - Quarter and Geography, since observations in the data frames only take a unique value based on these two variables. When using the merge function, how would you write out merging based on when two variables take the same value (i.e., both Quarter = 1 and Geography = Urban)?</p>
```<code>merged_dataframe <-merge(df_A, fr_B, by .x = "Quarter", by.y = "Quarter")

Data frame A:
Year    Quarter     Geography
2020    1           All
2020    1           Urban
2020    1           Rural
2020    2           All
2020    2           Urban
2020    2           Rural

Data frame B:
Year    Quarter     Geography
2021    1           All
2021    1           Urban
2021    1           Rural
2021    2           All
2021    2           Urban
2021    2           Rural
</code>```

Body:
I would like to merge two data frames, A and B based on two variables - Quarter and Geography, since observations in the data frames only take a unique value based on these two variables. When using the merge function, how would you write out merging based on when two variables take the same value (i.e., both Quarter = 1 and Geography = Urban)?

merged_dataframe <-merge(df_A, fr_B, by .x = "Quarter", by.y = "Quarter")

Data frame A:
Year    Quarter     Geography
2020    1           All
2020    1           Urban
2020    1           Rural
2020    2           All
2020    2           Urban
2020    2           Rural

Data frame B:
Year    Quarter     Geography
2021    1           All
2021    1           Urban
2021    1           Rural
2021    2           All
2021    2           Urban
2021    2           Rural


问:
What's the proper way to set git email and name in Visual Studio Code?
I'm getting the following error in Visual Studio Code on Windows when I try to commit code:

```<code>2022-12-19 07:17:00.902 [info] Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: no email was given and auto-detection is disabled
</code>```

So I run this command:

```<code>PS E:\path\to\repo> git config --global user.email "john.doh@domainname.com"
error: could not lock config file %HOMEDRIVE%%HOMEPATH%/.gitconfig: No such file or directory
</code>```

I tried the same from Git-Bash with the same result:

```<code>johndoh@myhost MINGW64 /
$ git config --global user.email "john.doh@domainname.com"
error: could not lock config file C:/Program Files/Git/%HOMEDRIVE%%HOMEPATH%/.gitconfig: No such file or directory
</code>```

I installed git via the Visual Studio Installer:

```<code>C:\Users\johndoh>which git
C:/Program Files/Git/cmd/git.exe

C:\Users\johndoh>git --version
git version 2.38.1.windows.1
</code>```

How do am I supposed to set this up for git on Windows with Visual Studio code? It seems like others may have run into this issue but it went away for them after they logged out and then back in again. Some of the other related Stack Overflow questions are:

git CMD finds .gitconfig but Windows cmd does not?

git config command returns: fatal: unable to read config file '%HOMEDRIVE%%HOMEPATH%/.gitconfig': No such file or directory

Body:
I'm getting the following error in Visual Studio Code on Windows when I try to commit code:

2022-12-19 07:17:00.902 [info] Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: no email was given and auto-detection is disabled

So I run this command:

PS E:\path\to\repo> git config --global user.email "john.doh@domainname.com"
error: could not lock config file %HOMEDRIVE%%HOMEPATH%/.gitconfig: No such file or directory

I tried the same from Git-Bash with the same result:

johndoh@myhost MINGW64 /
$ git config --global user.email "john.doh@domainname.com"
error: could not lock config file C:/Program Files/Git/%HOMEDRIVE%%HOMEPATH%/.gitconfig: No such file or directory

I installed git via the Visual Studio Installer:

C:\Users\johndoh>which git
C:/Program Files/Git/cmd/git.exe

C:\Users\johndoh>git --version
git version 2.38.1.windows.1

How do am I supposed to set this up for git on Windows with Visual Studio code? It seems like others may have run into this issue but it went away for them after they logged out and then back in again. Some of the other related Stack Overflow questions are:

git CMD finds .gitconfig but Windows cmd does not?

git config command returns: fatal: unable to read config file '%HOMEDRIVE%%HOMEPATH%/.gitconfig': No such file or directory


问:
How to access Vercel serverless functions locally using Vite?
I found many solutions to make Vercel serverless functions work with Vite on prod (I got that working using rewrites), but I can't use them locally.

As far as I can see, the routes created from vercel dev that uses Vite to compile the app, won't enable pointing to the functions and will try to go straight into react-router-dom routes.

Is there a workaround? Should I spin up serverless functions separately?


问:
expo camera eas build crashes when started video recording
I have been working on a react-native camera app using expo camera.

According to me, on launching the camera app in expo go, video recording automatically start using onCameraReady method in expo camera but when building eas builds the app crashes.

I have used onCameraReady method to call the function record which will call recordAsync function to record the video.

```<code><Camera
      ref={(ref) => {
        setcamera(ref)
      }}
      style={{flex: 1, aspectRatio: 9/16}}
      ratio={'16:9'}
      type={type}
      onCameraReady={record}
      >
</code>```

On initial launch the video is not recorded i have to manually click record button to record the video.

```<code>const record = async () => {
    setstartRecording(true)
    await camera.recordAsync()
      .then(video => {
        MediaLibrary.saveToLibraryAsync(video.uri)
      })
  }
</code>```

Kindly help me, i am not been able to solve this.

```<code>import { Camera, CameraType } from 'expo-camera';
import { setStatusBarTranslucent } from 'expo-status-bar';
import { useEffect, useState } from 'react';
import { Alert, Dimensions, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
import { Fontisto } from '@expo/vector-icons';
import * as MediaLibrary from 'expo-media-library';

export default function App() {

  const [type, settype] = useState(CameraType.back)
  const [camera, setcamera] = useState()
  const [cameraStatus,setcameraStatus] = useState({})
  const [micStatus,setmicStatus] = useState({})
  const [mediaStatus,setmediaStatus] = useState({})
  const [startRecording, setstartRecording] = useState(false)
  const [timer, settimer] = useState(0)

  async function permission(){
    await Camera.requestCameraPermissionsAsync().then(setcameraStatus)
    await Camera.requestMicrophonePermissionsAsync().then(setmicStatus)
    await MediaLibrary.requestPermissionsAsync().then(setmediaStatus)
  }

  useEffect(() => {
    permission()
    setStatusBarTranslucent(true)
  },[])

  useEffect(() => {
    let interval = null
    if(startRecording){
      interval = setInterval(() => {
        settimer( prev => prev + 1)
      }, 1000);

    }else{
      clearInterval(interval)
      settimer(0)
    }

    return () => {
      clearInterval(interval)
    }

  },[startRecording])

  const record = async () => {
    setstartRecording(true)
    await camera.recordAsync()
      .then(video => {
        MediaLibrary.saveToLibraryAsync(video.uri)
      })
  }

  const toggleCameraType = () => {
    setstartRecording(false)
    settype( current => (current === CameraType.back ? CameraType.front : CameraType.back))
  }

  const stopRecording = () => {
    camera.stopRecording()
    setstartRecording(false)
  }

  return (
    <Camera
      ref={(ref) => {
        setcamera(ref)
      }}
      style={{flex: 1, aspectRatio: 9/16}}
      ratio={'16:9'}
      type={type}
      onCameraReady={record}
      >
        <View style={{position: 'absolute', flexDirection: 'row', bottom: 0, padding: 48, justifyContent: 'space-between', width: Dimensions.get('window').width}}>
          <View
           style={{
            width: 61,
            height: 61,
            borderWidth: 3,
            borderColor: 'white',
            borderRadius: 100,
            backgroundColor: 'black',
            alignItems: 'center',
            justifyContent: 'center'
            }}>
            <Text
             style={{
              color: 'white',
              fontSize: 34,
              fontWeight: 'bold'
              }}>{timer}</Text>
          </View>
          <TouchableOpacity onPress={startRecording ? () => stopRecording() : () => setstartRecording(true)}>
            <Fontisto name="record" size={64} color={ startRecording ? "red" : "white"} />
          </TouchableOpacity>
          <TouchableOpacity onPress={toggleCameraType}>
            <MaterialIcons name="flip-camera-android" size={64} color="white" />
          </TouchableOpacity>
        </View>

    </Camera>
  );
}

const styles = StyleSheet.create({
  camera: {
    flex: 1,
  }
});
</code>```

I am making a camera app which automatically starts recording video using the expo-camera library.

On launching the application the video recording must start immediately after mounting the camera component.

It works well on the expo go app but when building eas build and installing the apk on a physical device, the app crashes or the app does not record video at all.

Body:
I have been working on a react-native camera app using expo camera.

According to me, on launching the camera app in expo go, video recording automatically start using onCameraReady method in expo camera but when building eas builds the app crashes.

I have used onCameraReady method to call the function record which will call recordAsync function to record the video.

<Camera
      ref={(ref) => {
        setcamera(ref)
      }}
      style={{flex: 1, aspectRatio: 9/16}}
      ratio={'16:9'}
      type={type}
      onCameraReady={record}
      >

On initial launch the video is not recorded i have to manually click record button to record the video.

const record = async () => {
    setstartRecording(true)
    await camera.recordAsync()
      .then(video => {
        MediaLibrary.saveToLibraryAsync(video.uri)
      })
  }

Kindly help me, i am not been able to solve this.

import { Camera, CameraType } from 'expo-camera';
import { setStatusBarTranslucent } from 'expo-status-bar';
import { useEffect, useState } from 'react';
import { Alert, Dimensions, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
import { Fontisto } from '@expo/vector-icons';
import * as MediaLibrary from 'expo-media-library';

export default function App() {

  const [type, settype] = useState(CameraType.back)
  const [camera, setcamera] = useState()
  const [cameraStatus,setcameraStatus] = useState({})
  const [micStatus,setmicStatus] = useState({})
  const [mediaStatus,setmediaStatus] = useState({})
  const [startRecording, setstartRecording] = useState(false)
  const [timer, settimer] = useState(0)

  async function permission(){
    await Camera.requestCameraPermissionsAsync().then(setcameraStatus)
    await Camera.requestMicrophonePermissionsAsync().then(setmicStatus)
    await MediaLibrary.requestPermissionsAsync().then(setmediaStatus)
  }

  useEffect(() => {
    permission()
    setStatusBarTranslucent(true)
  },[])

  useEffect(() => {
    let interval = null
    if(startRecording){
      interval = setInterval(() => {
        settimer( prev => prev + 1)
      }, 1000);

    }else{
      clearInterval(interval)
      settimer(0)
    }

    return () => {
      clearInterval(interval)
    }

  },[startRecording])

  const record = async () => {
    setstartRecording(true)
    await camera.recordAsync()
      .then(video => {
        MediaLibrary.saveToLibraryAsync(video.uri)
      })
  }

  const toggleCameraType = () => {
    setstartRecording(false)
    settype( current => (current === CameraType.back ? CameraType.front : CameraType.back))
  }

  const stopRecording = () => {
    camera.stopRecording()
    setstartRecording(false)
  }

  return (
    <Camera
      ref={(ref) => {
        setcamera(ref)
      }}
      style={{flex: 1, aspectRatio: 9/16}}
      ratio={'16:9'}
      type={type}
      onCameraReady={record}
      >
        <View style={{position: 'absolute', flexDirection: 'row', bottom: 0, padding: 48, justifyContent: 'space-between', width: Dimensions.get('window').width}}>
          <View
           style={{
            width: 61,
            height: 61,
            borderWidth: 3,
            borderColor: 'white',
            borderRadius: 100,
            backgroundColor: 'black',
            alignItems: 'center',
            justifyContent: 'center'
            }}>
            <Text
             style={{
              color: 'white',
              fontSize: 34,
              fontWeight: 'bold'
              }}>{timer}</Text>
          </View>
          <TouchableOpacity onPress={startRecording ? () => stopRecording() : () => setstartRecording(true)}>
            <Fontisto name="record" size={64} color={ startRecording ? "red" : "white"} />
          </TouchableOpacity>
          <TouchableOpacity onPress={toggleCameraType}>
            <MaterialIcons name="flip-camera-android" size={64} color="white" />
          </TouchableOpacity>
        </View>

    </Camera>
  );
}

const styles = StyleSheet.create({
  camera: {
    flex: 1,
  }
});

I am making a camera app which automatically starts recording video using the expo-camera library.

On launching the application the video recording must start immediately after mounting the camera component.

It works well on the expo go app but when building eas build and installing the apk on a physical device, the app crashes or the app does not record video at all.


问:
GKE Usage Metering : How to add Node Level System Metrics to the Data
I have enabled GKE Usage metering for my 3 Node GKE Cluster. However, I don't see any node related information such as node name, CPU, Disk, Memory usage etc. I need to derive node specific metrics such as :-

CPU/Memory/Disk Utilization for each node

Details of Pods/Namespace/Containers running in each node.

I can see those details under Resource summary section in each node as shown below :-

How do I add those information to the Metering data ?


问:
Should I cast and normalize my discrete observation space for stable baselines 3 custom environments?
I read Antonin Raffin's SB3 RL Tips and Tricks and I am wondering if I should use a Box observation space and normalize or discrete observation space.

I have a toy problem where my observations are a sequence of 10 scores that have all lower bound 0 and upper bound from 10 to 200.
The variables values can be any integer from [0, upper bound].

Would you cast this to a continuous space and normalize or use discrete spaces?

I think discrete spaces might become computationally very expensive or is my intuition wrong here?

Thank you very much for your suggestions and insights!


问:
Android terminate problem
i have some problem my android application. While the program is running ,  when i press back, program is running the background , but after i want to reopen my application unexpectedly stop. What should I do if I want to re-enter the application , it not stop.

UPDATE:

I am not copy my code because I am not sure why i got this error.
For example my application have QR barcode When I push the Barcode button camera open and I read barcode after read barcode , my main activity page give error   when i press back, program is running the background , but after i want to reopen my application unexpectedly stop and , give same error on logcat. What should I do if I want to re-enter the application , it not stop.
I got this record.

```<code>09-21 10:05:27.555: ERROR/AndroidRuntime(13401): FATAL EXCEPTION: AsyncTask #3
09-21 10:05:27.555: ERROR/AndroidRuntime(13401): java.lang.RuntimeException: An error occured while executing doInBackground()
09-21 10:05:27.555: ERROR/AndroidRuntime(13401):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
09-21 10:05:27.555: ERROR/AndroidRuntime(13401):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
09-21 10:05:27.555: ERROR/AndroidRuntime(13401):     at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
</code>```

ContentLicense: CC BY-SA 3.0

Title: Android terminate problem

Body:
i have some problem my android application. While the program is running ,  when i press back, program is running the background , but after i want to reopen my application unexpectedly stop. What should I do if I want to re-enter the application , it not stop.

UPDATE:

I am not copy my code because I am not sure why i got this error.
For example my application have QR barcode When I push the Barcode button camera open and I read barcode after read barcode , my main activity page give error   when i press back, program is running the background , but after i want to reopen my application unexpectedly stop and , give same error on logcat. What should I do if I want to re-enter the application , it not stop.
I got this record.

09-21 10:05:27.555: ERROR/AndroidRuntime(13401): FATAL EXCEPTION: AsyncTask #3
09-21 10:05:27.555: ERROR/AndroidRuntime(13401): java.lang.RuntimeException: An error occured while executing doInBackground()
09-21 10:05:27.555: ERROR/AndroidRuntime(13401):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
09-21 10:05:27.555: ERROR/AndroidRuntime(13401):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
09-21 10:05:27.555: ERROR/AndroidRuntime(13401):     at java.util.concurrent.FutureTask.setException(FutureTask.java:125)


问:
Tailwind custom utility class - duration not working
I have problem with duration in tailwind. I made custom CSS class in main input.css file and add this to html code. Unfortunately duration-300 dont work with this custom class. Can somebody help me and tell me how to fix this problem ? I will be very grateful.

Greetings

I tried to add transition-duration to custom class, add duration to group-hover and put it into different html tag but nothing helps.

@layer utilities {
    .orangefilter {
        filter: invert(55%) sepia(29%) saturate(5825%) hue-rotate(352deg) brightness(102%) contrast(90%);
    }
}
```
<pre class="lang-html prettyprint-override"><code><li class="flex justify-center items-center group hover:text-orange-400 duration-300 ">
    <img class="w-4 h-4 mr-2 contrast-50 group-hover:orangefilter duration-300" src="./icons/user.png">
    <p>Account</p>
</li>
</code>```

Body:
I have problem with duration in tailwind. I made custom CSS class in main input.css file and add this to html code. Unfortunately duration-300 dont work with this custom class. Can somebody help me and tell me how to fix this problem ? I will be very grateful.

Greetings

I tried to add transition-duration to custom class, add duration to group-hover and put it into different html tag but nothing helps.

@layer utilities {
    .orangefilter {
        filter: invert(55%) sepia(29%) saturate(5825%) hue-rotate(352deg) brightness(102%) contrast(90%);
    }
}

Account


问:
Adding keys inside two hdf5 files
I have two hdf5 files and it has several keys in it, for example 'eventnumber' and 'channelnum' etc. I want to add these two files such that the keys inside it i.e. eventnumber from two files will add up. If one file has 5 eventnumber and second file has 3 so it will add up to 8 events in the sum-up file as one can do in summing up root files.

I did the following but it always gives the last file and not the addition of both files.

import os
import h5py

os.chdir('path/to/raw_data/')
file_names = ['raw1.lh5', 'raw2.lh5']
for file_name in file_names:
    print(file_name)
    f = h5py.File(file_name, 'r')
```

Title: Adding keys inside two hdf5 files


Title: Generate new data based on existing datasets using Python with a similarity value above 85%

Body:
I have a dataset which contains 89 rows of numbers. To test the performance of the deep learning model that I have created, I want to test it using data that is more than 85% similar to the training data. I want to generate new data based on existing datasets with data similarities above 85%.

How can I do this using Python?

Here's the sample data

[[  0.  14.  52.  65.  14.   2.   0.   0.   0.   0.  19. 100.  82.   2.
   46.   0.   0.   0.   0.   0.  33.  64.  80.  68.  51.   0.   0.   0.
    0.  45.  89.  75.  48.  35.   0.   0.   0.   0.   0.  33.  90. 101.
   76.  68.  26.  38.   0.   0.  69. 130. 135. 109.   1.   0.   0.   0.
    0.   8.  59.  45.  40.  69.  62.  86.  69.  97. 123. 142. 148. 145.
    0.   0.   0.   0.  84. 114. 133. 149. 153.  74.   0.   0.   0. 135.
  134.  19.   0.   0.   0.]
 [  0.  14.  52.  65.  14.   2.   0.   0.   0.   0.  19. 100.  82.   2.
   46.   0.   0.   0.   0.   0.  33.  64.  80.  68.  51.   0.   0.   0.
    0.  45.  89.  75.  48.  35.   0.   0.   0.   0.   0.  33.  90. 101.
   76.  68.  26.  38.   0.   0.  69. 130. 135. 109.   1.   0.   0.   0.
    0.   8.  59.  45.  40.  69.  62.  86.  69.  97. 123. 142. 148. 145.
    0.   0.   0.   0.  84. 114. 133. 149. 153.  74.   0.   0.   0. 135.
  134.  20.   0.   0.   0.]
 [  0.  15.  50.  61.  15.   2.   0.   0.   0.   0.  19. 100.  82.   2.
   46.   0.   0.   0.   0.   0.  33.  64.  80.  68.  51.   0.   0.   0.
    0.  45.  89.  75.  48.  35.   0.   0.   0.   0.   0.  33.  90. 101.
   76.  68.  26.  38.   0.   0.  69. 130. 135. 109.   1.   0.   0.   0.
    0.   8.  59.  45.  40.  69.  62.  86.  69.  97. 123. 142. 148. 145.
    0.   0.   0.   0.  84. 114. 133. 149. 153.  74.   0.   0.   0. 135.
  134.  20.   0.   0.   0.]]
DataShape :  (2050, 89)

Load Data code

## Load Data
Insole = pd.read_csv('1119_Rwalk40s2_list.txt', header=None, low_memory=False)
SIData =  np.asarray(Insole)

SmartInsole = np.array(SIData[:2050])
print(SmartInsole[55:58])
print('DataShape : ', SmartInsole.shape)

This question is quite similar to Generate data by using existing dataset as the base dataset  which seems to have been answered using R which I could not get to work.

Thanks


问:
Which transport protocol I need for a turn server with ice4j?
Which transport protocol I need to use for the follow ice4j code?

```<code>Transport transport = ?;
TransportAddress ta = new TransportAddress( hostname, port, transport );
LongTermCredential credential = new LongTermCredential( username, password );
TurnCandidateHarvester turnServer =new TurnCandidateHarvester( ta, credential );
</code>```

possible values are:

Transport.UDP

Transport.TCP

Transport.TLS

Transport.DLTS

or other, which transport protocol matched to the two turn protocols turn: and truns:

Body:
Which transport protocol I need to use for the follow ice4j code?

Transport transport = ?;
TransportAddress ta = new TransportAddress( hostname, port, transport );
LongTermCredential credential = new LongTermCredential( username, password );
TurnCandidateHarvester turnServer =new TurnCandidateHarvester( ta, credential );

possible values are:

Transport.UDP

Transport.TCP

Transport.TLS

Transport.DLTS

or other, which transport protocol matched to the two turn protocols turn: and truns:


问:
How to remove values in a text file from another text file in R?
I have a file that contains a list (n = 83)

```<code>rs997007
rs66492148
1:18293758
rs4920291
rs223177
</code>```

I have another file that contains a list (n = 5777).

```<code>rs997007
rs66492148
rs72648488
1:18293758
rs71579813
rs4920291
rs223177
rs72650382
</code>```

Everything in file 1, I want removed from file 2. So file 2 looks like this
(n = 5694):

```<code>rs72648488
rs71579813
rs72650382
</code>```

I have no idea what R function to use when handling text files?

Body:
I have a file that contains a list (n = 83)

rs997007
rs66492148
1:18293758
rs4920291
rs223177

I have another file that contains a list (n = 5777).

rs997007
rs66492148
rs72648488
1:18293758
rs71579813
rs4920291
rs223177
rs72650382

Everything in file 1, I want removed from file 2. So file 2 looks like this
(n = 5694):

rs72648488
rs71579813
rs72650382

I have no idea what R function to use when handling text files?


问:
Multi-project dependency resolution with gradle
Assumed we have two projects A and B. A provides artifacts that are consumed by B, i.e. A is some kind of base component where B builds upon.

All projects are git repositories, i.e. each has a main branch. For feature development there may be feature branches.

A feature development may affect

either B only

or A and B

A and B are built with gradle, i.e. there are gradle scripts. The script of B specifies A as a dependency.

The dependency of the B script of the main branch looks like

```<code>...
dependencies {
    implementation("my.company:a-component:1.0.+")
...
</code>```

Assume a feature development FEAT1 that affects both projects.
We create feature branches and name them like the features.
gradle builds artifacts of both projects, and we choose to give artifacts the feature name as version.
Then the dependency specification in the gradle script of B on branch FEAT1 looks like

```<code>...
dependencies {
    implementation("my.company:a-component:FEAT1")

</code>```

Admittedly this is an unusual version. But who cares, feature development is short-living, such versions (i.e. feature branches) come and go within few days. What finally counts is the main branch and the versions specified there.

Assume FEAT2 affects B only. So the dependency specification is again

```<code>...
dependencies {
    implementation("my.company:a-component:1.0.+")

</code>```

since there is no FEAT2 branch (i.e. no FEAT2 version) of A.

Now for the question: can I fetch the dependency from a feature branch if there is one, and otherwise default to main?
In pseudocode something like

```<code>...
dependencies {
    implementation("my.company.a-component:${if (version FEAT2 of a-component exists) then FEAT2 else 1.0.+}")
</code>```

Can I achieve that with gradle means?

If so any new feature branch of B would choose the version of its A dependency automatically correctly. That's what I would like to achieve.

I don't have more than basic gradle knowledge, read https://docs.gradle.org/current/userguide/single_versions.html and following, but didn't find an obvious solution.

We are currently using gradle 7.5.1.

The projects are Java/Kotlin projects, the artifacts are jar files.

Body:
Assumed we have two projects A and B. A provides artifacts that are consumed by B, i.e. A is some kind of base component where B builds upon.

All projects are git repositories, i.e. each has a main branch. For feature development there may be feature branches.

A feature development may affect

either B only

or A and B

A and B are built with gradle, i.e. there are gradle scripts. The script of B specifies A as a dependency.

The dependency of the B script of the main branch looks like

...
dependencies {
    implementation("my.company:a-component:1.0.+")
...

Assume a feature development FEAT1 that affects both projects.
We create feature branches and name them like the features.
gradle builds artifacts of both projects, and we choose to give artifacts the feature name as version.
Then the dependency specification in the gradle script of B on branch FEAT1 looks like

...
dependencies {
    implementation("my.company:a-component:FEAT1")

Admittedly this is an unusual version. But who cares, feature development is short-living, such versions (i.e. feature branches) come and go within few days. What finally counts is the main branch and the versions specified there.

Assume FEAT2 affects B only. So the dependency specification is again

...
dependencies {
    implementation("my.company:a-component:1.0.+")

since there is no FEAT2 branch (i.e. no FEAT2 version) of A.

Now for the question: can I fetch the dependency from a feature branch if there is one, and otherwise default to main?
In pseudocode something like

...
dependencies {
    implementation("my.company.a-component:${if (version FEAT2 of a-component exists) then FEAT2 else 1.0.+}")

Can I achieve that with gradle means?

If so any new feature branch of B would choose the version of its A dependency automatically correctly. That's what I would like to achieve.

I don't have more than basic gradle knowledge, read https://docs.gradle.org/current/userguide/single_versions.html and following, but didn't find an obvious solution.

We are currently using gradle 7.5.1.

The projects are Java/Kotlin projects, the artifacts are jar files.


问:
minio-js: SignatureDoesNotMatch
I have problem with show in browser images using minio-js.

My code:

```<code>var Minio = require('minio')

var s3Client = new Minio.Client({
  endPoint: 's3.amazonaws.com',
  accessKey: 'YOUR-ACCESSKEYID',
  secretKey: 'YOUR-SECRETACCESSKEY',
  useSSL: true // Default is true.
})

var presignedUrl = s3Client.presignedPutObject('my-bucketname', 'my-objectname', 1000, function(e, presignedUrl) {
  if (e) return console.log(e)
  console.log(presignedUrl)
})
</code>```

When I open url in browser I get:

```<code>http://127.0.0.1:9000/dev/p001.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=IKOuiLumBs8UoCUg%2F20221219%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221219T150326Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=34da742218296f849239605b34cfe3d4db228456f6888313c01052bf1eec3dde
</code>```
```<code><Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<Key>p001.jpeg</Key>
<BucketName>dev</BucketName>
<Resource>/the-modern-dev/p001.jpeg</Resource>
<RequestId>17323BC3DBFE0887</RequestId>
<HostId>5757084b-ef2b-4e71-928b-e0f025e2fb91</HostId>
</Error>
</code>```

How I can get fix it?

Title: minio-js: SignatureDoesNotMatch

Body:
I have problem with show in browser images using minio-js.

My code:

var Minio = require('minio')

var s3Client = new Minio.Client({
  endPoint: 's3.amazonaws.com',
  accessKey: 'YOUR-ACCESSKEYID',
  secretKey: 'YOUR-SECRETACCESSKEY',
  useSSL: true // Default is true.
})

var presignedUrl = s3Client.presignedPutObject('my-bucketname', 'my-objectname', 1000, function(e, presignedUrl) {
  if (e) return console.log(e)
  console.log(presignedUrl)
})

When I open url in browser I get:

http://127.0.0.1:9000/dev/p001.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=IKOuiLumBs8UoCUg%2F20221219%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221219T150326Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=34da742218296f849239605b34cfe3d4db228456f6888313c01052bf1eec3dde

<Error>
SignatureDoesNotMatch
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<Key>p001.jpeg</Key>
<BucketName>dev</BucketName>
<Resource>/the-modern-dev/p001.jpeg</Resource>
<RequestId>17323BC3DBFE0887</RequestId>
<HostId>5757084b-ef2b-4e71-928b-e0f025e2fb91</HostId>
</Error>

How I can get fix it?


问:
I'm trying to make a Hello World program using NASM x64 but I keep getting "Segmentation Fault", how could I fix this?
I followed a tutorial to make a Hello World program but when I run it, either my computer freezes for a while or I get a Segmentation Fault. This is the code

```<code>section .bss
    msg resb 1600000000
section .text
    global _start
_start:
loop:
    mov byte[msg+rbx], 1
    inc rbx
    cmp rbx, 1600000000
    jl loop

    mov rax, 0x3c
    mov rdi, 0
    syscall
</code>```

I looked on google, in the comments of the video and even the Linux manual for devs. Any help would be appreciated

Body:
I followed a tutorial to make a Hello World program but when I run it, either my computer freezes for a while or I get a Segmentation Fault. This is the code

section .bss
    msg resb 1600000000
section .text
    global _start
_start:
loop:
    mov byte[msg+rbx], 1
    inc rbx
    cmp rbx, 1600000000
    jl loop

    mov rax, 0x3c
    mov rdi, 0
    syscall

I looked on google, in the comments of the video and even the Linux manual for devs. Any help would be appreciated


问:
Building libwebsockets for OP-TEE
I've been trying to build libwebsockets for OP-TEE running on a TI AM437x HS (an arm platform). I'm using Yocto to build; here's the version string for OP-TEE, which is displayed on boot:

I/TC: OP-TEE version: ti2019.05-rc1-dev (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #1 Tue Nov 29 17:49:12 UTC 2022 arm

I'm using libwebsockets version 4.3.2.

OP-TEE support is documented for libwebsockets:

https://libwebsockets.org/lws-api-doc-main/html/md_READMEs_README_build.html#optee

I'm specifying -DLWS_PLAT_OPTEE=1 to CMake, but a number of libwebsockets source files include errno.h, which is not provided by OP-TEE's minimal libc.  I have tried specifying an additional -I/-isystem option to pick up the errno.h that comes with the toolchain (gcc) but this causes further problems with headers included by it, and I think it should only by used with GNU's libc.

Is OP-TEE still a supported platform for libwebsockets?  If so, how should I resolve the issue with errno.h?

Thank you for your help!

Title: Building libwebsockets for OP-TEE


问:
Get dir content in cross-platform Jenkins
We have a Jenkins Master on linux and Jenkins Agent on Windows for building C# applications.
(before that we've had master and agent on the same Windows machine)

In pipeline I have this code

```<code>def getFilesNamesFromDir(dir)
{
    def fileNames= []

    new File(dir).eachFile() { file ->
        fileNames << file.getName()
    }

    return fileNames
}
...

def testDir= "${env.WORKSPACE}/test"

    try
    {
        testResults= getFilesNamesFromDir(testDir)
    } catch (err) {
        println(err.toString());
        println(err.getMessage());
        println(err.getStackTrace());
        error "Error"
    }
</code>```

and after that in logs I got:

```<code>[Pipeline] echo
java.io.FileNotFoundException: /var/lib/jenkins/c:\jenkins\workspace\app-name_4.2.1/test
[Pipeline] echo
/var/lib/jenkins/c:\jenkins\workspace\app-name_4.2.1/test
[Pipeline] echo
[Ljava.lang.StackTraceElement;@311b5ad0
[Pipeline] error
[Pipeline] }
</code>```

Within old setup it was working.

Where it's code is running? On the agent or on the master? How to fix this?

I need to get file list from a directory. But I've got an error.

Body:
We have a Jenkins Master on linux and Jenkins Agent on Windows for building C# applications.
(before that we've had master and agent on the same Windows machine)

In pipeline I have this code

def getFilesNamesFromDir(dir)
{
    def fileNames= []

    new File(dir).eachFile() { file ->
        fileNames << file.getName()
    }

    return fileNames
}
...

def testDir= "${env.WORKSPACE}/test"

    try
    {
        testResults= getFilesNamesFromDir(testDir)
    } catch (err) {
        println(err.toString());
        println(err.getMessage());
        println(err.getStackTrace());
        error "Error"
    }

and after that in logs I got:

[Pipeline] echo
java.io.FileNotFoundException: /var/lib/jenkins/c:\jenkins\workspace\app-name_4.2.1/test
[Pipeline] echo
/var/lib/jenkins/c:\jenkins\workspace\app-name_4.2.1/test
[Pipeline] echo
[Ljava.lang.StackTraceElement;@311b5ad0
[Pipeline] error
[Pipeline] }

Within old setup it was working.

Where it's code is running? On the agent or on the master? How to fix this?

I need to get file list from a directory. But I've got an error.


问:
Nextjs + amplify deployment
When I deployed nextjs 13 SSR application using amplify, I don't see new CloudFront entry.

Question: doesn't amplify creates it, or I should manually create amplify entry?

Title: Nextjs + amplify deployment