Conda command not found

If you’re using zsh and it has not been set up to read .bashrc, you need to add the Miniconda directory to the zsh shell PATH environment variable. Add this to your .zshrc: Make sure to replace /home/username/miniconda with your actual path. Save, exit the terminal and then reopen the terminal. conda command should work.

“Char cannot be dereferenced” error

I’m trying to use the char method isLetter(), which is supposed to return boolean value corresponding to whether the character is a letter. But when I call the method, I get an error stating that “char cannot be dereferenced.” I don’t know what it means to dereference a char or how to fix the error. … Read more

Need to reset git branch to origin version

If you haven’t pushed to origin yet, you can reset your branch to the upstream branch with: (Make sure that you reference your latest commit in a separate branch, like you mention in your question) Note that just after the reset, mybranch@{1} refers to the old commit, before reset. But if you had already pushed, … Read more

What is the purpose and use of **kwargs? [duplicate]

You can use **kwargs to let your functions take an arbitrary number of keyword arguments (“kwargs” means “keyword arguments”): You can also use the **kwargs syntax when calling functions by constructing a dictionary of keyword arguments and passing it to your function: The Python Tutorial contains a good explanation of how it works, along with … Read more

The static keyword and its various uses in C++

Variables: static variables exist for the “lifetime” of the translation unit that it’s defined in, and: If it’s in a namespace scope (i.e. outside of functions and classes), then it can’t be accessed from any other translation unit. This is known as “internal linkage” or “static storage duration”. (Don’t do this in headers except for … Read more

What does the “+=” operator do in Java?

The “common knowledge” of programming is that x += y is an equivalent shorthand notation of x = x + y. As long as x and y are of the same type (for example, both are ints), you may consider the two statements equivalent. However, in Java, x += y is not identical to x … Read more

Expression must have class type

It’s a pointer, so instead try: Basically the operator . (used to access an object’s fields and methods) is used on objects and references, so: If you have a pointer type, you have to dereference it first to obtain a reference: The a->b notation is usually just a shorthand for (*a).b. A note on smart … Read more

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

What is this warning about? Modern CPUs provide a lot of low-level instructions, besides the usual arithmetic and logic, known as extensions, e.g. SSE2, SSE4, AVX, etc. From the Wikipedia: Advanced Vector Extensions (AVX) are extensions to the x86 instruction set architecture for microprocessors from Intel and AMD proposed by Intel in March 2008 and … Read more