Julia `julia --project` argument use - julia

I learned of a way to run julia, so I can use the file structure of a package for my project.
Namely julia --project inside my developement directory. With this I can load all projects structured like projectName/src/projectName.jl inside the same folder.
An Example:
all my julia projects/
├─ project 1/
│ ├─ working with files in julia.jl
│ ├─ data.csv
├─ project 2/
│ ├─ project.toml
│ ├─ src/
│ │ ├─ project 2.jl
├─ project 3/
│ ├─ draft.uxf
│ ├─ .gitignore
│ ├─ project.toml
│ ├─ auto_compile.jl
│ ├─ src/
│ │ ├─ project 3.jl
With this file structure I want to call auto_compile.jl that does the following:
using Pkg
cd("..")
Pkg.activate(".")
Pkg.instatiate()
Pkg.add("PackageCompiler")
using PackageCompiler
create_app("Project 3", "Project 3 Compiled")
However, PackageCompiler.jl only works with the --project command. The --project argument doesnt seem to modify LOAD_PATH, what does it do exactly? Can I edit my julia session with --project later on? I figured julia does the same when loading packages from the ~user/.julia/packages/ dir, but how do I do that, and are there more usefull arguments I should know about?

after some quick "testing" I can confirm:
the --project/--project=. flags when starting julia from the terminal do the same as Pkg.activate(".")

Related

nextjs page contains a space is not triggered but /pages/page%20title does

i have this following structure under pages
├─ pages
│ ├─ index.tsx
│ ├─ betting
│ │ ├─ [bet].tsx
│ │ ├─ ippica live.tsx
into index.tsx i have a next/link that redirects to ippica live, in the url i have localhost:3000/betting/ippica%20live
but ippica live.tsx is not triggered but [bet].tsx does
i noticed that if i rename the file ippica live.tsx into ippica%20live.tsx all starts working but is very ugly and unconvenient
is there any other clean solution other than applying %20 into the file name?

Old symfony directory structure better? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 months ago.
Improve this question
I have seen that new symfony projects have a diffrent directory stucture. Mainly the ressources-folder is not used anymore. I personally found that old structuring very nice, since all ressources were where they were used. When I start using bundles. it feels wrong to have all in the root folder. This is clearly an opinion, but I got a question from that, and the following question is not about opinion, but in practicality of the old structure in Symfony > 6:
What is the benefit of the new folder structure compared to the old approach with src/Ressources? Is there an advantage to the new structure which I don't see, or is it just a matter of taste and i can go the old way?
Your inputs are highly appreciated
Old approach
Root/
├─ src/
│ ├─ Ressources/
│ │ ├─ config/
│ │ ├─ public/
│ │ ├─ js/
│ │ ├─ styles/
│ │ ├─ views/
│ │ ├─ translations/
New approach
Root/
├─ src/
├─ public/
├─ templates/
├─ translations/
├─ config/
First of all, you can use old structure in new Symfony versions too! It all depends on few configurations.
To me, new structure is better, it makes more sense to move most things out of Resources directory into assets.
So it should really be:
├─ root/
│ ├─ config/
│ ├─ src/
│ ├─ public/
│ ├─ views/
│ ├─ translations/
│ ├─ assets/
│ │ ├─ js/
│ │ ├─ styles/

Sass not finding correct filepaths

I want to use sass to write individual components, for example styling a chart. But I don't want to manually include every component, but rather have one scss file that includes all the components and then gets compiled to one .css file that I can include. I found this SO answer but it didn't work for me and according to SASS, you're not supposed to use #import anymore. This is the project structure:
src/
├─ about/
│ ├─ .../
│ ├─ scss/
│ │ ├─ chart.scss/
├─ app/
│ ├─ scss/
├─ build/
│ ├─ css/
| | ├─ styles.css
├─ base/
│ ├─ styles.scss
styles.scss should include all scss files from all projects in the src, and should be compiled on every .scss save. When I do it with this command though:
sass base/styles.scss:build/css/main.css --watch --style=compressed --no-source-map
it gives the error:
Error: Can't find stylesheet to import.
╷
1 │ #use "//about/scss/chart.scss";
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
base_templates\styles.scss 1:1 root stylesheet
The content of styles.scss is
#use "//about/scss/chart.scss";
and that of chart.scss:
h1 {
color: #fff;
}
(as a test). What am I doing wrong?
The path should be "/src/about/scss/chart.scss" for Sass if src is the source of the volume respectively partition. Sass never 'knows' anything about your domain or network, therefore you can't assume that you can use paths based on the webroot as absolute paths.
You can also consider using relative paths, then it would be '../about/scss/chart.scss'.

