How to exclude subfolders and files in the Search pane of LightTable? - lighttable

What is the syntax of the Locations field in the Find and Replace pane of LightTable? (which appears when hitting CTRL-SHIFT-F, or CTRL+SPACE then Searcher: show)
I would like to exclude all files of the docs/ subfolder, as well as all *.txt and *.csv files of my workspace. What should I enter in the Locations field to exclude them from a search & replace?
Or inversely, I'd like to include only the files from the src/ subfolder. How would I accomplish that?

There doesn't seem to be a way to exclude directories or file patterns right now. However, you can specify which directories to include. You will have to write the whole path though (relative paths use Light Table's application directory). If you want to have more than one path you can separate them by using a comma:
/absolute/path/to/first/dir, /absolute/path/to/second/dir

Related

Need to handle the spaces between the filename in Control-M File watcher command

I have File watcher job which is looking for certain file name(Membership Daily 20191230.xslx). Could some one share some insights how to handle the space between the file when i provided the path with file name?
Usually will use * as wild card search but i have the different files which are closer with member.
Server File Watcher Run : UNIX
Enclose the full path name in quotation marks (for example, “c:\ctm\My Example.txt”). Only if a file name is in a Rules file containing a wildcard, then the filename should not be enclosed in quotation marks.
If you don't want to use spaces, one ? will wildcard for any one character, for example c:\ctm\My?File?Example.txt.

Atom: How to search in only the current folder?

I've read the documentation here and about Glob pattern, but still couldn't find a way to search the current folder only(not including the subfolders).
That is, if I open "search in project" and type "meta/*.php" into the "fire/directory pattern" field, the search will be against all *.php files in folder "meta" and all of its subfolders.
So how do I search the "meta" folder only?
If you are using glob with depth unknown subfolders are included in search otherwise it will search in the specified folder only
C:\\dir1\dir2\*.ext
The above pattern will search only in the files with extension .ext inside the dir2 excluding subfolders
C:\\dir1\**\*.ext
The double star is called unknown depth and will search in the files with extension .ext inside dir1 including all subfolders

Relative path for a included file - ASP/HTML

Sorry if this question is answered somewhere else but I tried searching several pages and was unsuccessful.
So i have an include file (sidebar) which i am using in all pages.
Default.asp
Products.asp
Salary/Survey.asp
inc/sidebar.asp (this is the included file)
now inside sidebar.asp I have a link for Salary/Survey.asp
from all other pages at root level, i can simply use href='Salary/Survey.asp' and will work fine. but when I am on page Survey.asp , writing href='Salary/Survey.asp' will become actually Salary/Salary/Survey.asp. I understand it has to be ../Salary/Survey.asp to be used properly but it will then not work for root level pages.
I can not use root relative which is /Default.asp and /Salary/Survey.asp as I am working for someone else' project and i dont know his directory structure and thus i only have option to document relative path.
Hope this is clear to understand and someone helps me out.
Thanks!
We solved this problem the following way...
Each of our asp pages included a special file that Dims and sets golbal variables. We called ours Info.asp
Inside Info.asp we defined a variable called strRelativePath
Dim strRelativePath
strRelativePath = ""
Every asp page set the relative path according to it relative position:
for example:
Root pages - strRelativePath = ""
One level deep pages - strRelativePath = "../"
Two levels deep pages - strRelativePath = "../../"
Then it was a matter of prefacing all the links requiring a relative path with <%=strRelativePath%>
you need to get write this after the that - Salary/Survey.asp
You can get the virtual path to the file from one of several server variables - try either:
Request.ServerVariables("PATH_INFO")
Request.ServerVariables("SCRIPT_NAME")
Either server variable will give you the virtual path including any sub-directories and the file name - given your example, you'll get /virtual_directory/subdirectory/file.asp. If you just want the virtual directory, you'll need to strip off everything after the second forward slash using whatever method you prefer for plucking a directory out of a path, such as:
s = Request.ServerVariables("SCRIPT_NAME")
i = InStr(2, s, "/")
If i > 0 Then
s = Left(s, i - 1)
End If
or:
s = "/" & Split(Request.ServerVariables("SCRIPT_NAME"), "/")(1)
basically, if your sidebar can be included from programs in different folders, the only 'easy' way is to use absolute paths like you mentioned.
You say can't use it, so I would think of different ways...
virtual folders: In IIS you could set a virtual folder in salary folder for 'salary' and point it to the site's root.
OS links (similar to above, but at the OS level)
use mappath. You could check mappath to see the actual folder you're in, and use the correct include (with/without /salary) though I'm thinking this might give you an error, not sure.

ASP.NET localized files

I've got a web page with a link, and the link is suppose to correspond to a PDF is the given user's language. I'm wondering where I should put these PDF files though. If I put them in App_LocalResources, I can't specify a link to /App_LocalResources/TOS_en-US.pdf can I?
The PDF should definitely not be in the App_LocalResources folder. That folder is only for RESX files.
The PDF files can go anywhere else in your app. For example, a great place to put them would be in a ~/PDF folder. Then your links will have to be dynamically generated (similar to what Greg has shown):
string cultureSpecificFileName = String.Format("TOS_{0}.pdf", CultureInfo.CurrentCulture.Name);
However, there are some other things to consider:
You need a way to ensure that you actually have a PDF for the given language. If someone shows up at your site and has their culture specified as Klingon, it's unlikely that you have such a PDF.
You need to decide exactly what the file format will be. In the example given, the file would have to be named TOS_en-US.pdf. It you want to use the 2-letter ISO culture names, use CurrentCulture.TwoLetterISOLanguageName and then the file name would be TOS_en.pdf.
I would store the filename somewhere with an argument in it (i.e. "TOS_{0}.pdf" ) and then just add the appropriate suffix in code:
string cultureSpecificFileName = string.Format("TOS_{0}.pdf", CultureInfo.CurrentCulture);
Does the PDF have to have the same file name for each of the different languages? If not, put them all into a directory and just store the path in your resources file.

What's the most simple way to get files only visible in Finder in a directory?

NSFileManager has several method to enumerate directory contents, but they returns all files including hidden or system files which is invisible for users in Finder.
I want to get the file list same as Finder. As possible as simple. What do I have to do?
Test the filename, usually a hidden file begins with a "." (period).

Resources