This question already has answers here:
How to get path to the parent folder of a certain directory?
(3 answers)
Closed 6 years ago.
Hi Guys ,I need help!
When I extract file path with ExtractFilePath (paramstr(0))
I'm getting this: C:\Users\Admin\Documents\Embarcadero\Studio\Projects\example13.02\Win32\Debug
but I need to go 2 step back. C:\Users\Admin\Documents\Embarcadero\Studio\Projects\example13.02\
I don't know, How?
ExtractFilePath (paramstr(0)) how to make 2 step back ....\
I tried (ExtractFilePath (paramstr(0))+'....\')
result:
C:\Users\Admin\Documents\Embarcadero\Studio\Projects\example13.02\Win32\Debug\..\..\
ExtractFileDir(ExtractFileDir(ExtractFileDir(ParamStr(0))))
Related
This question already has an answer here:
Alignment problem with ieeetran website citation
(1 answer)
Closed 6 months ago.
I have this bib item and I am using IEEEtran as a bibliographystyle. I have used the default IEEEtran.bst and IEEEtran.cls. I am not sure, if I need both but I have tried all variations.
#misc{clark_2022,
title={Tiktok faces investigation into its impact on Young People's Mental Health}, url={https://www.theverge.com/2022/3/2/22958900/tiktok-state-ag-investigation-teens-kids-mental-physical-health},
journal={The Verge},
publisher={The Verge},
author={Clark, Mitchell},
year={2022},
month={Mar}
}
The reference now looks like this:
What is causing it and how do I change it? Is this part of IEEEtran?
I had a similar issue with IEEEtran, and adding the xurl package seemed to completely fix it.
This question already has an answer here:
How to set the current working directory in Dart?
(1 answer)
Closed 5 years ago.
I want to know what the current directory is. I don't want to shell out to run pwd. Is there an easy way to do this in Dart?
and also,
Is there a way, put name of directory into a string?
Re the current directory, from the documentation from the Directory class in dart:io (emphasis added).
In addition to being used as an instance to access the file system,
Directory has a number of static properties, such as systemTemp, which
gets the system's temporary directory, and the getter and setter
current, which you can use to access or change the current directory.
To get the name of a Directory as a string just use toString(), or perhaps the path property.
This question already has answers here:
How to read file from an imported library
(2 answers)
Closed 6 years ago.
Suppose the following files:
lib/src/program.dart
lib/src/file.txt
I want to read file.txt contents from program.dart using a library that contains readingFunction(path):
//program.dart
String fileContents = library.readingFunction("./file.txt");
This throws an error, because the current path is the one in which execution was launched (or the package path if executing with pub run).
How could I achieve the reading with relative path instead of being forced to use "./lib/src/file.txt" path?
Use the Resource package.
It allows you to read files that are embedded in packages. Files are specified with a special URL that looks like package:package_name/path/to/file.txt (same as used in import statements).
This question already has answers here:
How to create directories recursively in ruby?
(6 answers)
Closed 8 years ago.
i have built this little app that generates a excel document. i am trying to make a directory to stick it in. these documents are built differently depending on the #agency that people select. so i made this method to return the path since the path is used in a few places.
def reportsheet_dir
file_path = "#{Rails.root}/public/reportsheets/#{#agency.downcase.gsub("_","")}"
end
At the beginning of the method that creates the document i have this method that supposedly builds directories but it doest seem to be working
Dir.mkdir(reportsheet_dir) unless File.exists?(reportsheet_dir)
I keep getting. this
and i get
Errno::ENOENT at /addons/agency_report_builders
No such file or directory -/Users/fortknokx/Work/toolkit/public/reportsheets/empowerlogicbuilder
I think its because its multiple levels deep?? since public/reportsheets/agency_name/file_name has to be made. i could just go and make the folders but i would like to just make the dir each time because new agencies could be made at any time. is this possible?
Have a look at FileUtils.mkdir_p()
http://ruby-doc.org/stdlib-1.9.3/libdoc/fileutils/rdoc/FileUtils.html#method-c-mkdir_p
It will recursively create non-existent directories. Dir.mkdir will not.
This question already has answers here:
Formatting code in Notepad++
(15 answers)
Closed 6 years ago.
Is there a function (and shortcut) to reformat code in Notepad++
Like CTRL+SHIFT+F in Eclipse?
TextFX hasn't been updated for a long time. A more powerful choice is UniversalIndentGUI.
If you are working with C++ then you can use the TextFX features. Go to
TextFX->Edit->Reindent C++ code
And regarding shortcuts you can always modify your shortcuts for NPP by using
Settings->Shortcut mapper
in this case go to
Settings->Shortcut mapper->Plugin commands: #141
and modify it to CTRL + SHIFT + F.