Meteor: Random.fraction() issue - meteor

I'm getting the following error when after installing my Meteor app (developed on an older version of Meteor) on Meteor version 1.2.0.1:
ReferenceError: Random is not defined
Offending line:
Players.insert({name: names[i], score: Math.floor(Random.fraction()*10)*5});
I've never had a problem with this line of code before and according to the docs this should still work.
Any ideas?

You've got to install the random package, it's not installed by default anymore. A simple meteor add random will suffice.

Some basic packages were removed from Meteor to reduce its initial footprint. Perhaps if you run meteor add random your issue will be solved. The update process was supposed to detect your use of Random and automatically install the package but perhaps it slipped through.
If you are working inside of a package, you may need to add random#1.0.4 to your api.use().
For a list of packages that are no longer installed by default, see this link: https://quip.com/RXFlAk9Rc2xI . It also contains some other interesting notes about the update.

Related

URL '/help/library/<package>/r/html/00Index.html' not found when using `devtools::load_all()`

I am using devtools::load_all as a workflow to iteratively make a package. However, I cannot seem to be able to view the package documentation using ? or help(package=package_name) until I install the package. The error I get is:
No documentation for ‘function’ in specified packages and libraries
and
URL '/help/library//r/html/00Index.html'
any suggestions on how to resolve this?
Thanks!
I guess the help(package=package_name) do nothing than open (in case of Windows) this file for you:
C:\Users\YourName\Documents\R\win-library\4.1\package_name\html\00Index.html
devtools::load_all make your latest functions available to you for testing without installing the package (i.e. the html file was not updated, and masked because it was belonged to the old version of your own package). To view your latest documentation (i.e. make a new version html), you can devtools::document() and check your package working directory \man\Functions_name.rd, OR, devtools::install() and help(package=package_name)
Just restarting r session solved my problem.

Cannot configure rgee R package properly with ee_install()

I've searched for tutorials to help configure the package in my PC, and I've found this one: https://www.youtube.com/watch?v=_fDhRL_LBdQ
I executed every part of the code interactively with the tutorial, but when I run ee_install() (after installing miniconda with py_discover_config() and other packages previously, such as reticulate), but it keeps me returning an error saying that anaconda is mandatory for the package since I'm a windows user.
Here is the error I get:
Error in ee_install_set_pyenv_env(py_env = py_env, py_path = python_path, : Windows users must install miniconda/anaconda to use rgee. The use of a Python environment is mandatory.
I've just installed Anaconda (full version with navigator) and I set a new python environment called "py2r" and tried to use the function ee_install_set_pyenv(), passing the path to the environment created through Anaconda Navigator (which has a python.exe) as paremeter to py_path and the name "py2r" as paremeter for py_env arg. And yet, it didn't work.
What am I missing?
In case you want to take a look at the code, I can provide it, but I don't think it's necessary because is a simple test script that follows as I described.
Thanks for your attention and congratulations for the library, it will be very usefull for me at work!
I fixed the ee_install() problems bypassing them and doing every passage manually. It will require no more then 10 mins and you will probably fix the installation problems. You can find and follow the manual installation with this tutorial:
https://www.youtube.com/watch?v=1-k6wNL2hlo

Julia: Use an older version of a package

I am really new to Julia and confused about using an old version of the SISL Vec package.
I am trying to setup ngsim_env and their instructions require you to use an older v0.1.0 of Vec. But, when I followed the instructions to install the Vec package and then checkout the v0.1.0 tag it didn't work.
Here's what I did
$ julia ../build.jl for some package which includes this block
packages = keys(Pkg.installed())
if !in("Vec", packages)
Pkg.clone("https://github.com/tawheeler/Vec.jl.git")
end
Note: This git URL actually goes to the SISL Vec page.
cd ~/.julia/packages/Vec
git fetch tags
git checkout v0.1.0
I did a bunch of other installations with many other packages. At some point I noticed that there is a package ~/.julia/dev/Vec and ~/.julia/packages/Vec. The one in dev has the correct v0.1.0 code and the one in packages has the newer wrong code. When I tried to use other packages that needed the older Vec they were throwing errors and the paths were to files in the packages directory.
I tried Pkg.rm("Vec"). This did something to the project manifest. After nothing worked, every package would throw errors like KeyError: key "Vec" not found and Pkg.add("Vec") nor original Vec installation helped. I even tried removing both the Vec directories from ~/.julia but that didn't help.
I guess a big question is why does Julia put some packages into packages/ and others into dev/ and how to control which one's get used if the same package appears in both places like Vec is.
Would greatly appreciate any assistance, totally confused.
The dev command fetches a full clone of the package to ~/.julia/dev/
via the docs. The only things I have in my dev directory there are the ones I am developing on my own.
I think that triggered when you did a check out manually with git checkout.
Accordingly:
to stop tracking a path and use the registered version again, use free
Try deleting the packages, and whipping mentions of Vec.jl from your manifest:
(v1.0) pkg> rm Vec
(v1.0) pkg> add https://github.com/tawheeler/Vec.jl.git#0.1.0
In general, try using Pkg when possible, cause it does a lot of house keeping magic in the back
(Also, the repl interface with pkg makes everything easier, so hit ] from a blank julia> to get there. And a quick Pkg.status() or ] st will show you what youre tracking and whats in dev and what version you have pinned, etc.)

App not loading dependency properly from another package

I'm playing a bit with Meteor and got stuck with a problem here. I'm using Meteor 1.2 btw.
I'm implementing a cardgame, so as I read over the interwebs as a good practice, I started separating my app features in packages.
I did an app-lib package to wire my dependencies. That package is then required by other packages in the app, so in the case that I have to update some package's version, it updates for all the packages that use it at once.
In this app-lib package I api.imply() the dependencies that I want to expose, to the other packages that use it. Right now, I have just one other package that is a board package that api.use() the api-lib, but I'm getting the following error on app startup:
"Object [object Object] has no method 'helpers'"
This error goes for a Collection and has to do with the dburles:collection-helpers package I think.
The things I tried to solve the problem:
Check that app-lib has dburles:collection-helpers on the api.imply()
Include dburles:collection-helpers in the main app
Include dburles:collection-helpers in the 'board' package
The problem persists. It's important to notice that before I extracted the packages, all the dependencies were in the main app and everything worked fine.
I think maybe the problem has to with some load order stuff that I'm not familiar with.
Any guesses?
try remove the package and install it again? As far i know meteor sets the

Using mocha-given to test a Meteor package

I'm up and running with practicalmeteor:mocha but would like to try mocha-given. I think the way to go would be to use the browser version but I can't get it to work. I added the browser version file and included it in api.addFiles but I get ReferenceError: Given is not defined when I try to use it.

Resources