Is it possible in Sublime Text 3 to make a project have a name with tokens in it where the tokens would be parts of the path. I am trying to produce a name like the following.
${Product} (${Branch})
The branch would be the name of folder I added the to the project and the Product would be the name of the folder 1 level up from this so the path would look like this.
Products\\Product\\Branch
Here is an example of what I would think the project file would look like if these tokens existed or if there is a means for me to define them.
{
"folders":
[
{
"name": "${Product} (${Branch})",
"path": "Products\\Product1\\Branch"
},
{
"name": "${Product} (${Branch})",
"path": "Products\\Product2\\Branch"
}
...
]
}
Related
I am currently using SSH-Remote add-on for VisualStudioCode and some directories are having numbered names due to docker usage, my question is:
"Can i somehow 'rename' them without actually making changes to directory name"
With this i would give folder a nickname or a alias shown only to me and not changing actual values on my VPS
As a workaround you can add those folders to a workspace in VS Code, save the workspace and then edit the .code-workspace file you just saved to add a new node "name" where you can add custom names to the folder without actually renaming them.
{
"folders": [
{
"path": "../path/to/your/directory1"
},
{
"path": "../path/to/your/directory2"
}
],
"settings": {}
}
from this to
{
"folders": [
{
"path": "../path/to/your/directory1",
"name": "Your Custom NickName1"
},
{
"path": "../path/to/your/directory2",
"name": "Your Custom NickName2"
}
],
"settings": {}
}
I am looking for a way to implement a structural ordering for a search. I use Azure search and have indexes (simplified):
[
{
"id": Guid,
"name": string,
"folderId": Guid
}
]
name field is the field I am executing the search queries against. And the folder - obviously, the folder the object lives in.
Suppose I have a folder structure:
[
{
"id": "a595885e-520e-4fd2-9bdd-3f494f187b2e",
"name": "folder1"
"searchObjects": [],
"folders": [
{
"id": "f760f2bd-7291-49ed-9be2-9546ce57fb87",
"name": "subfolder1",
"searchObjects": [],
"folders": []
}
]
},
{
"id": "200ff3b6-310a-49d1-ad99-aed6f34a8f38",
"name": "folder2",
"searchObjects": [],
"folders": []
}
]
And each of these folders has 3000 searchable objects.
What I would like to achieve is I want to paginate the search results and retrieve these pages accordingly to the folders structure. For example, let's say I query 5000 objects with each request. In this case, I would get:
1 page - 3000 items from folder1 + 2000 items from subfolder1;
2 page - 1000 items from subfolder1 + 3000 items from folder2;
The initial thought was to calculate a certain folder index before putting the searchable objects into Azure Search. e.g. folder index:
[
{
"index": 1
"name": "folder1"
"folders": [
{
"index": 11,
"name": "subfolder1"
},
{
"index": 12,
"name": "subfolder2"
},
{
"index": 13,
"name": "subfolder3"
"folders": [
{
"index": 131,
"name": "subSubfolder1"
}
]
}
]
},
{
"index": 2
"name": "folder2"
"folders": [
{
"index": 21,
"name": "subfolder2"
}
]
}
]
Searchable objects:
[
{
"id": "3d4374ec-18a0-4e5b-bb55-e7576b475cdb",
"name": "this object is in folder1",
"folderIndex": 1
},
{
"id": "3d4374ec-18a0-4e5b-bb55-e7576b475cdb",
"name": "this object is in subSubfolder1",
"folderIndex": 131
},
{
"id": "2c2c02ec-3f57-4c85-886e-df6603718d44",
"name": "this object is in subfolder1",
"folderIndex": 11
},
...
]
This would allow me to search by the name and order by the folder structure:
search=this object&$top=5000&$searchFields=name&$orderby=folderIndex,name
When I put/change one or even a thousand of objects in a folder it works fine, I just index/reindex these objects on Azure Search side. But it doesn't work in scale. I may have hundreds of folders folded into each other and each of these folders may contain thousands of objects. So if I reorganize the folders it becomes a mess. I have to recalculate almost all of the objects starting from the top folder in the changing tree down to the bottom leaves.
This would be much easier with a relational structure where I could store folders with their indexes separately from the searchable objects, join them by folder IDs and order by the folder indexer all the same, but ...
Is there a way of doing this right?
Is the folder index being kept just for the reason of ordering the result set by folder path? If that's the case, why not keep full folder paths as a sortable field in the original index? This way you'll be able to order the result set by folder paths, assuming the folder path order you want is alphabetical.
For example:
Doc1: “field1”
Doc2: ”field1”
Doc3: “field1\subfield11\subfield111”
Doc4: ”field2”
I am searching for a tool that gives me output as follows for the input word 'unstoppable'.
prefix: un
suffix: able
root: stop
I think what you're looking for is an morphological analyzer that returns "morphemes" of the given word. I'm not sure about the state-of-the-art but Morfessor FlatCat should work.
The result is like straightforwardness -> straight/STM + forward/STM + ness/SUF.
Check out Lingua Robot. It's a REST API that returns a bunch of useful information for English words including morphemes. Looks like it returns what you want for unstoppable:
"morphemes": [
{
"entry": "un-",
"type": "prefix"
},
{
"entry": "stop",
"type": "root"
},
{
"entry": "-able",
"type": "suffix"
}
]
I have created a role (commonrole) and applied to multiple nodes.
Now I want to override one of the attributes on 1 particular node to change to a different value.
So , created 1 more role (noderole) and applied that role after "commonrole "to this node but my node does not picks the new value (-Xmx2048m as mentioned below).
Sample common role-
{
"name": "commonrole",
"description": "Manages all nodes",
"run_list": [
"recipe[abc]"
],
"default_attributes": {
"catalina_opts": [
"-Dfile.encoding=UTF-8"
]
}
Sample noderole-
{
"name": "noderole",
"description": "Manages particular node",
"run_list": [
"role[commonrole]"
],
"default_attributes": {
"catalina_opts": [
"-Dfile.encoding=UTF-8",
"-Xmx2048m"
]
}
}
Am I missing something?
Arrays in node attributes are kind of weird. I've got a full write up on my site but basically this should result in the merged value being:
[
"-Dfile.encoding=UTF-8",
"-Dfile.encoding=UTF-8",
"-Xmx2048m"
]
or something similar. Also remember you won't see the attribute change immediately in the knife node show output, only after a successful converge.
The git cookbook has an error in the url that it uses to download the appropriate version. The url is set in the attributes file as a default attribute so I figured I could just overwrite the url with something static but it does not work. Here is the code from the git cookbook:
case node['platform_family']
when 'windows'
default['git']['version'] = '2.8.1'
if node['kernel']['machine'] == 'x86_64'
default['git']['architecture'] = '64'
default['git']['checksum'] = '5e5283990cc91d1e9bd0858f8411e7d0afb70ce26e23680252fb4869288c7cfb'
else
default['git']['architecture'] = '32'
default['git']['checksum'] = '17418c2e507243b9c98db161e9e5e8041d958b93ce6078530569b8edaec6b8a4'
end
default['git']['url'] = 'https://github.com/git-for-windows/git/releases/download/v%{version}.windows.1/Git-%{version}-%{architecture}-bit.exe'
The cookbook is being included as a dependency in my metadata.rb file and used as a resource in my recipe. It is not part of the runlist. I've tried overwriting the url in my role file like so
"name": "web",
"description": "Web Server Role.",
"json_class": "Chef::Role",
"default_attributes": {
"chef_client": {
"interval": 300,
"splay": 60
},
"git": {
"url": "a test string"
}
},...
That did not work, so I tried adding it to the attributes file of my recipe as a default value, and when that did not work, I tried the override! method which still did not work.
I think the problem is due to the fact that the attribute does not exist when I have declared it, and it gets overwritten by the git recipe.
I don't know how to get around that.
Use override_attributes instead of default_attributes:
"name": "web",
"description": "Web Server Role.",
"json_class": "Chef::Role",
"default_attributes": {
"chef_client": {
"interval": 300,
"splay": 60
}
},
"override_attributes": {
"git": {
"url": "a test string"
}
},...