Category Archives: How to Fix

mysql error 1033 Incorrect information in file: ‘xxx.frm’ (Fixed)

|mysql 1033 Incorrect startleinfo in file: ‘xxx.frm’ problem. The solution
Problem description Error prompt find problem solve problem

It is
Database 5.0 cannot open innoDB table, only open MySAM table
Database 5.0 startup exception, unable to start properly
3 database 5.0 crashed, unable to backup normally, unable to import and export normally
An error prompt
Peninel1 1033-peninelinfile: “.\ database name \ table name. FRM”
2 InnoDB: Error: unable to create temporary file; errno:
InnoDB: Error: logfile./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the. CNF file0 67108864 bytes!
Find the problem
1 Through the observation of the first error report, only the FRM table could not be qufied, but the MyISAM table could be used normally, so it was inferred that there might be problems with the mysql engine
2 mysql did not start normally, only mysql MyISAM engine started, but the InnoDB engine is abnormal
3 Query mysql engine Show Engines; Show variables like ‘% storage_engine %’; Related to this, you can see that InnoDB is in a state where disable is not enabled for the installation
What causes innoDB exceptions
Through the second error, it can be seen that innoDB table space can not be created normally
6 find innoDB table space location, for The C disk, C disk space is not too much
Change configuration file InnoDB engine temporary table space location tMPdir = “D:\ mySQLData” do not restart mysql on C drive
8. Mysql can be started normally after the repair, but it cannot submit the relevant data normally. Observe the configuration file, innodb_forCE_recovery needs to be closed (this parameter is used to force the repair of innoDB damaged data, and it is not recommended to use it if there is no backup)
To solve the problem
Change innoDB temporary table space location
2. Check whether innoDB engine is normal
3. As the disk space may be full, all temporary table Spaces should not be placed on The C disk in the future. In fact, the C disk space is not full, but the mysql temporary table space may not be able to establish files normally due to the water level and release problem, which may lead to log and data inconsistency and other problems
Modify configuration file temporary table space location restart
Encounter new problems
1. In this restart, I found that innoDB buff booted by 32-bit Windows system could not be booted with 2G. I set it down by 1G temporarily, solved the problem of freeing native memory, restarted and replaced the machine, etc
2 InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!

It turns out that the size of the log file is inconsistent with the description.
Removed the log file and restarted mysql, problem solved!

Note that innodb_fast_shutdown cannot be 2. You can use show variables like '%innodb_fast_shutdown%';in mysql to see if the default is 1.

3. There is no backup, so we need to be more careful and careful in operation. In the future, we should pay attention to remote backup
Reason: most of the tables in the database are MyISAM engine, and the default of the new table is to use the InnoDB engine, there is no problem, InnoDB can also run normally, looked at the configuration of the database is disabled InnoDB engine. As a result, this table which USES InnoDB engine by default cannot be opened. After starting InnoDB engine, this table returns to normal.

IOS WebView failed to load the web page. Error domain = kcferrodomaincfnetwork code = 310 “there was a problem communicating with the secure web proxy server (HTTPS). “

The error message
ErrorDomain =kCFErrorDomainCFNetwork Code=310 “Problem communicating with secure Web Proxy server (HTTPS).” The UserInfo = 0 x155e20e0 {_kCFStreamErrorCodeKey = – 2096, NSErrorFailingURLStringKey = https://api.leancloud.cn/1.1/batch/save, NSErrorFailingURLKey = https://api.leancloud.cn/1.1/batch/save, NSLocalizedDescription= Problem communicating with secure Web proxy server (HTTPS). , _kCFStreamErrorDomainKey = 4, NSLocalizedRecoverySuggestion = please check your proxy Settings. Please contact your system administrator for assistance with this issue. }
Load page error occurs when ios UIWebView loads HTTPS :Error Domain=NSURLErrorDomain Code=-1202 “This server’s certificate is invalid
In the case of such problems, first set the plIST file to allow true.
The following solutions
1. Declare it in the VC of the WebView

NSURLConnection *_urlConnection;

NSURLRequest *_request;

BOOL _authenticated;

2. Add the following methods to the VC of webView

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
{
    if (!_authenticated) {
        _authenticated =NO;
        _urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 
        _request = request; 
        [_urlConnection start];
        return NO;
    }
    return YES;
}
 
#pragma mark - NURLConnection delegate
 
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
    if ([challenge previousFailureCount] == 0)
    {
        _authenticated = YES;
        NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
        [challenge.sender useCredential:credential forAuthenticationChallenge:challenge];
    } else
    {
        [[challenge sender] cancelAuthenticationChallenge:challenge];
    }
}
 
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
    // remake a webview call now that authentication has passed ok.
    _authenticated = YES;
    [self.webView loadRequest:_request]; //  self.webView replace your webview
    // Cancel the URL connection otherwise we double up (webview + url connection, same url = no good!)
    [_urlConnection cancel];
}
 
