问:
Keep getting call revert exception error whenever I try to run Crowd-Funding Dapp
So I have been following this tutorial to build a Crowd-Funding Dapp using blockchain, solidity, react. And I keep getting the following mentioned error whenever I start React App. I think it might be related to contract address. The above image is what I get after I click on inspect. As I am still a beginner in Blockchain and programming in general it would be really helpful if anyone can suggest any solutions.

The error

```<code>Blockchain loaded
blockchain.jsx:219 call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="getProjects()", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)

blockchain.jsx:220 Uncaught (in promise) Error: No ethereum object.
    at reportError (blockchain.jsx:220:1)
    at loadProjects (blockchain.jsx:116:1)
    at async Home.jsx:13:1
</code>```

Here is the contract file which is Genesis.sol and the blockchain.jsx in which the error occurs.

Genesis.sol

```<code>//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

contract Genesis {
    address public owner;
    uint public projectTax;
    uint public projectCount;
    uint public balance;
    statsStruct public stats;
    projectStruct[] projects;

    mapping(address => projectStruct[]) projectsOf;
    mapping(uint => backerStruct[]) backersOf;
    mapping(uint => bool) public projectExist;

    enum statusEnum {
        OPEN,
        APPROVED,
        REVERTED,
        DELETED,
        PAIDOUT
    }

    struct statsStruct {
        uint totalProjects;
        uint totalBacking;
        uint totalDonations;
    }

    struct backerStruct {
        address owner;
        uint contribution;
        uint timestamp;
        bool refunded;
    }

    struct projectStruct {
        uint id;
        address owner;
        string title;
        string description;
        string imageURL;
        uint cost;
        uint raised;
        uint timestamp;
        uint expiresAt;
        uint backers;
        statusEnum status;
    }

    modifier ownerOnly(){
        require(msg.sender == owner, "Owner reserved only");
        _;
    }

    event Action (
        uint256 id,
        string actionType,
        address indexed executor,
        uint256 timestamp
    );

    constructor(uint _projectTax) {
        owner = msg.sender;
        projectTax = _projectTax;
    }

    function createProject(
        string memory title,
        string memory description,
        string memory imageURL,
        uint cost,
        uint expiresAt
    ) public returns (bool) {
        require(bytes(title).length > 0, "Title cannot be empty");
        require(bytes(description).length > 0, "Description cannot be empty");
        require(bytes(imageURL).length > 0, "ImageURL cannot be empty");
        require(cost > 0 ether, "Cost cannot be zero");

        projectStruct memory project;
        project.id = projectCount;
        project.owner = msg.sender;
        project.title = title;
        project.description = description;
        project.imageURL = imageURL;
        project.cost = cost;
        project.timestamp = block.timestamp;
        project.expiresAt = expiresAt;

        projects.push(project);
        projectExist[projectCount] = true;
        projectsOf[msg.sender].push(project);
        stats.totalProjects += 1;

        emit Action (
            projectCount++,
            "PROJECT CREATED",
            msg.sender,
            block.timestamp
        );
        return true;
    }

    function updateProject(
        uint id,
        string memory title,
        string memory description,
        string memory imageURL,
        uint expiresAt
    ) public returns (bool) {
        require(msg.sender == projects[id].owner, "Unauthorized Entity");
        require(bytes(title).length > 0, "Title cannot be empty");
        require(bytes(description).length > 0, "Description cannot be empty");
        require(bytes(imageURL).length > 0, "ImageURL cannot be empty");

        projects[id].title = title;
        projects[id].description = description;
        projects[id].imageURL = imageURL;
        projects[id].expiresAt = expiresAt;

        emit Action (
            id,
            "PROJECT UPDATED",
            msg.sender,
            block.timestamp
        );

        return true;
    }

    function deleteProject(uint id) public returns (bool) {
        require(projects[id].status == statusEnum.OPEN, "Project no longer opened");
        require(msg.sender == projects[id].owner, "Unauthorized Entity");

        projects[id].status = statusEnum.DELETED;
        performRefund(id);

        emit Action (
            id,
            "PROJECT DELETED",
            msg.sender,
            block.timestamp
        );

        return true;
    }

    function performRefund(uint id) internal {
        for(uint i = 0; i < backersOf[id].length; i++) {
            address _owner = backersOf[id][i].owner;
            uint _contribution = backersOf[id][i].contribution;

            backersOf[id][i].refunded = true;
            backersOf[id][i].timestamp = block.timestamp;
            payTo(_owner, _contribution);

            stats.totalBacking -= 1;
            stats.totalDonations -= _contribution;
        }
    }

    function backProject(uint id) public payable returns (bool) {
        require(msg.value > 0 ether, "Ether must be greater than zero");
        require(projectExist[id], "Project not found");
        require(projects[id].status == statusEnum.OPEN, "Project no longer opened");

        stats.totalBacking += 1;
        stats.totalDonations += msg.value;
        projects[id].raised += msg.value;
        projects[id].backers += 1;

        backersOf[id].push(
            backerStruct(
                msg.sender,
                msg.value,
                block.timestamp,
                false
            )
        );

        emit Action (
            id,
            "PROJECT BACKED",
            msg.sender,
            block.timestamp
        );

        if(projects[id].raised >= projects[id].cost) {
            projects[id].status = statusEnum.APPROVED;
            balance += projects[id].raised;
            performPayout(id);
            return true;
        }

        if(block.timestamp >= projects[id].expiresAt) {
            projects[id].status = statusEnum.REVERTED;
            performRefund(id);
            return true;
        }

        return true;
    }

    function performPayout(uint id) internal {
        uint raised = projects[id].raised;
        uint tax = (raised * projectTax) / 100;

        projects[id].status = statusEnum.PAIDOUT;

        payTo(projects[id].owner, (raised - tax));
        payTo(owner, tax);

        balance -= projects[id].raised;

        emit Action (
            id,
            "PROJECT PAID OUT",
            msg.sender,
            block.timestamp
        );
    }

    function requestRefund(uint id) public returns (bool) {
        require(
            projects[id].status != statusEnum.REVERTED ||
            projects[id].status != statusEnum.DELETED,
            "Project not marked as revert or delete"
        );

        projects[id].status = statusEnum.REVERTED;
        performRefund(id);
        return true;
    }

    function payOutProject(uint id) public returns (bool) {
        require(projects[id].status == statusEnum.APPROVED, "Project not APPROVED");
        require(
            msg.sender == projects[id].owner ||
            msg.sender == owner,
            "Unauthorized Entity"
        );

        performPayout(id);
        return true;
    }

    function changeTax(uint _taxPct) public ownerOnly {
        projectTax = _taxPct;
    }

    function getProject(uint id) public view returns (projectStruct memory) {
        require(projectExist[id], "Project not found");

        return projects[id];
    }

    function getProjects() public view returns (projectStruct[] memory) {
        return projects;
    }

    function getBackers(uint id) public view returns (backerStruct[] memory) {
        return backersOf[id];
    }

    function payTo(address to, uint256 amount) internal {
        (bool success, ) = payable(to).call{value: amount}("");
        require(success);
    }
}
</code>```

blockchain.jsx

