问:
Update Token Information Page
I did the first 2 steps, verifying the contract address, but because I didn't know much about smart contracts before, I also created many wallets,enter image description here now the last step is to verify the signature, I don't know I used the wallet  any.  .  Can anyone guide me to redo or what is possible in my case?  Thank you very much alone!  help</p>
```<code>/**
 *Submitted for verification at Etherscan.io on 2017-11-28
*/

pragma solidity ^0.4.17;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }
        uint256 c = a * b;
        assert(c / a == b);
        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }
}

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
    address public owner;

    /**
      * @dev The Ownable constructor sets the original `owner` of the contract to the sender
      * account.
      */
    function Ownable() public {
        owner = msg.sender;
    }

    /**
      * @dev Throws if called by any account other than the owner.
      */
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    /**
    * @dev Allows the current owner to transfer control of the contract to a newOwner.
    * @param newOwner The address to transfer ownership to.
    */
    function transferOwnership(address newOwner) public onlyOwner {
        if (newOwner != address(0)) {
            owner = newOwner;
        }
    }

}

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20Basic {
    uint public _totalSupply;
    function totalSupply() public constant returns (uint);
    function balanceOf(address who) public constant returns (uint);
    function transfer(address to, uint value) public;
    event Transfer(address indexed from, address indexed to, uint value);
}

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
    function allowance(address owner, address spender) public constant returns (uint);
    function transferFrom(address from, address to, uint value) public;
    function approve(address spender, uint value) public;
    event Approval(address indexed owner, address indexed spender, uint value);
}

/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances.
 */
contract BasicToken is Ownable, ERC20Basic {
    using SafeMath for uint;

    mapping(address => uint) public balances;

    // additional variables for use if transaction fees ever became necessary
    uint public basisPointsRate = 0;
    uint public maximumFee = 0;

    /**
    * @dev Fix for the ERC20 short address attack.
    */
    modifier onlyPayloadSize(uint size) {
        require(!(msg.data.length < size + 4));
        _;
    }

    /**
    * @dev transfer token for a specified address
    * @param _to The address to transfer to.
    * @param _value The amount to be transferred.
    */
    function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
        uint fee = (_value.mul(basisPointsRate)).div(10000);
        if (fee > maximumFee) {
            fee = maximumFee;
        }
        uint sendAmount = _value.sub(fee);
        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(sendAmount);
        if (fee > 0) {
            balances[owner] = balances[owner].add(fee);
            Transfer(msg.sender, owner, fee);
        }
        Transfer(msg.sender, _to, sendAmount);
    }

    /**
    * @dev Gets the balance of the specified address.
    * @param _owner The address to query the the balance of.
    * @return An uint representing the amount owned by the passed address.
    */
    function balanceOf(address _owner) public constant returns (uint balance) {
        return balances[_owner];
    }

}

/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * @dev https://github.com/ethereum/EIPs/issues/20
 * @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is BasicToken, ERC20 {

    mapping (address => mapping (address => uint)) public allowed;

    uint public constant MAX_UINT = 2**256 - 1;

    /**
    * @dev Transfer tokens from one address to another
    * @param _from address The address which you want to send tokens from
    * @param _to address The address which you want to transfer to
    * @param _value uint the amount of tokens to be transferred
    */
    function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
        var _allowance = allowed[_from][msg.sender];

        // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
        // if (_value > _allowance) throw;

        uint fee = (_value.mul(basisPointsRate)).div(10000);
        if (fee > maximumFee) {
            fee = maximumFee;
        }
        if (_allowance < MAX_UINT) {
            allowed[_from][msg.sender] = _allowance.sub(_value);
        }
        uint sendAmount = _value.sub(fee);
        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(sendAmount);
        if (fee > 0) {
            balances[owner] = balances[owner].add(fee);
            Transfer(_from, owner, fee);
        }
        Transfer(_from, _to, sendAmount);
    }

    /**
    * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
    * @param _spender The address which will spend the funds.
    * @param _value The amount of tokens to be spent.
    */
    function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {

        // To change the approve amount you first have to reduce the addresses`
        //  allowance to zero by calling `approve(_spender, 0)` if it is not
        //  already 0 to mitigate the race condition described here:
        //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
        require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));

        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
    }

    /**
    * @dev Function to check the amount of tokens than an owner allowed to a spender.
    * @param _owner address The address which owns the funds.
    * @param _spender address The address which will spend the funds.
    * @return A uint specifying the amount of tokens still available for the spender.
    */
    function allowance(address _owner, address _spender) public constant returns (uint remaining) {
        return allowed[_owner][_spender];
    }

}

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
  event Pause();
  event Unpause();

  bool public paused = false;

  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    require(paused);
    _;
  }

  /**
   * @dev called by the owner to pause, triggers stopped state
   */
  function pause() onlyOwner whenNotPaused public {
    paused = true;
    Pause();
  }

  /**
   * @dev called by the owner to unpause, returns to normal state
   */
  function unpause() onlyOwner whenPaused public {
    paused = false;
    Unpause();
  }
}

contract BlackList is Ownable, BasicToken {

    /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) ///////
    function getBlackListStatus(address _maker) external constant returns (bool) {
        return isBlackListed[_maker];
    }

    function getOwner() external constant returns (address) {
        return owner;
    }

    mapping (address => bool) public isBlackListed;

    function addBlackList (address _evilUser) public onlyOwner {
        isBlackListed[_evilUser] = true;
        AddedBlackList(_evilUser);
    }

    function removeBlackList (address _clearedUser) public onlyOwner {
        isBlackListed[_clearedUser] = false;
        RemovedBlackList(_clearedUser);
    }

    function destroyBlackFunds (address _blackListedUser) public onlyOwner {
        require(isBlackListed[_blackListedUser]);
        uint dirtyFunds = balanceOf(_blackListedUser);
        balances[_blackListedUser] = 0;
        _totalSupply -= dirtyFunds;
        DestroyedBlackFunds(_blackListedUser, dirtyFunds);
    }

    event DestroyedBlackFunds(address _blackListedUser, uint _balance);

    event AddedBlackList(address _user);

    event RemovedBlackList(address _user);

}

contract UpgradedStandardToken is StandardToken{
    // those methods are called by the legacy contract
    // and they must ensure msg.sender to be the contract address
    function transferByLegacy(address from, address to, uint value) public;
    function transferFromByLegacy(address sender, address from, address spender, uint value) public;
    function approveByLegacy(address from, address spender, uint value) public;
}

