Category Archives: How to Fix

Xcode – pbxcp Error Repair – no such file or directory

Xcode-pbxcp error fixes -No such file or directory, which is almost a common compilation error in Xcode. The reason is usually caused by an error when adding or deleting art resources. It’s a small problem, but it comes up quite frequently.

Solutions (try one after the other, and there is always one that will solve the problem) :
Methods 1. Xcode, then from the finder and into the ~/Library/Developer/Xcode/DerivedData delete all the content inside, and then restart Xcode give it a try

Method 2. The above operations can also be performed directly in The Xcode organizer, switch to projects in the organizer, and then delete derivedData
Delete the PrefixHeader values from the Target Settings and try restarting Xcode
Finally, restore the setting of the Prefix Header

Method 3:
It’s still in Xcode
Project – the targets – buildphases,
Then delete the red error resource file from copy Bundleresources

Mac OS error in make pycaffe times failure error:’python.h’file not found resolved

After installing caffe, report the following error when executing Make Pycaffe in caffe/build:

 linxierdeAir:caffe linxier$ cd build
linxierdeAir:build linxier$ make pycaffe
[  1%] Built target caffeproto
[ 98%] Built target caffe
[ 98%] Building CXX object python/CMakeFiles/pycaffe.dir/caffe/_caffe.cpp.o
/Users/linxier/caffe/python/caffe/_caffe.cpp:1:10: fatal error: 'Python.h' file
      not found
#include <Python.h>  // NOLINT(build/include_alpha)
         ^~~~~~~~~~
1 error generated.
make[3]: *** [python/CMakeFiles/pycaffe.dir/caffe/_caffe.cpp.o] Error 1
make[2]: *** [python/CMakeFiles/pycaffe.dir/all] Error 2
make[1]: *** [python/CMakeFiles/pycaffe.dir/rule] Error 2
make: *** [pycaffe] Error 2

Solutions:

Export CPLUS_INCLUDE_PATH =/System/Library/Frameworks/Python framework Versions/2.7/include/python2.7

Reference links: https://stackoverflow.com/questions/35778495/fatal-error-python-h-file-not-found-while-installing-opencv
the path name to your computer contains Python. H folder path, after successful compilation.

A server error occurred. Please contact the administrator.

preface
Regarding the site management of Django, the login site admin encountered A server error “A Server error occurred. Please contact the Administrator.”
why
Localization, letter case didn’t pay attention to, the right is LANGUAGE_CODE = 'useful - Hans and TIME_ZONE =' Asia/Shanghai , then analysis is setting up the contents of the file is changed after cannot be interpreter identification, so later met the same problem can according to this train of thought analysis (then if new create a project to try again, or if the original error, before the project could be open). Without the model migration, the project's data tables will not be generated, and the login site is a data table operation. Without the migration, how can you log into the site if there are no tables?

MySQL error code 1217 (ER_ROW_IS_REFERENCED): Cannot delete or update a parent row: a foreign key co

There was an error copying the development environment from the library with the following error message:
mysql> show slave status\G;
Last_Errno: 1217
Last_Error: Error ‘Cannot delete or update a parent row: a foreign key constraint fails’ on query.
# perror 1217
MySQL error code 1217 (ER_ROW_IS_REFERENCED): Cannot delete or update a parent row: a foreign key constraint fails
mysql> show variables like ‘foreign_key_checks’;
+ — — — — — — — — — — — — — — — — — — — – + — — — — — — — +
| Variable_name Value | |
+ — — — — — — — — — — — — — — — — — — — – + — — — — — — — +
| foreign_key_checks | ON |
+ — — — — — — — — — — — — — — — — — — — – + — — — — — — — +
1 row in the set (0.00) sec)

Solution:
1. First stop slave, forbid foreign key constraint detection, start slave;
stop slave; set global foreign_key_checks =off; start slave;

2. Observe the normal synchronous replication by show Slave Status \G, start the foreign key constraint detection, and restart the replication.

set global foreign_key_checks =off; stop slave; start slave;
This operation is limited to the development environment and should be used with caution in the production environment.

AngularJS–[ng:areq] Argument ‘xxCtrl’ is not a function, got undefined! Error (Fixed)

In the Angular Chinese community, we sometimes hear students asking about “ng:areq” errors:

 [ng:areq] Argument 'DemoCtrl' is not a function, got undefined!

This is often due to forgetting to define a Controller or declaring a module multiple times, which will cause the previous module definition information to be cleared, so the application will not find the defined component. We also know this from the Angular source (from Loader.js) :