// We use this method is to accept an untrusted site which unfortunately we need to do, as our PVM servers are self signed.
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
{
    return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];
}

And that should load the webView properly

Invalid operands to binary expression (‘double’ and ‘double’)

Invalid operands to Binary expression (‘ double ‘and’ double ‘)
In the following code, the implementation does something by getting the estimatedProgress to be a multiple of 5,

  double estimatedProgress = 100;

     if(estimatedProgress%5==0) {

         NSLog(@"");

    }

Resolves – type conversion to estimatedProgress to int

     if((int)estimatedProgress%5==0) {

         NSLog(@"");

    }

 

Bitcoin source code analysis – load Wallet

The next Step is the analysis of bitcoins main Core process of loading the purse in initialization, the corresponding source is SRC/init. The CPP AppInitMain () method of Step 8: the load wallet this part, see: https://github.com/bitcoin/bitcoin/blob/v0.16.1/src/init.cpp

    // ********************************************************* Step 8: load wallet
#ifdef ENABLE_WALLET
    if (!OpenWallets())
        return false;
#else
    LogPrintf("No wallet support compiled in!\n");
#endif

The key is the OpenDUTY () method:

bool OpenWallets()
{
    if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
        LogPrintf("Wallet disabled!\n");
        return true;
    }

    for (const std::string& walletFile : gArgs.GetArgs("-wallet")) {
        CWallet * const pwallet = CWallet::CreateWalletFromFile(walletFile);
        if (!pwallet) {
            return false;
        }
        vpwallets.push_back(pwallet);
    }

    return true;
}

According to “- wallet wallet file path of the parameter Settings” read the corresponding files to create the purse, and “- wallet” parameters by WalletParameterInteraction set () method:

bool WalletParameterInteraction()
{
    if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
        for (const std::string& wallet : gArgs.GetArgs("-wallet")) {
            LogPrintf("%s: parameter interaction: -disablewallet -> ignoring -wallet=%s\n", __func__, wallet);
        }

        return true;
    }

    gArgs.SoftSetArg("-wallet", DEFAULT_WALLET_DAT);

......

You can see that the “-Wallet” parameter is set to DEFAULT_WALLET_DAT by default, and DEFAULT_WALLET_DAT is defined in SRC/Wallet/Wallet. CPP:

const char * DEFAULT_WALLET_DAT = "wallet.dat";

That is, the default is to create a wallet by loading the wallet file from wallet. Dat.
WalletParameterInteraction () method by the previously mentioned AppInitParameterInteraction () method call.
The next step is to analyze the key CreateWalletFromFile() method, defined in SRC/Wallet/Wallet. CPP:

CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
{
    // needed to restore wallet transaction meta data after -zapwallettxes
    std::vector<CWalletTx> vWtx;

1. Clear your wallet of transaction data
Then look at the source code:

    if (gArgs.GetBoolArg("-zapwallettxes", false)) {
        uiInterface.InitMessage(_("Zapping all transactions from wallet..."));

        std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, walletFile));
        std::unique_ptr<CWallet> tempWallet = MakeUnique<CWallet>(std::move(dbw));
        DBErrors nZapWalletRet = tempWallet->ZapWalletTx(vWtx);
        if (nZapWalletRet != DB_LOAD_OK) {
            InitError(strprintf(_("Error loading %s: Wallet corrupted"), walletFile));
            return nullptr;
        }
    }

If the user has set the “-zapwallettxes” option, then clear all the transaction data of the wallet. Why clear the transaction data?This is because there may be transactions with low or no transaction fee, which can be eliminated by this option.
here is the ZapWalletTx() method that calls the CWallet class to clear the transaction, further followed, you can find the ZapWalletTx() method that calls the CWalletDB class to clear the transaction:

