Installing a complete package into Mathematica - installation

I downloaded a Mathematica package (it's called "automaticUnits" - http://library.wolfram.com/infocenter/MathSource/7655/). I can make the functions work, but I would like to install all the documentation and tutorials so I can look it up in the help menu in case I need to.
The install feature does not seem to work very well, for this...
Thanks!

Download http://library.wolfram.com/infocenter/MathSource/7655/ zip file.
Extract AutomaticUnits from the above folder to Applications under $UserBaseDirectory, e.g. C:\Users\me\AppData\Roaming\Mathematica\Applications\,
In[1]:= $UserBaseDirectory
Out[1]= C:\Users\me\AppData\Roaming\Mathematica
So now it looks like this on my windows
From Mathematica
Needs["AutomaticUnits`"]
?AutomaticUnits`*
This is the result

Related

Tensorflow object detection: ImportError: No module named nets

I am currently attempting to install the tensorflow object detection app on Windows 7 (employer requirement) and I am failing at a few steps from the end.
Basically I get the following error when I run the installation test command:
ImportError: No module named nets.
I have read some solutions on the subject:
https://github.com/tensorflow/models/issues/729
https://github.com/tensorflow/models/issues/1842
which looks like this:
export PYTHONPATH="$PYTHONPATH:"somepath"/tensorflow/models/slim"
basically meaning that I must set the right path in the PYTHONPATH environmental variable.
Working with Windows, I tried calling this:
SET PYTHONPATH="$PYTHONPATH:C:tensorflow/models/slim
And when it didn't work, I created a PYTHONPATH variable in system-> environmental variables.
I'm still getting the error so I suppose that I am still missing something but due to my lack of knowledge I still can't figure out what.
Would someone familiar with Windows be able to point out what's missing?
Thanks
in linux:
add export export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim to ~/.bashrc
attention:you should keep single quote mark
if you work with windows, i guess it should like this:PYTHONPATH=$PYTHONPATH:'C:/tensorflow/models':'C:/tensorflow/models'/slim
just my guess, you can take a try.
good luck!
If you run the setup.py it will install all the relevant modules for object detection. The other option is download the git directory. cd to the folder and try to run the module from there. You might face protubuf issue. Try to install it before running the code. It's bit complicated to install protobuf in windows. But if you are not using ".pb" file, then you don't need to.
I figured out a way to make it work. I am not writing this as a final answer as it is mostly a workaround and due to lack of understanding from my part I cannot guarantee it will work (and also it might not be best good practice).
Anyway here it is:
As Beta previously suggested, you have to run setup.py, however running it from models folder did not do it for me, I also had to run it from object detection folder.
However there was a problem there, it generated an error saying the BUILD already existed (which was correct) so I had to delete the BUILD file from inside of model.
After that it worked, turns out the path I had set was working fine.
Now if some experts would look into this and explain how and why this workaround worked it might make this a valid solution.

How to spellcheck R comments with RStudio on R source files?

How to conveniently spellcheck R comments with RStudio on R source files?
I am writing a package and I want it to look professional. Thanks to Oxygen, all package's documentation lives in R comments, which by default is excluded from spell checking. So even if spell checking functionality does exist in RStudio, I don't know how to use it.
The spelling package is great for this: https://github.com/ropensci/spelling.
devtools::install_github("ropensci/spelling")
spelling::spell_check_package() # path to package Project
RStudio 1.3 will include this feature; and it is possible to already try it out.
Well this is moot now that Rstudio has spellcheck for spin documents!
So, I write a lot of my lessons and examples for teaching using spin rather than markdown. It just makes for an easier flow. The problem is that there is no spell-check in a spin document, much like your package documentation example.
What I have resorted to is using the terminal then running a command line spellchecker on the document.
I'm on linux so here is my workflow.
save the file I am working let's say example_lesson.R (typos and all)
open the terminal pane of Rstudio and cd to the right folder
make sure the file example_lesson.R is there
run the spell-checker
> aspell check example_lesson.R
Once I'm done with aspell, I go back to the editor window in Rstudio and it updates what I am working on with the spell-checked version. I spin it and I am done.
I've only tested with small examples, but it has worked thus far. Your mileage may vary. Hope that helps.

How do I install gtk-fortran on windows 8?

I want to build a GUI for some fortran code I have. GTK-Fortran seemed like a simple option, but I'm having trouble getting everything installed in the correct place.
I am using Windows 8. I have gfortran (version 4.8.1), Cmake, and GTK+ 3 installed. As far as I can tell, the last thing I need to do is include GTK-Fortran, which I download from https://github.com/jerryd/gtk-fortran (the link to download the .zip file is on the right side of the page), but all of the instructions on what to do with it are incredibly vague to me. The INSTALL instructions seem to want me to make a new directory, C:\build, and then do something with cmake, but I'm not sure what that something is or how to do it.
I have GTK+ 3 in C:\GTK, and its bin is included in the path. I would like to just put the GTK-Fortran files within the GTK folder, but I don't think that will actually give me access to the GTK-Fortran files.
Could someone give me very clear instructions on what to do with the files for GTK-Fortran so that I can call them from my own fortran code?
The simplest way for using gtk-fortran under Windows is to install MSYS2/MINGW64, following the installation steps described in the wiki of the project:
https://github.com/vmagnin/gtk-fortran/wiki#windows

RQuantlib and Mac OS X 10.8.2

I'm a total newbie in Mac OS X, R and C++. Sound like a good mix, doesn't it?
I have the need to use RQuantLib, because I want to use some pricing functions part of the QuantLib package inside R, all on a Mac OS X-powered environment.
I've correctly installed QuantLib. I've already asked to the official QuantLib mailing list, and together we seem to have reached the conclusion that the problems I'm encountering are not related to my QuantLib installation, which seems ok and correctly configured.
So, I turned to R to try and solve the problem. Whenever I try to run ZeroCouponBond from within R, copying and pasting the first example provided with the official documentation, I get the following error:
"Error in DiscountCurve.default(discountCurve.param, list(flat = 0.05)) :
cannot find function errorOccured"
Now, I would rule any syntax.related problem out, since I'm copying the very same example present in the official help.
I don't know what I did wrong, but I know I need to find a solution at all costs. I've installed Rcpp, and the configuration seems really ok. Just one question I was not able to find an answert to: in my understanding, RQuantLib basically acts as a link between QuantLib and R. If that's correct, how can I tell RQuantLib where to look to find libQuantLib.a, that is, the compiled library resulting from the "make && sudo make install" commands performed while installing QuantLib itself?
Right, so, I've finally managed to get it to work.
First of all, I would like to say that things would have been much easier if a thorough, step-by-step installation procedure had been provided. I acknowledge I'm a total newbie, but I think other people approaching to R for the first time might encounter difficulties similar to those I had to overcome.
Anyway, this is what I did:
I've downloaded the .tar.gz source packages for both Rcpp and RQuantLib from cran.r-project.org
I've compiled them installing them from within the R environment. This is where I was making a mistake. Indeed, I was trying to compile them by invoking the configure installation script from the terminal; however, as Dirk said, the config script looks for QuantLib's quantlib-config script, and I didn't know the correct syntax to tell the configure script the correct path to QuantLib. Executing the procedure from R (by just installing the package) sorts out any problem, as all the dependencies are correctly located and loaded
So, that's pretty much it: just install the .tar.gz source package as you would do with the binary version, and everything should work ok.
Of course, I'm still curious to understand:
If it is possible to compile Rcpp and RQuantLib from the terminal; and
Why the binary version for Mac OS X will not work on my system, ie: why do I have to compile starting from the source code?
Thank you so much to anyone willing to answer my (probably naive and silly) questions. I'm eager to understand a bit more!
Thanks!
The RQuantLib package uses a tool called configure which determines the patch at package build-time. It looks for the script quantlib-config from which it learns about the location of libQuantLib.a.
First, install boost (brew install boost) and, secondly, Quantlib (currently at 1.7.1) by following instructions at http://quantlib.org/install/macosx.shtml:
cd QuantLib-1.x.y
./configure --enable-static --with-boost-include=/opt/local/include/ \
--with-boost-lib=/opt/local/lib/ --prefix=/opt/local/
make && sudo make install
It takes some time (~1 hour) for make.
Then in R or Rstudio, install packages Rcpp and RQuantlib. The later requires type="source" since only source package is available.
At this point, you should be able to use RQuantlib. The American Option value (SPY as of 4/1/2016, maturity 7/15/2016) can be calculated in R as
AmericanOption("put", strike=206, volatility=0.1525, underlying = 206.92, 0.021, 0.003, 73/252, engine="CrankNicolson")

Can Ruby + Crate + Windows work?

I've got a project for work I'd like to do in Ruby that will have to run on Windows, but perturbing the filesystem for a Ruby install or RubyScript2Exe unpack isn't an option (this is supposed to be the harness for a testing system). Has anyone successfully used Crate to package up something on Windows? If so, what was your build environment like and can you pass on any other hints?
I've tried and worked in getting Crate work under Windows, but is a more complicated system than I would expect.
If extraction of code for your system is your problem. I recommend take a look to Exerb, and specially: exerb-mingw hosted on GitHub exerb-mingw
It will generate a single executable like Ocra or RubyScript2Exe, but with the difference that the source code will not be extracted and extensions will be dynamically loaded.
This works perfectly with RubyInstaller packages, and is being used with Pik (Ruby version manager for Windows).
Hope this helps.
You can embed a Ruby interpreter and script into a C program, which may be easier than trying to run Crate. Here are some helpful links that describe how to do this, and may provide enough sample code to use as a skeleton for what you are trying to build.

Resources