GJS: Using filter or search in TextBuffer in GJS - gtk3

I've tried buffer.forward_search(), but GJS doesn't seem to support it yet. I want to be able to search a string in a TextBuffer, and get the match, and its location (start, end). Went through the wiki, GJS 3 doesn't have anything similar yet, it seems

Related

building android source for pixel 6

I'm trying to build grapheneos for pixel 6 with custom bootanimation.
I created the bootanimation.zip file according to instructions but can't figure out the location to put it in. Since the usual location, system/media/bootanimation.zip is giving me an Error:
offending entries: system/media/bootanimation.zip
besides this, the build also fails.
Can anyone help me to understand what I am doing wrong ?
Error message
If it is still relevant, I may have an answer for you.
There's a mechanism that prevents you from doing something to the system partition from the product makefile in some cases.
The solution to your specific situation might be different, and there are also suggested solutions in the link below.
If you have something that is a part of the system partition, and is not a product specific thing, you can also add it to:
build/make/target/product/generic_system.mk
instead of the product specific makefile
Here is a link explaining this mechanism

Google Actions CLI 3.1.0 version and actions.intent.TEXT

I want to be able to talk with Google Assistant, but connect the Actions project directly to an NLP service I already have running on my server. In other words, NOT use dialogflow.
All the following examples show how to do this.
With Rasa
https://blog.rasa.com/going-beyond-hey-google-building-a-rasa-powered-google-assistant/
With LUIS
https://www.grokkingandroid.com/using-the-actions-sdk/
https://dzone.com/articles/using-the-actions-sdk-for-google-assistant-develop
With Watson
https://www.youtube.com/watch?v=no0R0bSkHXc
They use the actions.intent.MAIN as the invocation and actions.intent.TEXT for all other utterances from the talker.
This is what I need. I don’t want to create a load of intents, with utterance phrases, inside the Action because I just want all the phrases spoken by the talker to be passed to my server, and for my NLP service to deal with them.
So I set up a new Action project, install the Actions CLI and then spend 3 days trying all possible combinations without success, because all these examples are using gactions cli 2.1.3 and Google have now moved on to gactions cli 3.1.0.
Not only have the commands changed, but so too has the file formats and structure.
It appears there is also a new Google Actions Console, and actions.intent.TEXT is no longer available.
My Action is webhook connected to my server, but I cannot figure out how to get the action.intent.TEXT included and working.
Everything I find, even here
Publishing Actions on google without Dialogflow
is pre version update and follows the same pattern.
Can anyone point to an up-to-date, v3.1.0, discussion, tutorial or example about how to send all talker phrases through to an NLP that isn’t dialogflow, or has Google closed that avenue?
Is it possible to somehow go back and use the 2.1 CLI either with the new Console or revert the console back. (I have both CLI versions, I can see how different their commands are)
Is it possible to go back and use 2.1?
There is no way to go back to AoG 2. You probably also don't want to do so - newer features aren't available with v2 and are only available with v3.
Can I use my own NLP with v3?
Yes, although it isn't as obvious, and there are some changes in semantics.
As an overview, what you'll need to do is:
Create a Type that can accept "Free form text". I usually call this type "Any".
In the console, it looks something like this:
Create a Custom Intent that has a single parameter of this Any Type and at least one phrase that captures everything for this parameter. (So you should add one training phrase, highlight the entire phrase, and set it for the parameter. Sometimes I also add additional phrases that includes words that I don't want to capture.) I usually call the Intent "matchAny" and the parameter "any".
In the console, it could be something like this:
Finally, you'll have a Scene that you transition to from the Main invocation. When it matches the "matchAny" Intent, it should call your webhook with a handler name. Your webhook will be called with the "any" parameter set with the user utterance. (Note that the JSON has also changed.
Again, the console might have it looking something like this:
That seems like a lot of work. Isn't there just some way to do all that from the command line?
Yes. You can do all of that in the configuration files that the CLI accesses and then upload it. (You can then also use the console to review the configuration, if necessary, to make sure they're configured as you expect. You can shift back and forth between them as appropriate.)
Google also has a github repository that contains most of the files pre-configured for this sort of setup.
You will need to update the configuration from the repository to handle the webhook correctly (it includes code to illustrate what is happening using the inline code editor) and to add your project ID.

Opening the VSC settings window from code

I'm working on a Visual Studio Code extension, where some settings are required for it to work properly. Right now, in case the user has forgotten something, I'm showing a warning message indicating this, and telling them to fix this property in the settings. I would, however, like to add a button that opens the settings page of that property.
However, after looking around for over an hour, I can't seem to find any support for this in the Api, or anyone else asking this question (which I find a bit weird?). If it really doesn't exist, I'd still expect at least 1 other person asking this somewhere, but as far as I can see there's absolutely nothing.
Is it possible to open the settings window (preferably even filtering them down to only my extension's properties/the one property that has to be filled in) from code?
Thanks in advance
I found it out myself after digging through the keybinds window. You can use the following to open the settings:
vscode.commands.executeCommand("workbench.action.openSettings2");
I did not, however, find how to pass a search query into it to open a specific place in the settings.
EDIT: You can use openSettings & add the search query as an extra argument to executeCommand. For example - if your property is defined as my.extension.property in package.json, you can use this:
vscode.commands.executeCommand("workbench.action.openSettings", "my.extension.property");

What are Visual Studio Code experiments?

Today I was surprised to find an "Enable Experiments" option under VSCode's Workbench settings, turned on by default.
The setting's description is "Fetches experiments to run from a Microsoft online service" which seems rather vague to me. I tried googling this but didn't find any clear answers.
So, does anybody know what those "experiments" are and if it would probably be better to turn this off?
This is one of the case where using open-source software is a good idea. Because the source code of visual studio code is published in https://github.com/Microsoft/vscode. We could try to search in where the code would be used.
First, we could try to search the string Enable Experiments. And see, to which action the option is tied to. From there, I see that, the file src/vs/workbench/contrib/experiments/node/experimentService.ts is using it. Specifically, when trying to load an experiment in line 173
if (!product.experimentsUrl || this.configurationService.getValue('workbench.enableExperiments') === false) {
We see that, the code would check for "experiment URL". this could be seen in product.json which #Joey mentioned in the comment. In my case, the text looks like this.
"experimentsUrl": "https://az764295.vo.msecnd.net/experiments/vscode-experiments.json",
From there, we could see the content of the JSON file by making a GET request to that URL. And, it returns this (at least, at the time I make the request)
{
"experiments": [
{
"id": "cdias.searchForAzure",
"enabled": true,
"action": {
"type": "ExtensionSearchResults",
"properties": {
"searchText": "azure",
"preferredResults": [
"ms-vscode.vscode-node-azure-pack",
"ms-azuretools.vscode-azureappservice",
"ms-azuretools.vscode-azurestorage",
"ms-azuretools.vscode-cosmosdb"
]
}
}
}
]
}
Based on the response, I could see that, it try to alter my search result if I search using "azure" key word. Which I tried, and the search result shows the 4 items there on top of the result search.
As to whether to disable it or not. On safe side (if you don't want for it to alter your experience using vscode) I think you would want to disable it. But, I don't think microsoft would do something crazy.
I just noticed this one and was curious about it as well. A search through the VS Code release notes finds one reference to it in July 2018. workbench.enableExperiments is listed as one of the settings for VS Code's "Offline mode": https://code.visualstudio.com/updates/v1_26#_offline-mode
The description of offline mode suggests that this settings is for "A/B experiments":
To support this offline mode, we have added new settings to turn off features such as automatic extension update checking, querying settings for A/B experiments, and fetching of online data for auto-completions.
As mentioned by others, the source code for VS Code shows this setting being used in experimentService.ts: https://github.com/microsoft/vscode/blob/93bb67d7efb669b4d1a7e40cd299bfefe5e85574/src/vs/workbench/contrib/experiments/common/experimentService.ts
If you look at the code of experimentService.ts, the stuff it's fetching seems to be related to extension recommendations, notifications about new features, and similar things. So it looks like the experiment service is for fetching data to do A/B testing of feature and extension recommendations to users.

ReactJS 5.3.0 not loading from unpkg.com

We have been using the following library for months:
https://unpkg.com/react#15.3.0/dist/react.min.js
Yes - I know we can just reference 15.3 and get the URL rewrite to the latest, but they released a breaking change. That's another issue for another day. Don't get distracted.
Yesterday this simply stopped working. You'll notice that if you load the URL mentioned, that the file is TRUNCATED. Simply cuts off. This made everything we use react with break. Interestingly, if you go to the following URL (without the .js extension) - things work.
https://unpkg.com/react#15.3.0/dist/react.min
My question is - what the heck happened? Why did the URL we've been using for 8 months suddenly stop working, and who can we get to fix it. In the interim, we had a copy locally that we've started referencing (which we probably should have been doing to begin with, since we don't want the automatic upgrade). When things like this happen, who do you inform?
I'm not sure you'll find the answer as to why this file is no longer working here but based off of the website you could reached out to the creator on twitter: https://twitter.com/mjackson
On the website it says:
SUPPORT
unpkg is a free, best-effort service and cannot provide any uptime or
support guarantees.
i.e. you should probably only use this link if you are messing around with a small project and shouldn't be used for any website where you actually care about the uptime of the site.