DBErrors CWalletDB::ZapWalletTx(std::vector<CWalletTx>& vWtx)
{
    // build list of wallet TXs
    std::vector<uint256> vTxHash;
    DBErrors err = FindWalletTx(vTxHash, vWtx);
    if (err != DB_LOAD_OK)
        return err;

    // erase each wallet TX
    for (uint256& hash : vTxHash) {
        if (!EraseTx(hash))
            return DB_CORRUPT;
    }

    return DB_LOAD_OK;
}

Locate the hash corresponding to all transactions in the collection vTxHash using the CWalletDB::FindWalletTx() method and then iterate through the collection calling the CWalletDB::EraseTx() method to clear the transaction.
Create a wallet

    uiInterface.InitMessage(_("Loading wallet..."));

    int64_t nStart = GetTimeMillis();
    bool fFirstRun = true;
    std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, walletFile));
    CWallet *walletInstance = new CWallet(std::move(dbw));
    DBErrors nLoadWalletRet = walletInstance->LoadWallet(fFirstRun);

The CWallet object is created, and then the LoadWallet() method is called to load the data from the Wallet. Dat file.
3. Upgrade your wallet

    if (gArgs.GetBoolArg("-upgradewallet", fFirstRun))
    {
        int nMaxVersion = gArgs.GetArg("-upgradewallet", 0);
        if (nMaxVersion == 0) // the -upgradewallet without argument case
        {
            LogPrintf("Performing wallet upgrade to %i\n", FEATURE_LATEST);
            nMaxVersion = CLIENT_VERSION;
            walletInstance->SetMinVersion(FEATURE_LATEST); // permanently upgrade the wallet immediately
        }
        else
            LogPrintf("Allowing wallet upgrade up to %i\n", nMaxVersion);
        if (nMaxVersion < walletInstance->GetVersion())
        {
            InitError(_("Cannot downgrade wallet"));
            return nullptr;
        }
        walletInstance->SetMaxVersion(nMaxVersion);
    }

If the “-UpgradeWallet” option is set, then the wallet upgrades according to the parameters.
4. Generate the primary and child private keys

    if (fFirstRun)
    {
        // ensure this wallet.dat can only be opened by clients supporting HD with chain split and expects no default key
        if (!gArgs.GetBoolArg("-usehd", true)) {
            InitError(strprintf(_("Error creating %s: You can't create non-HD wallets with this version."), walletFile));
            return nullptr;
        }
        walletInstance->SetMinVersion(FEATURE_NO_DEFAULT_KEY);

        // generate a new master key  生成主私钥
        CPubKey masterPubKey = walletInstance->GenerateNewHDMasterKey();
        if (!walletInstance->SetHDMasterKey(masterPubKey))
            throw std::runtime_error(std::string(__func__) + ": Storing master key failed");

        // Top up the keypool 生成子私钥,填充满密钥池
        if (!walletInstance->TopUpKeyPool()) {
            InitError(_("Unable to generate initial keys") += "\n");
            return nullptr;
        }

        walletInstance->SetBestChain(chainActive.GetLocator());
    }

A wallet is a collection of private keys. HD Cosmetic wallet requires a master private key, which is used to create a large number of child private keys.
4.1 to generate the private key
see CPubKey CWallet: : GenerateNewHDMasterKey () the source code

CPubKey CWallet::GenerateNewHDMasterKey()
{

    CKey key;
    key.MakeNewKey(true);

    int64_t nCreationTime = GetTime();
    CKeyMetadata metadata(nCreationTime);


    // calculate the pubkey
    CPubKey pubkey = key.GetPubKey();
    assert(key.VerifyPubKey(pubkey));


    // set the hd keypath to "m" -> Master, refers the masterkeyid to itself
    metadata.hdKeypath     = "m";
    metadata.hdMasterKeyID = pubkey.GetID();

    {
        LOCK(cs_wallet);

        // mem store the metadata
        mapKeyMetadata[pubkey.GetID()] = metadata;

		//将公钥私钥对写入到钱包的数据库文件中
        // write the key&metadata to the database
        if (!AddKeyPubKey(key, pubkey))
            throw std::runtime_error(std::string(__func__) + ": AddKeyPubKey failed");
    }

    return pubkey;
}

4.1.1 create private key

calls the CKey::MakeNewKey() method to generate a private key using the encrypted PRNG.
Public key generated by private key
call CPubKey ::GetPubKey() according to secp256k1 elliptic curve algorithm generated by private key:

CPubKey CKey::GetPubKey() const {
    assert(fValid);
    secp256k1_pubkey pubkey;
    size_t clen = CPubKey::PUBLIC_KEY_SIZE;
    CPubKey result;
    int ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &pubkey, begin());
    assert(ret);
    secp256k1_ec_pubkey_serialize(secp256k1_context_sign, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ?SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
    assert(result.size() == clen);
    assert(result.IsValid());
    return result;
}

4.1.3 mark the primary key
calls pubkey.getid () to calculate a CKeyID, which is actually a reference to the private key CKey and is used to uniquely identify a private key, but is represented by the Hash160 hash of the public key corresponding to the private key.
look at the source code:

    //! Get the KeyID of this public key (hash of its serialization)
    CKeyID GetID() const
    {
        return CKeyID(Hash160(vch, vch + size()));
    }

Write the public and private key pairs to the database file of the wallet
call the CWallet::AddKeyPubKey() method to write the public and private key pairs to the database file of the wallet:

bool CWallet::AddKeyPubKey(const CKey& secret, const CPubKey &pubkey)
{
    CWalletDB walletdb(*dbw);
    return CWallet::AddKeyPubKeyWithDB(walletdb, secret, pubkey);
}

4.2 generation of child key
bool CWallet::TopUpKeyPool(unsigned int kpSize) source code:

bool CWallet::TopUpKeyPool(unsigned int kpSize)
{
    {
        LOCK(cs_wallet);

        if (IsLocked())
            return false;

        // Top up key pool
        unsigned int nTargetSize;
        if (kpSize > 0)
            nTargetSize = kpSize;
        else
            nTargetSize = std::max(gArgs.GetArg("-keypool", DEFAULT_KEYPOOL_SIZE), (int64_t) 0);

        // count amount of available keys (internal, external)
        // make sure the keypool of external and internal keys fits the user selected target (-keypool)
        int64_t missingExternal = std::max(std::max((int64_t) nTargetSize, (int64_t) 1) - (int64_t)setExternalKeyPool.size(), (int64_t) 0);
        int64_t missingInternal = std::max(std::max((int64_t) nTargetSize, (int64_t) 1) - (int64_t)setInternalKeyPool.size(), (int64_t) 0);

        if (!IsHDEnabled() || !CanSupportFeature(FEATURE_HD_SPLIT))
        {
            // don't create extra internal keys
            missingInternal = 0;
        }
        bool internal = false;
        CWalletDB walletdb(*dbw);
        for (int64_t i = missingInternal + missingExternal; i--;)
        {
            if (i < missingInternal) {
                internal = true;
            }

            assert(m_max_keypool_index < std::numeric_limits<int64_t>::max()); // How in the hell did you use so many keys?
            int64_t index = ++m_max_keypool_index;
			
			//调用GenerateNewKey()方法生成公钥私钥对
            CPubKey pubkey(GenerateNewKey(walletdb, internal));
            if (!walletdb.WritePool(index, CKeyPool(pubkey, internal))) {
                throw std::runtime_error(std::string(__func__) + ": writing generated key failed");
            }

            if (internal) {
                setInternalKeyPool.insert(index);
            } else {
                setExternalKeyPool.insert(index);
            }
            m_pool_key_to_index[pubkey.GetID()] = index;
        }
        if (missingInternal + missingExternal > 0) {
            LogPrintf("keypool added %d keys (%d internal), size=%u (%u internal)\n", missingInternal + missingExternal, missingInternal, setInternalKeyPool.size() + setExternalKeyPool.size(), setInternalKeyPool.size());
        }
    }
    return true;
}