contract TetherToken is Pausable, StandardToken, BlackList {

    string public name;
    string public symbol;
    uint public decimals;
    address public upgradedAddress;
    bool public deprecated;

    //  The contract can be initialized with a number of tokens
    //  All the tokens are deposited to the owner address
    //
    // @param _balance Initial supply of the contract
    // @param _name Token Name
    // @param _symbol Token symbol
    // @param _decimals Token decimals
    function TetherToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
        _totalSupply = _initialSupply;
        name = _name;
        symbol = _symbol;
        decimals = _decimals;
        balances[owner] = _initialSupply;
        deprecated = false;
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function transfer(address _to, uint _value) public whenNotPaused {
        require(!isBlackListed[msg.sender]);
        if (deprecated) {
            return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
        } else {
            return super.transfer(_to, _value);
        }
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function transferFrom(address _from, address _to, uint _value) public whenNotPaused {
        require(!isBlackListed[_from]);
        if (deprecated) {
            return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
        } else {
            return super.transferFrom(_from, _to, _value);
        }
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function balanceOf(address who) public constant returns (uint) {
        if (deprecated) {
            return UpgradedStandardToken(upgradedAddress).balanceOf(who);
        } else {
            return super.balanceOf(who);
        }
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
        if (deprecated) {
            return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
        } else {
            return super.approve(_spender, _value);
        }
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function allowance(address _owner, address _spender) public constant returns (uint remaining) {
        if (deprecated) {
            return StandardToken(upgradedAddress).allowance(_owner, _spender);
        } else {
            return super.allowance(_owner, _spender);
        }
    }

    // deprecate current contract in favour of a new one
    function deprecate(address _upgradedAddress) public onlyOwner {
        deprecated = true;
        upgradedAddress = _upgradedAddress;
        Deprecate(_upgradedAddress);
    }

    // deprecate current contract if favour of a new one
    function totalSupply() public constant returns (uint) {
        if (deprecated) {
            return StandardToken(upgradedAddress).totalSupply();
        } else {
            return _totalSupply;
        }
    }

    // Issue a new amount of tokens
    // these tokens are deposited into the owner address
    //
    // @param _amount Number of tokens to be issued
    function issue(uint amount) public onlyOwner {
        require(_totalSupply + amount > _totalSupply);
        require(balances[owner] + amount > balances[owner]);

        balances[owner] += amount;
        _totalSupply += amount;
        Issue(amount);
    }

    // Redeem tokens.
    // These tokens are withdrawn from the owner address
    // if the balance must be enough to cover the redeem
    // or the call will fail.
    // @param _amount Number of tokens to be issued
    function redeem(uint amount) public onlyOwner {
        require(_totalSupply >= amount);
        require(balances[owner] >= amount);

        _totalSupply -= amount;
        balances[owner] -= amount;
        Redeem(amount);
    }

    function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
        // Ensure transparency by hardcoding limit beyond which fees can never be added
        require(newBasisPoints < 20);
        require(newMaxFee < 50);

        basisPointsRate = newBasisPoints;
        maximumFee = newMaxFee.mul(10**decimals);

        Params(basisPointsRate, maximumFee);
    }

    // Called when new token are issued
    event Issue(uint amount);

    // Called when tokens are redeemed
    event Redeem(uint amount);

    // Called when contract is deprecated
    event Deprecate(address newAddress);

    // Called if contract ever adds fees
    event Params(uint feeBasisPoints, uint maxFee);
}
</code>```

Title: Update Token Information Page

Body:
I did the first 2 steps, verifying the contract address, but because I didn't know much about smart contracts before, I also created many wallets,enter image description here now the last step is to verify the signature, I don't know I used the wallet  any.  .  Can anyone guide me to redo or what is possible in my case?  Thank you very much alone!  help

/**
 *Submitted for verification at Etherscan.io on 2017-11-28
*/

pragma solidity ^0.4.17;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }
        uint256 c = a * b;
        assert(c / a == b);
        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }
}

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
    address public owner;

    /**
      * @dev The Ownable constructor sets the original `owner` of the contract to the sender
      * account.
      */
    function Ownable() public {
        owner = msg.sender;
    }

    /**
      * @dev Throws if called by any account other than the owner.
      */
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    /**
    * @dev Allows the current owner to transfer control of the contract to a newOwner.
    * @param newOwner The address to transfer ownership to.
    */
    function transferOwnership(address newOwner) public onlyOwner {
        if (newOwner != address(0)) {
            owner = newOwner;
        }
    }

}

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20Basic {
    uint public _totalSupply;
    function totalSupply() public constant returns (uint);
    function balanceOf(address who) public constant returns (uint);
    function transfer(address to, uint value) public;
    event Transfer(address indexed from, address indexed to, uint value);
}

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
    function allowance(address owner, address spender) public constant returns (uint);
    function transferFrom(address from, address to, uint value) public;
    function approve(address spender, uint value) public;
    event Approval(address indexed owner, address indexed spender, uint value);
}

/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances.
 */
contract BasicToken is Ownable, ERC20Basic {
    using SafeMath for uint;

    mapping(address => uint) public balances;

    // additional variables for use if transaction fees ever became necessary
    uint public basisPointsRate = 0;
    uint public maximumFee = 0;

    /**
    * @dev Fix for the ERC20 short address attack.
    */
    modifier onlyPayloadSize(uint size) {
        require(!(msg.data.length < size + 4));
        _;
    }

    /**
    * @dev transfer token for a specified address
    * @param _to The address to transfer to.
    * @param _value The amount to be transferred.
    */
    function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
        uint fee = (_value.mul(basisPointsRate)).div(10000);
        if (fee > maximumFee) {
            fee = maximumFee;
        }
        uint sendAmount = _value.sub(fee);
        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(sendAmount);
        if (fee > 0) {
            balances[owner] = balances[owner].add(fee);
            Transfer(msg.sender, owner, fee);
        }
        Transfer(msg.sender, _to, sendAmount);
    }

    /**
    * @dev Gets the balance of the specified address.
    * @param _owner The address to query the the balance of.
    * @return An uint representing the amount owned by the passed address.
    */
    function balanceOf(address _owner) public constant returns (uint balance) {
        return balances[_owner];
    }

}

/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * @dev https://github.com/ethereum/EIPs/issues/20
 * @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is BasicToken, ERC20 {

    mapping (address => mapping (address => uint)) public allowed;

    uint public constant MAX_UINT = 2**256 - 1;

    /**
    * @dev Transfer tokens from one address to another
    * @param _from address The address which you want to send tokens from
    * @param _to address The address which you want to transfer to
    * @param _value uint the amount of tokens to be transferred
    */
    function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
        var _allowance = allowed[_from][msg.sender];

        // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
        // if (_value > _allowance) throw;

        uint fee = (_value.mul(basisPointsRate)).div(10000);
        if (fee > maximumFee) {
            fee = maximumFee;
        }
        if (_allowance < MAX_UINT) {
            allowed[_from][msg.sender] = _allowance.sub(_value);
        }
        uint sendAmount = _value.sub(fee);
        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(sendAmount);
        if (fee > 0) {
            balances[owner] = balances[owner].add(fee);
            Transfer(_from, owner, fee);
        }
        Transfer(_from, _to, sendAmount);
    }

    /**
    * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
    * @param _spender The address which will spend the funds.
    * @param _value The amount of tokens to be spent.
    */
    function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {

        // To change the approve amount you first have to reduce the addresses`
        //  allowance to zero by calling `approve(_spender, 0)` if it is not
        //  already 0 to mitigate the race condition described here:
        //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
        require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));

        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
    }

    /**
    * @dev Function to check the amount of tokens than an owner allowed to a spender.
    * @param _owner address The address which owns the funds.
    * @param _spender address The address which will spend the funds.
    * @return A uint specifying the amount of tokens still available for the spender.
    */
    function allowance(address _owner, address _spender) public constant returns (uint remaining) {
        return allowed[_owner][_spender];
    }

}

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
  event Pause();
  event Unpause();

  bool public paused = false;

  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    require(paused);
    _;
  }

  /**
   * @dev called by the owner to pause, triggers stopped state
   */
  function pause() onlyOwner whenNotPaused public {
    paused = true;
    Pause();
  }

  /**
   * @dev called by the owner to unpause, returns to normal state
   */
  function unpause() onlyOwner whenPaused public {
    paused = false;
    Unpause();
  }
}

contract BlackList is Ownable, BasicToken {

    /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) ///////
    function getBlackListStatus(address _maker) external constant returns (bool) {
        return isBlackListed[_maker];
    }

    function getOwner() external constant returns (address) {
        return owner;
    }

    mapping (address => bool) public isBlackListed;

    function addBlackList (address _evilUser) public onlyOwner {
        isBlackListed[_evilUser] = true;
        AddedBlackList(_evilUser);
    }

    function removeBlackList (address _clearedUser) public onlyOwner {
        isBlackListed[_clearedUser] = false;
        RemovedBlackList(_clearedUser);
    }

    function destroyBlackFunds (address _blackListedUser) public onlyOwner {
        require(isBlackListed[_blackListedUser]);
        uint dirtyFunds = balanceOf(_blackListedUser);
        balances[_blackListedUser] = 0;
        _totalSupply -= dirtyFunds;
        DestroyedBlackFunds(_blackListedUser, dirtyFunds);
    }

    event DestroyedBlackFunds(address _blackListedUser, uint _balance);

    event AddedBlackList(address _user);

    event RemovedBlackList(address _user);

}

contract UpgradedStandardToken is StandardToken{
    // those methods are called by the legacy contract
    // and they must ensure msg.sender to be the contract address
    function transferByLegacy(address from, address to, uint value) public;
    function transferFromByLegacy(address sender, address from, address spender, uint value) public;
    function approveByLegacy(address from, address spender, uint value) public;
}

contract TetherToken is Pausable, StandardToken, BlackList {

    string public name;
    string public symbol;
    uint public decimals;
    address public upgradedAddress;
    bool public deprecated;

    //  The contract can be initialized with a number of tokens
    //  All the tokens are deposited to the owner address
    //
    // @param _balance Initial supply of the contract
    // @param _name Token Name
    // @param _symbol Token symbol
    // @param _decimals Token decimals
    function TetherToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
        _totalSupply = _initialSupply;
        name = _name;
        symbol = _symbol;
        decimals = _decimals;
        balances[owner] = _initialSupply;
        deprecated = false;
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function transfer(address _to, uint _value) public whenNotPaused {
        require(!isBlackListed[msg.sender]);
        if (deprecated) {
            return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
        } else {
            return super.transfer(_to, _value);
        }
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function transferFrom(address _from, address _to, uint _value) public whenNotPaused {
        require(!isBlackListed[_from]);
        if (deprecated) {
            return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
        } else {
            return super.transferFrom(_from, _to, _value);
        }
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function balanceOf(address who) public constant returns (uint) {
        if (deprecated) {
            return UpgradedStandardToken(upgradedAddress).balanceOf(who);
        } else {
            return super.balanceOf(who);
        }
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
        if (deprecated) {
            return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
        } else {
            return super.approve(_spender, _value);
        }
    }

    // Forward ERC20 methods to upgraded contract if this one is deprecated
    function allowance(address _owner, address _spender) public constant returns (uint remaining) {
        if (deprecated) {
            return StandardToken(upgradedAddress).allowance(_owner, _spender);
        } else {
            return super.allowance(_owner, _spender);
        }
    }

    // deprecate current contract in favour of a new one
    function deprecate(address _upgradedAddress) public onlyOwner {
        deprecated = true;
        upgradedAddress = _upgradedAddress;
        Deprecate(_upgradedAddress);
    }

    // deprecate current contract if favour of a new one
    function totalSupply() public constant returns (uint) {
        if (deprecated) {
            return StandardToken(upgradedAddress).totalSupply();
        } else {
            return _totalSupply;
        }
    }

    // Issue a new amount of tokens
    // these tokens are deposited into the owner address
    //
    // @param _amount Number of tokens to be issued
    function issue(uint amount) public onlyOwner {
        require(_totalSupply + amount > _totalSupply);
        require(balances[owner] + amount > balances[owner]);

        balances[owner] += amount;
        _totalSupply += amount;
        Issue(amount);
    }

    // Redeem tokens.
    // These tokens are withdrawn from the owner address
    // if the balance must be enough to cover the redeem
    // or the call will fail.
    // @param _amount Number of tokens to be issued
    function redeem(uint amount) public onlyOwner {
        require(_totalSupply >= amount);
        require(balances[owner] >= amount);

        _totalSupply -= amount;
        balances[owner] -= amount;
        Redeem(amount);
    }

    function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
        // Ensure transparency by hardcoding limit beyond which fees can never be added
        require(newBasisPoints < 20);
        require(newMaxFee < 50);

        basisPointsRate = newBasisPoints;
        maximumFee = newMaxFee.mul(10**decimals);

        Params(basisPointsRate, maximumFee);
    }

    // Called when new token are issued
    event Issue(uint amount);

    // Called when tokens are redeemed
    event Redeem(uint amount);

    // Called when contract is deprecated
    event Deprecate(address newAddress);

    // Called if contract ever adds fees
    event Params(uint feeBasisPoints, uint maxFee);
}


来源: stackexchange

问:
exoplayer does not play 3k videos.It gives decoder failed exception
If i initialise exoplayer without rendersfactory then high resolution videos gives decoders failed exception.
If i use default renders factory, videos are rotating sometime ,sometime not.

```<code>
exoPlayer = new ExoPlayer.Builder(holder.mVideoView.getContext()).setLoadControl(loadControl).build();

holder.mVideoView.setPlayer(exoPlayer);
holder.mVideoView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_ZOOM);
holder.mVideoView.setShutterBackgroundColor(Color.TRANSPARENT);
holder.mVideoView.setKeepContentOnPlayerReset(true);
exoPlayer.seekTo(0);
exoPlayer.setRepeatMode(Player.REPEAT_MODE_ONE);

 mediaSource = new ProgressiveMediaSource.Factory(
        new CacheDataSource.Factory()
                .setCache(SimpleMediaPlayer.getInstance(mContext))
                .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
                        .setUserAgent(mContext.getString(R.string.app_name)))
                .setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
).createMediaSource(MediaItem.fromUri(videoItem.videoURL));

exoPlayer.addMediaSource(mediaSource);

exoPlayer.prepare();

exoPlayer.setPlayWhenReady(true);
exoPlayer.play();
</code>```

I am releasing player in onviewdettached and initialising player in onViewAttached in recyclerview by calling holder.player.stop and then release correctly.

please help.

high resolution videos should play without exception.

ContentLicense: CC BY-SA 4.0

Body:
If i initialise exoplayer without rendersfactory then high resolution videos gives decoders failed exception.
If i use default renders factory, videos are rotating sometime ,sometime not.

exoPlayer = new ExoPlayer.Builder(holder.mVideoView.getContext()).setLoadControl(loadControl).build();

holder.mVideoView.setPlayer(exoPlayer);
holder.mVideoView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_ZOOM);
holder.mVideoView.setShutterBackgroundColor(Color.TRANSPARENT);
holder.mVideoView.setKeepContentOnPlayerReset(true);
exoPlayer.seekTo(0);
exoPlayer.setRepeatMode(Player.REPEAT_MODE_ONE);

 mediaSource = new ProgressiveMediaSource.Factory(
        new CacheDataSource.Factory()
                .setCache(SimpleMediaPlayer.getInstance(mContext))
                .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
                        .setUserAgent(mContext.getString(R.string.app_name)))
                .setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
).createMediaSource(MediaItem.fromUri(videoItem.videoURL));