```<code>import abi from '../abis/src/contracts/Genesis.sol/Genesis.json'
import address from '../abis/contractAddress.json'
import { getGlobalState, setGlobalState } from '../store'
import { ethers } from 'ethers'

const { ethereum } = window
const contractAddress = address.address
const contractAbi = abi.abi

const connectWallet = async () => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const accounts = await ethereum.request({ method: 'eth_requestAccounts' })
    setGlobalState('connectedAccount', accounts[0]?.toLowerCase())
  } catch (error) {
    reportError(error)
  }
}

const isWallectConnected = async () => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const accounts = await ethereum.request({ method: 'eth_accounts' })
    setGlobalState('connectedAccount', accounts[0]?.toLowerCase())

    window.ethereum.on('chainChanged', (chainId) => {
      window.location.reload()
    })

    window.ethereum.on('accountsChanged', async () => {
      setGlobalState('connectedAccount', accounts[0]?.toLowerCase())
      await isWallectConnected()
    })

    if (accounts.length) {
      setGlobalState('connectedAccount', accounts[0]?.toLowerCase())
    } else {
      alert('Please connect wallet.')
      console.log('No accounts found.')
    }
  } catch (error) {
    reportError(error)
  }
}

const getEtheriumContract = async () => {
  const connectedAccount = getGlobalState('connectedAccount')

  if (connectedAccount) {
    const provider = new ethers.providers.Web3Provider(ethereum)
    const signer = provider.getSigner()
    const contract = new ethers.Contract(contractAddress, contractAbi, signer)

    return contract
  } else {
    return getGlobalState('contract')
  }
}

const createProject = async ({
  title,
  description,
  imageURL,
  cost,
  expiresAt,
}) => {
  try {
    if (!ethereum) return alert('Please install Metamask')

    const contract = await getEtheriumContract()
    cost = ethers.utils.parseEther(cost)
    await contract.createProject(title, description, imageURL, cost, expiresAt)
  } catch (error) {
    reportError(error)
  }
}

const updateProject = async ({
  id,
  title,
  description,
  imageURL,
  expiresAt,
}) => {
  try {
    if (!ethereum) return alert('Please install Metamask')

    const contract = await getEtheriumContract()
    await contract.updateProject(id, title, description, imageURL, expiresAt)
  } catch (error) {
    reportError(error)
  }
}

const deleteProject = async (id) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const contract = await getEtheriumContract()
    await contract.deleteProject(id)
  } catch (error) {
    reportError(error)
  }
}

const loadProjects = async () => {
  try {
    if (!ethereum) return alert('Please install Metamask')

    const contract = await getEtheriumContract()
    const projects = await contract.getProjects()
    const stats = await contract.stats()

    setGlobalState('stats', structureStats(stats))
    setGlobalState('projects', structuredProjects(projects))
  } catch (error) {
    reportError(error)
  }
}

const loadProject = async (id) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const contract = await getEtheriumContract()
    const project = await contract.getProject(id)

    setGlobalState('project', structuredProjects([project])[0])
  } catch (error) {
    alert(JSON.stringify(error.message))
    reportError(error)
  }
}

const backProject = async (id, amount) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const connectedAccount = getGlobalState('connectedAccount')
    const contract = await getEtheriumContract()
    amount = ethers.utils.parseEther(amount)

    await contract.backProject(id, {
      from: connectedAccount,
      value: amount._hex,
    })
  } catch (error) {
    reportError(error)
  }
}

const getBackers = async (id) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const contract = await getEtheriumContract()
    let backers = await contract.getBackers(id)

    setGlobalState('backers', structuredBackers(backers))
  } catch (error) {
    reportError(error)
  }
}

const payoutProject = async (id) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const connectedAccount = getGlobalState('connectedAccount')
    const contract = await getEtheriumContract()

    await contract.payOutProject(id, {
      from: connectedAccount,
    })
  } catch (error) {
    reportError(error)
  }
}

const structuredBackers = (backers) =>
  backers
    .map((backer) => ({
      owner: backer.owner.toLowerCase(),
      refunded: backer.refunded,
      timestamp: new Date(backer.timestamp.toNumber() * 1000).toJSON(),
      contribution: parseInt(backer.contribution._hex) / 10 ** 18,
    }))
    .reverse()

const structuredProjects = (projects) =>
  projects
    .map((project) => ({
      id: project.id.toNumber(),
      owner: project.owner.toLowerCase(),
      title: project.title,
      description: project.description,
      timestamp: new Date(project.timestamp.toNumber()).getTime(),
      expiresAt: new Date(project.expiresAt.toNumber()).getTime(),
      date: toDate(project.expiresAt.toNumber() * 1000),
      imageURL: project.imageURL,
      raised: parseInt(project.raised._hex) / 10 ** 18,
      cost: parseInt(project.cost._hex) / 10 ** 18,
      backers: project.backers.toNumber(),
      status: project.status,
    }))
    .reverse()

const toDate = (timestamp) => {
  const date = new Date(timestamp)
  const dd = date.getDate() > 9 ? date.getDate() : `0${date.getDate()}`
  const mm =
    date.getMonth() + 1 > 9 ? date.getMonth() + 1 : `0${date.getMonth() + 1}`
  const yyyy = date.getFullYear()
  return `${yyyy}-${mm}-${dd}`
}

const structureStats = (stats) => ({
  totalProjects: stats.totalProjects.toNumber(),
  totalBacking: stats.totalBacking.toNumber(),
  totalDonations: parseInt(stats.totalDonations._hex) / 10 ** 18,
})

const reportError = (error) => {
  console.log(error.message)
  throw new Error('No ethereum object.')
}

export {
  connectWallet,
  isWallectConnected,
  createProject,
  updateProject,
  deleteProject,
  loadProjects,
  loadProject,
  backProject,
  getBackers,
  payoutProject,
}
</code>```

I tried running these commands in separate terminals

```<code>npx hardhat node

npx hardhat run scripts/deploy.js --network localhost
</code>```

The contract gets deployed but the error continues and I should be able to create new projects for Crowdfunding Dapp but because of this error the projects do not get loaded.

Body:
So I have been following this tutorial to build a Crowd-Funding Dapp using blockchain, solidity, react. And I keep getting the following mentioned error whenever I start React App. I think it might be related to contract address. The above image is what I get after I click on inspect. As I am still a beginner in Blockchain and programming in general it would be really helpful if anyone can suggest any solutions.

The error

Blockchain loaded
blockchain.jsx:219 call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="getProjects()", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)

blockchain.jsx:220 Uncaught (in promise) Error: No ethereum object.
    at reportError (blockchain.jsx:220:1)
    at loadProjects (blockchain.jsx:116:1)
    at async Home.jsx:13:1

Here is the contract file which is Genesis.sol and the blockchain.jsx in which the error occurs.

Genesis.sol

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

contract Genesis {
    address public owner;
    uint public projectTax;
    uint public projectCount;
    uint public balance;
    statsStruct public stats;
    projectStruct[] projects;

    mapping(address => projectStruct[]) projectsOf;
    mapping(uint => backerStruct[]) backersOf;
    mapping(uint => bool) public projectExist;

    enum statusEnum {
        OPEN,
        APPROVED,
        REVERTED,
        DELETED,
        PAIDOUT
    }

    struct statsStruct {
        uint totalProjects;
        uint totalBacking;
        uint totalDonations;
    }

    struct backerStruct {
        address owner;
        uint contribution;
        uint timestamp;
        bool refunded;
    }

    struct projectStruct {
        uint id;
        address owner;
        string title;
        string description;
        string imageURL;
        uint cost;
        uint raised;
        uint timestamp;
        uint expiresAt;
        uint backers;
        statusEnum status;
    }

    modifier ownerOnly(){
        require(msg.sender == owner, "Owner reserved only");
        _;
    }

    event Action (
        uint256 id,
        string actionType,
        address indexed executor,
        uint256 timestamp
    );

    constructor(uint _projectTax) {
        owner = msg.sender;
        projectTax = _projectTax;
    }

    function createProject(
        string memory title,
        string memory description,
        string memory imageURL,
        uint cost,
        uint expiresAt
    ) public returns (bool) {
        require(bytes(title).length > 0, "Title cannot be empty");
        require(bytes(description).length > 0, "Description cannot be empty");
        require(bytes(imageURL).length > 0, "ImageURL cannot be empty");
        require(cost > 0 ether, "Cost cannot be zero");

        projectStruct memory project;
        project.id = projectCount;
        project.owner = msg.sender;
        project.title = title;
        project.description = description;
        project.imageURL = imageURL;
        project.cost = cost;
        project.timestamp = block.timestamp;
        project.expiresAt = expiresAt;

        projects.push(project);
        projectExist[projectCount] = true;
        projectsOf[msg.sender].push(project);
        stats.totalProjects += 1;

        emit Action (
            projectCount++,
            "PROJECT CREATED",
            msg.sender,
            block.timestamp
        );
        return true;
    }

    function updateProject(
        uint id,
        string memory title,
        string memory description,
        string memory imageURL,
        uint expiresAt
    ) public returns (bool) {
        require(msg.sender == projects[id].owner, "Unauthorized Entity");
        require(bytes(title).length > 0, "Title cannot be empty");
        require(bytes(description).length > 0, "Description cannot be empty");
        require(bytes(imageURL).length > 0, "ImageURL cannot be empty");

        projects[id].title = title;
        projects[id].description = description;
        projects[id].imageURL = imageURL;
        projects[id].expiresAt = expiresAt;

        emit Action (
            id,
            "PROJECT UPDATED",
            msg.sender,
            block.timestamp
        );

        return true;
    }

    function deleteProject(uint id) public returns (bool) {
        require(projects[id].status == statusEnum.OPEN, "Project no longer opened");
        require(msg.sender == projects[id].owner, "Unauthorized Entity");

        projects[id].status = statusEnum.DELETED;
        performRefund(id);

        emit Action (
            id,
            "PROJECT DELETED",
            msg.sender,
            block.timestamp
        );

        return true;
    }

    function performRefund(uint id) internal {
        for(uint i = 0; i < backersOf[id].length; i++) {
            address _owner = backersOf[id][i].owner;
            uint _contribution = backersOf[id][i].contribution;

            backersOf[id][i].refunded = true;
            backersOf[id][i].timestamp = block.timestamp;
            payTo(_owner, _contribution);

            stats.totalBacking -= 1;
            stats.totalDonations -= _contribution;
        }
    }

    function backProject(uint id) public payable returns (bool) {
        require(msg.value > 0 ether, "Ether must be greater than zero");
        require(projectExist[id], "Project not found");
        require(projects[id].status == statusEnum.OPEN, "Project no longer opened");

        stats.totalBacking += 1;
        stats.totalDonations += msg.value;
        projects[id].raised += msg.value;
        projects[id].backers += 1;

        backersOf[id].push(
            backerStruct(
                msg.sender,
                msg.value,
                block.timestamp,
                false
            )
        );

        emit Action (
            id,
            "PROJECT BACKED",
            msg.sender,
            block.timestamp
        );

        if(projects[id].raised >= projects[id].cost) {
            projects[id].status = statusEnum.APPROVED;
            balance += projects[id].raised;
            performPayout(id);
            return true;
        }

        if(block.timestamp >= projects[id].expiresAt) {
            projects[id].status = statusEnum.REVERTED;
            performRefund(id);
            return true;
        }

        return true;
    }

    function performPayout(uint id) internal {
        uint raised = projects[id].raised;
        uint tax = (raised * projectTax) / 100;

        projects[id].status = statusEnum.PAIDOUT;

        payTo(projects[id].owner, (raised - tax));
        payTo(owner, tax);

        balance -= projects[id].raised;

        emit Action (
            id,
            "PROJECT PAID OUT",
            msg.sender,
            block.timestamp
        );
    }

    function requestRefund(uint id) public returns (bool) {
        require(
            projects[id].status != statusEnum.REVERTED ||
            projects[id].status != statusEnum.DELETED,
            "Project not marked as revert or delete"
        );

        projects[id].status = statusEnum.REVERTED;
        performRefund(id);
        return true;
    }

    function payOutProject(uint id) public returns (bool) {
        require(projects[id].status == statusEnum.APPROVED, "Project not APPROVED");
        require(
            msg.sender == projects[id].owner ||
            msg.sender == owner,
            "Unauthorized Entity"
        );

        performPayout(id);
        return true;
    }

    function changeTax(uint _taxPct) public ownerOnly {
        projectTax = _taxPct;
    }

    function getProject(uint id) public view returns (projectStruct memory) {
        require(projectExist[id], "Project not found");

        return projects[id];
    }

    function getProjects() public view returns (projectStruct[] memory) {
        return projects;
    }

    function getBackers(uint id) public view returns (backerStruct[] memory) {
        return backersOf[id];
    }

    function payTo(address to, uint256 amount) internal {
        (bool success, ) = payable(to).call{value: amount}("");
        require(success);
    }
}