function setupModuleLoader(window) {
            ...
            function ensure(obj, name, factory) {
                return obj[name] || (obj[name] = factory());
            }
            var angular = ensure(window, 'angular', Object);
            return ensure(angular, 'module', function() {
                var modules = {};
                return function module(name, requires, configFn) {
                    var assertNotHasOwnProperty = function(name, context) {
                        if (name === 'hasOwnProperty') {
                            throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
                        }
                    };

                    assertNotHasOwnProperty(name, 'module');
                    if (requires && modules.hasOwnProperty(name)) {
                        modules[name] = null;
                    }
                    return ensure(modules, name, function() {
                        if (!requires) {
                            throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " +
                                "the module name or forgot to load it. If registering a module ensure that you " +
                                "specify the dependencies as the second argument.", name);
                        }
                        var invokeQueue = [];
                        var runBlocks = [];
                        var config = invokeLater('$injector', 'invoke');
                        var moduleInstance = {
                            _invokeQueue: invokeQueue,
                            _runBlocks: runBlocks,
                            requires: requires,
                            name: name,
                            provider: invokeLater('$provide', 'provider'),
                            factory: invokeLater('$provide', 'factory'),
                            service: invokeLater('$provide', 'service'),
                            value: invokeLater('$provide', 'value'),
                            constant: invokeLater('$provide', 'constant', 'unshift'),
                            animation: invokeLater('$animateProvider', 'register'),
                            filter: invokeLater('$filterProvider', 'register'),
                            controller: invokeLater('$controllerProvider', 'register'),
                            directive: invokeLater('$compileProvider', 'directive'),
                            config: config,
                            run: function(block) {
                                runBlocks.push(block);
                                return this;
                            }
                        };
                        if (configFn) {
                            config(configFn);
                        }
                        return moduleInstance;

                        function invokeLater(provider, method, insertMethod) {
                            return function() {
                                invokeQueue[insertMethod || 'push']([provider, method, arguments]);
                                return moduleInstance;
                            };
                        }
                    });
                };
            });
        }

In the code, we learn that Angular sets the global Angular object at startup and publishes the Module API on the Angular object. For the module API code, you can clearly see the first predicate sentence, module name cannot be named after hasOwnProperty, otherwise it will throw the “badname” error message. Next, if the name parameter is passed in, which represents a declaration of a module, the existing module information is deleted and set to null.
From the definition of moduleInstance, we can see that the apis exposed for us are: invokeQueue, runBlocks, Requires, provider, Factory, Servic, value, Constant, animation, Filter, Controller, directive, config, run. InvokeQueue and runBlocks is as agreed in the name of the private property, please do not use other apis are our common presents component definition method, see this class presents the invokeLater code from the component definition of return is still moduleInstance instances, this creates a fluent API, it is recommended to use chain defines these components, rather than a statement of a global module variables.
Finally, if the third parameter, configFn, is passed in, it will be configured into the config information. When Angular enters the config phase, they will in turn execute the pre-instantiation configuration for Angular applications or Angular components such as services.

E11000 duplicate key error collection in mongodb


id repetition error occurs when mongodb is inserting data. The specific error code is as follows:

 { [MongoError: E11000 duplicate key error collection: zhihu.people index: _id_ dup key: { : ObjectId('59a3b9275f063c20cc8bdec7') }]
  name: 'MongoError',
  message: 'E11000 duplicate key error collection: zhihu.people index: _id_ dup key: { : ObjectId(\'59a3b9275f063c20cc8bdec7\') }',
  driver: true,
  index: 0,
  code: 11000,
  errmsg: 'E11000 duplicate key error collection: zhihu.people index: _id_ dup key: { : ObjectId(\'59a3b9275f063c20cc8bdec7\') }' }

baidu once, found that many people have a similar problem, some people say that since removed manually generated id can solve, someone says to empty the collection.
turns out to be useless, however, as the database id appears to be generated based on the timestamp + host + process + sequence. There are two possible reasons for the repetition:
internal reasons: insert two pieces of data at the same time, causing the database to generate the same id value.
external reason: using the same variable to store different data each time causes the database to think that it stores the same data each time and finally generates the same id value.
All of the above have one thing in common: let the database generate the ID value itself.
then found a post on stockoverflow that gave me the hint.

 If a document does not have a value for the indexed field in a unique index, the index will store a null value for this document. Because of the unique constraint, MongoDB will only permit one document that lacks the indexed field. If there is more than one document without a value for the indexed field or is missing the indexed field, the index build will fail with a duplicate key error.

You can combine the unique constraint with the sparse index to filter these null values from the unique index and avoid the error.

Sparse indexes only contain entries for documents that have the indexed field, even if the index field contains a null value.

: due to unique constraints, MongoDB will only allow one file, missing index fields. An error is reported if more than one document does not have the value of an index field or is missing an index field
Add the ID value yourself manually, and mongoDB will no longer automatically generate the ID when the inserted data has a field of _ID.
so far, the mongodb duplicate id problem is solved. Of course, there must be a better solution, I think of a follow-up to add.

Error: could not find a version that satisfies the requirement flake8 (from versions: none) (Fixed)

ERROR: Could not find a version that satisfies the requirement flake8 (from versions: none)
ERROR: No matching distribution found for flake8
Instead of using https://pypi.python.org, we’re using a mirror site, which is:
http://pypi.doubanio.com/simple/
The corresponding command line is

pip install package_name  -i http://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com

Couldn’t reserve space for cygwin’s heap, Win32 error 487

Couldn’t Reserve space for Cygwin’s heap, Win32 Error 487 occurred when Git was being committed or pulled, the solution was:
Locate the bin folder of Git’s installation directory, open a command window here, and execute the following command:
Rebase. Exe – b 0 x50000000 msys – 1.0. DLL
Both rebase.exe and Msys-1.0.DLL are files in the bin folder

