How can I make an ICU data file with information for emojis only - c

I'm trying to pare down the libicudata.a file to the bare minimum that would still allow me to be able to test the following:
u_stringHasBinaryProperty(icu::UnicodeString::fromUTF8("🤙🏿").getBuffer(), -1, UProperty::UCHAR_RGI_EMOJI);
As per the instructions found here, I crafted the following file file and used it accordingly when configuring ICU's build.
{
"strategy": "additive",
"resourceFilters": [
{
"categories": [
"misc"
],
"files": {
"includelist": [
"emoji-sequences",
"emoji-zwj-sequences"
]
},
"rules": []
}
]
}
I did end up with a (much) smaller file (17kb) but it's obviously not working. M code compiles, links and runs but fails the test.

The good folks at icu-support#lists.sourceforge.net helped me out. The information was (temporarily) missing from their documentation. The following filter is what I was looking for:
{
"strategy": "additive",
"featureFilters": {
"uemoji": "include"
}
}

Related

How can I make snippet that place a variable in the script in VSCODE?

I want my prefix "ffz15" turns into "font-size: var(--fz15)".
So, when I have typed "ffz", everything that goes after this prefix should come as variable and inserts in snippets body.
It should be something like this (pseudocode):
"font-size variable": {
"scope": "css, scss",
"prefix": "fzz{value-of-font-size}",
"body": [
"font-size: var(--fz{value-of-font-size}px)",
],
},
I think it can be made quite simple, but I cannot find any information about that.
Thank you in advance for your help.
I don't think you can use part of the prefix as a variable in the snippet. Can you just do this instead? Use fzz as prefix, then it inserts the snippet, and puts you at the place where you just type the font size:
"font-size variable": {
"scope": "css, scss",
"prefix": "fzz",
"body": [
"var(--fz$0)",
],
},

gatsby-plugin-mdx with rehype-autolink-headers only working with wrap option

I am trying to get my site setup with Gatsby + MDX. I am looking at the documentation here and want to make use of the autolink-header-option. I have tried using the rehype and remark plugins for this, but I can only get the Rehype plugin to work and only with the wrap option. I would much prefer the GitHub (default) style with the link coming before the title.
I am using the below config in gatsby-config.js and cleared .cache and public after updating the file to be sure nothing was cached. Also I am not getting any errors, everything builds and runs successfully, there just is not any link to the headers.
{
resolve: `gatsby-plugin-mdx`,
options: {
rehypePlugins: [
// To pass options, use a 2-element array with the
// configuration in an object in the second element
require("rehype-autolink-headings"),
],
},
},
UPDATE
After trying multiple configurations, the way I was able to get it working as expected was with a different plugin config.
{
resolve: `gatsby-plugin-mdx`,
options: {
gatsbyRemarkPlugins: [ `gatsby-remark-autolink-headers` ],
plugins: [ `gatsby-remark-autolink-headers` ],
},
}
Both gatsbyRemarkPlugins and plugins are required as per: https://github.com/gatsbyjs/gatsby/issues/15486
The README for rehype-autolink-headings mentions that:
This package works with headings that have IDs. One way to add IDs to headings is by using remark-slug before this plugin.
Changing your config to the following should fix it:
{
resolve: `gatsby-plugin-mdx`,
options: {
rehypePlugins: [
require("rehype-slug"),
// To pass options, use a 2-element array with the
// configuration in an object in the second element
require("rehype-autolink-headings"),
],
},
},
In fact, the documentation you linked to has this additional require line as well, but it doesn't clarify what it is used for.

Mix of objects and arrays

I am trying to structure the json-schema after a json response I want to send.
I have tried several versions of object->array->object->array, but it does not seem like I can validate an UUID key with a regex using patternProperties
The JSON looks like this:
[{
"54ffe69-b8f6-47c8-9437-ccea8ecc2d77": {
"name": "ORC",
"$description": "Design polar from ORC",
"source": {
"label": "signalk-polar"
},
"polarData": [{
"trueWindSpeed": 3.086666667,
"beatAngles": [
0.738274274
]
}]
}
}]
Not really sure, it might be something wrong with the UUID that you are trying to validate. It is though accepting this pattern:
[0-9a-f]{7}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
but, according to this post, we should have had:
[0-9a-f]{8}
in the starting part, or I might be wrong.
Demo

What is the meaning here list in array calling

Below I have environment file and recipe can you explain I am not getting what is the list here.
{
"json_class": "Chef::Environment",
"description": "prod environment",
"default_attributes": {
},
"chef_type": "environment",
"override_attributes": {
"user": {
"mapr": {
"id": "application",
"group": "application",
},
"local" : {
"id": "chef",
"group": "chef"
},
"ldap" : {
"id": "ldap",
"sudo": true,
},
}
"name": "prod"
}
Below is the recipe what is the list here i did not get
node['user_create'].each do |list, user|
group user['group'] do
group_name user['group']
gid user['gid']
action [:create]
ignore_failure true
end
user user do
username user['id']
uid user['uid']
group user['gid']
home user['home']
manage_home true
end
if list !='ldap'
How list is passing here in if condition
You are not actually passing in any attributes via the environment, which you can see because the values of default_attributes and override_attributes are both just empty hashes { }. The data you've included there is just ignored by Chef as noise. In the future I recommend you use the Ruby DSL for environment files as it has more error checking for things like this (though not perfect error checking).
As an aside, you've been asking a lot of questions on here and seem to be struggling with Chef. Please consider joining the Chef community Slack team and asking there instead as it's a full chat system and thus the community could offer real-time help rather than here random blurbs.

Azure Search Custom Analyzer

We are trying to use a custom analyzer (KeywordAnalyzer) using Azure Search Rest api-version: 2015-02-28-preview.
The Index definition code you see below is copied exactly from Microsoft docs.
This works if we put the Analyzer Type to CustomAnalyzer. However, if we make a single change by changing the analyzer type from CustomAnalyzer to any other analyzer such as KeywordAnalyzer, you get a Bad Request error when creating the Index and the Index is not created.
Would appreciate if anyone coud tell us how we can specify an Analyzer.
Many thanks
{
"name":"homes",
"fields":[
{
"name":"Id",
"type":"Edm.String",
"key":true,
"searchable":false},
{
"name":"IdStd",
"type":"Edm.String",
"searchable":true,
"analyzer":"my_analyzer"}
],
"analyzers":[
{
"name":"my_analyzer",
"#odata.type":"#Microsoft.Azure.Search.CustomAnalyzer",
"tokenizer":"my_standard_tokenizer",
"tokenFilters":[
"my_asciifolding",
"lowercase"
]
}
],
"tokenizers":[
{
"name":"my_standard_tokenizer",
"#odata.type":"#Microsoft.Azure.Search.StandardTokenizer",
"maxTokenLength":20}
],
"tokenFilters":[
{
"name":"my_asciifolding",
"#odata.type":"#Microsoft.Azure.Search.AsciiFoldingTokenFilter",
"preserveOriginal":true}
]
}
I'm from Azure Search. What's the error message you're seeing together with the BadRequest response code?
Edit:
I reread you question. Potentially you are specifying the tokenizer and tokenFilter properties for the KeywordAnalyzer. These properties only apply to the CustomAnalyzer. Please let me know if you find the documentation insufficient or confusing. We'll make sure to make it more clear and easier to follow.

Resources