blockchain.jsx

import abi from '../abis/src/contracts/Genesis.sol/Genesis.json'
import address from '../abis/contractAddress.json'
import { getGlobalState, setGlobalState } from '../store'
import { ethers } from 'ethers'

const { ethereum } = window
const contractAddress = address.address
const contractAbi = abi.abi

const connectWallet = async () => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const accounts = await ethereum.request({ method: 'eth_requestAccounts' })
    setGlobalState('connectedAccount', accounts[0]?.toLowerCase())
  } catch (error) {
    reportError(error)
  }
}

const isWallectConnected = async () => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const accounts = await ethereum.request({ method: 'eth_accounts' })
    setGlobalState('connectedAccount', accounts[0]?.toLowerCase())

    window.ethereum.on('chainChanged', (chainId) => {
      window.location.reload()
    })

    window.ethereum.on('accountsChanged', async () => {
      setGlobalState('connectedAccount', accounts[0]?.toLowerCase())
      await isWallectConnected()
    })

    if (accounts.length) {
      setGlobalState('connectedAccount', accounts[0]?.toLowerCase())
    } else {
      alert('Please connect wallet.')
      console.log('No accounts found.')
    }
  } catch (error) {
    reportError(error)
  }
}

const getEtheriumContract = async () => {
  const connectedAccount = getGlobalState('connectedAccount')

  if (connectedAccount) {
    const provider = new ethers.providers.Web3Provider(ethereum)
    const signer = provider.getSigner()
    const contract = new ethers.Contract(contractAddress, contractAbi, signer)

    return contract
  } else {
    return getGlobalState('contract')
  }
}

const createProject = async ({
  title,
  description,
  imageURL,
  cost,
  expiresAt,
}) => {
  try {
    if (!ethereum) return alert('Please install Metamask')

    const contract = await getEtheriumContract()
    cost = ethers.utils.parseEther(cost)
    await contract.createProject(title, description, imageURL, cost, expiresAt)
  } catch (error) {
    reportError(error)
  }
}

const updateProject = async ({
  id,
  title,
  description,
  imageURL,
  expiresAt,
}) => {
  try {
    if (!ethereum) return alert('Please install Metamask')

    const contract = await getEtheriumContract()
    await contract.updateProject(id, title, description, imageURL, expiresAt)
  } catch (error) {
    reportError(error)
  }
}

const deleteProject = async (id) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const contract = await getEtheriumContract()
    await contract.deleteProject(id)
  } catch (error) {
    reportError(error)
  }
}

const loadProjects = async () => {
  try {
    if (!ethereum) return alert('Please install Metamask')

    const contract = await getEtheriumContract()
    const projects = await contract.getProjects()
    const stats = await contract.stats()

    setGlobalState('stats', structureStats(stats))
    setGlobalState('projects', structuredProjects(projects))
  } catch (error) {
    reportError(error)
  }
}

const loadProject = async (id) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const contract = await getEtheriumContract()
    const project = await contract.getProject(id)

    setGlobalState('project', structuredProjects([project])[0])
  } catch (error) {
    alert(JSON.stringify(error.message))
    reportError(error)
  }
}

const backProject = async (id, amount) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const connectedAccount = getGlobalState('connectedAccount')
    const contract = await getEtheriumContract()
    amount = ethers.utils.parseEther(amount)

    await contract.backProject(id, {
      from: connectedAccount,
      value: amount._hex,
    })
  } catch (error) {
    reportError(error)
  }
}

const getBackers = async (id) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const contract = await getEtheriumContract()
    let backers = await contract.getBackers(id)

    setGlobalState('backers', structuredBackers(backers))
  } catch (error) {
    reportError(error)
  }
}

const payoutProject = async (id) => {
  try {
    if (!ethereum) return alert('Please install Metamask')
    const connectedAccount = getGlobalState('connectedAccount')
    const contract = await getEtheriumContract()

    await contract.payOutProject(id, {
      from: connectedAccount,
    })
  } catch (error) {
    reportError(error)
  }
}

const structuredBackers = (backers) =>
  backers
    .map((backer) => ({
      owner: backer.owner.toLowerCase(),
      refunded: backer.refunded,
      timestamp: new Date(backer.timestamp.toNumber() * 1000).toJSON(),
      contribution: parseInt(backer.contribution._hex) / 10 ** 18,
    }))
    .reverse()

const structuredProjects = (projects) =>
  projects
    .map((project) => ({
      id: project.id.toNumber(),
      owner: project.owner.toLowerCase(),
      title: project.title,
      description: project.description,
      timestamp: new Date(project.timestamp.toNumber()).getTime(),
      expiresAt: new Date(project.expiresAt.toNumber()).getTime(),
      date: toDate(project.expiresAt.toNumber() * 1000),
      imageURL: project.imageURL,
      raised: parseInt(project.raised._hex) / 10 ** 18,
      cost: parseInt(project.cost._hex) / 10 ** 18,
      backers: project.backers.toNumber(),
      status: project.status,
    }))
    .reverse()

const toDate = (timestamp) => {
  const date = new Date(timestamp)
  const dd = date.getDate() > 9 ? date.getDate() : `0${date.getDate()}`
  const mm =
    date.getMonth() + 1 > 9 ? date.getMonth() + 1 : `0${date.getMonth() + 1}`
  const yyyy = date.getFullYear()
  return `${yyyy}-${mm}-${dd}`
}

const structureStats = (stats) => ({
  totalProjects: stats.totalProjects.toNumber(),
  totalBacking: stats.totalBacking.toNumber(),
  totalDonations: parseInt(stats.totalDonations._hex) / 10 ** 18,
})

const reportError = (error) => {
  console.log(error.message)
  throw new Error('No ethereum object.')
}

export {
  connectWallet,
  isWallectConnected,
  createProject,
  updateProject,
  deleteProject,
  loadProjects,
  loadProject,
  backProject,
  getBackers,
  payoutProject,
}

I tried running these commands in separate terminals

npx hardhat node

npx hardhat run scripts/deploy.js --network localhost

The contract gets deployed but the error continues and I should be able to create new projects for Crowdfunding Dapp but because of this error the projects do not get loaded.


来源: stackexchange

问:
Login, roles and actions
hello i have a question.

What is the correct form to make roles in a database?

For example: A student can acces to a distinct parts of a system, a teacher can acces to other parts of the system and the administrartor can acces to all system

Thanks :)

enter image description here

How do I make the user table so that the "student" and "teacher" roles access different sections of the system

ContentLicense: CC BY-SA 4.0

Title: Login, roles and actions


问:
Validate particular field in form instance through yup on basis of condition
Here as we can see that the form instance contain main three fields Organization name, Course name and Chapters
Here the Chapters fields contain array of objects which also includes field called cards ,one of its value is type, so when the type of card is assessment only then the validation for assessment field (which comes under array of object for Cards ) should run for all of its object

Currently as of now all of this form instance validation is triggered on a single submit button, so therefore even the type of cards (here cards has a select dropdown with different value) is not selected as assessment, the validation for assessment object is triggered.