exoPlayer.addMediaSource(mediaSource);

exoPlayer.prepare();

exoPlayer.setPlayWhenReady(true);
exoPlayer.play();

I am releasing player in onviewdettached and initialising player in onViewAttached in recyclerview by calling holder.player.stop and then release correctly.

please help.

high resolution videos should play without exception.


问:
add target point of a timeseries to 3dplot matplotlib
Based on the method plot_series in this notebook.
I would like to plot a timeseries in 3d where my points consist of x,y coordinates and time.
My problem is found when I go to plot the target point by raising the exception

```<code>     18     if y_true is not None:
---> 19         ax.plot3D(n_steps+1, x_true, y_true, "bo", markersize=10, label="Target")

TypeError: object of type 'int' has no len()
</code>```

my code is this, I have a 9 step timeseries and I would like to print the target point on the 10th step as well. How to do this?

```<code>from matplotlib.pyplot import figure

def plot_series(x_train, y_train, n_steps=10, x_true=None, y_true=None, x_pred=None, y_pred=None, x_label="$time$", y_label="$x$", z_label="$y$", legend=True):
    figure(figsize=(8, 6), dpi=80)
    ax = plt.axes(projection='3d')
    time = np.arange(start=0, stop=len(x_train), step=1)

    # base plot
    ax.plot3D(time, x_train, y_train, ".-")

    if y_true is not None:
        ax.plot3D(n_steps+1, x_true, y_true, "bo", markersize=10, label="Target")
    if y_pred is not None:
        ax.plot3D(n_steps+1, x_pred, y_pred, "rx", markersize=10, label="Prediction")

    ax.grid(True)
    if x_label:
        ax.set_xlabel(x_label, fontsize=16)
    if y_label:
        ax.set_ylabel(y_label, fontsize=16, rotation=0)
    if z_label:
        ax.set_zlabel(z_label, fontsize=16, rotation=0)

    if legend and (y_true or y_pred):
        ax.legend(fontsize=14, loc="upper left")

# single timseries on training set
x_r = [0.58114803 0.5591796  0.59348005 0.59550647 0.61035596 0.4759958 0.56246371 0.51623335 0.56018264]
y_r = [0.37528117 0.52601401 0.4105518  0.41212707 0.42236306 0.36568968 0.53288641 0.42619483 0.48411763]

# target point for that timeseries on training set
x_t = [0.60137904]
y_t = [0.37068267]

plot_series(x_r, y_r, 9, x_true=x_t, y_true=y_t)
</code>```

Body:
Based on the method plot_series in this notebook.
I would like to plot a timeseries in 3d where my points consist of x,y coordinates and time.
My problem is found when I go to plot the target point by raising the exception

     18     if y_true is not None:
---> 19         ax.plot3D(n_steps+1, x_true, y_true, "bo", markersize=10, label="Target")

TypeError: object of type 'int' has no len()

my code is this, I have a 9 step timeseries and I would like to print the target point on the 10th step as well. How to do this?

from matplotlib.pyplot import figure

def plot_series(x_train, y_train, n_steps=10, x_true=None, y_true=None, x_pred=None, y_pred=None, x_label="$time$", y_label="$x$", z_label="$y$", legend=True):
    figure(figsize=(8, 6), dpi=80)
    ax = plt.axes(projection='3d')
    time = np.arange(start=0, stop=len(x_train), step=1)

    # base plot
    ax.plot3D(time, x_train, y_train, ".-")

    if y_true is not None:
        ax.plot3D(n_steps+1, x_true, y_true, "bo", markersize=10, label="Target")
    if y_pred is not None:
        ax.plot3D(n_steps+1, x_pred, y_pred, "rx", markersize=10, label="Prediction")

    ax.grid(True)
    if x_label:
        ax.set_xlabel(x_label, fontsize=16)
    if y_label:
        ax.set_ylabel(y_label, fontsize=16, rotation=0)
    if z_label:
        ax.set_zlabel(z_label, fontsize=16, rotation=0)

    if legend and (y_true or y_pred):
        ax.legend(fontsize=14, loc="upper left")

# single timseries on training set
x_r = [0.58114803 0.5591796  0.59348005 0.59550647 0.61035596 0.4759958 0.56246371 0.51623335 0.56018264]
y_r = [0.37528117 0.52601401 0.4105518  0.41212707 0.42236306 0.36568968 0.53288641 0.42619483 0.48411763]

# target point for that timeseries on training set
x_t = [0.60137904]
y_t = [0.37068267]

plot_series(x_r, y_r, 9, x_true=x_t, y_true=y_t)


问:
Rust: Generalize over Tokio TCPStream or anything that extends std::io::Write

Background

I am writing a protocol machine for a library that I have purposefully written to abstract away the TCP stream.

In general, it has three functions:

receive_data(), which takes in bytes.

read_pdu(), which consumes the next Protocol Data Unit (PDU).

write_data(), which frames data in a Protocol Data Unit (PDU) and writes it to the write stream.

I did this so I could abstract over these three IO sources:

Mocked input sources and output sinks in unit tests.

std::net::TcpStream (which implements Write).

tokio::net::TcpStream

Number 3 is my problem: I thought Tokio implements std::io::Write in TcpStream, but I see now that it implements AsyncWrite. I am essentially trying to generalize over synchronous and asynchronous write(), which I am not even sure is possible.

Question

That said, to re-state my question: how do I generalize over sync and async writes in Rust?

I would like to add that I am open to answers that provide alternative solutions. For example, if there is a way to mock TCP sockets for testing purposes, then I don't have as strong a need for this layer of abstraction.


问:
Golang package pkg/st is not in GOROOT
Lan: Golang
OS: Win11
go version go1.19.4 windows/amd64

go env:

set GO111MODULE=on

GOPATH=e:\Develop\Go\

GOROOT=E:\Develop\Go

I am trying to understand how to add my own package into main entry go file.

the structure of my files are the following:

e:\Develop\Go\src\stepik\main.go
e:\Develop\Go\src\stepik\pkg\st.go

where stepik is a project

main.go is the following:

```<code>`package main

import "fmt"
import  "pkg/st"

func main() {
    a : 100
    a++
    st.stepik
    fmt.Print(a)
}`
</code>```

and st.go is the following:

```<code>`package st

import (
    "fmt"
)

func LetsGo(a int) {
    a++
    fmt.Print(a)
}`
</code>```

Also I add my project stepik into mod file by using the following commands:

```<code>E:\develop\go\src\stepik> go mod init
go: creating new go.mod: module stepik
go: to add module requirements and sums:
        go mod tidy
PS E:\develop\go\src\stepik> go mod tidy
</code>```

So file  go.mod was created, and it contains the following:

`module stepik

go 1.19`

But when I try to execute my main.go file I am getting the following error:
**
Build Error: go build -o e:\Develop\Go\src\Stepik__debug_bin.exe -gcflags all=-N -l .
main.go:4:9: package pkg/st is not in GOROOT (E:\Develop\Go\src\pkg\st) (exit status 1)
**

Please advice how to fix issue above?
Thank you in advance.

Title: Golang package pkg/st is not in GOROOT

Body:
Lan: Golang
OS: Win11
go version go1.19.4 windows/amd64

go env:

set GO111MODULE=on

GOPATH=e:\Develop\Go\

GOROOT=E:\Develop\Go

I am trying to understand how to add my own package into main entry go file.

the structure of my files are the following:

e:\Develop\Go\src\stepik\main.go
e:\Develop\Go\src\stepik\pkg\st.go

where stepik is a project

main.go is the following:

`package main

import "fmt"
import  "pkg/st"

func main() {
    a : 100
    a++
    st.stepik
    fmt.Print(a)
}`

and st.go is the following:

`package st

import (
    "fmt"
)

func LetsGo(a int) {
    a++
    fmt.Print(a)
}`

Also I add my project stepik into mod file by using the following commands:

E:\develop\go\src\stepik> go mod init
go: creating new go.mod: module stepik
go: to add module requirements and sums:
        go mod tidy
