How can I get microphone dB level in a script? - spark-ar-studio

I would like to get microphone input level in spark ar script for an AR filter I'm developing.
It looks like this existed at this link at some point but the page is empty now: https://sparkar.facebook.com/ar-studio/learn/documentation/tutorials-and-samples/audio-analyzer-and-energy-meter/
I tried to create a bit crusher patch and connect its output to a value patch and pass that to script but spark ar shows an error: "Please check the patch graph and try again"
Also I have no idea what type that would be so I can't read it on the script.

Related

Cloud Build fails due to Cloud Function container not being ready yet

we have a Google cloudbuild pipeline that does the following:
Create a temp function
Run some tests
Deploy the production function
However, the second step often fails due to the first container not being ready yet:
Step #3: Unexpected token '<' at 2:1
Step #3: <html><head>
Step #3: site unreachable
looks like it is returning some placeholder html from nginx.
How can we fix that?
Currently, we just put an ugly sleep between steps
You probably want to have a look to the Cloud Functions API, there you can find the operations endpoint that will tell you if the operation is finished or not (assuming v1, otherwise look below): https://cloud.google.com/functions/docs/reference/rest/v1/operations/get
The operation is the same Id that is returned in the creation operation. Also you can list them with the list endpoint (in the same doc).

Why my Soffid JSON REST Web Services Connector does not update an object in the target system?