I tried using:
yup.when('cards.type' { is: assessment; then: yup.string().required() for the required fields of assessment.
But nothing worked so far

All the help will be appreciated.

My Whole code  look like:
`

```<code>const chapterManagementFormInstance = useForm<ChapterManagmentFields>({
        resolver: yupResolver(
            yup.object({
                organizationName: yup
                    .string()
                    .label('Organization Name')
                    .required('Please select organization name'),
                courseName: yup
                    .string()
                    .label('Course Name')
                    .required('Please select course name'),
                chapters: yup.array(
                    yup.object({
                        title: yup
                            .string()
                            .label('chapter title')
                            .required('Please enter chapter title')
                            .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                message: ({label}) => `${label} should not contain special character`,
                            })
                            .test({
                                name: 'start-space-validation',
                                message: ({label}) => `${label as string} should not start with space`,
                                test: (value: string | undefined) => {
                                    if (value?.startsWith(' ')) {
                                        return false;
                                    } else {
                                        return true;
                                    }
                                },
                            })
                            .test({
                                name: 'end-space-validation',
                                message: ({label}) => `${label as string} should not end with space`,
                                test: (value: string | undefined) => {
                                    if (value?.endsWith(' ')) {
                                        return false;
                                    } else {
                                        return true;
                                    }
                                },
                            }),
                        description: yup
                            .string()
                            .required('Please enter chapter description')
                            .label('Chapter description')
                            .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                message: ({label}) => `${label} should not contain special character`,
                            })
                            .test({
                                name: 'start-space-validation',
                                message: ({label}) => `${label as string} should not start with space`,
                                test: (value: string | undefined) => {
                                    if (value?.startsWith(' ')) {
                                        return false;
                                    } else {
                                        return true;
                                    }
                                },
                            })
                            .test({
                                name: 'end-space-validation',
                                message: ({label}) => `${label as string} should not end with space`,
                                test: (value: string | undefined) => {
                                    if (value?.endsWith(' ')) {
                                        return false;
                                    } else {
                                        return true;
                                    }
                                },
                            }),
                        video: yup.mixed().label('Chapter video'),
                        isNew: yup.boolean(),
                        cards: yup.array(
                            yup.object({
                                type: yup
                                    .string()
                                    .nullable()
                                    .required('Please enter card type')
                                    .label('Card type'),
                                // .oneOf(['text', 'image', 'audio', 'video', 'document', 'assessment']),
                                color: yup
                                    .string()
                                    .required('Please select card color')
                                    .label('Card color'),
                                video: yup.mixed().label(''),
                                title: yup
                                    .string()
                                    .required('Please enter card title')
                                    .label('Card title')
                                    .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                        message: ({label}) => `${label} should not contain special character`,
                                    })
                                    .test({
                                        name: 'start-space-validation',
                                        message: ({label}) =>
                                            `${label as string} should not start with space`,
                                        test: (value: string | undefined) => {
                                            if (value?.startsWith(' ')) {
                                                return false;
                                            } else {
                                                return true;
                                            }
                                        },
                                    })
                                    .test({
                                        name: 'end-space-validation',
                                        message: ({label}) => `${label as string} should not end with space`,
                                        test: (value: string | undefined) => {
                                            if (value?.endsWith(' ')) {
                                                return false;
                                            } else {
                                                return true;
                                            }
                                        },
                                    }),
                                newCard: yup.boolean(),
                                description: yup
                                    .string()
                                    .required('Please enter card description')
                                    .label('Card description')
                                    .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                        message: ({label}) => `${label} should not contain special character`,
                                    })
                                    .test({
                                        name: 'start-space-validation',
                                        message: ({label}) =>
                                            `${label as string} should not start with space`,
                                        test: (value: string | undefined) => {
                                            if (value?.startsWith(' ')) {
                                                return false;
                                            } else {
                                                return true;
                                            }
                                        },
                                    })
                                    .test({
                                        name: 'end-space-validation',
                                        message: ({label}) => `${label as string} should not end with space`,
                                        test: (value: string | undefined) => {
                                            if (value?.endsWith(' ')) {
                                                return false;
                                            } else {
                                                return true;
                                            }
                                        },
                                    }),
                                assets: yup.mixed(),
                                assessment: yup.object({
                                    type: yup
                                        .string()
                                        // .nullable()
                                        .required('Please select assessment type')
                                        .label('Assessment type'),
                                    // .when('assessment', {
                                    //  is: true,
                                    //  then: yup.string().required('Please select assessment type'),
                                    // })
                                    submitAssessment: yup.boolean(),
                                    marks: yup
                                        .number()
                                        .required('Please enter assessment marks')
                                        .label('Assessment marks'),
                                    // .oneOf([yup.ref('type'), null]),
                                    wrongAnswerRedirection: yup.boolean(),
                                    redirectionUrl: yup
                                        .string()
                                        // .required('Please select redirection card')
                                        .label('Redirection Card'),
                                    options: yup.array(
                                        yup.object({
                                            text: yup
                                                .string()
                                                .label('Text')
                                                .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                                    message: ({label}) =>
                                                        `${label} should not contain special character`,
                                                })
                                                .test({
                                                    name: 'start-space-validation',
                                                    message: ({label}) =>
                                                        `${label as string} should not start with space`,
                                                    test: (value: string | undefined) => {
                                                        if (value?.startsWith(' ')) {
                                                            return false;
                                                        } else {
                                                            return true;
                                                        }
                                                    },
                                                })
                                                .test({
                                                    name: 'end-space-validation',
                                                    message: ({label}) =>
                                                        `${label as string} should not end with space`,
                                                    test: (value: string | undefined) => {
                                                        if (value?.endsWith(' ')) {
                                                            return false;
                                                        } else {
                                                            return true;
                                                        }
                                                    },
                                                }),
                                            isCorrectAnswer: yup.string(),
                                            newField: yup.boolean(),
                                            // isCorrectAnswer: yup.boolean(),
                                        }),
                                    ),
                                }),
                            }),
                        ),
                    }),
                ),
            }),
        ),
        // shouldUnregister: true,
        // shouldFocusError: false,
    });
</code>```

`

Body:
Here as we can see that the form instance contain main three fields Organization name, Course name and Chapters
Here the Chapters fields contain array of objects which also includes field called cards ,one of its value is type, so when the type of card is assessment only then the validation for assessment field (which comes under array of object for Cards ) should run for all of its object

Currently as of now all of this form instance validation is triggered on a single submit button, so therefore even the type of cards (here cards has a select dropdown with different value) is not selected as assessment, the validation for assessment object is triggered.

