Common place for custom helper Matlab scripts and function? - repository

Matlab Central file exchange contains numerous helper scripts and functions. Is it possible to place them somewhere in order not to populate current (project) directory with helper files?

There is set of functionality that concerns itself with search path (documentation).
What Is the MATLAB Search Path?
The search path, or path is a subset of all the folders in the file system. MATLAB® software uses the search path to efficiently locate files used with MathWorks® products. MATLAB can access all files in the folders on the search path.
Add Folders to Search Path Upon Startup
The startup.m file is for specifying startup options. You can add folders to the search path by including addpath statements in startup.m. For example, to add the specified folders, /home/username/mytools to the search path, include this statement:
addpath /home/username/mytools

Related

How to search full content of code files (e.g. SQL scripts) stored in a SharePoint folder?

Do you run into this situation that there are many code files (e.g. SQL scripts *.sql) stored in a SharePoint folder, and you need to run full text search to find a specific one containing certain keywords (a table/column/function name, a comment, someone's initials, etc)?
Problem here is the search function in SharePoint document library only looks at the filenames, not the full content.
Of course many code repo systems (e.g. BitBucket) have advanced full text search functions (e.g. definition over usage), but in this case SharePoint hosts the "code repo", and the business depends on it...
Through experiment I found out SharePoint search function actually looks at the full content of a few limited file types – plain text (.txt) and Word (.doc, .docx) files.
Since code files (*.sql, *.py, *.js, *.htm, *.css, etc) are essentially text files, we can "cheat" SharePoint by appending ".txt" to the filename (e.g. my_script.sql → my_script.sql.txt), making the file content searchable once indexing finishes (in the matter of seconds according to my test).
So if you manage a SharePoint folder of many code files, you can download the entire folder as a zipped file, unzip and modify all code filenames (with utility tools to do this in batch or run a DIY script), and re-upload... voila!

MS Graph API Search File Name not Content

I want to return a list of files within a folder on a OneDrive site that match a search pattern using MS Graph API.
The files can be up to a few levels deep in sub folders.
The files are named consistently, for example starting with the letters WKP. My searches always also return files that don't have WKP in the file name. I assume wkp is in the content somewhere for these files.
I can't find anything in the MS Graph docs that tells me how to search only the file names and not the content.
I am using this endpoint /v1.0/sites/{siteId}/drive/items/{ItemId}/search(q='WKP')
Is there a way to build the query so that it only looks at the file name? I tried q='filename:WKP'
Thanks,

List files and paths in a VB poject

I have several VB.Net projects each with containing many files/forms. Several of the forms are shared/linked between more than one project and saved in a shared folder. Recently I discovered one file that should have been shared was not, meaning that there were two files with the same name in two different folders. Obviously any change of a file in one project was not shown in the other poject. Is there any way of listing all the files and paths in a project - either to screen or spreadsheet?
you should take a look at the projectname.vbproj file, it is a xml file and in the node called <ItemGroup> you are going to find what you are looking for, you can tell if a file is a linked one if inside the <Compile> node there is a <Link> tag.

Programmatically set default column values based on folder in SharePoint Online

I'm working on enhancing metadata in our SharePoint online (O365) environment. Since a portion of my user base is used to foldering (explorer style), I've started using default column values to automatically set values on any files added to that specific folder (we have content organized categorically by folder currently). An example is our HR documents library - we have separate folders for recruiting, payroll, personnel files, etc. that automatically categorize files added to that folder with the same categories (recruiting, payroll, personnel, etc.). This supports both "search" and "click" users and makes adoption WAY easier while getting important metadata.
I want to implement this in a larger, more dynamic fashion, so manually setting default column values on each folder is not going to be scalable.
How can I reference the top level folder within the library (or even the current folder) for each newly added file and populate the "category" field for that new file with that folder name? I can do some very basic C# or Java code copy/paste, but bonus points for non-coding solutions =)
This problem can be solved through no coding.You can use the workflow to implement this by SharePoint Designer.
Create different view for different function team, and then use the view filter to show the document.
If you upload a file, use the workflow to set the metadata of the file. There are some known limitations: if you upload multiple files at the same time, the metadata for the file maybe does not work well; or if you upload a folder, the meta will not work for it and the file in the folder may not be set to right metadata.
I was actually able to use MS Flow to accomplish this in a pretty simple and straightforward fashion without managing custom views per team. The concept at a high level was:
(Trigger) When a new document is created in a folder in the library
Get the link of the parent folder of the newly added document
Create a variable (or just code it out in the Flow step) to parse out the name of the parent folder from the parent folder link (should be all text to the right of the last "/")
Set the category field as the variable
I'm sure that you could do the same right in a SharePoint designer workflow, but I prefer flow due to the visual aspect of it and being far easier to troubleshoot.

How to find all references to a specific file in source control within Team Foundation Server

I am trying to find the simplest best way to find all the programs in our source control that use a particular .vb file. Is there an easy way to do this or do I just need to go through each program and search for my particular file?
Ok thanks to some of my colleagues here is how to do it. To find any files within your project you can search the .vbproj file. If you download grepWin you can search a directory for a specified file based on its ext. (.vbproj), then you can put in the file you are looking for and search. It will return a listing of all the programs/.vbproj files that contain the text you searched for.