Batch renaming files into sub directories

I have files as follows:
assets/
├─ icon_1.png
├─ icon_1#2x.png
├─ icon_1#3x.png
├─ icon_2.png
├─ icon_2#2x.png
├─ icon_2#3x.png
and I want to change it to this format:
assets/
├─ icon_1/
│ ├─ 3.0x/
│ │ ├─ icon_1.png
│ ├─ 2.0x/
│ │ ├─ icon_1.png
│ ├─ icon_1.png
├─ icon_2/
│ ├─ 3.0x/
│ │ ├─ icon_2.png
│ ├─ 2.0x/
│ │ ├─ icon_2.png
I am trying to use zmv commands such as
zmv '(*).png' $1/'$1.png'
or
zmv '(*).png' '$1/$1.png'
to get a feel of how it works. However, it tells me that I do not have the right directories. Is there a way to create directories dynamically from the file names?
I wasn't really able to find a way to parametrize the suffixes and create the directories dynamically, however I did find a solution for my specific case of the problem.
I ran the following commands on zsh:
for file in *#3x.png
do
dirname="${file%#3x.png}" #this truncates the #3x.png from 'icon_1#3x.png' and so on
mkdir "$dirname"
mkdir "$dirname/2.0x"
mkdir "$dirname/3.0x"
done
This creates the folder structures that I want. Now I only have to move the files from ./ to the desired directories as follows:
zmv '(*)#3x.png' '$1/3.0x/$1.png'
zmv '(*)#2x.png' '$1/2.0x/$1.png'
zmv '(*).png' '$1/$1.png'
I move the ones with #3x, #2x suffixes first so they don't get selected by the (*).png selector.
This can be done with zmv, but you may need a somewhat complicated pattern. This will move the files if the destination directories exist:
zmv -n '(icon_<->)(*).png' '${1:r}/${${2##}%x}${2:+.0x}/$1.png'
The -n (no-execute) option is for testing - remove it to actually move the files. The extended glob pattern <-> matches any number; it lets us split the source pattern into two pieces. The destination pattern uses several zsh parameter expansions to build the path, with repeated forward slashes being treated like a single slash for the icon_1 and icon_2 directories.
Out-of-the box, zmv will not create directories, but it will accept a custom command that can call mkdir:
mkdir_mv () {
mkdir -p -- $3:h
mv -- $2 $3
}
zmv -n -p mkdir_mv '(icon_<->)(*).png' '${1:r}/${${2##}%x}${2:+.0x}/$1.png'
The mkdir_mv code is from this answer.

Artifactory zip directory with exclude pattern

I do store my software releases in Artifactory.
As a minimal example my repository structure looks like this:
my_repo/
├─ release-1/
├─ release-2/
├─ release-3/
│ ├─ reports/
│ │ ├─ trace.pzip
│ │ ├─ cov_report.html
│ ├─ release/
│ │ ├─ app.exe
│ ├─ debug/
│ │ ├─ app_debug.exe
Now I want to create different zipped deliveries. E.g. so that we do have an internal release package (release-3_woDebug.zip), one for the end customer (release-3_woreports.zip), etc...
my_repo/release-3/ contains all files of the release, to create the packages I want to exclude specific files.
my_repo/
├─ packages/
│ ├─ release-3-packages/
│ │ ├─ release-3_woDebug.zip
│ │ ├─ release-3_woreports.zip
├─ release-1/
├─ release-2/
├─ release-3/
Is there a simple REST or jFrog CLI command which I can use to create such zip files.
When looking at the documentation, the jf rt download (ref) command has an --exclusions option which looks already promising.
But is there a way to create such packages (zip files) without downloading the content first?

Resources