5. Scan the blockchain and add relevant transactions to the wallet

    CBlockIndex *pindexRescan = chainActive.Genesis();
    if (!gArgs.GetBoolArg("-rescan", false))
    {
        CWalletDB walletdb(*walletInstance->dbw);
        CBlockLocator locator;
        if (walletdb.ReadBestBlock(locator))
            pindexRescan = FindForkInGlobalIndex(chainActive, locator);
    }

    walletInstance->m_last_block_processed = chainActive.Tip();
    RegisterValidationInterface(walletInstance);

    if (chainActive.Tip() && chainActive.Tip() != pindexRescan)
    {
        //We can't rescan beyond non-pruned blocks, stop and throw an error
        //this might happen if a user uses an old wallet within a pruned node
        // or if he ran -disablewallet for a longer time, then decided to re-enable
        if (fPruneMode)
        {
            CBlockIndex *block = chainActive.Tip();
            while (block && block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA) && block->pprev->nTx > 0 && pindexRescan != block)
                block = block->pprev;

            if (pindexRescan != block) {
                InitError(_("Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)"));
                return nullptr;
            }
        }

        uiInterface.InitMessage(_("Rescanning..."));
        LogPrintf("Rescanning last %i blocks (from block %i)...\n", chainActive.Height() - pindexRescan->nHeight, pindexRescan->nHeight);

        // No need to read and scan block if block was created before
        // our wallet birthday (as adjusted for block time variability)
        while (pindexRescan && walletInstance->nTimeFirstKey && (pindexRescan->GetBlockTime() < (walletInstance->nTimeFirstKey - TIMESTAMP_WINDOW))) {
            pindexRescan = chainActive.Next(pindexRescan);
        }

        nStart = GetTimeMillis();
        {
            WalletRescanReserver reserver(walletInstance);
            if (!reserver.reserve()) {
                InitError(_("Failed to rescan the wallet during initialization"));
                return nullptr;
            }
            walletInstance->ScanForWalletTransactions(pindexRescan, nullptr, reserver, true);
        }
        LogPrintf(" rescan      %15dms\n", GetTimeMillis() - nStart);
        walletInstance->SetBestChain(chainActive.GetLocator());
        walletInstance->dbw->IncrementUpdateCounter();

        // Restore wallet transaction metadata after -zapwallettxes=1
        if (gArgs.GetBoolArg("-zapwallettxes", false) && gArgs.GetArg("-zapwallettxes", "1") != "2")
        {
            CWalletDB walletdb(*walletInstance->dbw);

            for (const CWalletTx& wtxOld : vWtx)
            {
                uint256 hash = wtxOld.GetHash();
                std::map<uint256, CWalletTx>::iterator mi = walletInstance->mapWallet.find(hash);
                if (mi != walletInstance->mapWallet.end())
                {
                    const CWalletTx* copyFrom = &wtxOld;
                    CWalletTx* copyTo = &mi->second;
                    copyTo->mapValue = copyFrom->mapValue;
                    copyTo->vOrderForm = copyFrom->vOrderForm;
                    copyTo->nTimeReceived = copyFrom->nTimeReceived;
                    copyTo->nTimeSmart = copyFrom->nTimeSmart;
                    copyTo->fFromMe = copyFrom->fFromMe;
                    copyTo->strFromAccount = copyFrom->strFromAccount;
                    copyTo->nOrderPos = copyFrom->nOrderPos;
                    walletdb.WriteTx(*copyTo);
                }
            }
        }
    }

If the user sets the “-rescan” option, starting with the creation block, gets the location where the wallet transaction needs to be re-updated, and then begins scanning the block to add the relevant transaction to the wallet. Under the analysis of the corresponding ScanForWalletTransactions () method:

/**
 * Scan the block chain (starting in pindexStart) for transactions
 * from or to us. If fUpdate is true, found transactions that already
 * exist in the wallet will be updated.
 *
 * Returns null if scan was successful. Otherwise, if a complete rescan was not
 * possible (due to pruning or corruption), returns pointer to the most recent
 * block that could not be scanned.
 *
 * If pindexStop is not a nullptr, the scan will stop at the block-index
 * defined by pindexStop
 *
 * Caller needs to make sure pindexStop (and the optional pindexStart) are on
 * the main chain after to the addition of any new keys you want to detect
 * transactions for.
 */
CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlockIndex* pindexStop, const WalletRescanReserver &reserver, bool fUpdate)
{
    int64_t nNow = GetTime();
    const CChainParams& chainParams = Params();

    assert(reserver.isReserved());
    if (pindexStop) {
        assert(pindexStop->nHeight >= pindexStart->nHeight);
    }

    CBlockIndex* pindex = pindexStart;
    CBlockIndex* ret = nullptr;
    {
        fAbortRescan = false;
        ShowProgress(_("Rescanning..."), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup
        CBlockIndex* tip = nullptr;
        double dProgressStart;
        double dProgressTip;
        {
            LOCK(cs_main);
            tip = chainActive.Tip();
            dProgressStart = GuessVerificationProgress(chainParams.TxData(), pindex);
            dProgressTip = GuessVerificationProgress(chainParams.TxData(), tip);
        }
        while (pindex && !fAbortRescan)
        {
            if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0) {
                double gvp = 0;
                {
                    LOCK(cs_main);
                    gvp = GuessVerificationProgress(chainParams.TxData(), pindex);
                }
                ShowProgress(_("Rescanning..."), std::max(1, std::min(99, (int)((gvp - dProgressStart)/(dProgressTip - dProgressStart) * 100))));
            }
            if (GetTime() >= nNow + 60) {
                nNow = GetTime();
                LOCK(cs_main);
                LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));
            }

            CBlock block;
            if (ReadBlockFromDisk(block, pindex, Params().GetConsensus())) {
                LOCK2(cs_main, cs_wallet);
                if (pindex && !chainActive.Contains(pindex)) {
                    // Abort scan if current block is no longer active, to prevent
                    // marking transactions as coming from the wrong block.
                    ret = pindex;
                    break;
                }
                for (size_t posInBlock = 0; posInBlock < block.vtx.size(); ++posInBlock) {
                    AddToWalletIfInvolvingMe(block.vtx[posInBlock], pindex, posInBlock, fUpdate);
                }
            } else {
                ret = pindex;
            }
            if (pindex == pindexStop) {
                break;
            }
            {
                LOCK(cs_main);
                pindex = chainActive.Next(pindex);
                if (tip != chainActive.Tip()) {
                    tip = chainActive.Tip();
                    // in case the tip has changed, update progress max
                    dProgressTip = GuessVerificationProgress(chainParams.TxData(), tip);
                }
            }
        }
        if (pindex && fAbortRescan) {
            LogPrintf("Rescan aborted at block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));
        }
        ShowProgress(_("Rescanning..."), 100); // hide progress dialog in GUI
    }
    return ret;
}

Read the source code of this method, you can see that all the block data is stored on disk. ChainActive stores the block’s location index chain. By walking through this location index chain, call ReadBlockFromDisk() to read the block information from disk, and then add the block’s transaction data to the wallet by the AddToWalletIfInvolvingMe() method.

In IOS development, there is an error: Apple mach-o linker error

Small make up in a small demo letter about ring, ring of import letter SDK (EaseMobSDK), the connection of the error, as shown in the figure below:

solution is in general, the following figure, respectively, in the absence of label arrow to add compiler needs. M files and the necessary framework:

and the small make up the problem here is not more than compile files and framework problem, the solution is,

in the third arrow to add: -obJC, and then you just recompile.

MySQL password setting error message: error 1054 (42s22): unknown column ‘password’ in ‘field list’

Today, in the last step of installing MySQL, there was an error when setting the password for MySQL!!
ERROR 1054 (42S22): Unknown column ‘password’ in ‘field list’
Do along while just know, can change password through password-free login way.
First of all, let’s go to the mysql master configuration file and add a command as follows:

skip-grant-tables

After adding, save and restart MySQL service.

systemctl  restart  mysqld

If you log into mysql database again, you can log in directly without password, and then change the password again, as follows:

update mysql.user set authentication_string=password('password') where user='account' ;

Log out of mysql service and log in again!!

The next problem is that the MySQL password has suddenly expired, with an error message:
ERROR 1862 (HY000): Your password has expired. To log in you must change
Error 1862(HY000): Your password has expired. Login must change it to use a client that supports expired passwords.
The solution is as follows:
Login to MySQL service in passpassage-free mode, as mentioned above, simply add a line of skip-gran-tables parameter to the configuration file, and then view the root user’s details after you enter MySQL.

# mysql -u root -p
        > use mysql
        > select * from mysql.user where user='root' \G

See the following information:

*************************** 1. row ***************************
                  Host: localhost
                  User: root
           Select_priv: Y
           Insert_priv: Y
           Update_priv: Y
           Delete_priv: Y
           Create_priv: Y
             Drop_priv: Y
           Reload_priv: Y
         Shutdown_priv: Y
          Process_priv: Y
             File_priv: Y
            Grant_priv: Y
       References_priv: Y
            Index_priv: Y
            Alter_priv: Y
          Show_db_priv: Y
            Super_priv: Y
 Create_tmp_table_priv: Y
      Lock_tables_priv: Y
          Execute_priv: Y
       Repl_slave_priv: Y
      Repl_client_priv: Y
      Create_view_priv: Y
        Show_view_priv: Y
   Create_routine_priv: Y
    Alter_routine_priv: Y
      Create_user_priv: Y
            Event_priv: Y
          Trigger_priv: Y