PS E:\develop\go\src\stepik> go mod tidy

So file  go.mod was created, and it contains the following:

`module stepik

go 1.19`

But when I try to execute my main.go file I am getting the following error:
**
Build Error: go build -o e:\Develop\Go\src\Stepik__debug_bin.exe -gcflags all=-N -l .
main.go:4:9: package pkg/st is not in GOROOT (E:\Develop\Go\src\pkg\st) (exit status 1)
**

Please advice how to fix issue above?
Thank you in advance.


问:
How can I optimize this code? A Javascript loop showing images
I've created a loop in Javascript that shows a new image every 2 seconds.
Additionally, it shows a new image also when the user move the mouse, but this is not an issue.
The problem is that the CPU usage is not as low as I would expect: 7-10% on PC and if I open the website on my mobile it slows down too much...

Other things to say are that this is part of a Nuxt 3 project and I tried both to put this in a plugin or under a component script section with the same result.

Here is the code part of the main "loop".
Initially I fetch the images from the backend and keep them in img elements that I then clone for better performance.
Then it starts looping with "window.requestAnimationFrame".
In order to have some improvements, I generate an arbitrary amount of images (30 if mobile, 60 on desktops) and then I just reuse them.

import { Point, AnchorWork } from './extra/types';
import * as utils from './extra/utils';

export default defineNuxtPlugin(async () => {
    async function start() {
        const { find } = useStrapi(),
            apiUrl = useApi(),
            isMobile = useMobile(),
            baseLink = document.createElement('a');

        try {
            let loadedImages = 0;
            const pics = await find('works', { populate: '*' }),
                rawImages = [],
                totalImages = Object.keys(pics.data).length;

            pics.data.forEach((pic) => {
                const picUrl = apiUrl + (isMobile ? pic.attributes.image.data.attributes.formats.medium.url : pic.attributes.image.data.attributes.formats.xlarge.url);
                const img = new Image();

                img.addEventListener('load', async () => {

                    const link = baseLink.cloneNode();
                    link.appendChild(img);
                    rawImages.push(link);

                    if (++loadedImages >= totalImages) {
                        utils.delay(100).then(async () => {
                            //document.getElementById('loader').style.opacity = '0';
                            await loop(rawImages, totalImages);
                        });
                    }
                });
                img.src = picUrl;
                img.alt = pic.attributes.name;
            })
        } catch(error) {
            console.log(error);
            return;
        }
    }

    await start();

    async function loop(pictures, max) {
        const isMobile = useMobile(),
            maxQueue = isMobile ? 30 : 60,
            imagesQueue = [],
            delay = 2000,
            baseDiv = document.createElement('div'),
            body = document.body;
        let auto = true,
            picsContainer = document.getElementById('pictures'),
            mainContainer = document.getElementById('main'),
            mouseMinDelta = window.innerWidth * 0.1 + window.innerHeight * 0.1,
            current = Math.floor( Math.random() * ( max - 3 ) ),
            mouseTimeout,
            resizeTimeout,
            oldMouse = new Point(0, 0),
            movement = new Point(0, 0);

        async function generateImg(px, py) {
            const { x, y } = px && py ? { x: px, y: py } : utils.generateCoord(picsContainer.clientWidth, picsContainer.clientHeight);
            if(imagesQueue.length < maxQueue) {
                if(current >= max) current = 0;

                const link = new AnchorWork(pictures[current++].cloneNode(true), x, y);
                await link.appendTo(picsContainer);

                let overlay = baseDiv.cloneNode();
                link.element.addEventListener('click', (e) => {
                    e.preventDefault();
                    workClick(link, overlay);
                });

                imagesQueue.push(link);

            } else {
                const index = imagesQueue[0].hasClass('active') ? 1 : 0;
                const item = imagesQueue[index];
                await item.removeClass('work');
                item.position = new Point(x, y);
                picsContainer.lastElementChild.after(item.element);
                item.newSize();
                imagesQueue.push(imagesQueue.splice(index, 1)[0]);
                setTimeout(() => { item.addClass('work'); }, 200);
            }
        }

        function workClick(link, overlay) {
            const target = link;

            if(target.hasClass('active')) {
                target.childImage.resetStyle();

                overlay.remove();
                target.removeClass('active');
            } else {
                const height = body.clientHeight > body.clientWidth ? 'auto' : '100%';
                const width = height == 'auto' ? '100%' : 'auto';
                target.childImage.modStyle('height: ' + height + '; width: ' + width + ';');

                overlay.classList.add('overlay');
                overlay.addEventListener('click', overlay.remove);
                picsContainer.appendChild(overlay);

                target.appendTo(mainContainer);

                target.addClass('active');
            }
        }

        if(!isMobile) {
            picsContainer.addEventListener('mousemove', (event) => {
                clearTimeout(mouseTimeout);

                mouseTimeout = setTimeout(() => {
                    picsContainer.dispatchEvent(new Event('mousestop'))
                }, delay);

                movement.x += Math.abs(event.pageX - oldMouse.x);
                movement.y += Math.abs(event.pageY - oldMouse.y);

                if(movement.x + movement.y > mouseMinDelta) {
                    generateImg(picsContainer.clientWidth - event.pageX, picsContainer.clientHeight - event.pageY);
                    movement.Set(0, 0);
                }

                oldMouse.Set(event.pageX, event.pageY);

                auto = false;
            });

            picsContainer.addEventListener('mousestop', () => { auto = true; });
        }

        //Reposition images based on new window size
        window.addEventListener('resize', () => {
            clearTimeout(resizeTimeout);

            resizeTimeout = setTimeout(() => {
                window.dispatchEvent(new Event('resizeend'))
            }, 20);
        });

        window.addEventListener('resizeend', () => {
            mouseMinDelta = window.innerWidth * 0.1 + window.innerHeight * 0.1;

            imagesQueue.forEach(img => {
                const coord = utils.generateCoord(picsContainer.clientWidth, picsContainer.clientHeight),
                    point = new Point(coord.x, coord.y);

                if(!img.hasClass('active')) {
                    img.position = point;
                    img.newSize();
                }
            })
        })

        //Initial images
        for(let x = 0; x < 3; x++) { generateImg(); }

        async function animate() {
            if(auto) {
                generateImg();
            }

            await utils.delay(delay);
            window.requestAnimationFrame(animate);
        }

        window.requestAnimationFrame(animate);
    }
});```
</div>
</div>
</p>
<p>Here are some classes I created to help me:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>import * as utils from './utils';

class BaseWork {

    _width;
    _height;
    _style;
    _element;

    constructor(el) {
        this._element = el;
        const size = utils.generateSize();
        this._width = size.width;
        this._height = size.height;
        this._style = '';
    }

    //Getters - Setters
    get element() { return this._element; }
    get width() { return this._width; }
    get height() { return this._height; }
    get style() { return this._style; }

    set width(newWidth) { this._width = newWidth; }
    set height(newHeight) { this._height = newHeight; }
    set style(newStyle) {
        this._style = newStyle;
        this.element.setAttribute('style', newStyle);
    }

    //Methods
    async addClass(className) { this.element.classList.add(className); }
    async removeClass(className) { this.element.classList.remove(className); }
    hasClass(className) { return this.element.classList.contains(className); }
    async appendTo(container) {
        container.appendChild(this.element);
        await utils.delay(20); //To let the rect being computed
    }
    async resetStyle() { this.element.setAttribute('style', this.style); }
    async modStyle(newStyle) { this.element.setAttribute('style', newStyle); }

}

class ImageWork extends BaseWork {

    _container;

    constructor(el, container) {
        super(el);

        this._container = container;
        this.newSize();
    }

    get element() { return this._element; }
    get container() { return this._container; }

    async newSize() {
        this.width = this.container.element.clientHeight > this.container.element.clientWidth ? 'auto' : '100%';
        this.height = this.width == 'auto' ? '100%' : 'auto';
        this.style = 'width: ' + this.width + '; height: ' + this.height + ';';
    }

}

class AnchorWork extends BaseWork {

    _position = new Point(0, 0);
    _childImage = null;

    constructor( el, x = 0, y = 0) {
        super(el);

        if(x == 0 || y == 0) {

            const coord = utils.generateCoord(window.innerWidth, window.innerHeight);
            this._position.Set(coord.x, coord.y);

        } else this._position.Set(x, y);

        this.style = 'left: ' + this.position.x + 'px; top: ' + this.position.y + 'px; display: none; width: ' + this.width + '; height: ' + this.height + ';';

        this.generateImage(this.element.querySelector('img'));
        setTimeout(() => { this.addClass('work'); }, 200);
    }

    //Getters - Setters
    get element() { return this._element; }
    get position() { return this._position; }
    get childImage() { return this._childImage; }

    set position(newPosition) {
        this._position = newPosition;

        this.style = 'left: ' + newPosition.x + 'px; top: ' + newPosition.y + 'px; display: none; width: ' + this.width + '; height: ' + this.height + ';';
    }

    //Methods
    generateImage(el) { this._childImage = new ImageWork(el, this); }
    async newSize() {
        const size = utils.generateSize();
        this.width = size.width;
        this.height = size.height;

        this.style = 'left: ' + this.position.x + 'px; top: ' + this.position.y + 'px; display: none; width: ' + this.width + '; height: ' + this.height + ';';
        this.childImage.newSize();
    }

}

class Point {
    _x;
    _y;

    constructor(x = 0, y = 0) {
        this._x = x;
        this._y = y;
    }

    get x() { return this._x; }
    get y() { return this._y; }

    set x(newX) { this._x = newX; }
    set y(newY) { this._y = newY; }

    Set(x, y) {
        this.x = x;
        this.y = y;
    }
}

export { BaseWork, ImageWork, AnchorWork, Point }</code>```

Here are some helper functions:

function generateSize() {
    const mod = document.body.clientHeight > document.body.clientWidth ? true : false;
    const modW = (mod ? 40 : 20);
    const modH = (mod ? 20 : 40);
    return { width: Math.round((Math.random() * modW) + modW) + '%', height: Math.round((Math.random() * modH) + modH) + '%' }
}

