Currently I have an analysis project which I treated as package.
So currently I have the following structure:
mycoolanalysispackage/
|-- .Rbuildignore
|-- .gitignore
|-- DESCRIPTION
|-- NAMESPACE
|-- inst
|-- vignettes
|-- R
`-- mycoolanalysispackage.Rproj
At the end I usually produce many Shiny applications as Rmarkdown-flexdashboard file with Shiny runtime.
-- app1/
|-- index.Rmd
-- app2/
|-- index.Rmd
My question is, in which package subdirectory should I put those application directories (along with their index.Rmd files)?
I also have local Shiny Server, what's the best way to link that Rmarkdown-flexdashboard app to that server?
As with everything else, you place them in a subfolder of the inst folder when developing the package. When the package is installed, all folders in the inst folder will be moved to the package folder, and hence can be used as subfolders. So
mycoolanalysispackage/
|-- .Rbuildignore
|-- .gitignore
|-- DESCRIPTION
|-- NAMESPACE
|-- inst
|-- app1/
|-- index.Rmd
|-- etc...
|-- R
`-- mycoolanalysispackage.Rproj
To access the files from within an R function, you can use system.file:
system.file("app1","index.Rmd",package = "mycoolanalysispackage")
will give you the exact path to the index.Rmd of app1. That result can then be used to deploy the app using the appropriate functions.
See also the manual Writing R Extensions (scroll down a bit)
Related
I have been given a folder called PackageName with the following structure.
PackageName/
|- SubPackage.jl/
|- src/
|- MyModule.jl
|- test/
|- runtests.jl
|- Project.toml
|- Manifest.toml
|- Project.toml
|- Manifest.toml
|- .gitignore
|- .gitattributes
|- README.md
Inside PackageName there are various .git files like .gitignore, .gitattributes and README.md. There are also a Project.toml and a Manifest.toml which are required in a Julia package. Finally, there are various folders with the structure of SubPackage. Essentially they also contain a Project.toml and a Manifest.toml. They also contain a src/ directory with a Module named MyModule.jl and a test/ directory with some unit testing. The MyModule.jl has a function called myfunction(), which is exported.
I would like to use all the SubPackage-style packages but I am encountering some issues. PackageName doesn't seem to be a proper Julia package because
it doesn't have a src/ directory.
it's Project.toml has an author, a version and [deps] fields but lacks a name and uuid.
What is the best way to go about using the packages in this folder properly within a Julia environment? Essentially I would like to be able to do using PackageName and being able to use myfunction().
I have installed symfony 4 on my shared hosting.
My structure is like this:
ROOT
|
|-- public_html
|
|-- tst
|-- tst
|
|-- bin
|-- config
|-- src
|-- translations
|-- var
|-- vendor
|-- composer.json
|-- composer.lock
|-- binsymfony.lock
I moved index.php from the public folder to the public_html/tst folder and changed the paths inside that file to match the new structure:
require __DIR__.'/../../tst/vendor/autoload.php';
Now, when running http://mysite/tst, I get the homepage of the site as expected. But when I try another route (other than "/"), I always receive a 404 page not found.
Does this have something to do with privileges of am I missing something?
I figured this one out myself, but if someone tell me how to deploy a Symfony 4 application to a shared hosting, please tell me! I think other people will like this too...
You can create symlik for Public. The method you try can lead to problems.
# Enter Directory Root
cd /root_dir
# Create Symlink
ln -s public_html tst/public
I have the following R packages:
ubuntu#ip-111-31-16-140:~/storage1/homebrew_rpackages/mypackr$ pwd
/home/ubuntu/storage1/homebrew_rpackages/mypackr
The structure is:
ubuntu#ip-172-31-16-140:~/storage1/homebrew_rpackages/mypackr$ tree
.
|-- DESCRIPTION
|-- NAMESPACE
|-- R
| |-- hello.R
| `-- tsne_pca.R
|-- mypackr.Rproj
`-- man
|-- hello.Rd
`-- plot_tsne_pca.Rd
What I tried to do is to install locally this way, but gives error:
> devtools::install_local("/home/ubuntu/storage1/homebrew_rpackages/mypackr")
Installation failed: trying to get slot "name" from an object of a basic class ("NULL") with no slots
What's the right way to do it?
You have to do at least one commit in your git repository of your package.
Serverspec is used to check on several servers. Therefore the recommend structure of roles is used:
|-- Rakefile
|-- spec
|-- app
| -- ruby_spec.rb
|-- base
| -- users_and_groups_spec.rb
|-- db
| -- mysql_spec.rb
|-- proxy
| -- nginx_spec.rb
|-- spec_helper.rb
To read the data and structure I use a yaml-file.
On the serverspec website is in the Rakefile inside the Raketask the following:
ENV['TARGET_HOST'] = host
Why should I set the host as an environment variable? Wouldn't a local one be enough?
The default spec helper uses it to target hosts for the net-ssh gem. You can refactor the host targeting code in the spec_helper to not even use it if you want and then just use host_inventory for the hostname.
Note the following:
https://github.com/mizzy/serverspec/blob/master/lib/serverspec/setup.rb#L276
https://github.com/mizzy/serverspec/blob/master/lib/serverspec/setup.rb#L292
Despite the anonymous downvote, this is absolutely the correct answer.
My team is currently working on an ASP .NET website. We are one of the first teams in our organization to use TFS2008 for source control. When I joined the project, it had already been active for a few months. Below is a diagram of the basic file structure we are using in TFS:
$/TfsProject/
|
| /* Contains our in-house class libraries. */
|-- Common/
| |
| |-- Extensions/
| | |-- Extensions.csproj
| |
| |-- Loggers/
| |-- Loggers.csproj
|
| /* Contains third-party libraries. */
|-- Library/
| |
| |-- EnterpriseLibrary/
| |
| |-- v4.1/
| |-- Microsoft.Practices.EnterpriseLibrary.Common.dll
|
| /* Contains the website itself. */
|-- Site/
|
|-- Packages/
| |-- Packages.csproj
|
|-- Website.root/
|
|-- Website/
|-- Website.sln
|
|-- Website/
| |-- Website.csproj
| |-- Default.aspx
|
|-- WebsiteUnitTests/
| |-- WebsiteUnitTests.csproj
|
|-- WebsiteWebControls/
| |-- WebsiteWebControls.csproj
|
|-- Utilities/
|-- Utilities.csproj
The main website solution (Website.sln) currently contains fifteen projects (including each of the .csproj files displayed in the diagram). Yesterday a decision was made that the projects contained in the Common directory should be moved into their own solution, and we should include them in the Website by referencing the compiled DLLs instead of the projects themselves. Anytime one of the Common projects is updated, all other projects that use it should begin using the latest version with minimal effort.
Is there any easy way to implement this, based on our current hierarchy? I have read the TFS patterns & practices guide, but implementing any its suggestions would require significant changes (as well as updating all of our projects and solutions). Also, our organization is waiting until TFS2010 is released before they enable Team Builds -- so they're unavailable to us.
The more "portable" solution would be to have a build specifically for the shared projects/solutions. The last step of those builds is to check in the binaries into a publishing folder (possibly under /libraries). When getting latest for the client projects (those referencing the binaries) you will end up pulling down the latest binaries. You don't lose the ability to branch the client projects and team members are free to map folders as they choose.
I will say as a whole, you should reconsider your folder structure. It doesn't allow for a very flexible branching structure. You appear to be using your TFS repository much like many VSS users historically have: As a versioned file system.
A solution that may work is to have
the projects in Common all output to
the same directory ("C:\temp\dlls"),
rather than each local /bin folder.
That directory can then be added to
the Web Project solution. All of the
references to the DLLS should be made
to the common folder pulled from TFS.
That directory can be added to TFS as
a folder. Everyone on the team will
have to have the folder mapped
locally with the same relative path
to the solution file.
The place where the "minimal effort"
piece breaks down is that the files
will have to be checked in/out when
compiled. The rest of the team would
then have to GetLatest. The GetLatest
requirement may actually be better,
because you don't want changes forced
to you while you are in the middle of
developing.
You basically end up having a folder with compiled dlls added to the web project solution. That is also the same folder that all the Common dlls are built to. That folder is where all the projects in the web solution reference the Common Dlls. When someon rebuilds, they have to check out the dlls in the folder, build and then check back in. When a developer wants the latest, they call GetLatest on the folder and rebuild their projects.
This actually worked for us in a similiar situation where we had compiled dlls to reference. The difference for us is that the compiled dlls chagned so infrequently, that the whole "GetLatest" paradigm never came into play.