Create_tablespace_priv: Y
              ssl_type:
            ssl_cipher:
           x509_issuer:
          x509_subject:
         max_questions: 0
           max_updates: 0
       max_connections: 0
  max_user_connections: 0
                plugin: mysql_native_password
 authentication_string: *AC241830FFDDC8943AB31CBD47D758E79F7953EA
      password_expired: N
 password_last_changed: 2015-11-11 16:52:49
     password_lifetime: NULL
        account_locked: N
1 row in set (0.00 sec)

Change password_EXPIRED to unexpired

 >  update user set password_expired='N' where user='root';
 > flush privileges;
 > quit

Finally, annotate the skip-Grant-tables parameter, restart MySQL service, and log in MySQL service again!!

didFailWithError: Error Domain=kCLErrorDomain Code=0 “The operation couldn’t be completed. (kCLError

I believe that many people have encountered this problem, the Internet is also by a variety of answers which this calculate more comprehensive
The reason for the error is the project — &gt in Xcode; The scheme – & gt; Edit scheme – & gt; The options – & gt; The core location – & gt; Error allowing location simulation;
solutions:

    if it is already set, uncheck it and save it; The simulator – & gt; Reset content and Settings: re-check allow location simulation, then reset content and Settings

Most people should have solved the problem, but I didn’t… And the solution is this

It’s not because I’m in Hong Kong. It’s because there’s only one Chinese in Hong Kong.
will not report an error after it is set. In fact, it is to specify the position of the simulator. I don’t know why the simulator cannot be automatically positioned, so I can test with the real machine

Learn iOS, he is enough, small code brother video, wisdom, dark horse, all kinds of Swift books

coretelephony trace file error

Encountered problems:
Xcode compiles correctly, but is Unable to start the simulator. Prompt: Unable to boot the simulator. I looked up a lot of information and tried a lot of methods but nothing worked.
As indicated in coretelephony trace file error, she reminds me that it may be related to this.

Solutions:
Update the macOS. Find macOS in the AppStore and upgrade the system.

How to Fix RTL8188 “Set Mode” (8B06) Error

To get 8188 into Monitor mode while using RTL8188, use the following setup instructions:

iwconfig ra0 mode monitor

But the print appears as follows:

Error for wireless request "Set Mode" (8B06) :
    SET failed on device ra0 ; Operation not supported.
device ra0 entered promiscuous mode

Note that this operation is not supported because iwconfig does not support it, but check that iwconfig supports setting modes

~ # iwconfig --help
Usage: iwconfig [interface]
                interface essid {NNN|any|on|off}
                interface mode {managed|ad-hoc|master|...}
                interface freq N.NNN[k|M|G]
                interface channel N
                interface bit {N[k|M|G]|auto|fixed}
                interface rate {N[k|M|G]|auto|fixed}
                interface enc {NNNN-NNNN|off}
                interface key {NNNN-NNNN|off}
                interface power {period N|timeout N|saving N|off}
                interface nickname NNN
                interface nwid {NN|on|off}
                interface ap {N|off|auto}
                interface txpower {NmW|NdBm|off|auto}
                interface sens N
                interface retry {limit N|lifetime N}
                interface rts {N|auto|fixed|off}
                interface frag {N|auto|fixed|off}
                interface modulation {11g|11a|CCK|OFDMg|...}
                interface commit 
       Check man pages for more details.
~ # 

Then I looked at the driver source code and found that the driver source code turned off Monitor mode by default, as follows:

CONFIG_WIFI_MONITOR = n

Rewrite N to Y, then recompile the driver, burn it to the device, and the test can be set to Monitor mode as normal.

Python error: permissionerror: [errno 13] permission denied solution details

Error message
During the process of using Python to make a data set, the following error was reported:

The reason for the error
The error translates as:

Permission error: [Errno 13] permission denied:

The error occurs when the file cannot be opened. It can occur when the file cannot be found, is occupied, has no access, or is opened not to a file but to a directory.
The solution
The solution is as follows:

1. Check whether the file under the corresponding path exists and is occupied. If the file does not exist, just find the corresponding file; If the file exists and is occupied, the occupying program is temporarily closed.
2. Modify the permissions of CMD to run as administrator.
3. Check if the folder is open.