Matlab: search path locked for editing? - matlab

I have written some database management software in Matlab. Occasionally data is labeled incorrectly and must be moved manually using windows explorer. All of the folders of the database are in the matlab search path via addpath(DataBaseRootDir). When one attempts to move or delete a folder in the search path, windows gets stuck waiting for Matlab to stop accessing the folder.
Is there a way to prevent this programmatically? It is always possible to close Matlab, make chances, and re-open the software but this is sub-ideal.
Thanks!

http://de.mathworks.com/help/matlab/ref/rmpath.html
rmpath(DataBaseRootDir)
Be aware that like addpath this will only remove the directory, but leave any subdirectories in the path, so if the directory has subdirectories that are also in the path, you would need to remove them as well.

Related

Problems with adding NetLogo extension for Mac

I'm having a problem adding the matlab-extension folder previously developed (https://github.com/mbi2gs/netlogo-matlab-extension/wiki) into the net logo extension folder. I think there is some problem with my ability to write into the NetLogo folders. I have tried troubleshooting with erasing and rewriting the drive, and by checking the 'ignore ownership on this volume' in the get info box. But neither of these have helped adding files into NetLogo. My system is macOS Sierra v. 10.12.6 and NetLogo 6.1.1.
At the moment I don't have MatLab installed, but here are a few things you could try.
It looks like you are running NetLogo from inside the disk image (dmg file) it came in. This might work, but generally I'd advise copying the NetLogo 6.1.1 folder out of the disk image into your Applications folder and getting rid of the disk image entirely. You can either open the the NetLogo disk image and the Applications folder at the same time then drag the NetLogo 6.1.1 folder over, or you can select the NetLogo 6.1.1 folder and Command-C to copy then Command-V to paste the folder to the Applications.
The second step is to make you sure you have the matlab folder copied into the extensions folder under the NetLogo 6.1.1 folder, per those MatLab extension directions.
If the Matlab extension does write to the NetLogo folder while it's running, you may have to repeat those steps you tried to give your user read and write access to the NetLogo 6.1.1 folder, too.
Here is a pic of how things look with my NetLogo 6.1.1 folder in the Applications folder and the matlab extension copied in.
If none of that helps, one alternative to try is to place the contents of the matlab extension folder in a new folder inside your Documents folder, something like matlab-models. Then if you place an nlogo model file there and load it, NetLogo should use this matlab-models folder's copy of the extension, and you'll definitely have proper permission to write to it in your Documents folder. You want the matlab.jar file right alongside the nlogo models you use Matlab with if you try this.

PowerShell - actions over files in folders and subfolders

So basically, there is a tab in a website containing thousands of .pdf files. It's a list with folders of which some of them have subfolders. Obviously, these folders/subfolders contain the files. In order to download the files, I need to open each and every folder, right click on every single file and click download. Is there a way to automate this recursively with PowerShell for all the files? Or maybe UiPath?
If you are unable to access the server files directly, so not through the website but through Windows Explorer then that would probably rule out, or at least make it quite trick to use power shell.
However this is something that UiPath should be able to cope with quite easily. Several automation's I have worked on do a similar thing.
Essentially the automation would need to do the following
login
enter search terms
for each returned folder
for each file in folder
Download file
for each folder in folder
repeat above
Essentially you need to build a recursive loop to loop through all of the folders and files, downloading a file when you encounter one

How can I search for a file in just one specific folder in VSCode when using a workspace with multiple folders?

