“unary operator expected” error in Bash if condition

If you know you’re always going to use Bash, it’s much easier to always use the double bracket conditional compound command [[ … ]], instead of the POSIX-compatible single bracket version [ … ]. Inside a [[ … ]] compound, word-splitting and pathname expansion are not applied to words, so you can rely on to compare the value of $aug1 with … Read more

Curl command for https ( SSL )

if you’re using a self signed certificate on the server, you can use: but be aware that then it’s no better than using non SSL connection to the server, as your communication won’t be secure anymore, enabling all sorts of man in the middle attacks. Though my advice to you is to download the .pem from the … Read more

“replace” function examples

If you look at the function (by typing it’s name at the console) you will see that it is just a simple functionalized version of the [<- function which is described at ?”[“. [ is a rather basic function to R so you would be well-advised to look at that page for further details. Especially important is learning that the … Read more

Categories R

ARM Assembler – How do I use CMP, BLT and BGT?

You cannot do a conditional branch without first setting the condition register somehow. This can be done with cmp or by adding s to most instructions. Check out the ARM assembly documentation for details. Quick example: Branch if r0 greater than 5: Compare r6 with r4 , put difference into r7, branch if r7 < 0:

Python virtualenv questions

Normally virtualenv creates environments in the current directory. Unless you’re intending to create virtual environments in C:\Windows\system32 for some reason, I would use a different directory for environments. You shouldn’t need to mess with paths: use the activate script (in <env>\Scripts) to ensure that the Python executable and path are environment-specific. Once you’ve done this, the command prompt changes to indicate the … Read more

where is the official c++ documentation

The official C++ “documentation” is the C++ standard, ISO/IEC 14882:2014(E). There is information at ISOCPP how to obtain the document. I wouldn’t necessarily consider the standard good documentation but it does specify the behavior of the standard language and library constructs. There isn’t any other official document on C++ describing the entire language. There are good derivative works making … Read more