I tried using:
yup.when('cards.type' { is: assessment; then: yup.string().required() for the required fields of assessment.
But nothing worked so far

All the help will be appreciated.

My Whole code  look like:
`

const chapterManagementFormInstance = useForm<ChapterManagmentFields>({
        resolver: yupResolver(
            yup.object({
                organizationName: yup
                    .string()
                    .label('Organization Name')
                    .required('Please select organization name'),
                courseName: yup
                    .string()
                    .label('Course Name')
                    .required('Please select course name'),
                chapters: yup.array(
                    yup.object({
                        title: yup
                            .string()
                            .label('chapter title')
                            .required('Please enter chapter title')
                            .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                message: ({label}) => `${label} should not contain special character`,
                            })
                            .test({
                                name: 'start-space-validation',
                                message: ({label}) => `${label as string} should not start with space`,
                                test: (value: string | undefined) => {
                                    if (value?.startsWith(' ')) {
                                        return false;
                                    } else {
                                        return true;
                                    }
                                },
                            })
                            .test({
                                name: 'end-space-validation',
                                message: ({label}) => `${label as string} should not end with space`,
                                test: (value: string | undefined) => {
                                    if (value?.endsWith(' ')) {
                                        return false;
                                    } else {
                                        return true;
                                    }
                                },
                            }),
                        description: yup
                            .string()
                            .required('Please enter chapter description')
                            .label('Chapter description')
                            .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                message: ({label}) => `${label} should not contain special character`,
                            })
                            .test({
                                name: 'start-space-validation',
                                message: ({label}) => `${label as string} should not start with space`,
                                test: (value: string | undefined) => {
                                    if (value?.startsWith(' ')) {
                                        return false;
                                    } else {
                                        return true;
                                    }
                                },
                            })
                            .test({
                                name: 'end-space-validation',
                                message: ({label}) => `${label as string} should not end with space`,
                                test: (value: string | undefined) => {
                                    if (value?.endsWith(' ')) {
                                        return false;
                                    } else {
                                        return true;
                                    }
                                },
                            }),
                        video: yup.mixed().label('Chapter video'),
                        isNew: yup.boolean(),
                        cards: yup.array(
                            yup.object({
                                type: yup
                                    .string()
                                    .nullable()
                                    .required('Please enter card type')
                                    .label('Card type'),
                                // .oneOf(['text', 'image', 'audio', 'video', 'document', 'assessment']),
                                color: yup
                                    .string()
                                    .required('Please select card color')
                                    .label('Card color'),
                                video: yup.mixed().label(''),
                                title: yup
                                    .string()
                                    .required('Please enter card title')
                                    .label('Card title')
                                    .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                        message: ({label}) => `${label} should not contain special character`,
                                    })
                                    .test({
                                        name: 'start-space-validation',
                                        message: ({label}) =>
                                            `${label as string} should not start with space`,
                                        test: (value: string | undefined) => {
                                            if (value?.startsWith(' ')) {
                                                return false;
                                            } else {
                                                return true;
                                            }
                                        },
                                    })
                                    .test({
                                        name: 'end-space-validation',
                                        message: ({label}) => `${label as string} should not end with space`,
                                        test: (value: string | undefined) => {
                                            if (value?.endsWith(' ')) {
                                                return false;
                                            } else {
                                                return true;
                                            }
                                        },
                                    }),
                                newCard: yup.boolean(),
                                description: yup
                                    .string()
                                    .required('Please enter card description')
                                    .label('Card description')
                                    .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                        message: ({label}) => `${label} should not contain special character`,
                                    })
                                    .test({
                                        name: 'start-space-validation',
                                        message: ({label}) =>
                                            `${label as string} should not start with space`,
                                        test: (value: string | undefined) => {
                                            if (value?.startsWith(' ')) {
                                                return false;
                                            } else {
                                                return true;
                                            }
                                        },
                                    })
                                    .test({
                                        name: 'end-space-validation',
                                        message: ({label}) => `${label as string} should not end with space`,
                                        test: (value: string | undefined) => {
                                            if (value?.endsWith(' ')) {
                                                return false;
                                            } else {
                                                return true;
                                            }
                                        },
                                    }),
                                assets: yup.mixed(),
                                assessment: yup.object({
                                    type: yup
                                        .string()
                                        // .nullable()
                                        .required('Please select assessment type')
                                        .label('Assessment type'),
                                    // .when('assessment', {
                                    //  is: true,
                                    //  then: yup.string().required('Please select assessment type'),
                                    // })
                                    submitAssessment: yup.boolean(),
                                    marks: yup
                                        .number()
                                        .required('Please enter assessment marks')
                                        .label('Assessment marks'),
                                    // .oneOf([yup.ref('type'), null]),
                                    wrongAnswerRedirection: yup.boolean(),
                                    redirectionUrl: yup
                                        .string()
                                        // .required('Please select redirection card')
                                        .label('Redirection Card'),
                                    options: yup.array(
                                        yup.object({
                                            text: yup
                                                .string()
                                                .label('Text')
                                                .matches(/^[a-zA-Z0-9 _]+\s*$/, {
                                                    message: ({label}) =>
                                                        `${label} should not contain special character`,
                                                })
                                                .test({
                                                    name: 'start-space-validation',
                                                    message: ({label}) =>
                                                        `${label as string} should not start with space`,
                                                    test: (value: string | undefined) => {
                                                        if (value?.startsWith(' ')) {
                                                            return false;
                                                        } else {
                                                            return true;
                                                        }
                                                    },
                                                })
                                                .test({
                                                    name: 'end-space-validation',
                                                    message: ({label}) =>
                                                        `${label as string} should not end with space`,
                                                    test: (value: string | undefined) => {
                                                        if (value?.endsWith(' ')) {
                                                            return false;
                                                        } else {
                                                            return true;
                                                        }
                                                    },
                                                }),
                                            isCorrectAnswer: yup.string(),
                                            newField: yup.boolean(),
                                            // isCorrectAnswer: yup.boolean(),
                                        }),
                                    ),
                                }),
                            }),
                        ),
                    }),
                ),
            }),
        ),
        // shouldUnregister: true,
        // shouldFocusError: false,
    });

`


问:
How to trace and validate path of a 'letter' canvas in flutter
I want to track the following path and validate if the user write it correct or not  any ideas how can I achieve that?
I want to check if the user write it correctly (red color) or not ?

I wrote the following code to draw the letter itself and the user paths but I couldn't figure out how to match between two paths.

```<code>
class LetterTracerPainter extends CustomPainter {
  final String letter;
  final List<Offset> tracePath;

  LetterTracerPainter({required this.letter, required this.tracePath});

  @override
  void paint(Canvas canvas, Size size) {
    TextPainter textPainter = TextPainter(
      text: TextSpan(
          text: letter,
          style: Styles.fontHeadlineCustom(
              color: Colors.black.withOpacity(.2), fontSize: 200.0)),
      textDirection: TextDirection.ltr,
    );
    textPainter.layout();
    textPainter.paint(canvas, Offset(0.0, 0.0));

    List<LineMetrics> lines = textPainter.computeLineMetrics();
    //lines.map((e) => print(e));

    if (tracePath.isNotEmpty) {
      Paint paint = Paint()
        ..color = Colors.blue
        ..strokeWidth = 10.0
        ..strokeCap = StrokeCap.round;
      for (int i = 1; i < tracePath.length; i++) {
        if ((tracePath[i].dx <= textPainter.width &&
                tracePath[i - 1].dx <= textPainter.width) &&
            (tracePath[i].dy <= textPainter.height &&
                tracePath[i - 1].dy <= textPainter.height)) {
          canvas.drawLine(tracePath[i - 1], tracePath[i], paint);
        }
      }
    }
  }

  @override
  bool shouldRepaint(LetterTracerPainter oldDelegate) {
    return letter != oldDelegate.letter || tracePath != oldDelegate.tracePath;
  }
}

class CanvasPainter extends CustomPainter {
  Paint? _paint;
  List<Offset> _points;

  CanvasPainter(this._points) {
    _paint = Paint()
      ..color = Colors.blue
      ..strokeWidth = 10.0
      ..strokeCap = StrokeCap.round;
  }

  @override
  void paint(Canvas canvas, Size size) {
    for (var i = 1; i < this._points.length; i++) {
      if (_points[i - 1] != null && _points[i] != null) {
        canvas.drawLine(_points[i - 1], _points[i], _paint!);
      }
    }
  }

  @override
  bool shouldRepaint(CanvasPainter oldDelegate) {
    return oldDelegate._points != _points;
  }
}
</code>```

Body:
I want to track the following path and validate if the user write it correct or not  any ideas how can I achieve that?
I want to check if the user write it correctly (red color) or not ?

I wrote the following code to draw the letter itself and the user paths but I couldn't figure out how to match between two paths.

class LetterTracerPainter extends CustomPainter {
  final String letter;
  final List<Offset> tracePath;

  LetterTracerPainter({required this.letter, required this.tracePath});

  @override
  void paint(Canvas canvas, Size size) {
    TextPainter textPainter = TextPainter(
      text: TextSpan(
          text: letter,
          style: Styles.fontHeadlineCustom(
              color: Colors.black.withOpacity(.2), fontSize: 200.0)),
      textDirection: TextDirection.ltr,
    );
    textPainter.layout();
    textPainter.paint(canvas, Offset(0.0, 0.0));

    List<LineMetrics> lines = textPainter.computeLineMetrics();
    //lines.map((e) => print(e));

    if (tracePath.isNotEmpty) {
      Paint paint = Paint()
        ..color = Colors.blue
        ..strokeWidth = 10.0
        ..strokeCap = StrokeCap.round;
      for (int i = 1; i < tracePath.length; i++) {
        if ((tracePath[i].dx <= textPainter.width &&
                tracePath[i - 1].dx <= textPainter.width) &&
            (tracePath[i].dy <= textPainter.height &&
                tracePath[i - 1].dy <= textPainter.height)) {
          canvas.drawLine(tracePath[i - 1], tracePath[i], paint);
        }
      }
    }
  }

  @override
  bool shouldRepaint(LetterTracerPainter oldDelegate) {
    return letter != oldDelegate.letter || tracePath != oldDelegate.tracePath;
  }
}

class CanvasPainter extends CustomPainter {
  Paint? _paint;
  List<Offset> _points;

  CanvasPainter(this._points) {
    _paint = Paint()
      ..color = Colors.blue
      ..strokeWidth = 10.0
      ..strokeCap = StrokeCap.round;
  }

  @override
  void paint(Canvas canvas, Size size) {
    for (var i = 1; i < this._points.length; i++) {
      if (_points[i - 1] != null && _points[i] != null) {
        canvas.drawLine(_points[i - 1], _points[i], _paint!);
      }
    }
  }

  @override
  bool shouldRepaint(CanvasPainter oldDelegate) {
    return oldDelegate._points != _points;
  }
}


问:
"jvm" appearing everywhere while generating the markdown format documentation using Dokka
Whenever I generate markdown format (GFM or Jekyll) using dokka, it generates the documentation with "[jvm]" tag appearing everywhere in every field as show in the screenshot below. Does anyone has any idea why this is happening and what can I do to fix it. I'm using dokka version 1.7.20 on a pure kotlin project, and I have just added "id("org.jetbrains.dokka") version ("1.7.20")" in the Gradle file.


问:
R: X-axis value is outside the figure in a bar chart
This code for a bar chart works fine, but it has one flaw, and I don't know what it is. The figure it produces does not show completely. As you can see, in the x-axis the last number "100" is almost completely outside the figure. How to fix this?

```<code>library(dplyr)
library(tidyr)
library(ggplot2)

mydata <- mydata %>%
  mutate(
    variable = recode(
      variable,
      "item3" = "item name here"
    )
  ) %>%
  drop_na() %>%
  mutate(value = recode(value, "1" = "yes", "2" = "no", "3" = "maybe")) %>%
  count(variable, value) |>
  group_by(variable) |>
  mutate(pct = n / sum(n))

ggplot(mydata, mapping = aes(x = value, y = pct)) +
  geom_col(aes(fill = value),
           width = 0.30
  ) +
  scale_y_continuous(
    breaks = seq(from = 0, to = 1, by = 0.2),
    minor_breaks = seq(from = 0, to = 1, by = 0.1),
    labels = seq(from = 0, to = 100, by = 20),
    limits = c(0, 1),
    expand = c(0, 0)
  ) +
  scale_fill_manual(
    values = c(yes = "green", no = "red", maybe = "grey80"
               ),
    drop = FALSE
  ) +
  labs(x = "Answer", y = "Percentage") +
  guides(
    fill = "none"
  ) +
  theme(
    panel.background = element_blank(),
    panel.grid.major = element_line(colour = "grey"),
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_line(colour = "lightgrey"),
    axis.ticks.x = element_blank(),
    axis.ticks.y = element_line(colour = "grey"),
    axis.text.x = element_text(
      size = 11,
      face = "bold",
      hjust = 0
    )
  ) +
  coord_flip()
</code>```

Body:
This code for a bar chart works fine, but it has one flaw, and I don't know what it is. The figure it produces does not show completely. As you can see, in the x-axis the last number "100" is almost completely outside the figure. How to fix this?

library(dplyr)
library(tidyr)
library(ggplot2)

mydata <- mydata %>%
  mutate(
    variable = recode(
      variable,
      "item3" = "item name here"
    )
  ) %>%
  drop_na() %>%
  mutate(value = recode(value, "1" = "yes", "2" = "no", "3" = "maybe")) %>%
  count(variable, value) |>
  group_by(variable) |>
  mutate(pct = n / sum(n))

ggplot(mydata, mapping = aes(x = value, y = pct)) +
  geom_col(aes(fill = value),
           width = 0.30
  ) +
  scale_y_continuous(
    breaks = seq(from = 0, to = 1, by = 0.2),
    minor_breaks = seq(from = 0, to = 1, by = 0.1),
    labels = seq(from = 0, to = 100, by = 20),
    limits = c(0, 1),
    expand = c(0, 0)
  ) +
  scale_fill_manual(
    values = c(yes = "green", no = "red", maybe = "grey80"
               ),
    drop = FALSE
  ) +
  labs(x = "Answer", y = "Percentage") +
  guides(
    fill = "none"
  ) +
  theme(
    panel.background = element_blank(),
    panel.grid.major = element_line(colour = "grey"),
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_line(colour = "lightgrey"),
    axis.ticks.x = element_blank(),
    axis.ticks.y = element_line(colour = "grey"),
    axis.text.x = element_text(
      size = 11,
      face = "bold",
      hjust = 0
    )
  ) +
  coord_flip()


问:
SonarQube Configuring the analysis with a compilation database
Does someone tried alternative ways on SonarQube without executing Build Wrapper for C/C++/Objective-C analysis from 8.9 versions below? I'm afraid that Compilation Database is not supported on our current enterprise version 8.9.2.

Thank you all


问:
How to delete request parameter in aws apigatewayv2
I am trying to delete a route request parameter in apigatewayv2, aws docs requires the following arguments to fulfill deletion request:

```<code> apigatewayv2 delete-route-request-parameter
--api-id <value>
--request-parameter-key <value>
--route-id <value>
</code>```

I am not sure what AWS meant with request-parameter-key, I've tried the following with no success.

```<code>aws apigatewayv2 delete-route-request-parameter --api-id red6c408c5 --route-id i09lhet --request-parameter-key '"integration.request.header.authorization": "route.request.body.payload.authorization"'
</code>```

I got:

```<code>An error occurred (NotFoundException) when calling the DeleteRouteRequestParameter operation: Invalid request parameter specified
</code>```

request parameter key I would like to delete is first  in the RequestParameters object from the following :

```<code>    {
        "ConnectionType": "INTERNET",
        "ContentHandlingStrategy": "CONVERT_TO_TEXT",
        "IntegrationId": "40w4rqd",
        "IntegrationMethod": "POST",
        "IntegrationType": "HTTP_PROXY",
        "IntegrationUri": "https://***/chat/api/v1/live/sync-contacts/results",
        "PassthroughBehavior": "WHEN_NO_MATCH",
        "PayloadFormatVersion": "1.0",
        "RequestParameters": {
//=>> deleting this "integration.request.header.cognito_token": "route.request.body.payload.authorization",
            "integration.request.header.domainName": "context.domainName",
            "integration.request.header.connectionid": "context.connectionId"
        },
        "TimeoutInMillis": 29000
    }
</code>```

is there a specific way to represent particular request parameter to be deleted?

Body:
I am trying to delete a route request parameter in apigatewayv2, aws docs requires the following arguments to fulfill deletion request:

 apigatewayv2 delete-route-request-parameter
--api-id <value>
--request-parameter-key <value>
--route-id <value>

I am not sure what AWS meant with request-parameter-key, I've tried the following with no success.

aws apigatewayv2 delete-route-request-parameter --api-id red6c408c5 --route-id i09lhet --request-parameter-key '"integration.request.header.authorization": "route.request.body.payload.authorization"'

I got:

An error occurred (NotFoundException) when calling the DeleteRouteRequestParameter operation: Invalid request parameter specified

request parameter key I would like to delete is first  in the RequestParameters object from the following :

    {
        "ConnectionType": "INTERNET",
        "ContentHandlingStrategy": "CONVERT_TO_TEXT",
        "IntegrationId": "40w4rqd",
        "IntegrationMethod": "POST",
        "IntegrationType": "HTTP_PROXY",
        "IntegrationUri": "https://***/chat/api/v1/live/sync-contacts/results",
        "PassthroughBehavior": "WHEN_NO_MATCH",
        "PayloadFormatVersion": "1.0",
        "RequestParameters": {
//=>> deleting this "integration.request.header.cognito_token": "route.request.body.payload.authorization",
            "integration.request.header.domainName": "context.domainName",
            "integration.request.header.connectionid": "context.connectionId"
        },
        "TimeoutInMillis": 29000
    }

is there a specific way to represent particular request parameter to be deleted?


问:
Set Variable is null in compute function
I set a variable to an instance of BIP32 in a function, but accessing the varialble in a compute returns null

Map checkRoot(a) {
  print(root); // null
}
Map calculateSeed(String seedPhrase) {
  seed = bip39.mnemonicToSeed(seedPhrase);
  return {'root': bip32.BIP32.fromSeed(seed), 'seed': seed};
}
Future<void> initializeAllPrivateKeys(String mnemonic) async {
  Map seedDetails = await compute(calculateSeed, mnemonic);
  root = seedDetails['root'];
  seed = seedDetails['seed'];
  print(root); // 'Instance of BIP32'
  await compute(checkRoot, '');
}
```
<p>What I expected</p>
<pre class="lang-dart prettyprint-override"><code>Map checkRoot(a) {
  print(root); // 'Instance of BIP32'
}

</code>```

Body:
I set a variable to an instance of BIP32 in a function, but accessing the varialble in a compute returns null

Map checkRoot(a) {
  print(root); // null
}
Map calculateSeed(String seedPhrase) {
  seed = bip39.mnemonicToSeed(seedPhrase);
  return {'root': bip32.BIP32.fromSeed(seed), 'seed': seed};
}
Future<void> initializeAllPrivateKeys(String mnemonic) async {
  Map seedDetails = await compute(calculateSeed, mnemonic);
  root = seedDetails['root'];
  seed = seedDetails['seed'];
  print(root); // 'Instance of BIP32'
  await compute(checkRoot, '');
}

What I expected

Map checkRoot(a) {
  print(root); // 'Instance of BIP32'
}


问:
Localization .Net6 Calendar Issue
I am using input type date which is opening calendar for me. I am setting the current value by setting it in backend and passing as a model property. It is working fine.
Now, I have implemented localization with arabic version. Every thing works fine on local. When I deployed the project, calendar is showing in hijri.

I have tried to convert it to en-Us culture but it is still showing same.

Title: Localization .Net6 Calendar Issue


问:
how to query nested jsonb array for a given key
I have a table 'animals' to store information

row 1 -> [{"type": "rabbit", "value": "carrot"}, {"type": "cat", "value": "milk"}]

row 2 -> [{"type": "cat", "value": "fish"}, {"type": "rabbit", "value": "leaves"}]

I need to query the value for type rabbit from all the rows.

tried to use operator @> [{"type" : "rabbit"}}

select *  from data where data @> '[{"type":"rabbit"}]';

but doesn't work


问:
How to copy global functions between lua_State
I need to copy a global function in a lua_State to a new lua_State, because this function will be called in multiple threads, I need to assign lua_State to each thread separately

Here is the simplified code, I want to implement TODO

lua_State *La = luaL_newstate();
luaL_openlibs(La);

luaL_dostring(La, "x = 10");
luaL_dostring(La, "function hello() print(x) end");
lua_getglobal(La, "hello");
lua_call(La, 0, 0); // Expected to print 10

lua_State *Lb = luaL_newstate();
luaL_openlibs(Lb);

// TODO: copy La hello to Lb hello

lua_getglobal(Lb, "hello");
lua_call(Lb, 0, 0); // Expected to print nil

lua_close(La);
lua_close(Lb);
```


问:
How can i create unique together based on a field in Django
This is my code:

class Address(models.Model):
    customer = models.ForeignKey(Customer, related_name='addresses',
                                 on_delete=models.CASCADE)
    lat = models.FloatField()
    long = models.FloatField()
    ...

    class Meta:
        constraints = [
            UniqueConstraint(fields=['lat', 'long'], name='lat_long_unique')

```
<p>I want the field lat long unique together but just with the same customer, how can I achieve that?</p>
<p>I tried :</p>
<pre class="lang-py prettyprint-override"><code>fields=['customer', 'lat', 'long']
</code>```

And didn't validate at all

Edit, data example :
let's say I already have the:

```<code>cust1 lat1 long1
cust2 lat2 long2
</code>```

with UniqueConstraint(fields=['lat', 'long'] if I insert cust3 lat1 long1 its returns the below error:

```<code>address with lat long already exist
</code>```

with

unique_together('customer', 'lat', 'long')
```
<p>or</p>
<pre class="lang-py prettyprint-override"><code>unique_together(('customer', 'lat',), ('customer','long',))
</code>```

if I insert cust1 lat1 long1 its successful to add

Edit:

When adding a customer in the constraint field and after migrating.I got the following error when enter the same value

```<code>IntegrityError at /customers/addresses/add/

duplicate key value violates unique constraint "customer_lat_long_unique"
DETAIL: Key(lat, long, customer_id)=(-6.241181999999999, 106.814273, 2) already exists.
</code>```

But I didn't get the same debug-page error when only lat and long in constraint field. I just handle it in the template with {{form.non_field_errors}} returning:

```<code>Addresses with this lat long already exist.
</code>```

Body:
This is my code:

class Address(models.Model):
    customer = models.ForeignKey(Customer, related_name='addresses',
                                 on_delete=models.CASCADE)
    lat = models.FloatField()
    long = models.FloatField()
    ...

    class Meta:
        constraints = [
            UniqueConstraint(fields=['lat', 'long'], name='lat_long_unique')

I want the field lat long unique together but just with the same customer, how can I achieve that?

I tried :

fields=['customer', 'lat', 'long']

And didn't validate at all

Edit, data example :
let's say I already have the:

cust1 lat1 long1
cust2 lat2 long2

with UniqueConstraint(fields=['lat', 'long'] if I insert cust3 lat1 long1 its returns the below error:

address with lat long already exist

with

unique_together('customer', 'lat', 'long')

or

unique_together(('customer', 'lat',), ('customer','long',))

if I insert cust1 lat1 long1 its successful to add

Edit:

When adding a customer in the constraint field and after migrating.I got the following error when enter the same value

IntegrityError at /customers/addresses/add/

duplicate key value violates unique constraint "customer_lat_long_unique"
DETAIL: Key(lat, long, customer_id)=(-6.241181999999999, 106.814273, 2) already exists.

But I didn't get the same debug-page error when only lat and long in constraint field. I just handle it in the template with {{form.non_field_errors}} returning:

Addresses with this lat long already exist.


问:
.net 6 web API project still requires older hosting bundle to run
I had Web API project which was hosted on IIS on windows server 2012.
I migrated the project to .net 6.
The application runs successfully. However when I remove older version of windows hosting bundle (2.1) the application stops functioning.
It's not just with my applicaiton. To test I created a dummy fresh web api in .net 6, and it also stopped functioning on removal of older .net bundle.</p>


问:
Estimating discretization step from noisy timeseries
We have a sensor that measures some physical process that sends the value via PWM. As the sensor discretize the data, when reading the PWM signal we should only see the value in discrete steps. For example, when the signal varies from 200 to 400, we will not see  all possible values between 200 and 400, but rather values like 200 225 250 ... 375 400  indicating the discretization step of 25.

However our PWM reader is noisy resulting in values like 198 224 261 275 etc. What is the correct way to estimate the discretization step and parameters of the noise assuming the noise is Gaussian?

I suppose we can just enumerate all the possible steps, then for each step calculate reminders of values divided by the step. Then the discretization step should be the step when the remainders produce the best fit to Gaussian. For the best fit I suppose we can take the least sum of minimal squares from the Gaussian based on reminders.

The obvious problem with this naive approach is that both step and step / 2 may produce the same fit. That can be taken care I suppose by reducing a possible step range based on some guess. But perhaps this naive approach based on remainders is not the proper way to deal with the problem?

In our case typical histogram of data points is given bellow. As we suspect that the step and parameters of the noise depend on environmental conditions we prefer not to mix data from different runs limiting the data amount.

```<code>value   count
682     2
775     8
776     14
807     7
838     3
868     1
869     2
900     1
931     3
993     2
1024    2
1055    2
1117    3
1179    2
1210    1
1241    1
1272    2
1303    1
1334    1
1365    2
1397    1
1427    1
1428    2
1458    1
1521    2
1551    1
1552    1
1583    1
1614    1
1645    1
1676    1
1707    3
1738    1
1769    1
1800    2
1831    1
1862    3
1893    1
1924    2
1955    1
1986    2
2047    1
2048    2
2079    1
2111    1
2141    1
2142    1
2173    1
2204    2
2234    1
2235    2
2266    1
2297    1
2325    1
2359    2
2390    3
2483    3
2514    2
2545    1
2575    1
2607    2
2638    3
2669    1
2731    4
2762    2
2794    2
2823    1
2825    1
2854    1
2858    1
2889    1
2918    2
2980    3
3011    2
3042    2
3071    1
3073    1
3104    2
3134    2
3135    1
3197    3
3228    1
3259    1
3287    1
3289    1
3290    2
3321    2
3351    1
3352    2
3383    1
3414    1
3445    4
3506    1
3508    3
3539    1
3570    3
3601    2
3630    1
3632    1
3661    1
3663    2
3694    2
3723    1
3725    2
3754    2
3756    2
3785    16
3787    7
3818    45
3820    1
3822    1
3825    2
3849    3
3880    2
3911    1
3942    3
3971    1
3973    2
4002    1
4004    2
4035    5
4095    1
4097    3
4128    2
4152    1
4157    2
4191    2
4220    1
4222    1
4251    1
4253    3
4276    1
4313    1
4315    4
4344    1
4346    3
4375    3
4377    4
</code>```

Body:
We have a sensor that measures some physical process that sends the value via PWM. As the sensor discretize the data, when reading the PWM signal we should only see the value in discrete steps. For example, when the signal varies from 200 to 400, we will not see  all possible values between 200 and 400, but rather values like 200 225 250 ... 375 400  indicating the discretization step of 25.

However our PWM reader is noisy resulting in values like 198 224 261 275 etc. What is the correct way to estimate the discretization step and parameters of the noise assuming the noise is Gaussian?

I suppose we can just enumerate all the possible steps, then for each step calculate reminders of values divided by the step. Then the discretization step should be the step when the remainders produce the best fit to Gaussian. For the best fit I suppose we can take the least sum of minimal squares from the Gaussian based on reminders.

The obvious problem with this naive approach is that both step and step / 2 may produce the same fit. That can be taken care I suppose by reducing a possible step range based on some guess. But perhaps this naive approach based on remainders is not the proper way to deal with the problem?

In our case typical histogram of data points is given bellow. As we suspect that the step and parameters of the noise depend on environmental conditions we prefer not to mix data from different runs limiting the data amount.

value   count
682     2
775     8
776     14
807     7
838     3
868     1
869     2
900     1
931     3
993     2
1024    2
1055    2
1117    3
1179    2
1210    1
1241    1
1272    2
1303    1
1334    1
1365    2
1397    1
1427    1
1428    2
1458    1
1521    2
1551    1
1552    1
1583    1
1614    1
1645    1
1676    1
1707    3
1738    1
1769    1
1800    2
1831    1
1862    3
1893    1
1924    2
1955    1
1986    2
2047    1
2048    2
2079    1
2111    1
2141    1
2142    1
2173    1
2204    2
2234    1
2235    2
2266    1
2297    1
2325    1
2359    2
2390    3
2483    3
2514    2
2545    1
2575    1
2607    2
2638    3
2669    1
2731    4
2762    2
2794    2
2823    1
2825    1
2854    1
2858    1
2889    1
2918    2
2980    3
3011    2
3042    2
3071    1
3073    1
3104    2
3134    2
3135    1
3197    3
3228    1
3259    1
3287    1
3289    1
3290    2
3321    2
3351    1
3352    2
3383    1
3414    1
3445    4
3506    1
3508    3
3539    1
3570    3
3601    2
3630    1
3632    1
3661    1
3663    2
3694    2
3723    1
3725    2
3754    2
3756    2
3785    16
3787    7
3818    45
3820    1
3822    1
3825    2
3849    3
3880    2
3911    1
3942    3
3971    1
3973    2
4002    1
4004    2
4035    5
4095    1
4097    3
4128    2
4152    1
4157    2
4191    2
4220    1
4222    1
4251    1
4253    3
4276    1
4313    1
4315    4
4344    1
4346    3
4375    3
4377    4


问:
How to add unity generated (xcode) project to another xcode project?
I have just created a unity application and exported that to xcode.

How can I add the exported project to another xcode project and add the view created in unity on top of window?

I have added and removed all the compile time errors, but when I run the application and try to load the view created in unity, the application crashes and I receive this error:

The assembly mscorlib.dll was not found or could not be loaded

Any kind of help would be very much appreciated

ContentLicense: CC BY-SA 3.0


问:
How can I fix this npm error? npm ERR! Windows_NT 10.0.19044
I'm trying to make a .so file with node.js to be able to make an App but I don't know what the error is, this is the cmd response.
supposedly the binding.gyp file is configured correctly, I show it below and it is saved as .JSON
{ "targets": [ { "target_name": "App", "sources": [ "src/HR_PluginsMgr.cpp"] } ] }

and this is what the cmd shows me when I enter the command node-gyp configure

gyp: binding.gyp not found (cwd: C:\Users\Cuexus\Desktop\test 1) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Cuexus\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:325:16)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Cuexus\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "configure"
gyp ERR! cwd C:\Users\Cuexus\Desktop\test 1
gyp ERR! node -v v18.12.1
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok

I have supposedly installed everything it asked for, I have removed and put the package-lock.json file
I think I have downloaded and uploaded the versions of node, python and visual studio.
In theory, everything is in the same folder.
the truth that I am not sure of anything anymore


问:
Vue component library calls debug-js for node in browser
I have a problem in a vue project I have I´m in the process of breaking out components into a components library.

i get this error message when i consume components from my local components library.

```<code>Uncaught TypeError: Cannot read properties of undefined (reading 'fd')
    at Function.useColors
</code>```

looking where that is in the code i find this

```<code>/**
 * Is stdout a TTY? Colored output is enabled when `true`.
 */

function useColors() {
  return 'colors' in exports.inspectOpts
    ? Boolean(exports.inspectOpts.colors)
    : tty__default["default"].isatty(process.stderr.fd);
}
</code>```

and a litle googling later it is my understanding is that this code is debug-js for node and that other people have gotten the same error in the past. The solution in the old thread  is something with babeland how to resolve modules  but i do not seem to be able to find out how to do it for rollup.

Manipulating the bundled code manually so the function returns false makes the code run with no problem but i really do not want to do that

How can I fix this the right way. It seems like I miss something super basic that i for some reason cant find the answer to.

package.json

```<code>{
  "name": "local-vue-components",
  "version": "0.1.0",
  "main": "lib/index.js",
  "module": "lib/index.esm.js",
  "scripts": {
    "build": "rollup -c"
  },
  "peerDependencies": {
    "vue": "^2.6.11",
    "vue-class-component": "^7.2.3",
    "vue-property-decorator": "^8.4.2"
  },
  "dependencies": {
    "local-library":"*"
  },
  "devDependencies": {
    "vue": "^2.6.11",
    "vue-class-component": "^7.2.3",
    "vue-property-decorator": "^8.4.2",
    "@rollup/plugin-commonjs": "^14.0.0",
    "@rollup/plugin-node-resolve": "^8.4.0",
    "@rollup/plugin-json":"^5.0.1",
    "@vue/compiler-sfc": "^3.0.0-rc.5",
    "rollup": "^2.23.1",
    "rollup-plugin-peer-deps-external": "^2.2.3",
    "rollup-plugin-typescript2": "^0.27.2",
    "rollup-plugin-vue": "^5.1.6",
    "typescript": "^3.9.7",
    "vue-template-compiler": "^2.6.11"
  }
}
</code>```

rollup.config.js

```<code>import peerDepsExternal from "rollup-plugin-peer-deps-external";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "rollup-plugin-typescript2";
import vue from "rollup-plugin-vue";
import json from "@rollup/plugin-json";

import packageJson from "./package.json";

export default {
  input: "src/index.ts",
  output: [
    {
      format: "cjs",
      file: packageJson.main,
      sourcemap: true
    },
    {
       format: "esm",
       file: packageJson.module,
       sourcemap: true
    }
  ],
  plugins: [peerDepsExternal(), resolve(), commonjs(), typescript(),json(),vue()]
};
</code>```

I realise it can also be a problem with the consuming project that uses babel and Webpack with the configs below.

babelrc.js

```<code>module.exports = function (api) {
    const presets = [
        '@babel/preset-env',
        {
            targets: {
                chrome: "70"
            }
        }
    ];
    return presets;
}
</code>```

webpack.js

```<code>const path = require("path");

const CopyWebpackPlugin = require('copy-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

require("@babel/register");

module.exports = {
  entry: {
    babelPollyfill: "@babel/polyfill",
    jprApp: "./src/app/main.ts",
    '
  },
  resolve: {
    extensions: [".js", ".ts", ".json"],
    mainFields: ["browser", "main"],
    alias: {
      vue$: "vue/dist/vue.esm.js"
    }
  },
  module: {
    rules: [
      {
        test: /\.(css)$/,
        use: [
        {
          loader: 'file-loader',
          options: {
            name: '[name].css',
          }
        }, {
            loader: 'extract-loader'
        }, {
          loader: 'css-loader',
        }, {
          loader: 'postcss-loader',
        }
      ]
      },
      {
        enforce: "pre",
        use: ["source-map-loader"],
        test: /\.js$/
      },
      {
        test: /\.ts$/,
        use: 'ts-loader',
        exclude: [/node_modules/,/__test__/]
      },
      {
        test: /\.render\.js$/,
        use: ["file-loader"]
      },
      {
        test: /\.m?js$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: "babel-loader",
        }
      }
    ]
  },
  output: {
    publicPath: "",
    filename: "[name].js",
    path: path.resolve(__dirname, "dist")
  },
  plugins: [

    new NodePolyfillPlugin(),

  ]
};

</code>```

Body:
I have a problem in a vue project I have I´m in the process of breaking out components into a components library.

i get this error message when i consume components from my local components library.

Uncaught TypeError: Cannot read properties of undefined (reading 'fd')
    at Function.useColors

looking where that is in the code i find this

/**
 * Is stdout a TTY? Colored output is enabled when `true`.
 */

function useColors() {
  return 'colors' in exports.inspectOpts
    ? Boolean(exports.inspectOpts.colors)
    : tty__default["default"].isatty(process.stderr.fd);
}

and a litle googling later it is my understanding is that this code is debug-js for node and that other people have gotten the same error in the past. The solution in the old thread  is something with babeland how to resolve modules  but i do not seem to be able to find out how to do it for rollup.

Manipulating the bundled code manually so the function returns false makes the code run with no problem but i really do not want to do that

How can I fix this the right way. It seems like I miss something super basic that i for some reason cant find the answer to.

package.json

{
  "name": "local-vue-components",
  "version": "0.1.0",
  "main": "lib/index.js",
  "module": "lib/index.esm.js",
  "scripts": {
    "build": "rollup -c"
  },
  "peerDependencies": {
    "vue": "^2.6.11",
    "vue-class-component": "^7.2.3",
    "vue-property-decorator": "^8.4.2"
  },
  "dependencies": {
    "local-library":"*"
  },
  "devDependencies": {
    "vue": "^2.6.11",
    "vue-class-component": "^7.2.3",
    "vue-property-decorator": "^8.4.2",
    "@rollup/plugin-commonjs": "^14.0.0",
    "@rollup/plugin-node-resolve": "^8.4.0",
    "@rollup/plugin-json":"^5.0.1",
    "@vue/compiler-sfc": "^3.0.0-rc.5",
    "rollup": "^2.23.1",
    "rollup-plugin-peer-deps-external": "^2.2.3",
    "rollup-plugin-typescript2": "^0.27.2",
    "rollup-plugin-vue": "^5.1.6",
    "typescript": "^3.9.7",
    "vue-template-compiler": "^2.6.11"
  }
}

rollup.config.js

import peerDepsExternal from "rollup-plugin-peer-deps-external";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "rollup-plugin-typescript2";
import vue from "rollup-plugin-vue";
import json from "@rollup/plugin-json";

import packageJson from "./package.json";

export default {
  input: "src/index.ts",
  output: [
    {
      format: "cjs",
      file: packageJson.main,
      sourcemap: true
    },
    {
       format: "esm",
       file: packageJson.module,
       sourcemap: true
    }
  ],
  plugins: [peerDepsExternal(), resolve(), commonjs(), typescript(),json(),vue()]
};

I realise it can also be a problem with the consuming project that uses babel and Webpack with the configs below.

babelrc.js

module.exports = function (api) {
    const presets = [
        '@babel/preset-env',
        {
            targets: {
                chrome: "70"
            }
        }
    ];
    return presets;
}

webpack.js

const path = require("path");

const CopyWebpackPlugin = require('copy-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

require("@babel/register");

module.exports = {
  entry: {
    babelPollyfill: "@babel/polyfill",
    jprApp: "./src/app/main.ts",
    '
  },
  resolve: {
    extensions: [".js", ".ts", ".json"],
    mainFields: ["browser", "main"],
    alias: {
      vue$: "vue/dist/vue.esm.js"
    }
  },
  module: {
    rules: [
      {
        test: /\.(css)$/,
        use: [
        {
          loader: 'file-loader',
          options: {
            name: '[name].css',
          }
        }, {
            loader: 'extract-loader'
        }, {
          loader: 'css-loader',
        }, {
          loader: 'postcss-loader',
        }
      ]
      },
      {
        enforce: "pre",
        use: ["source-map-loader"],
        test: /\.js$/
      },
      {
        test: /\.ts$/,
        use: 'ts-loader',
        exclude: [/node_modules/,/__test__/]
      },
      {
        test: /\.render\.js$/,
        use: ["file-loader"]
      },
      {
        test: /\.m?js$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: "babel-loader",
        }
      }
    ]
  },
  output: {
    publicPath: "",
    filename: "[name].js",
    path: path.resolve(__dirname, "dist")
  },
  plugins: [

    new NodePolyfillPlugin(),

  ]
};


问:
OnRepeatAnimation event doesn't work on iOS - Xamarin Forms AnimationView from AirBnb
So I have been trying to create compositions of the animations, where I will turn on and off one particular animation according to how many times the animation is repeated, and according to some other enum statuses, but on iOS, OnRepeatAnimation event is not triggering at all, so any help here!</p>
```<code><forms:AnimationView
    HeightRequest="{Binding Source={RelativeSource AncestorType={x:Type viewModels:HomePageViewModel}}, Path=PresenceSimulationLoaderCircleSize}"
    WidthRequest="{Binding Source={RelativeSource AncestorType={x:Type viewModels:HomePageViewModel}}, Path=PresenceSimulationLoaderCircleSize}"
    Margin="5,6,0,0"
    HorizontalOptions="CenterAndExpand"
    VerticalOptions="CenterAndExpand"
    AnimationSource="AssetOrBundle"
    Scale="1.6"
    RepeatMode="Infinite"
    IsVisible="{Binding AnimationStatus, Converter={StaticResource AnimationIsEndingShouldBeActive}}"
    OnRepeatAnimation="TurnOffTheAnimationOnEnd"
    OnStopAnimation="TurnOnTheAnimationBeforeEnd"
    Animation="{DynamicResource LoaderEndAnimation}"
/>
</code>```

Body:
So I have been trying to create compositions of the animations, where I will turn on and off one particular animation according to how many times the animation is repeated, and according to some other enum statuses, but on iOS, OnRepeatAnimation event is not triggering at all, so any help here!

<forms:AnimationView
    HeightRequest="{Binding Source={RelativeSource AncestorType={x:Type viewModels:HomePageViewModel}}, Path=PresenceSimulationLoaderCircleSize}"
    WidthRequest="{Binding Source={RelativeSource AncestorType={x:Type viewModels:HomePageViewModel}}, Path=PresenceSimulationLoaderCircleSize}"
    Margin="5,6,0,0"
    HorizontalOptions="CenterAndExpand"
    VerticalOptions="CenterAndExpand"
    AnimationSource="AssetOrBundle"
    Scale="1.6"
    RepeatMode="Infinite"
    IsVisible="{Binding AnimationStatus, Converter={StaticResource AnimationIsEndingShouldBeActive}}"
    OnRepeatAnimation="TurnOffTheAnimationOnEnd"
    OnStopAnimation="TurnOnTheAnimationBeforeEnd"
    Animation="{DynamicResource LoaderEndAnimation}"
/>


问:
Imported Holiday List not shown in API call
I have imported holiday list ( .ical file)  form 2022 to 2030 and I can see holiday in my calendar view.

But when I try to fetch holiday for 2024 and higher year then API not render the result.

https://www.googleapis.com/calendar/v3/calendars/en.usa%23holiday%40group.v.calendar.google.com/events?key=AIzaSyC0Z8thEw_OB6G6v0jPQNLgvCfNyokNQto&timeMin=2022-01-01T00:00:00Z&timMax=2024-12-01

It's only work for 2023 and lower.

please guide here for how to not render result for 2024 and higher year.

Thank You!