ORA-19502: write error on file “”, block number (block size=)

1. Problem description
Check the alert to find the following error:
Wed Jun 08 23:03:50 2016
LNS: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (19502)
LNS: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned
Error 19502 for archive log file 5 to ‘PRODS’
Errors in file /u01/PROD/oracle/diag/rdbms/prod/PROD1/trace/PROD1_nsa2_25439.trc:
Ora-19502: write error on file “”, block number (block size=)
LNS: Failed to archive log 5 thread 1 sequence 22037 (19502)
Check DG:
Dragon Boat Festival holiday found a few days of archiving has not been applied in the library, nor has it passed
SQL>
1* select dest_name, error from v$archive_dest
SQL> /

DEST_NAME ERROR
—————————————- —————————————————————–
LOG_ARCHIVE_DEST_1
LOG_ARCHIVE_DEST_2 ORA-19502: Write error on file “”, block number (block size=)
LOG_ARCHIVE_DEST_3
2. Problem analysis
According to the alert, the LOG_ARCHIVE_DEST_2 error should be reported due to network reasons
Go back to the library and apply the process MRP0 and it’s stopped
3. Problem solving
Check the logs in the main library in recent days (11g will be retained if the backup library logs are not applied)
First enable the main library LOG_ARCHIVE_DEST_2
SQL> The alter system set log_archive_dest_state_2 = enable;
System altered.
SQL>
SQL> select dest_name, error from v$archive_dest;
DEST_NAME ERROR
—————————————- —————————————————————–
LOG_ARCHIVE_DEST_1
LOG_ARCHIVE_DEST_2
LOG_ARCHIVE_DEST_3
LOG_ARCHIVE_DEST_4
LOG_ARCHIVE_DEST_5
Disable as follows:

The alter system set log_archive_dest_state_2 = defer;  

Logs have also been transferred:
Reserve the library to start the application process:
SQL> alter database recover managed standby database disconnect from session;
Check the backup storage again. DG is running normally
SQL> L
1* select PROCESS,STATUS, THREAD#,SEQUENCE# from v$managed_standby
SQL>/

the PROCESS STATUS THREAD# SEQUENCE#
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
the ARCH CLOSING 1 22036
ARCH CLOSING 2 15425
ARCH CLOSING 2 15116
ARCH CLOSING 1 22197
RFS WRITING 1 22198
RFS WRITING 2 15485
APPLYING_LOG1
RFS WRITING 1 22088
RFS WRITING 1 22089
RFS WRITING 2 15532
RFS OPENING 2 15486

PROCESS STATUS THREAD# SEQUENCE#
—- — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
RFS CLOSING 2 15484
RFS WRITING 1, 22087,

13 rows selected.

SQL>
In another case, the MRP is not applied after the log transfer, showing the log that has been waiting to exist, and the MRP can be restarted
SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered.

SQL> select PROCESS,STATUS, THREAD#,SEQUENCE# from v$managed_standby;

the PROCESS STATUS THREAD# SEQUENCE#
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
the ARCH CLOSING 2 7450
the ARCH CLOSING 1 6856
the ARCH CLOSING 2 7449
the ARCH WRITING 2 Br> RFS RECEIVING1 7471
RFS WRITING 2 7568
RFS RECEIVING2 7495
RFS RECEIVING1 7470
RFS WRITING 1 7522
RFS WRITING 1 7472
MRP0 APPLYING_LOG2 7459
RFS RECEIVING2 7496

13 rows selected.

SQL>

Shell script syntax error near unexpected token ‘$’Do

Problem phenomenon:
Run shell script: Syntax error near unexpected token ‘$’ do\r
Problem analysis:
Nodepad++ does not show a $sign, it should be hidden
Causes:
Open notepad++ and click view -> Display symbol -& GT; Displays all symbols and finds that the return newline characters on Linux and Windows are incompatible
Unix is: & lt; LF> : /n

DOS is: < CR> < LF> : /r/n

MAC is: < CR>/r:
Problem Solving:
Use the DOS2UNIX tool for processing.
Install DOS2UNIX on Linux: Sudo Apt-get install dos2UNIX (install with different commands depending on the system)
After a successful installation, you can define a shell script or execute a command manually
Dos2unix *. Sh
So, as you can see: dos2UNIX: converting File eval1.sh to Unix format…
This will convert this file to an executable file under Linux.

About fatal error in GC: too many threads

One of the programs I wrote before has been tested on one machine and has not been tested on another. I can’t figure out why. At first I thought it was a computer problem, but later I found that it would not appear in the place where the network is good, and the place where the network is bad is often seen. At the time of double code is found written in the Update, a StartCoroutine invoke the WWW class, every call Update will open a thread calls the WWW, under the condition of network good WWW can be returned in time, there will not be Too Many threads, once the network condition is bad, this way has been pulling thread, there waiting for the thread to return again, leading to excess thread, appear “Too Many threads”, I used the solution is put WWW calls in a while (true), Each call to WWW must wait for the last WWW return.