I am using project lib in ibm watson studio to store and save files created in a jupyter notebook(mainly csv and pkl files). The thing is that I need to store these files in different folders in my project. I could not find the way to do this properly.
def my_append_data(source_data, file_name): #source data is a Pandas Dataframe
project.save_data(file_name,source_data.to_csv(),set_project_asset=True,overwrite=True)#save csv file
return 0
this is the function that i am using(for csv files) but the files are stored in the project library without any folder specification, is there any way to create folders inside the project using project lib?
There are no folders in Projects on Watson Studio. You cannot create files in folders on Object Storage using project-lib.
The project-lib documentation states that explicitly:
The project-lib functions can’t be used to access folder assets (files on a path in Cloud Object Storage).
Related
I am trying to transfer 2 folders from an old project into a new project, I have used this command in the past to pass between projects:
gsutil cp -r gs://oldProjectAPIURL/{folder name} gs://newProjectURL
But I am not sure if it will overwrite the existing folders, since they have the same name, how can you import these folders without overwriting the existing folders, assuming they have the same names?
A folder is an artificial construct on Google Cloud Storage. In reality it has a flat list of files, and interprets / in the path as a directory separator in the SDKs.
That also allows us to answer your question: if you write files to an existing directory, they will be merged with the existing files in there, as on the flat list of files these are unique names that just happen to have the same prefix.
When I open my R project from the project folder, the default working directory is not my project folder.
I thought it should, by default, set the working directory to the project folder. I know how to set the working directory but I need to setup r studio so that my R projects open with the project folder as the default working directory.
I have found that creating an .Rprofile file for each project and store it in the same folder as the Rprojfile works. Thanks to this
https://csgillespie.github.io/efficientR/
website about efficient R programming. Only that it means I have to create the .Rprofile file myself every time I create a new project. This is however better than having to set the working directory manually making my projects non-portable.
I have created a Dynamic Library using Qt Creator which I have included in another Qt Project but when I call functions with works with resource files for example reading the contents of a .txt in resources, it does not work.
Once I have the Build of the Dynamic Library which created the *.so, *.a and the qrc_resources.cpp files in another folder outside the library project folder, example:
Project Folder: /home/username/Qt Project/library/
Build Folder: /home/username/Qt Project/build-library/
I then copy the build files into the library project folder and from the test project (a Qt Application Project), I right click on the project -> Add Library -> External Library -> Select the .so file (from the library project folder which I just copied).
Then, after including the header files and calling a function which reads the contents of a file from the qrc resources, it does not work.
UPDATE
I used a QFile to check if the Resource File exists in which it does but I get this error: QIODevice::read (QFile, ":/file.txt"): device not open
Adding Libraries to Projects
later
I think need to create an external resource file.
So I was able to resolve the problem by using a QFile object instead of ifstream object to open and read the file.
I have a build and release pipeline for Wordpress php files, but I only want to create a build for the files changed in source control. I am not using a Visual Studio Build task as this does not apply in case of php files I guess.
Here is how the pipeline is configured:
Currently under the build I am using publish artifacts only from $(Build.SourcesDirectory) and under the release pipeline I am copying those artifacts to the website using FTP upload.
Since the amount of files is larger than 10K,
I want it to only build files that have changed and publish those
instead of the whole directory again.
How do I achieve that within the build as the release will automatically pick files up based on the artifacts.
There isn’t the feature in VSTS that can just pick files up based on the previous artifacts.
You can refer to these ways to achieve it:
Create XML file that stores the last upload/publish information of each files (e.g. file name, date time, changeset/commit version).
Create a PowerShell script file that included the logical to compare files (get files metadata and compare with that XML file) and copy updated files to specific folder
Publish the files in that folder
can I configure jwrapper's xml so that a directory/file is included and put into the shared folder, not into the app folder ?
mydir/myfolder/foo
I would like to access it via
JWSystem.getAllAppVersionsSharedFolder()
Thank you
Peter
You can't have JWrapper copy files into the shared folder as it doesn't really fit in with how JWrapper works conceptually.
When you release a new version of your app the updated files will all be contained within the app folder (JWSystem.getAppFolder). From there you can save files that you want to remain consistent across versions to the all app versions shared folder (JWSystem.getAllAppVersionsSharedFolder).
However, managing the consistency of those files across versions and how they are updated is something that your app has to do since it will require context about what the files are and how they should be modified, updated etc.
If its just a case of overwriting files with the latest version then there's no real need to put them in the shared folder, you can just access the files bundled with your latest app version via the JWSystem.getAppFolder call.