function generateCoord(maxX, maxY) {
    let x = Math.round(Math.random() * (maxX ? maxX : window.innerWidth));
    let y = Math.round(Math.random() * (maxY ? maxY : window.innerHeight));
    return { x: x, y: y };
}

function delay(time) {
    return new Promise(resolve => setTimeout(resolve, time));
}

export { generateCoord, generateSize, delay }```

Body:
I've created a loop in Javascript that shows a new image every 2 seconds.
Additionally, it shows a new image also when the user move the mouse, but this is not an issue.
The problem is that the CPU usage is not as low as I would expect: 7-10% on PC and if I open the website on my mobile it slows down too much...

Other things to say are that this is part of a Nuxt 3 project and I tried both to put this in a plugin or under a component script section with the same result.

Here is the code part of the main "loop".
Initially I fetch the images from the backend and keep them in img elements that I then clone for better performance.
Then it starts looping with "window.requestAnimationFrame".
In order to have some improvements, I generate an arbitrary amount of images (30 if mobile, 60 on desktops) and then I just reuse them.

import { Point, AnchorWork } from './extra/types';
import * as utils from './extra/utils';

export default defineNuxtPlugin(async () => {
    async function start() {
        const { find } = useStrapi(),
            apiUrl = useApi(),
            isMobile = useMobile(),
            baseLink = document.createElement('a');

        try {
            let loadedImages = 0;
            const pics = await find('works', { populate: '*' }),
                rawImages = [],
                totalImages = Object.keys(pics.data).length;

            pics.data.forEach((pic) => {
                const picUrl = apiUrl + (isMobile ? pic.attributes.image.data.attributes.formats.medium.url : pic.attributes.image.data.attributes.formats.xlarge.url);
                const img = new Image();

                img.addEventListener('load', async () => {

                    const link = baseLink.cloneNode();
                    link.appendChild(img);
                    rawImages.push(link);

                    if (++loadedImages >= totalImages) {
                        utils.delay(100).then(async () => {
                            //document.getElementById('loader').style.opacity = '0';
                            await loop(rawImages, totalImages);
                        });
                    }
                });
                img.src = picUrl;
                img.alt = pic.attributes.name;
            })
        } catch(error) {
            console.log(error);
            return;
        }
    }

    await start();

    async function loop(pictures, max) {
        const isMobile = useMobile(),
            maxQueue = isMobile ? 30 : 60,
            imagesQueue = [],
            delay = 2000,
            baseDiv = document.createElement('div'),
            body = document.body;
        let auto = true,
            picsContainer = document.getElementById('pictures'),
            mainContainer = document.getElementById('main'),
            mouseMinDelta = window.innerWidth * 0.1 + window.innerHeight * 0.1,
            current = Math.floor( Math.random() * ( max - 3 ) ),
            mouseTimeout,
            resizeTimeout,
            oldMouse = new Point(0, 0),
            movement = new Point(0, 0);

        async function generateImg(px, py) {
            const { x, y } = px && py ? { x: px, y: py } : utils.generateCoord(picsContainer.clientWidth, picsContainer.clientHeight);
            if(imagesQueue.length < maxQueue) {
                if(current >= max) current = 0;

                const link = new AnchorWork(pictures[current++].cloneNode(true), x, y);
                await link.appendTo(picsContainer);

                let overlay = baseDiv.cloneNode();
                link.element.addEventListener('click', (e) => {
                    e.preventDefault();
                    workClick(link, overlay);
                });

                imagesQueue.push(link);

            } else {
                const index = imagesQueue[0].hasClass('active') ? 1 : 0;
                const item = imagesQueue[index];
                await item.removeClass('work');
                item.position = new Point(x, y);
                picsContainer.lastElementChild.after(item.element);
                item.newSize();
                imagesQueue.push(imagesQueue.splice(index, 1)[0]);
                setTimeout(() => { item.addClass('work'); }, 200);
            }
        }

        function workClick(link, overlay) {
            const target = link;

            if(target.hasClass('active')) {
                target.childImage.resetStyle();

                overlay.remove();
                target.removeClass('active');
            } else {
                const height = body.clientHeight > body.clientWidth ? 'auto' : '100%';
                const width = height == 'auto' ? '100%' : 'auto';
                target.childImage.modStyle('height: ' + height + '; width: ' + width + ';');

                overlay.classList.add('overlay');
                overlay.addEventListener('click', overlay.remove);
                picsContainer.appendChild(overlay);

                target.appendTo(mainContainer);

                target.addClass('active');
            }
        }

        if(!isMobile) {
            picsContainer.addEventListener('mousemove', (event) => {
                clearTimeout(mouseTimeout);

                mouseTimeout = setTimeout(() => {
                    picsContainer.dispatchEvent(new Event('mousestop'))
                }, delay);

                movement.x += Math.abs(event.pageX - oldMouse.x);
                movement.y += Math.abs(event.pageY - oldMouse.y);

                if(movement.x + movement.y > mouseMinDelta) {
                    generateImg(picsContainer.clientWidth - event.pageX, picsContainer.clientHeight - event.pageY);
                    movement.Set(0, 0);
                }

                oldMouse.Set(event.pageX, event.pageY);

                auto = false;
            });

            picsContainer.addEventListener('mousestop', () => { auto = true; });
        }

        //Reposition images based on new window size
        window.addEventListener('resize', () => {
            clearTimeout(resizeTimeout);

            resizeTimeout = setTimeout(() => {
                window.dispatchEvent(new Event('resizeend'))
            }, 20);
        });

        window.addEventListener('resizeend', () => {
            mouseMinDelta = window.innerWidth * 0.1 + window.innerHeight * 0.1;

            imagesQueue.forEach(img => {
                const coord = utils.generateCoord(picsContainer.clientWidth, picsContainer.clientHeight),
                    point = new Point(coord.x, coord.y);

                if(!img.hasClass('active')) {
                    img.position = point;
                    img.newSize();
                }
            })
        })

        //Initial images
        for(let x = 0; x < 3; x++) { generateImg(); }

        async function animate() {
            if(auto) {
                generateImg();
            }

            await utils.delay(delay);
            window.requestAnimationFrame(animate);
        }

        window.requestAnimationFrame(animate);
    }
});

Here are some classes I created to help me:

import * as utils from './utils';

class BaseWork {

    _width;
    _height;
    _style;
    _element;

    constructor(el) {
        this._element = el;
        const size = utils.generateSize();
        this._width = size.width;
        this._height = size.height;
        this._style = '';
    }

    //Getters - Setters
    get element() { return this._element; }
    get width() { return this._width; }
    get height() { return this._height; }
    get style() { return this._style; }

    set width(newWidth) { this._width = newWidth; }
    set height(newHeight) { this._height = newHeight; }
    set style(newStyle) {
        this._style = newStyle;
        this.element.setAttribute('style', newStyle);
    }

    //Methods
    async addClass(className) { this.element.classList.add(className); }
    async removeClass(className) { this.element.classList.remove(className); }
    hasClass(className) { return this.element.classList.contains(className); }
    async appendTo(container) {
        container.appendChild(this.element);
        await utils.delay(20); //To let the rect being computed
    }
    async resetStyle() { this.element.setAttribute('style', this.style); }
    async modStyle(newStyle) { this.element.setAttribute('style', newStyle); }

}

class ImageWork extends BaseWork {

    _container;

    constructor(el, container) {
        super(el);

        this._container = container;
        this.newSize();
    }

    get element() { return this._element; }
    get container() { return this._container; }

    async newSize() {
        this.width = this.container.element.clientHeight > this.container.element.clientWidth ? 'auto' : '100%';
        this.height = this.width == 'auto' ? '100%' : 'auto';
        this.style = 'width: ' + this.width + '; height: ' + this.height + ';';
    }

}

class AnchorWork extends BaseWork {

    _position = new Point(0, 0);
    _childImage = null;

    constructor( el, x = 0, y = 0) {
        super(el);

        if(x == 0 || y == 0) {

            const coord = utils.generateCoord(window.innerWidth, window.innerHeight);
            this._position.Set(coord.x, coord.y);

        } else this._position.Set(x, y);

        this.style = 'left: ' + this.position.x + 'px; top: ' + this.position.y + 'px; display: none; width: ' + this.width + '; height: ' + this.height + ';';

        this.generateImage(this.element.querySelector('img'));
        setTimeout(() => { this.addClass('work'); }, 200);
    }

    //Getters - Setters
    get element() { return this._element; }
    get position() { return this._position; }
    get childImage() { return this._childImage; }

    set position(newPosition) {
        this._position = newPosition;

        this.style = 'left: ' + newPosition.x + 'px; top: ' + newPosition.y + 'px; display: none; width: ' + this.width + '; height: ' + this.height + ';';
    }

    //Methods
    generateImage(el) { this._childImage = new ImageWork(el, this); }
    async newSize() {
        const size = utils.generateSize();
        this.width = size.width;
        this.height = size.height;

        this.style = 'left: ' + this.position.x + 'px; top: ' + this.position.y + 'px; display: none; width: ' + this.width + '; height: ' + this.height + ';';
        this.childImage.newSize();
    }

}

class Point {
    _x;
    _y;

    constructor(x = 0, y = 0) {
        this._x = x;
        this._y = y;
    }

    get x() { return this._x; }
    get y() { return this._y; }

    set x(newX) { this._x = newX; }
    set y(newY) { this._y = newY; }

    Set(x, y) {
        this.x = x;
        this.y = y;
    }
}

export { BaseWork, ImageWork, AnchorWork, Point }

Here are some helper functions:

function generateSize() {
    const mod = document.body.clientHeight > document.body.clientWidth ? true : false;
    const modW = (mod ? 40 : 20);
    const modH = (mod ? 20 : 40);
    return { width: Math.round((Math.random() * modW) + modW) + '%', height: Math.round((Math.random() * modH) + modH) + '%' }
}

function generateCoord(maxX, maxY) {
    let x = Math.round(Math.random() * (maxX ? maxX : window.innerWidth));
    let y = Math.round(Math.random() * (maxY ? maxY : window.innerHeight));
    return { x: x, y: y };
}

function delay(time) {
    return new Promise(resolve => setTimeout(resolve, time));
}

export { generateCoord, generateSize, delay }


问:
What is the main difference between both rcond values?
I am currently trying to find the difference between different rcond values, so when the rcond>=1 the matrix rank is 2, rcond<1 the rank are 1, but if rcond is small enough than rank is back to 2.

I already know the meaning of rcond in numpy.linalg.lstsq, but if the rcond>1, all singular values should be smaller than the largest singular value times rcond, so all the singular values will be viewed as zero.
The rank should also be zero at this case.

Here is the function I am using.

```<code>w = np.linalg.lstsq(A, x[idx_prev-1:idx], rcond=None)
</code>```

The singular values of A are [22.8,1.8], so if rcond >1, both of them should be viewed as 0, is that right?

Body:
I am currently trying to find the difference between different rcond values, so when the rcond>=1 the matrix rank is 2, rcond<1 the rank are 1, but if rcond is small enough than rank is back to 2.

I already know the meaning of rcond in numpy.linalg.lstsq, but if the rcond>1, all singular values should be smaller than the largest singular value times rcond, so all the singular values will be viewed as zero.
The rank should also be zero at this case.

Here is the function I am using.

w = np.linalg.lstsq(A, x[idx_prev-1:idx], rcond=None)

The singular values of A are [22.8,1.8], so if rcond >1, both of them should be viewed as 0, is that right?


问:
My python program to print matrix is working in VScode but when i run it in python online compiler it shows error
I tried to get values of rows and columns in the first line as string and convert it into an interger when using it in the second line. It runs well and gives me output in VScode but when I tried to run it in Python Online compiler it gives me error.

```<code>m,n=input("Enter number of rows and columns:").split()