I'm using the workspace feature of VSCode, with two projects, but it's annoying to search for a file in the front-end project and need to pass by back-end files to find the one I want.
I'm using ctrl + p to search for files.
How can I search for a file in just one folder with multiple projects opened in the workspace?
Yes thats possible: use a relative path: ./mySearchedProjectName in "files to include"-input
from HERE!
UPDATED answer to UPDATED question
The fuzzy file finder (CTRL+P or ⌘+P) somehow supports prefixing the filename with a folder, such as folder/filename to locate a file from a specific folder:
But, in my experience, the search is a bit lacking. For example, I find it usually can only find files this way if that file has been recently opened in your workspace. It also does not support regex.
The best thing that can be done is to enable including recently opened files by adding this to the workspace settings:
"settings": {
"search.quickOpen.includeHistory": true,
AFAIK, there is no other built-in way to filter the results. There are (still) open feature requests for this, like this Allow quick open to filter on folder names by typing folder name after the file. You can thumbs-up them to hopefully get them noticed.
ORIGINAL answer to ORIGINAL question
I don't know what you mean by "projects" since VS Code only has "workspaces" and "folders", such that you add folders to a workspace. I think you're already doing this, where each folder contains a separate set of codes.
With that said, the Search/Find panel has an area to specify files to include, where you can limit your search to a specific folder. For example:
Here I have 3 folders (proj 1-3) added to a workspace. I have 3 sample files with the same text.
When searching, you can set files to include to a specific folder (./proj2), so that the search results will be limited to that folder.
I've found the best solution to this for me (though it's still a sub-optimal one) is simply to run multiple VS Code instances, one for each folder.
It's a pain to start up, but once you get things going (and hopefully you're not restarting often on your dev machine, so this is less of an issue) it works perfectly: you can search for files with only the relevant ones showing up.
Also, if you want to reduce the start-up pain you can make a shortcut/alias/etc. in your operating system that starts both at once.

Manually Adding Toolbox to Matlab R2013b

I am working with OS X version 10.9.4 and using Matlab R2013b. I have recently downloaded a toolbox file and it saved as a folder on my desktop. It contains a bunch of .m files, which I'm not really sure how to add into my Matlab. I've read online and watched a few tutorials that all mention that I need to set the path to Matlab, but I can't seem to get it to work for me. I'm very new to Matlab and have been trying to figure this out for a couple of days, so my apologies if this is a very simple question to be asking.
There are a couple of ways of doing this. When a function is called in Matlab, it will look in all the directories contained within the path to find it. You can bring up the path by typing in the command "path".
Presumably, you want to add a new location for Matlab to look. This can be done via the addpath command. Addpath accepts both relative and absolute addresses. For example the command
addpath('C:\My_Matlab_Functions')
will enable you to access functions & files within the folder My_Matlab_Functions.
Relative directories are taken relative to the file which calls addpath. For example if I am running a function within C:\users\user_name\My_Documents\Matlab, calling
addpath('Tools')
will enable you to access all of the files within C:\users\user_name\My_Documents\Matlab\Tools. You can also go up directories via '..'. For example, if I am running a function within C:\users\user_name\My_Documents\Matlab\Project1, the command
addpath('..\Tools')
Accesses the same tools folder as before.
I have tried these examples on Windows, but I presume they work the same on a Mac. Hope this helps.
Alternatively, you may be able to add your file(s) directly into Matlab's built in toolbox. I don't know whether Matlab automatically searches for new folders here, but it may be worth a shot.

Can I search Netbeans' local history?

In one of the previous versions of one of my file in a Netbeans project I wrote code that I later removed, and now I want to retrieve it. However now I can't find it when I manually go to previous versions, as I have many versions in the local history of this file, and I don;t remember when exactly I wrote this code.
Is there a way to run a search on the local history of this file?
I saw in this answer that the local history is kept in this path
<HOME>/.netbeans/<NB_VERSION>/var/filehistory where HOME is my user home and NB_VERSION is the version of NetBeans (e.g. 7.0).
I tried running AgentRansack on that directory, but to no avail.
I recently had to solve this problem and figured it out. Netbeans stores local history files in your user directory as mentioned above. Inside that folder are numbered directories. It's pretty easy to guess which one you need based on the modification date of the folder (if you know when you last looked at it, so that doesn't help you much). In side the numbered folders is another folder with a hashed name, and inside of that folder is a set of files: a data file, and numbered files. The data file can be read with a binary file reader, and if viewed in ascii mode will show the filename that this history belongs to. The numbered files are actually zip files and they have full versions of the file in them. Just unzip those and open with a text editor if they are plain text files.
Hope this helps you out, but I realize its probably too late now. I had to figure this out because I had opened a remote file with netbeans (a file that was not associated with a project), and couldn't get back into the Local History because the file didn't have a project. However I could see it in the Local history by reading the data file, and I just guessed that the other files were zipped by the fact that they started with "PK" in the binary viewer. Once I put it all together I was home free.