Is it possible to have a _layout.svelte for sub directories in ./routes with svelte-kit? - sveltekit

I'm trying to create a layout for a specific route...Doesn't seem to work:
./routes/guides/_layout.svelte
./routes/guides/page1.svelte
Does _layout.svelte only work at the root of ./routes?
I'm using svelte-kit

The correct name would be __layout.svelte with 2 underscores, this should work.

Related

How to get the parent directory of the current working directory in Julia

This seems to be a simple question but I can't find any answer online. Suppose my current working directory is C:/parent_folder/sub_folder, and I want to get C:/parent_folder in Julia.
Edit:
I have a solution using PyCall but are there any better solutions, preferably without the need of importing libraries of other languages?
using PyCall
function get_parent_directory()
pathlib = pyimport("pathlib")
path = pathlib.Path(pwd())
s = string(path.parent)
return split(s, "\'")[2]
end
get_parent_directory()
An alternative solution is to use dirname:
dirname(pwd())
This should work for you:
cd(pwd, "..")
If you want to get the parent directory (without changing the working directory), you can do the following:
splitdir(pwd())[1]

Imagemagick using metadata properties to mass rename images

I have got a ton of dicom files that I want to mass rename using their properties tags.
My question is, what is the syntax for taking a property tag(such as dcm:SeriesNumber) for every image and using it to rename the images in the directory?
I'm guessing it involves breaking it down to the relevant tag using -identify -verbose and then somehow passing that string over to the filename property?
Really would appreciate the help(using win10 command line).
Figured it out.
convert *.dcm -set filename:f "%[dcm:SeriesNumber]"_"%[dcm:AcquisitionNumber]" "%[filename:f].jpg"
the "" after filename:f hold the string that's going to represent the file name
[] brackets hold the metadata property, that you can chain by using % percentage sign which declares a new property

use and or in two cssSelector

I am using selenium webdriver and i have a scenario like where i have to find out some elements. for this, i use :
driver.findElements(By.cssselector("mycsss"))
again, i have to use this to find another some elements. Now my question is,
is there any way to find both these elements using there css
path only in one methods like below:
driver.findElements(By.cssSelector("first element csspath" and "second element csspaht"))
pls help me.
use like below:
driver.findElements(By.cssSelector("first css path , second css path"))
You can try simply using , in between the 2 paths.
driver.findElements(By.cssSelector(css_path_1 + ", " css_path_2))

Can't Get Alias Name?

I can't understand why this code does not work. aItems is an array with paths to aliases.
repeat with j in aItems
set Aliasname to name of alias file j
display dialog Aliasname as string
end repeat
I just want to get the name of each alias in the array, but it fails with:
error number -1700 from alias file ... of startup disk to integer
When I hard code a path to an alias (literally the same path that is in j) it works just fine. What am I doing wrong?
2 suggestions. First I assume you got the aItems inside a Finder tell block of code. You also need to get the name from the Finder too, so first make sure the name line of code is inside a Finder tell block. Second, your list of aItems is a list of file references so when you ask for the name you don't need "alias file". Just ask for the name of j.
I hope that helps. Good luck.

Fitnesse Slim: How to concatenate symbol

How would one concatenate a symbol with text on either side?
For example:
Prefix: "GAR_"
Variable: $todayDate
Suffix: "_1"
GAR_$todayDate_1
Which would evaluate to:
GAR_07202012_1
When running the test in fitnesse, it seems as though the concatenation is working (GAR_$todayDate->[07202012]_1). However, I am passing this value as a parameter to visual studio and I instead end up with the following text: GAR_$todayDate_1.
When I remove the suffix or put a space between $todayDate and "_1", everything works as expected.
Any help would be appreciated.
Things I have tried:
GAR_!-$todayDate-!_1
GAR_$todayDate!-_1-!
GAR_$todayDate${SUFFIX} - static variable defined
Thanks,
Mike
I am stuck with the same problem currently.
The only way I found was to:
create a StringSupport class with a String concatenate(String s1, String s2) method
import the package of that class in your FitNesse test
put StringSupport in the available libraries in your FitNesse test with the Library table
in your Script, you can now do: |$result=|concatenate;|$s1|$s2|
To fit your exact use case, you just have to do the same concatenate() with 3 strings instead of just one.

Resources