matrix=[[int(input()) for y in range(int(n))]for x in range(int(m))]

[[[print(matrix[i][j], end=" ") for j in range(int(n))] and print(" ") ]for i in range(int(m))]
</code>```

output in VScode:

```<code>Enter number of rows and columns:2 2
1
2
3
4
1 2
3 4
</code>```

Output in online compiler:

```<code>Enter number of rows and columns:2 2
1
2
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "<string>", line 2, in <listcomp>
  File "<string>", line 2, in <listcomp>
ValueError: invalid literal for int() with base 10: ''
</code>```

Body:
I tried to get values of rows and columns in the first line as string and convert it into an interger when using it in the second line. It runs well and gives me output in VScode but when I tried to run it in Python Online compiler it gives me error.

m,n=input("Enter number of rows and columns:").split()

matrix=[[int(input()) for y in range(int(n))]for x in range(int(m))]

[[[print(matrix[i][j], end=" ") for j in range(int(n))] and print(" ") ]for i in range(int(m))]

output in VScode:

Enter number of rows and columns:2 2
1
2
3
4
1 2
3 4

Output in online compiler:

Enter number of rows and columns:2 2
1
2
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "<string>", line 2, in <listcomp>
  File "<string>", line 2, in <listcomp>
ValueError: invalid literal for int() with base 10: ''


问:
Getting multiprocessing.pool.ExceptionWithTraceback error on multiprocessing.pool.starmap() method
I'm trying to develop a code that gets certain data from an API and constructs an output file using said data. In order to accelerate the processing time, I'm (attempting to) make use of the multiprocessing library to paralellize this task.

With the code below, I manage to get some results returned, but at seemingly random times (after 2-4 results have been received) I get the following error:

multiprocessing.pool.MaybeEncodingError: Error sending result: '<multiprocessing.pool.ExceptionWithTraceback object at 0x000002CA8BA44BD0>'. Reason: 'PicklingError("Can't pickle <function HTTPResponse.getheaders at 0x000002CA8BA06980>: it's not the same object as http.client.HTTPResponse.getheaders")'

Here's the code:

```<code>def function1 (origin: str, departureDate: datetime, returnDate: datetime):
    if __name__ == '__main__':
        destinations = ["PAR", "LON", "AMS", "ROM", "BER", "BRU", "MUC"]

        res = []

        with Pool() as pool:
            pool.starmap(function2, zip(list(repeat(origin,7)), args, list(repeat(departureDate, 7)),
list(repeat(returnDate, 7))))

        x = [r[0] for r in res]

        with open("res.json", "w") as outfile:
            json.dump(x, outfile, indent=4, sort_keys=True)

