Rtools is not being detected from RStudio

I have no idea why RStudio has such kind of problems from time to time but there is a manual work-around described here: https://github.com/rwinlib/r-base/wiki/Testing-Packages-with-Experimental-R-Devel-Build-for-Windows Basically you have to set two environment variables to point to the correct installation path of Rtools: Sys.setenv(PATH = paste(“C:/Rtools/bin”, Sys.getenv(“PATH”), sep=”;”)) Sys.setenv(BINPREF = “C:/Rtools/mingw_$(WIN)/bin/”) To avoid losing this change after … Read more

Can I use __init__.py to define global variables?

You should be able to put them in __init__.py. This is done all the time. mypackage/__init__.py: MY_CONSTANT = 42 mypackage/mymodule.py: from mypackage import MY_CONSTANT print “my constant is”, MY_CONSTANT Then, import mymodule: >>> from mypackage import mymodule my constant is 42 Still, if you do have constants, it would be reasonable (best practices, probably) to … Read more

How do I write good/correct package __init__.py files

__all__ is very good – it helps guide import statements without automatically importing modules http://docs.python.org/tutorial/modules.html#importing-from-a-package using __all__ and import * is redundant, only __all__ is needed I think one of the most powerful reasons to use import * in an __init__.py to import packages is to be able to refactor a script that has grown … Read more

Help with packages in java – import does not work

Okay, just to clarify things that have already been posted. You should have the directory com, containing the directory company, containing the directory example, containing the file MyClass.java. From the folder containing com, run: $ javac com\company\example\MyClass.java Then: $ java com.company.example.MyClass Hello from MyClass! These must both be done from the root of the source … Read more

The import android.support cannot be resolved

Please follow these Steps: For Eclipse: Go to your Project’s Properties Navigate to the Java Build Path Then go to the Libraries tab. There click the Add External JARs Button on the Right pane. Select the android-support-v4.jar file, usually the path for the Jar file is : YOUR_DRIVE\android-sdks\extras\android\support\v4\android-support-v4.jar After adding android-support-v4.jar Library, navigate to the … Read more

What is the most compatible way to install python modules on a Mac?

The most popular way to manage python packages (if you’re not using your system package manager) is to use setuptools and easy_install. It is probably already installed on your system. Use it like this: easy_install django easy_install uses the Python Package Index which is an amazing resource for python developers. Have a look around to … Read more