I am trying to connect my Soffid 3 server with our custom web application named Schrift. I am using а JSON REST Web Services Connector for this purpose. I added REST Web service plugin and then configured an agent with JSON/XML/SOAP Rest webservice type.
Loading of objects is working fine. My REST connector connects to the web service successfully and gets data of the accounts.
The problem is when I am trying to update some data (for example, I am trying to lock an account), nothing happens. And unfortunately I don't know what should be happening. When should REST connector send updated data to the managed system and in which way? I didn't find any log entries saying that REST connector was trying to update an object on managed system. Maybe I did smth wrong or missed something.
I would appreciate for any help. I can post any conf or log details if you need.
Update#1
(I did some investigation after the first answer)
I checked the agent settings: Read only and Manual account creation are set to no
The account was set to unmanaged type, but I succeeded in changing its type to shared and then to single without getting an error. Now it is set to single
The task queue is empty.
Also I've checked that update method is present and update properties are set correctly. updateParams is not set (it means that all attributes should be sent to the managed system).
But when I change status of the account (from Enable to Disable), nothing happens.
In the console log I can see only these lines
14-Sep-2021 13:26:29.708 INFO [BPM-Scheduler:192.168.7.121:1] com.soffid.iam.bpm.job.JobExecutorThread.run No job to execute
When I manually run the task Analize impact for changes on Schrift, Execution log shows
Changes detected for accounts
=============================
NO CHANGE DETECTED
Changes detected for roles
=============================
NO CHANGE DETECTED
Update#2
After many attempts I made some progress. Now when I make some changes in the account, the task named UpdateAccount baklykov#irf.com.ua#Schrift appears, but runs with an error.
At first it was 415 Unsupported Media Type error as I wrote in comments, but now it looks a little different
Throws exception updating object : Extensible object [type = account]
EmployeeEmail: baklykov#irf.com.ua
IsLockedOut: true (log truncated) ...
caused by Unexpected response, Content-Type: null
Update#3
I found out that soffid's request for updating the object was in improper format (all the parameters were passed in the html request instead of putting them in json body)
After researching I found a method's property called Encoding and set it to application/json value.
Now the parameters are passed in json body (that's what I need), but now the problem is that soffid puts all the parameters in json body, including the key parameter by which the object for updating should be determined. My guess this is the reason why the object in the target system is still not updated.
In other words my application expects a request like this:
https://myapp.mysite.com/api/v1/Soffid/Employees?EmployeeEmail=baklykov%40irf.com.ua :
{"EmployeeLastName":"Baklykov","EmployeeFirstName":"Ivan"}
but Soffid sends this:
https://myapp.mysite.com/api/v1/Soffid/Employees:
{"EmployeeLastName":"Baklykov","EmployeeFirstName":"Ivan","EmployeeEmail":"baklykov#irf.com.ua"}
The system should have created a UpdateAccount task in the task queue. Please, verify:
The task engine is in automatic mode. In read-only or manual mode, no task will be created.
If you are updating an account, check the account is not set as unmanaged. In that case, no tasks is created.
Finally, verify the task queue has not held the task up.
Have you checked the engine mode? Look at Main Menu > Administration > Configure Soffid > Integration engine > Smart engine settings
It should be set to automatic.

Mention user on description Microsoft Azure DevOps API

I'm Using Azure devops API to get the description of a Pull Request and then take that description and paste it into another workitem using update api
This is an example of the description that i copy
Take a look at the **#Susan mention **at the very bottom, this is how it looks on HTML:
My question here is if there is an API to bring the whole description formatted, because this is what i get as description when i use the GET API
"description": "Summary:\nSome modifications to fix an issue in
the **** DPIDs startup code. \n\nBefore:\nThe PID stream startup
function is called continously when the TCM is not
responding.\n\nNow:\nThe PID stream startup is only executed one
time.\n\nTo Test:\nUse the next ECU Emulator
branch:\n*********\nEnable the vehicle and disable the TCM
module. Run the ECU Emulator. Run the Auto Agent. Open the mobile app.
Check in the serial output that The DPIDs are started only
once.\n\n#<6D4D***297> Pulled down on 8/12/2020, no more
looping PID stream startup without TCM. Looks good.",
it would also be nice to know how to attach by this way an image, when i get the description it shows like this: ! [ image (2).png ](https://dev.azu re.com/*/ /_apis/git/repositories/ac324630-b697-4990-ac7a-cb82443762d2/pullRequests/390/attachments/image%20(2).png)**
API can only get data, it's not able to get the page style. You may add the link to access the page directly.

Cannot create notebook immediately after creating group (modern group not

With Microsoft Graph I would like to create a Group and then after that create a Notebook (onenote) in that group directory.
First I execute a HTTP call to :
POST /groups
with the required access token in the header and JSON object of the Group in the body. (http://graph.microsoft.io/en-us/docs/api-reference/beta/api/group_post_groups).
If successful it will return a JSON object with the complete property of the group.
So far there was no problem, I've managed to get the {ID} (in GUID) of the group which will be required to create a notebook. Let's say for this example the {ID} of my Group is 123456789-abcd-4321-bbbb-9876543210aaa
Next for the notebook I execute a HTTP call to :
POST /groups/{ID}/notes/notebooks
And then I got following JSON response :
"error": {
"code": "20160",
"message": "No modern group was found that matches the ID 123456789-abcd-4321-bbbb-9876543210aaa",
"innerError": {
"request-id": "85b85297-ad3b-424d-b18f-2b1da904f5fc",
"date": "2016-01-29T08:19:27"
}
I've tried so many things to get a workaround for this issue. One time I set a break point between the method to create group and the method to create notebook in my program. I ran my program until the point it has finished creating the group. Then I stop, and try to open notebook tab from Office365 website in the browser and I found this :
In English it means "We are creating your notebook. It may take a few minutes. We will finish this even if you close the browser". I took about 10 seconds before I was redirected to OneNote Online page (the url is my sharepoint tenant name).
After that I continue my program and suddenly it successfully created the notebook.
I need some help here! I need to create the notebook immediately after creating the group without having to open up a browser. I think it has something to do with sharepoint sites creation for the Group.
Any help would be appreciated!
Creating groups does take some time (usually ~ 5 minutes).
It is recommended that you first query to see if group has been created or not and then create the notebook.
you can query drive endpoint to find if group has been provisioned.
GET /beta/groups/{id}/drive

Retrieving selenium logs and screenshots from grid back in Intern

There are two parts to my question in regards to Intern workflow in case of exception:
1- Per Selenium Desired Capabilities specifications, RemoteWebDriver captures screentshots on exceptions by default (unless it is disabled by setting webdriever.remote.quiteExceptions.) Is it possible to retrieve these screenshots in Intern?
2- I have set up a Selenium Grid with multiple platforms/browsers and can execute Intern tests on the grid successfully. However I am trying to gather the logs back in my Intern environment so that I don’t have to sign on to each machine on the grid to see the logs. I am particularly interested in server, driver, and browser logs based upon selenium logging guide. I tried adding the following Intern configurations using the Selenium Desired Capabilities guide but wasn't able to get any logs:
capabilities: {
'selenium-version': '2.39.0',
'driver': 'ALL',
'webdriver.log.driver':'INFO',
'webdriver.chrome.logfile': 'C:\\intern\\logs \\chromedriver.log',
'webdriver.firefox.logfile':'C:\\intern \\logs\\firefox.log'
To get a screenshot yourself you can call remote.takeScreenshot().then(function (base64Png) {}), but there is no way that I am aware of to retrieve the automatically generated screenshots—there appears to be nothing in the WebDriver JsonWireProtocol to do so.
To retrieve logs, you can call remote.log(typeOfLog).then(function (logs) {}). See the JsonWireProtocol on log for more information on what you get back.
There is a way to capture automatically generated screenshots. Using a custom reporter (https://github.com/theintern/intern/wiki/Using-and-Writing-Reporters#custom-reporters) I was able to save a screen shot and log browser console logs into a file.
As mentioned in the link above, when the '/test/fail' topic callback is called, it passes in a test object. If the webdriver had failed internally, this object will have a 'test.error.cause.value.screen' variable present in it. This is the variable that stores the webdriver generated screenshot. So the following is what I did:
if (test.error.cause.value.screen) {
//Store this variable into a file using node's fs library
}
If you look at the error object, you will also get to see more error information that the webdriver has logged.
Regarding the browser logs, #C Snover has hit the nail on that one. But that information is only available inside the remote object. This object is available when the '/session/start' topic callback is called. So what I did is I created a map that mapped the session ID from the remote object to the remote object itself. And luckily, the test object has the session ID in it too. So, I retrieved the remote object from my map using test.sessionId as the key to the map and logged the browser logs too. So in short this is what I did:
'/session/start': function (remote) {
sessions[remote.sessionId] = { remote: remote };
},
'/test/fail': function (test) {
var remote = sessions[test.sessionId].remote;
remote._wd.log('browser', function (err, logs) {
//Store the logs array into a file using node's fs library
});
}