Include local image in shiny - r

I'm trying to include a picture from my ubuntu machine into a gvisTable.
The path is specified as
<img src="google_logo.jpg"/>
And the folder structure looks like this:
+---/srv/shiny-server
| +---shinyApp
| +---server.R
| +---ui.R
| +---wwww
| +---google_logo.jpg
Pictures with an url do work, I played around with different placements of google_logo.jpg and the permission of google_logo.jpg, but I can't make it work.
In my css file I can access local images in the same directory with url("image.png")
Any suggestions?

Related

Hydra - Specifying config group with a keyword other than the directory

Say I have the following file structure:
|--configs
| |--config.yaml
| |--A
| |--conf1.yaml
| |--conf2.yaml
| |--conf3.yaml
|--main_app.py
and my base config.yaml looks like
defaults:
A: conf1
If I want to run some other config like conf2 or conf3, I can simply run
python main_app.py A=conf2
What I am trying to do is to somehow use a different keyword from the directory name to specify this config above. For example,
python main_app.py B=conf2
For reasons I can't explain, it is not possible for me to change the directory name from A to B. However, I would find the behavior I described above desirable since B is a way more descriptive keyword than the directory name A. Is something like this possible? Thank you!
If you are using Linux you can create a symbolic link.
Hydra itself does not support this.

CSS relative path broken when deploying to github pages, build process issue?

I built a very simple static page deployed to Github Pages.
I noticed quickly that most of the css background images failed to load.
After doing some digging around I found that the culprit is my SCSS/CSS.
In VSCode, my relative path for an image looks something like this:
#media (min-resolution: 192dpi) and (min-width: 37.5em),
(-webkit-min-device-pixel-ratio: 2) and (min-width: 37.5em),
(min-width: 125em) {
background-image: linear-gradient(
to right bottom,
rgba($color-primary-light, 0.801),
rgba($color-primary-dark, 0.801)
),
url(../../img/apple-mountains_1920.jpg);
However, this was causing the URL to become clipped, stepping backward out of the repository.
What it should be:
https://name.gethub.io/repositoryname/img/apple-mountains_1920.jpg
What I was getting:
https://name.gethub.io/img/apple-mountains_1920.jpg
To fix this, I simply needed to go through and remove one period from all of my background-image paths:
url(../../img/apple-mountains_1920.jpg);
Becomes:
url(./../img/apple-mountains_1920.jpg);
One thing that is interesting, is that in VSCode on my machine, if I don't use the format (../../img...) the file isn't found.
What am I doing wrong? I'm fairly new to deployment, is this going to be a problem with any webhost I use or is it something unique to Github pages?
Better yet, is there a way I can automate fix this in my build process?
Right now I just run my SCSS through this series:
"compile:sass": "node-sass sass/main.scss css/style.comp.css",
"concat:css": "concat -o css/style.concat.css css/icon-font.css css/style.comp.css",
"prefix:css": "postcss --use autoprefixer -b \"last 5 versions\" css/style.concat.css -o css/style.prefix.css",
"compress:css": "node-sass css/style.prefix.css css/main.css --output-style compressed",
EDIT:
My File tree structure is:
Project Folder
|- index.html
|- [css folder]
|- [img folder]
|- [js folder]
|- [sass folder]
| |- main.scss
| |- [abstracts]
| | |-_functions.scss
| | |-_mixins.scss
| | |-_variables.scss
| |- [base]
| | |-_base.scss
| | |-_typography.scss
| | |-_utilities.scss
| |- [components]
| | |-_buttons.scss
| | |-_form.scss
| | |-_cards.scss
| |- [layout]
| | |-_footer.scss
| | |-_header.scss
| | |-_navigation.scss
| |- [pages]
| | |-_home.scss
My development machine is Windows 10, if that makes a difference.
Thanks!
Try that '../img/apple-mountains_1920.jpg'
If your file-tree look like
somefolder
index.html
img
thisImage
But what would be better - add your file-tree to question
After digging around, it seems that the problem is due to me attempting to use a 7-1 style folder structure where the source SASS isn't in the same or similar structure to the CSS.
Seems that I might need to take advantage of a package like resolve-url-loader in order to fix the relative paths automatically.

Go relative path up and down in R

This is my folder structure:
projectFolder
| |
| subFolder2
|
subFolder1
I have an R-script in subFolder1. How can I source a script in subFolder2 using a relative path?
OK, I got the answer:
source("../subFolder2/myScript.R")

CMake finding directory of proper name

So as in the question.
I have structure of folders lets say like this:
|-root
| |
| |-someFolder
| | |
| | |-someSubFolder
| |
| |-someAnotherFolder
etc. in general I don't know far folder can be nested, but I need sometimes to
find path to a folder, that I don't know it's location (only name).
How can I do this using CMake? The only thing i found was find_path, but as I am looking for another CMakeLists.txt file in whole project, that is in the specific folder I cannot effectively use it.
So what is the way to find path to folder of given name provided I know path to the root folder?

How to show dockWidget at specific position in Qt?

I want to open my Qt application like as shown below. I have four dockwidgets, one is fixed and others are dockable.
___________________
| |mov. |
| Fixed |dock |
| dockWidget |widget|
|____________|______|
| Mov. |Movable |
|dockwid.|dockwidget|
|________|__________|
How can I create some settings or code to achieve this?
Can I use .ini file for default settings and user can also save its settings in .ini file? And how?
Here is the screenshot.

Resources