I had the same problem. This worked for me on mac: echo "set enable-bracketed-paste off" >> ~/.inputrc In the shell, you can't execute more than one statement at a time: >>> x = 5 y = 6 SyntaxError: multiple statements found while compiling a single statement You need to execute them one by one: >>> x = 5 >>> y = … [Read more...]
Exception Handling in C++ Terminate called after throwing an instance of ‘char const*’
A string literal is not a std::string. You throw the former, but try to catch the latter. Despite the fact a std::string may be constructed from a string literal, it won't happen in a catch clause. The conversions which are allowed in a catch clause are detailed in [except.handle]/3: terminate called after throwing an instance of 'char const*' A handler is a match for an … [Read more...]
How to query MongoDB with “like”
That would have to be: db.users.find({"name": /.*m.*/}) Or, similar: db.users.find({"name": /m/}) You're looking for something that contains "m" somewhere (SQL's '%' operator is equivalent to regular expressions' '.*'), not something that has "m" anchored to the beginning of the string. Note: MongoDB uses regular expressions which are more powerful than "LIKE" in SQL. … [Read more...]
gpg: no valid OpenPGP data found
This problem might occur if you are behind corporate proxy and corporation uses its own certificate. Just add "--no-check-certificate" in the command. e.g. wget --no-check-certificate -qO - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - It works. If you want to see what is going on, you can use verbose command instead of quiet before adding … [Read more...]
How to fix “Underfull hbox (badness 10000)” warning?
underfull \hbox (badness 10000) in paragraph Instead of forcing an underfull box with newline, you could simply leave an empty line to start a new … [Read more...]
(Google Map API) Geocode was not successful for the following reason: REQUEST_DENIED
Did you enable the Billing for API Key? Google Maps is no longer free. You have to associate a credit card so that you can get billed if your site has requests that exceed the $200 credit they give you monthly for free. geocode was not successful for the following reason: request_denied First of all, the problem was loading the scripts as async, remove it.. try that … [Read more...]
terminate called after throwing an instance of ‘std::invalid_argument’ what(): stoi
It means you are giving std::stoi() bad input, so it is throwing a std::invalid_argument exception that you are not catching. std::stoi, std::stol, std::stoll: terminate called after throwing an instance of 'std::invalid_argument' what(): stoi Exceptions std::invalid_argument if no conversion could be performed std::out_of_range if the converted value would fall out … [Read more...]
How do I delete a Git branch locally and remotely?
Delete Local Branch To delete the local branch use one of the following: $ git branch -d branch_name $ git branch -D branch_name Note: The -d option is an alias for --delete, which only deletes the branch if it has already been fully merged in its upstream branch. You could also use -D, which is an alias for --delete --force, which deletes the branch "irrespective of its … [Read more...]
How do I check out a remote Git branch?
While the first and selected answer is technically correct, there's the possibility you have not yet retrieved all objects and refs from the remote repository. If that is the case, you'll receive the following error: $ git checkout -b remote_branch origin/remote_branch fatal: git checkout: updating paths is incompatible with switching branches. Did you intend to checkout … [Read more...]
Git: How do I force “git pull” to overwrite local files?
If you have any files that are not tracked by Git (e.g. uploaded user content), these files will not be affected. First, run a fetch to update all origin/<branch> refs to latest: git fetch --all Backup your current branch: git branch backup-master Then, you have two options: git reset --hard origin/master OR If you are on some other branch: git reset … [Read more...]