function1("MAD", datetime.datetime(2023,3,1), datetime.datetime(2023,3,8))
</code>```
```<code>def function2 (origin: str, destination: str, departureDate: datetime, returnDate: datetime):

    vuelo = v.function3(origin, destination, departureDate, returnDate)
    habitacion = h.function4(destino, departureDate, returnDate)

    if(len(habitacion)!=0): habitacion = habitacion[0][0]

    result = {
        "destination": destination,
        "totalPrice": (float(room["offers"][0]["price"]["total"]) +
float(flight["price"]["total"])),
        "hotelPrice": float(room["offers"][0]["price"]["total"])/2,
        "departurePrice": float(flight["price"]["departure"]),
        "returnPrice": float(flight["price"]["return"])

    print(result) #this is to test the output
    return result
</code>```
```<code>def function3 (origin: str, destination: str, departureDate: datetime, returnDate: datetime):
    data = {#request parameters}

    try:
        response = provider.post(data)

        return response.data

    except ResponseError as error:
        raise error
</code>```
```<code>def function4 (destination: str, departureDate: datetime, returnDate: datetime):
    #if __name__ == '__main__':
        hotels = GetHotels(destination)

        res = []

        for hotel in hotels:
            res.append(function5 (hotel,departureDate,returnDate))

        rooms = list(filter(None, res[0]))

        return rooms
</code>```
```<code>def function5 (hotels, departureDate: datetime, returnDate: datetime):
    roomList = []

    try:
        hotel_offers = provider.get(#params)

        if(hotel_offers.data != []):
            roomList.append(hotel_offers.data)

    except Exception: 0

    if roomList == []: roomList.append("")

    return roomList
</code>```

Full error traceback:

```<code>Traceback (most recent call last):
  File "c:\Users\user\Documents\folder\folder\user\function2.py", line 49, in <module>
    function1("MAD", datetime.datetime(2023,3,1), datetime.datetime(2023,3,8))
  File "c:\Users\user\Documents\folder\folder\user\function2.py", line 42, in function1
    pool.starmap(function2, zip(list(repeat(origin,7)), args, list(repeat(departureDate, 7)), list(repeat(returnDate, 7))))
  File "C:\Python311\Lib\multiprocessing\pool.py", line 375, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\multiprocessing\pool.py", line 774, in get
    raise self._value
multiprocessing.pool.MaybeEncodingError: Error sending result: '<multiprocessing.pool.ExceptionWithTraceback object at 0x00000246DDDA4C50>'. Reason: 'PicklingError("Can't pickle <function HTTPResponse.getheaders at 0x00000246DDD66980>: it's not the same object as http.client.HTTPResponse.getheaders")'
</code>```

I have tried using different approaches to paralellize my code, even rewritting functions 3, 4 and 5 as they're the ones that deal with network data fetching, but to no avail, and I can't find the cause for this error.

Body:
I'm trying to develop a code that gets certain data from an API and constructs an output file using said data. In order to accelerate the processing time, I'm (attempting to) make use of the multiprocessing library to paralellize this task.

With the code below, I manage to get some results returned, but at seemingly random times (after 2-4 results have been received) I get the following error:

multiprocessing.pool.MaybeEncodingError: Error sending result: '<multiprocessing.pool.ExceptionWithTraceback object at 0x000002CA8BA44BD0>'. Reason: 'PicklingError("Can't pickle <function HTTPResponse.getheaders at 0x000002CA8BA06980>: it's not the same object as http.client.HTTPResponse.getheaders")'

Here's the code:

def function1 (origin: str, departureDate: datetime, returnDate: datetime):
    if __name__ == '__main__':
        destinations = ["PAR", "LON", "AMS", "ROM", "BER", "BRU", "MUC"]

        res = []

        with Pool() as pool:
            pool.starmap(function2, zip(list(repeat(origin,7)), args, list(repeat(departureDate, 7)),
list(repeat(returnDate, 7))))

        x = [r[0] for r in res]

        with open("res.json", "w") as outfile:
            json.dump(x, outfile, indent=4, sort_keys=True)

function1("MAD", datetime.datetime(2023,3,1), datetime.datetime(2023,3,8))

def function2 (origin: str, destination: str, departureDate: datetime, returnDate: datetime):

    vuelo = v.function3(origin, destination, departureDate, returnDate)
    habitacion = h.function4(destino, departureDate, returnDate)

    if(len(habitacion)!=0): habitacion = habitacion[0][0]

    result = {
        "destination": destination,
        "totalPrice": (float(room["offers"][0]["price"]["total"]) +
float(flight["price"]["total"])),
        "hotelPrice": float(room["offers"][0]["price"]["total"])/2,
        "departurePrice": float(flight["price"]["departure"]),
        "returnPrice": float(flight["price"]["return"])

    print(result) #this is to test the output
    return result

def function3 (origin: str, destination: str, departureDate: datetime, returnDate: datetime):
    data = {#request parameters}

    try:
        response = provider.post(data)

        return response.data

    except ResponseError as error:
        raise error

def function4 (destination: str, departureDate: datetime, returnDate: datetime):
    #if __name__ == '__main__':
        hotels = GetHotels(destination)

        res = []

        for hotel in hotels:
            res.append(function5 (hotel,departureDate,returnDate))

        rooms = list(filter(None, res[0]))

        return rooms

def function5 (hotels, departureDate: datetime, returnDate: datetime):
    roomList = []

    try:
        hotel_offers = provider.get(#params)

        if(hotel_offers.data != []):
            roomList.append(hotel_offers.data)

    except Exception: 0

    if roomList == []: roomList.append("")

    return roomList

Full error traceback:

Traceback (most recent call last):
  File "c:\Users\user\Documents\folder\folder\user\function2.py", line 49, in <module>
    function1("MAD", datetime.datetime(2023,3,1), datetime.datetime(2023,3,8))
  File "c:\Users\user\Documents\folder\folder\user\function2.py", line 42, in function1
    pool.starmap(function2, zip(list(repeat(origin,7)), args, list(repeat(departureDate, 7)), list(repeat(returnDate, 7))))
  File "C:\Python311\Lib\multiprocessing\pool.py", line 375, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\multiprocessing\pool.py", line 774, in get
    raise self._value
multiprocessing.pool.MaybeEncodingError: Error sending result: '<multiprocessing.pool.ExceptionWithTraceback object at 0x00000246DDDA4C50>'. Reason: 'PicklingError("Can't pickle <function HTTPResponse.getheaders at 0x00000246DDD66980>: it's not the same object as http.client.HTTPResponse.getheaders")'

I have tried using different approaches to paralellize my code, even rewritting functions 3, 4 and 5 as they're the ones that deal with network data fetching, but to no avail, and I can't find the cause for this error.


问:
How to detect any modal window on site Python selenium?
I make script which open site from text document (in document it about 150+ sites) and make screenshot of first screen. I have two problems. It is cookie alert and modal popup windows like "subscribe on our newsletter", "10% discount on this weekend" and something like this. Cookie alert was handeled by add crx extension before  driver launch ( Pop up blocker for Chrome™ - Poper Blocker). But i not found something like this for modal windows. All modal windows have different xPath and class names. Like "modal", "ui-diaglod", "popup", etc. I have a question how to handle modals and dimming the background and after closing them make screenshot. I tried handle it by adding JavaScript script that searching  modals by class names, but it so many classes that my solution didn`t work properly</p>


问:
Laravel install via Docker on WSL2 never stops building
I'm trying to install a fresh Laravel 9 on Windows 10/WSL 2 with Docker. I followed the documentation and once I run the first command it gets stuck during building when it gets to the 4/11 stage, running endlessly until I have to cancel.

Here is what it looks like in the Terminal:

```<code> => [ 4/11] RUN apt-get update     && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervis  167.8s
 => => # Processing triggers for ca-certificates (20211016ubuntu0.22.04.1) ...
 => => # Updating certificates in /etc/ssl/certs...
 => => # 0 added, 0 removed; done.
 => => # Running hooks in /etc/ca-certificates/update.d...
 => => # done.
 => => # gpg: keybox '/root/.gnupg/pubring.kbx' created
</code>```

I used Unbuntu and Docker is fresh install. I don't understand what seems to be the problem here.

Honestly I didn't try much, I have no idea what the issue is...

Body:
I'm trying to install a fresh Laravel 9 on Windows 10/WSL 2 with Docker. I followed the documentation and once I run the first command it gets stuck during building when it gets to the 4/11 stage, running endlessly until I have to cancel.

Here is what it looks like in the Terminal:

 => [ 4/11] RUN apt-get update     && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervis  167.8s
 => => # Processing triggers for ca-certificates (20211016ubuntu0.22.04.1) ...
 => => # Updating certificates in /etc/ssl/certs...
 => => # 0 added, 0 removed; done.
 => => # Running hooks in /etc/ca-certificates/update.d...
 => => # done.
 => => # gpg: keybox '/root/.gnupg/pubring.kbx' created

I used Unbuntu and Docker is fresh install. I don't understand what seems to be the problem here.

Honestly I didn't try much, I have no idea what the issue is...


问:
Smali change iget-wide to const value
I have this code (original):

```<code>.method public final component1()J
.registers 3

iget-wide v0, p0, Lio/wondrous/sns/data/model/levels/UserLevel;->totalPoints:J

return-wide v0
.end method
</code>```

I need to return static value, like:

```<code>const v0, 500000
</code>```

but it construction doesnt work.
Any ideas? Thanks!

Title: Smali change iget-wide to const value

Body:
I have this code (original):

.method public final component1()J
.registers 3

iget-wide v0, p0, Lio/wondrous/sns/data/model/levels/UserLevel;->totalPoints:J

return-wide v0
.end method

I need to return static value, like:

const v0, 500000

but it construction doesnt work.
Any ideas? Thanks!


问:
Property 'contentWindow' does not exist on type 'Window' fails on build
I am using nextjs with typescript, and I have the following code:

```<code>  useEffect(() => {

    const iframe = ref.current?.contentWindow;
    const iframeWin: any = iframe?.contentWindow || iframe;   <== error here
    const iframeDoc = iframe?.contentDocument || iframeWin.document;
    iframeDoc.addEventListener('click', (event) => {
      // do something...
   });
    eventListnerFrame();
  }, [eventListnerFrame]);

</code>```

These lines works as expected in yarn dev, but when I do yarn build I am getting the following error:

```<code>Type error: Property 'contentWindow' does not exist on type 'Window'.
> 33 |     const iframeWin: any = iframe?.contentWindow || iframe;
     |                                    ^
</code>```

Is there a way to solve this?

Body:
I am using nextjs with typescript, and I have the following code:

  useEffect(() => {

    const iframe = ref.current?.contentWindow;
    const iframeWin: any = iframe?.contentWindow || iframe;   <== error here
    const iframeDoc = iframe?.contentDocument || iframeWin.document;
    iframeDoc.addEventListener('click', (event) => {
      // do something...
   });
    eventListnerFrame();
  }, [eventListnerFrame]);

These lines works as expected in yarn dev, but when I do yarn build I am getting the following error:

Type error: Property 'contentWindow' does not exist on type 'Window'.
> 33 |     const iframeWin: any = iframe?.contentWindow || iframe;
     |                                    ^

Is there a way to solve this?


问:
Telegram.ext bot building
```<code>  File "c:\Users\21fin\Desktop\Python Learning\trial.py", line 5, in <module>
    updater = telegram.ext.updater( Token, use_context = True )
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'module' object is not callable
</code>```

what should i do?

```<code>import telegram.ext

Token = "my bot token"

updater = telegram.ext.updater( Token, use_context = True )

dispatcher = updater.dispatcher

</code>```

and i exepected the code to compile

Title: Telegram.ext bot building

Body:
  File "c:\Users\21fin\Desktop\Python Learning\trial.py", line 5, in <module>
    updater = telegram.ext.updater( Token, use_context = True )
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'module' object is not callable

what should i do?

import telegram.ext

Token = "my bot token"

updater = telegram.ext.updater( Token, use_context = True )

dispatcher = updater.dispatcher

and i exepected the code to compile


问:
VSCode intellisense default imports not working
I have following code in my library called @qual/utilities.

math.js

```<code>export default sum(a, b) { return a + b });
</code>```

index.js

```<code>export sum from './math'; // however vscode complains on this line - Declaration or statement expected.ts(1128)
</code>```

Babelrc looks like

```<code>{
  "plugins": [
    "@babel/plugin-proposal-export-namespace-from",
    "@babel/plugin-proposal-export-default-from",
</code>```

While consuming this library -

import { sum } from '@qual/utilities'; // also here I do not get any intellisense

How can I make I make VSCode work with this imports.

I tried setting eslint rules to disable warnings but that didn't work

```<code>"comma-dangle": ["error", {
   "arrays": "never",
   "objects": "never",
   "imports": "never",
   "exports": "never",
   "functions": "never"
}]
</code>```

Body:
I have following code in my library called @qual/utilities.

math.js

export default sum(a, b) { return a + b });

index.js

export sum from './math'; // however vscode complains on this line - Declaration or statement expected.ts(1128)

Babelrc looks like

{
  "plugins": [
    "@babel/plugin-proposal-export-namespace-from",
    "@babel/plugin-proposal-export-default-from",

While consuming this library -

import { sum } from '@qual/utilities'; // also here I do not get any intellisense

How can I make I make VSCode work with this imports.

I tried setting eslint rules to disable warnings but that didn't work

"comma-dangle": ["error", {
   "arrays": "never",
   "objects": "never",
   "imports": "never",
   "exports": "never",
   "functions": "never"
}]


问:
WASM issue resolution Manifest V3 Chromium Update
How is phantom handling the Manifest V3 chromium update? It seems that WASM will no longer be supported for extensions, and I was wondering how yall are planning to handle the change? I'm working on a related chrome extension project and have been hitting my head against a wall.

Basically, I've been working on a JS based web3 chrome extension, but significant portions of most libraries aren't going to be supported come the new year due to the manifest V3 update. I'm considering moving to mobile, but I'd rather not. I was wondering how Phantom's approaching the problem?

Thanks so much - huge fan!


问:
New Bloom Effect on YouTube video - Any ideas on how to reproduce it?
YouTube has a new bloom feature on their desktop site (I believe it is only available in dark mode). What's amazing is that as the video plays, the bloom effect changes with it. It's a moving bloom!

I think it's really nice, and it does not seem to lag at all on my computer.

Does anyone have any idea how they achieved this?

Thank you!


问:
Dart shelf router routes not being reached
I have written a simple backend RESTAPI web app. I can get the vehicles routes to work but not if i try to reach these routes: File: web/Network/service.dart line 22

```<code>    app.get('/vehicles/<id|.*>', (Request request, String id)  {
</code>```

or even something simple like this: File: web/Network/service.dart line 17

```<code>    app.get('/hi/<name|.*>', (Request request, String name) async {
</code>```

the / and /vehicles work. I have the code on github:
https://github.com/hassandaru/dart_middleware_example/blob/main/web/Network/service.dart

The issue bits are:
app.get('/hi/<name|.*>', (Request request, String name) async {
return await Response.ok('hello $name',headers: {'Content-Type': 'application/json' });
});

```<code>app.get('/vehicles/<id|.*>', (Request request, String id)  {
  final parseId = id.isNotEmpty ? id.toString() : '0';
  var result =   APICalls().fetchByID(parseId);
  //need to get result from result before sending it in json, find it j
  // return Response.ok(json.encode(result), headers: {'Content-Type': 'application/json'});
  return Response.ok(jsonEncode(result), headers: {'Content-Type': 'application/json'});
});
</code>```

It matches everything in the documentation. Any suggestions would be greatly appreciated.

```<code>import '../dbsettings.dart' as db;
import 'package:shelf_router/shelf_router.dart';
import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart' as io;
import 'dart:convert';
import 'apiCall.dart';

class Service {
  Handler get handler {
    var app = Router();

    app.get('/', (Request request)  {
      return Response.ok('hello transport API', headers: {'Content-Type': 'application/json'});
    });

    app.get('/hi/<name|.*>', (Request request, String name) async {
      return await Response.ok('hello $name',headers: {'Content-Type': 'application/json' });
    });

    app.get('/vehicles/<id|.*>', (Request request, String id)  {
      final parseId = id.isNotEmpty ? id.toString() : '0';
      var result =   APICalls().fetchByID(parseId);
      //need to get result from result before sending it in json, find it j
      // return Response.ok(json.encode(result), headers: {'Content-Type': 'application/json'});
      return Response.ok(jsonEncode(result), headers: {'Content-Type': 'application/json'});
    });

    //to read all entries of vehicle
    app.get('/vehicles', (Request request) async  {
      var result =  await APICalls().showAllVehicles();
      //need to get result from result before sending it in json, find it j
      // return Response.ok(json.encode(result), headers: {'Content-Type': 'application/json'});
      return Response.ok(jsonEncode(result), headers: {'Content-Type': 'application/json'});
    });

    return app;

  }
}
</code>```

Body:
I have written a simple backend RESTAPI web app. I can get the vehicles routes to work but not if i try to reach these routes: File: web/Network/service.dart line 22

    app.get('/vehicles/<id|.*>', (Request request, String id)  {

or even something simple like this: File: web/Network/service.dart line 17

    app.get('/hi/<name|.*>', (Request request, String name) async {

the / and /vehicles work. I have the code on github:
https://github.com/hassandaru/dart_middleware_example/blob/main/web/Network/service.dart

The issue bits are:
app.get('/hi/<name|.*>', (Request request, String name) async {
return await Response.ok('hello $name',headers: {'Content-Type': 'application/json' });
});

app.get('/vehicles/<id|.*>', (Request request, String id)  {
  final parseId = id.isNotEmpty ? id.toString() : '0';
  var result =   APICalls().fetchByID(parseId);
  //need to get result from result before sending it in json, find it j
  // return Response.ok(json.encode(result), headers: {'Content-Type': 'application/json'});
  return Response.ok(jsonEncode(result), headers: {'Content-Type': 'application/json'});
});

It matches everything in the documentation. Any suggestions would be greatly appreciated.

import '../dbsettings.dart' as db;
import 'package:shelf_router/shelf_router.dart';
import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart' as io;
import 'dart:convert';
import 'apiCall.dart';

class Service {
  Handler get handler {
    var app = Router();

    app.get('/', (Request request)  {
      return Response.ok('hello transport API', headers: {'Content-Type': 'application/json'});
    });

    app.get('/hi/<name|.*>', (Request request, String name) async {
      return await Response.ok('hello $name',headers: {'Content-Type': 'application/json' });
    });

    app.get('/vehicles/<id|.*>', (Request request, String id)  {
      final parseId = id.isNotEmpty ? id.toString() : '0';
      var result =   APICalls().fetchByID(parseId);
      //need to get result from result before sending it in json, find it j
      // return Response.ok(json.encode(result), headers: {'Content-Type': 'application/json'});
      return Response.ok(jsonEncode(result), headers: {'Content-Type': 'application/json'});
    });

    //to read all entries of vehicle
    app.get('/vehicles', (Request request) async  {
      var result =  await APICalls().showAllVehicles();
      //need to get result from result before sending it in json, find it j
      // return Response.ok(json.encode(result), headers: {'Content-Type': 'application/json'});
      return Response.ok(jsonEncode(result), headers: {'Content-Type': 'application/json'});
    });

    return app;

  }
}


问:
Using C# REST API to send TriggeredSend email - created in Content Builder in SFMC in C# code
I am totally new to SalesForce Marketing cloud.

We have a “Triggered Send” created using “Content Builder” with an email body with HTML attribuites. For eg. %%=v(@EVENT)=%% Invitation
There is a Customer_key for this TriggerSendDefinition

I am using FuelSDK –  to TriggerSend this email.
I have NUget Package manager install Fuel SDK in my Visual studio 2019 project.
The App.config has the “clientId” and “clientSecret” values in the FuelSDK config section.
Here is my code below.

```<code>public void TestInvitationSend(string CustomerKey)
    {

        string myName = "John Adams";
        string myEvent = "13989";

        string fullurl = baseAPIAuthURL + AuthTokenUrl;   // Values passed in
        NameValueCollection parameters = new NameValueCollection();
        parameters.Add("clientId", clientId);
        parameters.Add("clientSecret",clientSecret);
        parameters.Add("accountId", "account123");

        **ETClient myclient = new ETClient(parameters);**

        TriggeredSendDefinition definition = new TriggeredSendDefinition();
        definition.CustomerKey = customerKey;

        //subscriber to whom email is sent
        Subscriber subscriber = new Subscriber();
        subscriber.EmailAddress = myTest@test.com;
        subscriber.SubscriberKey = myTest@test.com;

        TriggeredSend triggeredsend = new TriggeredSend();
        triggeredsend.TriggeredSendDefinition = definition;
        triggeredsend.AuthStub = myclient;
        triggeredsend.CustomerKey = customerKey;
        triggeredsend.Subscribers = new Subscriber[] { subscriber };
        SendReturn results = triggeredsend.Send();
        Console.WriteLine("Send Status: " + results.Status.ToString());
          }
</code>```

I am getting a 404 error at the line in “bold” when initializing myClient and unable to pass-in values dynamically. Could not find much documentation for email send through code.
Can you point me to some examples of TriggerSend emails using REST API ?

Thanks

Body:
I am totally new to SalesForce Marketing cloud.

We have a “Triggered Send” created using “Content Builder” with an email body with HTML attribuites. For eg. %%=v(@EVENT)=%% Invitation
There is a Customer_key for this TriggerSendDefinition

I am using FuelSDK –  to TriggerSend this email.
I have NUget Package manager install Fuel SDK in my Visual studio 2019 project.
The App.config has the “clientId” and “clientSecret” values in the FuelSDK config section.
Here is my code below.

public void TestInvitationSend(string CustomerKey)
    {

        string myName = "John Adams";
        string myEvent = "13989";

        string fullurl = baseAPIAuthURL + AuthTokenUrl;   // Values passed in
        NameValueCollection parameters = new NameValueCollection();
        parameters.Add("clientId", clientId);
        parameters.Add("clientSecret",clientSecret);
        parameters.Add("accountId", "account123");

        **ETClient myclient = new ETClient(parameters);**

        TriggeredSendDefinition definition = new TriggeredSendDefinition();
        definition.CustomerKey = customerKey;

        //subscriber to whom email is sent
        Subscriber subscriber = new Subscriber();
        subscriber.EmailAddress = myTest@test.com;
        subscriber.SubscriberKey = myTest@test.com;

        TriggeredSend triggeredsend = new TriggeredSend();
        triggeredsend.TriggeredSendDefinition = definition;
        triggeredsend.AuthStub = myclient;
        triggeredsend.CustomerKey = customerKey;
        triggeredsend.Subscribers = new Subscriber[] { subscriber };
        SendReturn results = triggeredsend.Send();
        Console.WriteLine("Send Status: " + results.Status.ToString());
          }

I am getting a 404 error at the line in “bold” when initializing myClient and unable to pass-in values dynamically. Could not find much documentation for email send through code.
Can you point me to some examples of TriggerSend emails using REST API ?

Thanks


问:
Explanation of Var Scope & Why the Console Logs "3" for This Code
I am newer to learning javascript and still working through the basics. I'm also trying to wrap my head around some of the logic and wanting to make sure I clearly understanding the basics, before moving on to more difficult programming.

As I was learning, one of the things discussed was the var keyword's scope and the issues it can pose when declared globally. This code was given as an example:

`

```<code>var printNumTwo;
for (var i = 0; i < 3; i++) {
  if (i === 2) {
    printNumTwo = function() {
      return i;
    };
  }
}
console.log(printNumTwo());
</code>```

`

The console output for printNumTwo() is 3. However, I'm not understanding why this occurs.

This is what I'm getting from the code. The global variable is declared, but is undefined. However, the for loop would run and start at 0. 0 would fail the if statement, then the for loop would run again with i = 1. This would fail the for loop. Then the loop would run with i = 2, which would pass the for loop. This would then search in the global scope for a variable called printNumTwo and declare it, again, as a function that returns the i value. And, at that point, wouldn't the i value be 2?

I would appreciate any and all help to better understand why the output is 3 and what causes this to happen. Thank you!

Body:
I am newer to learning javascript and still working through the basics. I'm also trying to wrap my head around some of the logic and wanting to make sure I clearly understanding the basics, before moving on to more difficult programming.

As I was learning, one of the things discussed was the var keyword's scope and the issues it can pose when declared globally. This code was given as an example:

`

var printNumTwo;
for (var i = 0; i < 3; i++) {
  if (i === 2) {
    printNumTwo = function() {
      return i;
    };
  }
}
console.log(printNumTwo());

`

The console output for printNumTwo() is 3. However, I'm not understanding why this occurs.

This is what I'm getting from the code. The global variable is declared, but is undefined. However, the for loop would run and start at 0. 0 would fail the if statement, then the for loop would run again with i = 1. This would fail the for loop. Then the loop would run with i = 2, which would pass the for loop. This would then search in the global scope for a variable called printNumTwo and declare it, again, as a function that returns the i value. And, at that point, wouldn't the i value be 2?

I would appreciate any and all help to better understand why the output is 3 and what causes this to happen. Thank you!