Customize location header

I want to add an tenant identifier to the url that is returned to the client. I see it uses the UrlPath for this. But I don't want to change that, everyone sends to the same url and I extract the tenant identifier from the auth token. For retrieval I can't do this since the urls can be publicly accessible, to I need to add the identifier to the url (hashed).
Would be great if we could override some of the internal mechanics.

Hi!
Just to clarify, do you require a auth token for the entire upload process (creating the file and sending the data) or just creating the file? When you say "retrieval", do you mean "download"?

Yes, the JWT token is validated for all http verbs except GET for image download (no token).
Since I had to continue I solved it be overriding the ParseFileId and SetHeader method in the SetReponseHeaders (methodname has a typo btw). I added two Funcs to the Configuration class and use them if set. Hacky, but it works for now. For ParseFileId always get the last segment from the url so it does not care there is a tenantid in the url or not.
Example: http://localhost:5001/images/Aq8OMgrJ/07501d48e90444e6be939b2e0192f322
Would be nicer if we could override and inject custom classes with DI. But  I guess that would require making a separate version for Core and 462.
My Config build method (abbreviated):
 public DefaultTusConfiguration GetConfig(HttpContext context)
        {
            string tenantId = string.Empty;

            _requestUri = context.GetRequestUri();
            if (!_requestUri.LocalPath.StartsWith(urlPathBase, StringComparison.OrdinalIgnoreCase))
                return null;

            if (context.Request.Method.Equals("GET", StringComparison.OrdinalIgnoreCase))
            {
                tenantId = GetTenantIdFromUrl();
            }
            else
            {
                tenantId = GetTenantIdFromToken(context);
                if (context.Request.Method.Equals("DELETE", StringComparison.OrdinalIgnoreCase))
                {
                     // do auth for deletion
                }
            }

            storePath = Path.Combine(@"D:\upload_test", tenantId);
            if (!Directory.Exists(storePath))
            {
                Directory.CreateDirectory(storePath);
            }

            return new DefaultTusConfiguration
            {
                Store = new TusDiskStore(storePath),
                UrlPath = urlPathBase,
                ImageUrlGenerator = (fileId, path) =>
                {
                    var tenantIdHashed = new TenantIdCodec().Encode(int.Parse(tenantId));
                    return $"{path.TrimEnd('/')}/{tenantIdHashed}/{fileId}";
                },
                ParseFileId = (uri) => uri.Segments.Last()
            };
        }

If I understand what you are trying to do correctly I think you can achieve it without changing the tusdotnet source code.
tusdotnet will forward all GET requests to the next middleware in the chain. In this code I'm using the OnFileCompleteAsync event to send a custom header with the download location once the file upload is complete. You could just aswell change this to the OnCreateCompleteAsync event to return the URL instantly when the file is created.
Code can probably need some cleanup. Wrote it during commuting :)
The code assumes that all uploads go to the same endpoint, /files, and that all downloads go to /files/{tenantid}/{fileid}.
public void Configure(IApplicationBuilder app)
        {
            app.UseTus(httpContext => GetConfig(httpContext));

            // All GET requests to tusdotnet are forwarded so that you can handle file downloads.
            app.Use(async (httpContext, next) =>
            {
                var isGetRequest = httpContext.Request.Method.Equals("get", StringComparison.OrdinalIgnoreCase);

                if (!isGetRequest)
                {
                    await next();
                    return;
                }

                var tusConfig = GetConfig(httpContext);

                // Not accessing our download endpoint
                if (tusConfig == null)
                {
                    await next();
                    return;
                }

                var readableStore = (ITusReadableStore)tusConfig.Store;
                var fileId = new Uri(httpContext.Request.GetDisplayUrl()).Segments.Last();

                var file = await readableStore.GetFileAsync(fileId, httpContext.RequestAborted);

                // TODO: Do something with the file, e.g. send it to the client.

            });
        }

        private DefaultTusConfiguration GetConfig(HttpContext httpContext)
        {
            string urlPath = "/files";
            string diskPath;
            string tenantId;

            if(httpContext.Request.Method.Equals("get", StringComparison.OrdinalIgnoreCase))
            {
                var urlPathParts = httpContext.Request.Path.Value.Split("/", StringSplitOptions.RemoveEmptyEntries);
                if (urlPathParts.Length != 3)
                    return null;

                // Not accessing the download url, return null for a small performance improvement in tusdotnet
                if (urlPathParts[0].Trim('/') != urlPath.Trim('/'))
                    return null;

                tenantId = urlPathParts[1];

                // Set to whatever or leave it as is. GET methods are ignored by tusdotnet anyway and just forwarded to the next middleware.
                urlPath = Guid.NewGuid().ToString();
                diskPath = Path.Combine(@"C:\tusfiles\"); // combine with tenant id from URL
            }
            else
            {
                // TODO: Really get from JWT
                tenantId = "tenantIdFromJwt";
                diskPath = Path.Combine(@"C:\tusfiles\"); // combine with tenant id from JWT
            }

            return new DefaultTusConfiguration
            {
                UrlPath = urlPath,
                Store = new TusDiskStore(diskPath),
                Events = new Events
                {
                    OnFileCompleteAsync = ctx =>
                    {
                        // Only happens for PATCH requests, so we have the tenant id from the JWT
                        var downloadUrl = $"/files/{tenantId}/{ctx.FileId}";

                        ctx.HttpContext.Response.Headers.Add("DownloadLocation", downloadUrl);

                        return Task.CompletedTask;
                    }
                }
            };
        }

To get the DownloadLocation in the client I'm using this code (for tus-js-client):
var upload = new tus.Upload(file,
                {
                    endpoint: 'files/',
                    onSuccess: function () {
                        var downloadUrl = upload._xhr.getResponseHeader("DownloadLocation");
                        // TODO: Display the url or something...
                    }
                });

            upload.start();

@wardboumans Did you test the code provided and if so, is the issue resolved?

No answer for more than 30 days. Closing due to inactivity.

Sorry for the late reply. Been reassigned to this thing and had a look at your code and it seems to work fine! Thanks for the code :)


Making use of before and after effect add transition to the nav links

Fixed #IssueNumber
Check (put an 'x' between the square brackets) everything which applies:

[ ] I have added the issue number for which this pull request is created.

@nitin-pandita, please let me know about this update.

i would love to work on this

Hey @777Prabhjot good to have you here, go for it.


Adds monorepo support

Moving from #241 to here, so we have access to organization secrets.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>
Details

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 86.076%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
1292

Relevant Lines:
1501

💛  - Coveralls


refactor: use docusaurus for docs and blog

Signed-off-by: pigletfly<EMAIL_ADDRESS>

/assign @RainbowMango

The preview is broken?
https://deploy-preview-31--karmada.netlify.app/

The preview is broken? https://deploy-preview-31--karmada.netlify.app/

because we are using docusaurus instead of hugo, so the configuration on netlify should be changed as well,such as build method

or we can merge this PR to a separate branch, then tune netlify config on this branch

or we can merge this PR to a separate branch, then tune netlify config on this branch

That's a good idea, but hold on for a while. I'll see how to config the netlify.

According to Deploying to Netlify, I set:

build command: npm run build
base~build~ directory: build  （Note: the document might be outdated, there is no build directory anymore）

Is that right? Can you help push again to re-trigger the build?

or we can merge this PR to a separate branch, then tune netlify config on this branch

According to Deploying to Netlify, I set:

build command: npm run build
base~build~ directory: build  （Note: the document might be outdated, there is no build directory anymore）

Is that right? Can you help push again to re-trigger the build?

Try pushing now @pigletfly. If still doesn't work, we can try merging this PR into separate branch(as you stated earlier) and preview using that.

@RainbowMango The build runs successfully if we use yarn 👀

@RainbowMango The build runs successfully if we use yarn 👀 I guess @pigletfly used yarn while refactoring and thus there is no package-lock.json file

yes, we using yarn to install depends and build. @RainbowMango can you change npm run build to yarn run build ?

@RainbowMango can you change npm run build to yarn run build ?

Done. The build settings are:

Update: After changed Base Directory to <Empty>, the build for preview seems done. But the result seems can't reflect to GitHub, so,please push again?

It seems<EMAIL_ADDRESS>requires nodejs >=14.Can we choose nodejs version on netlify ? @RainbowMango


the number of epochs for your training

Could you please tell me the number of epochs for your training? I see in the code that it's set to 3100 epochs. Thank you.


Add API endpoint to edit manager profile data by manager.

POST /manager/profile/edit

[ ] Add API endpoint to edit manager profile data by manager.

Can I work on this

Assigned to @Nandgopal-R
@Nandgopal-R has only 1 issue assigned and he has opened a PR for that too. Whereas you haven't opened a PR for one of the 2 issues for which you're assigned to.


CI updates (build for Linux, MacOS, Windows)

Description

Using CirrusCI for making builds of packages for Linux, MacOS, Windows

@madnadyka
All 3 CI builds are green, merging this. Next PR would be to produce a new build and upload/tag it as a release.


I can't download the wdk for win10 version 1803, the log gets "invalid payload"

[Enter feedback here]

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 3f5d6d55-cb35-6b9e-f8ca-e75f70826dc3
Version Independent ID: 1d913516-b1e0-e872-c337-e30ed5dffce8
Content: Previous WDK versions and other downloads - Windows drivers
Content Source: windows-driver-docs-pr/other-wdk-downloads.md
Product: windows-hardware
GitHub Login: @EliotSeattle
Microsoft Alias: windowsdriverdev

I find when I using the wdksetup.exe for win10 1803, which is downloaded from the url:"https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk", it seems trying to download "windows driver kit - windows 10.0.10586.0". But  the version of win10 1803 (which I get it using vs2015) is 10.0.17134. Would this be correct?

While the winsdksetup.exe for win10 1803 works well, I install the SDK - windows 10.0.17134.12 successfully.

Closing this as duplicate of #1007


New architecture - Darwin-ARM

Apple's M1 arch is arm-based. Apparently it does a great job emulating amd instructions but still - we should make a 'legit' build.

https://goreleaser.com/customization/universalbinaries/ might be helpful here

👍🏽

done


Add more possible licenses to comparison.yml

Add more licenses from https://spdx.org/licenses/ to the comparison.yml. This way a link to the extended license can be automatically included on the website.

Done in 34ca4e444f3a4fbbf697502c507a13f86c9feebd


Name Redefinition Problem of variable and function

int main() {
    return 0;
}

int main = 0;

Expected Behavior:

test.c:9:5: error: redefinition of 'main' as different kind of symbol
int main = 0;
^
test.c:3:5: note: previous definition is here
int main()
^
test.c:9:1: warning: variable named 'main' with external linkage has undefined behavior [-Wmain]
int main = 0;
^
1 warning and 1 error generated.

Current Behavior:

Fixed.


Revit: Model commit object contains materialQuantities and a renderMaterial prop

https://latest.speckle.dev/streams/209caa98a6/commits/95e1ec136b
Discovered while chatting with @bimgeek around something else. Not sure if this is intended but as far as I'm aware, a Model does not (and should not) have a renderMaterial attached, nor materialQuantities

IMO, these properties do not belong here, as there is no chance of:

A model having a single renderMaterial
A model having materialQuantities, which are only for multi-layered elements such as walls and slabs. (I may be wrong on this one)

Closing as this was fixed in #1704 but did not get closed then.


Exclude pinned tabs

I would rather not have my pinned tabs be copied. Can you add an option for it?

I just noticed this feature was already present in Todo.txt, but let's keep this open for reference.

Fixed in ADVANCE-COPY branch

@Keith94  Can you please take the code from release-2.6.0 branch and confirm the fixes?

So far, that new build won't copy anything for me; this is the error: TypeError: fmtPattern is null[Learn More]  copy-task.jsm:68:7

This happens when there is an exception during extension initialization. Please follow following:

Open developer's console (Ctrl+Shift+J)
You may want to clear all the current contents of console window by clicking the recycle bin button at top left corner of the console window.
Open a new firfox window (Ctrl + N) and look for any errors reported in developer's console.

I opened a new window, and here's the contents of the browser console:
TypeError: target is null[Learn More]  copyurlsexpert.js:491:13
Does it matter if I'm running Firefox with -no-remote launch parameter?

I have no idea. Are you testing by installing xpi file? Since I cannot
reproduce it, would you be able to perform a little debugging :D?
Regards,
Kashif Iqbal Khan
On Sat, Dec 31, 2016 at 12:22 PM, Keith94<EMAIL_ADDRESS>wrote:

I opened a new window, and here's the contents of the browser console:
TypeError: target is null[Learn More] copyurlsexpert.js:491:13
Does it matter if I'm running Firefox with -no-remote launch parameter?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kashiif/copy-urls-expert/issues/26#issuecomment-269841652,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABveTFvKLeVNWiwdnLapvuml-6ULUcr8ks5rNa5lgaJpZM4LRoYU
.

Did you have something in mind for debugging?
I discovered that if I install the AMO release version, then I install the version from 2.6.0 branch, all the problems I was having are fixed, but I don't understand why.
Anyway, this feature now works as expected. I only noticed it was missing from the "Advanced Copy" dialog, in case it might be needed there. Otherwise the issue can be closed.

Are you testing by installing xpi file?

Yes I am

It looks like you had an empty urls.templates file in {profiledir}/copyurlsexpert directory. Since the issue was not related to code, no need for debugging. But in case if you were interested, you can run an extension from the source by setting up extension proxy file.
Process is

Install addon first time
close firefox
setup extension proxy file  to point to github clonned repo.
run the extension from source. You will need to restart browser every time there is a change in source.

I only noticed it was missing from the "Advanced Copy" dialog, in case it might be needed there

Hmmm, nice suggestion

Yeah, seems like that file was missing. I will try out the extension proxy file. Thanks for the tip!


Key::TAB / postValue vs. Chrome 53

It seems that with recent Chrome (v53) Key::TAB as used in here: https://github.com/minkphp/MinkSelenium2Driver/blob/master/src/Selenium2Driver.php#L681 will actually cause the character \t to be added into the input-box, instead of "hitting the tab key".
I can not reproduce it on a normal workstation setup (e.g. real desktop), but it does not work on a headless chrome setup (Ubuntu 15.10 / selenium-server-standalone-2.53.1.jar):
$ google-chrome-stable --version
Google Chrome 53.0.2785.92

$ chromedriver --version
ChromeDriver 2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1)

Can be reproduced (headless-browser) with the following snippet:
<?php

ini_set('display_errors', true);
error_reporting(E_ALL);

require 'vendor/autoload.php';

$driver = new \Behat\Mink\Driver\Selenium2Driver('chrome');
$session = new \Behat\Mink\Session($driver);

$session->start();

$session->visit('http://localhost/admin/login');
sleep(2);
$session->getPage()->fillField('email', 'test@test.test');
$session->getPage()->fillField('password', 'abcdef');
$session->getPage()->pressButton('login');

selenium-server is started like this:
screen -S selenium -d -m sh -c "DBUS_SESSION_BUS_ADDRESS=/dev/null xvfb-run -s '-screen 0 1024x768x24' -a java -jar /opt/selenium-server/selenium-server-standalone.jar > /home/bamboo/selenium.stdout.log 2> /home/bamboo/selenium.stderr.log"

$ java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

Swapping out the browser from chrome to firefox (version 46.0.1) works, as well as removing that Key::TAB from the code above (however not sure if it is the right fix, as obviously it should be working?).

maybe this is bug in Selenium, that changes in Chrome (in way how TAB is handled) are not handled properly
the TAB is sent to trigger onchange JS event

Is this maybe related to: https://github.com/instaclick/php-webdriver/issues/70 ?

Facing the same issue here.
Google Chrome 53.0.2785.92
ChromeDriver 2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1)
Selenium server 2.53.1

Did anyone found or confirmed anything?

Me nope. Probably somebody needs to post an issue on Chrome Driver issue tracker (with a link to it posted back here).

ok, just for others to see, if I'm not mistaken, a workaround for findField could be something like this:
$xpath = $this->getSession()->getSelectorsHandler()->selectorToXpath('named', [
    'field',
    $locator
]);
$elementName = strtolower($this->getSession()->getDriver()->getTagName($xpath));
if ($elementName === 'input' || $elementName === 'textarea') {
    $element = $this->getSession()->getDriver()->getWebDriverSession()->element('xpath', $xpath);
    $element->postValue(['value' => [$value]]);
} else {
    $this->findField($locator)->setValue($value);
}

https://github.com/minkphp/MinkSelenium2Driver/issues/243#issuecomment-245890248

@fonsecas72 , you've just removed TAB. That is one of possible solutions, but then onchange event won't be fired in JavaScript when value is changed.

yup, users should be aware of the downside when using it. I'd suggest to move it to a special method or something :)
@aik099 if you have a cleaner solution please let me know.

for me, the workaround was to remove the Key::TAB from the end of the line in Selenium2Driver.php:662.
About the "change" event, I don't know if is correct to fire this event automatically when an input is filled. I think could be more natural to have to explicitly hit the enter or leave the field to fire this event.

That change event firing also created problems for testing stuff, like jQueryUI.Autocomplete, because immediately after value change the dropdown with completions was hidden.
@stof , I know this might be a BC break, but maybe for inputs with free text entry (not checkbox/radio button/select) we can stop firing change JS event. If agreed, then we need a way to stop firing change event for other drivers as well.

I think first we need to figure out if this is a BC break intended by chromedriver/chrome, or if it is actually a bug.

How about this? https://github.com/adorin/MinkSelenium2Driver/commit/e2710a2d3fd2df46182bf0482d7862630fae7a8c

I'm making the same as a workaround but I not sure if is there the correct place for calling to excuteScript.
Probably is more natural to call the blur method after calling to setValue within the step definition.
What do you think guys?

The idea is to fix the issue without otherwise altering functionality.
I wouldn't combine a bugfix with a change like that.

It's true, you are right.

How about this? https://github.com/adorin/MinkSelenium2Driver/commit/e2710a2d3fd2df46182bf0482d7862630fae7a8c

@adorin , the $this->executeScript("document.activeElement && document.activeElement.blur()"); can be replaced with $this->blur($xpath);. As long as test pass that would solve this problem.
@adridev , I've suggested an update to @adorin solution according to your suggestion.

Same for me in Chrome Version 53.0.2785.101.
It helped to delete Key::TAB in line 681

$value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . Key::TAB;

Also https://github.com/minkphp/MinkSelenium2Driver/issues/194 seems to be identical.

@lifeofguenter it seems that the TAB doesn't work only for password type inputs.
For example, this worked for me:
// Add the TAB key to ensure we unfocus the field as browsers are triggering the change event only // after leaving the field. $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value; if ($elementType != 'password'){    $value .= Key::TAB; }
I think is not a BC break to exclude only password type.

@cocciagialla , did #244 work for you as well? A bonus side effect from #244 is ability to test jQueryUI.Autocomplete and similar controls.

@aik099 yes it works perfectly. I hope it will be merged soon.

Just merged #244. Happy test running.


How to make custom field name for password_again

I couldn't find a way to change the name of the label for password_again on reset-password route.
This is how I changed the password field.
AccountsTemplates.addField({
  _id: 'password',
  type: 'password',
  displayName: "Heslo",
  required: true,
  minLength: 6,
  re: /(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/,
  errStr: 'At least 1 digit, 1 lower-case and 1 upper-case',
});

OK, so I found the way to change the field. I dont delete it I just add it
AccountsTemplates.addField({
  _id: 'password_again',
  type: 'password',
  required: true,
  displayName: "Heslo znovu",
  placeholder: "*****"
});


DRAFT: Update Optimint to enable Fraud Proofs

This is a draft PR to keep track of changes to Optimint when adding support for Fraud Proofs

Handled by #567


trim transformer html

What:
Trimming the html returned from the transformer's getHTML function to fix #5.
Why:
Without these changes a transformer that returns html with any leading spaces would not be inserted into the AST. For example:
const html = `
    <div class="youtube">
        <iframe
            title=${id}
            src=${src}
            frameBorder="0"
            allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
            allowFullScreen
        >
        </iframe>
    </div>
`

How:
I added a single line of code which executes .trim() on the returned html from the transformer.
I'm not great with TypeScript but I think I handled the typing okay? 🤷🏼♂
Checklist:

[ ] Documentation (N/A)
[ ] Tests (N/A)
[X] Ready to be merged

Thanks @kentcdodds for working with me to solve #5 and for considering this PR!

@all-contributors please add @bradgarropy for code

@all-contributors please add @bradgarropy for code

@all-contributors please add @bradgarropy for bugs

@all-contributors please add @bradgarropy for bugs


Use match instead of BASH_REMATCH when using zsh

Fixes #893.

@marc0der Replaced the "conditional expressions" with proper if-else statements.


.Net: Handlebars universal split helper

We found that the handlebars planner sometime hallucinates universal helpers. In our case it is the split function that takes a string and splits it using some delimiter. From the Discord chat it seems that requesting these to be added is simpler than trying to force the LLM not to include them.

Yeah I hear you, there will be changes coming in PR #4017 .Net: Handlebars Prompt Template Helpers  that will allow users to easily add custom helpers when using the Handlebars Prompt Template Factory.
You can reference the HandlebarsPlanner as example of how to do this, where RegisterCustomCreatePlanHelpers is a callback passed when initializing PromptTemplateOptions in HandlebarsPlanner.cs.


nextcloud - fix empty files on chunked upload

Description of changes

Fixes: https://github.com/NixOS/nixpkgs/issues/252980
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

Can you redo this PR with the formatting changes in a separate commit or drop them?


Failed to generate a CA certificate and server key/certificate in Ratify installation

What happened in your environment?
I Installed Ratify with the helm chart by following https://github.com/deislabs/ratify#step-2-deploy-ratify-on-gatekeeper-in-the-default-namespace, but it returns the following error:
Error: INSTALLATION FAILED: execution error at (ratify/templates/provider.yaml:8:15): You must provide .Values.provider.tls.cabundle

According to the note if the crt/key/cabundle are NOT set under provider.tls in values.yaml, helm would generate a CA certificate and server key/certificate for you, it seems the CA cert and server key/cert are not generated by Helm.
What did you expect to happen?
Let Helm generate a CA certificate and server key/certificate in Ratify installation.
What version of Kubernetes are you running?
1.26
What version of Ratify are you running?
RC.2
Anything else you would like to add?
No response
Are you willing to submit PRs to contribute to this bug fix?

[ ] Yes, I am willing to implement it.

Close this issue since I forgot to update the Ratify Helm repo before installing it. I will raise a PR to add this command helm repo update in case users have added this repo before.


Move iter8 chart to iter8-tools/hub repository

Today the iter8 command uses a single iter8 Helm chart to create experiment definitions. The iter8 chart is defined in the iter8-tools/iter8 repository.
The implementation downloads the chart from the file system assuming it is a GitHub repository. However, it is structured as a Helm chart and treating it as such would simplify the implementation of Iter8. To do this:

move the chart to the iter8-tools/hub repository; the hub repository is already exported as a Helm repository
modify iter8 commands to use this Helm repository.

In the process, we want to be sure not to disrupt the development of automated experiments (i.e., autox) and we want to continue to support execution using a local chart for chart development use cases.

The current implementation of iter8 launch and iter8 k launch downloads the chart (assuming it is from a GitHub repository) using the internal implementation of iter8 hub), processes the downloaded template using the internal implementation of iter8 gen and runs the resulting experiment (file or secret) using the internal implementation of iter8 run.
While something similar is still needed for iter8 launch, a more Helm like implementation of iter8 k launch could more easily be accomplished using the equivalent of helm install and/or helm upgrade.
By default, the Helm repository and chart name are defaulted (to https://iter8-tools.github.io/hub and iter8, respectively). The launch command is then similar to:
iter8 --set "tasks={http}" --set http.url=http://httpbin.default/get --set runner=job

Optionally, the Helm repository and chart can set using options:

--repo <helm_repository_url>  identifies a Helm repository by URL
--chartName <chart_name> identifies a chart name

Furthermore, Helm allows identifying a chart using the form repo/chart where repo is a name added using the helm repo add command.
In all cases where a remote repository is specified, Helm commands offer a set of access options (--ca-file, --cert-file, --key-file, --insecure-skip-verify, --keyring, --password, --pass-credentials, --username and --verify
Finally, to indicate that a chart is local, --localChart can be specified.
When charts are pulled using the Helm APIs, there is no need to update the dependencies; the latest dependencies are already pulled.
The same options can be made available to local execution (iter8 launch).
In summary, the following changes are to be made to the commands

iter8 gen - remove update dependencies; hide
iter8 hub - remove this command (user can use helm pull if desired instead)
iter8 launch - add ChartPathOptions, --localChart flags; remove --chartsParentDir
iter8 run - hide
iter8 k launch - add ChartPathOptions, --localCharat flags; remove --chartsParentDir, --noDownload, --remoteFolderURL

Done; closing.


Add Chinese Translations

Add Chinese Translations to DarQ

Apologies for not merging this before 1.2, if you update it I will merge

Apologies for not merging this before 1.2, if you update it I will merge

Updated.


Before a booking is done, resources need to be accessed. Does this go through MaaS-router?

No, this is up to the MSP - they should either access the resources at the TOs themselves, or outsource this service to a Transport Integrator that accesses the TO resources on their behalf.


Normal model behavior ? or scaling ?

Hi,
I've continued training the Depth-Anything-V2-Large model serial on my custom dataset, and the predicted depth maps appear to be close to the ground truth ones. However, they appear to be scaled for some reason, which is evident from the black and white pixels(see annotations on images). I'm unsure if this is normal behavior from the model itself of if there's some scaling happening in the code.
predicted depth map:

ground truth:

Solved. The problem comes from me loading the predicted images with opencv when trying to separate the depth map from the actual image.


[BUG] v1.4.0 Harvester w/ Rancher v2.10.1-alpha1 Harvester Cloud-Config User Data Fail to Render At RKE2 Cluster Creation

Describe the bug
In Rancher when building RKE2 Clusters Cloud-Config User Data fails to come across correctly.
What's noticed is that it seems to only be rendering / bringing in a "small" portion of the cloud-config for User Data for instance.
In the attached screen grabs you can audit the behavior a bit more.
But the gist might be that it's just not doing a "merge" on the YAML content appropriately.
To Reproduce
Steps to reproduce the behavior:

In Harvester v1.4.0, create a cloud-config template for User Data that holds the following code block of yaml

#cloud-config
password: password
chpasswd:
  expire: false
ssh_pwauth: true
package_update: true
packages:
  - qemu-guest-agent
  - apt-transport-https
  - neovim
  - wget
  - ca-certificates
  - python3
  - python3-pip
  - jq
  - curl
  - gnupg-agent
  - gnupg
  - lsb-release
  - htop
  - parted
  - fdisk
  - gnupg2
  - neovim
  - software-properties-common
  - coreutils
  - sshpass
  - tmux
  - net-tools
  - unzip
runcmd:
  - - systemctl
    - enable
    - --now
    - qemu-guest-agent.service

In Rancher v2.10.1-alph1 / v2.10-head (possibly) , add the repo for the harvester-ui-extension, to your manage repos, then add the branch of gh-pages then select v1.0.2 , install and reload
Import your Harvester v1.4.0 cluster of N nodes into Rancher, wait for import to be successful
Build a cloud credential for your Harvester imported v1.4.0 cluster
Click create on a RKE2 Cluster (the k8s version of RKE2 does not matter) , go down to the "Advanced" Section, and then select your User Data Template you built in Harvester.
Notice that the User Data Template rendered does not show the correct cloud-config, you instead will see that it will show "other" items properly like password, chpasswd, package_update, ssh_pwauth, runcmd , yet the text merging of the data on packages seems to be entirely off -> Note that if you do "create" a RKE2 cluster with your cloud config, as referenced from the screengrabs below, they also will not have the correct cloud-config that you have desired from your template.

Expected behavior
User Data in an RKE2 Cluster to be accurate to the Template built in Harvester and not have issues merging properties like "packages" in the YAML
Environment

Harvester ISO version: v1.4.0
Rancher Version: v2.10.1-alpha1
Underlying Infrastructure: Bare Metal, HP-DL160, Single Node + VM For Rancher w/ K3S

Additional context

Note, workaround of:

If you unselect install guest agent, and then you choose the template, it does it correctly.

Downgrading severity


Dramatically improve watch mode performance.

Summary
Resolves #7341
This PR dramatically improves watch mode performance, bringing it in line with single run mode performance. It accomplishes that by:

Workers previously initialized a new ModuleMap and Resolver for every test in watch mode. Now, those objects are only initialized once when the worker is setup.
In the main thread, caching the conversion of ModuleMap to a JSON-friendly object.
Allowing watch mode to use the same number of CPUs as single run mode.

Benchmarks
I benchmarked against Jest's own test suite, excluding e2e tests which don't provide good signal because they individually take a long time (so startup time for the test is marginalized). The numbers show that running in Watch mode previously added an extra 35%~ of runtime to the tests but that has now been reduced to almost nothing.
Watch mode should now just be paying a one-time initial cost for each worker when the haste map changes instead of paying that same cost for every test run.
branch: master
yarn jest ./packages
Run time: 15.091s
yarn jest ./packages --watch
Run time: 23.234s
branch: watch-performance
yarn jest ./packages
Run time: 14.973s
yarn jest ./packages --watch
Run time: 15.196s
Test plan

All tests pass.
Benchmarked to verify the performance wins.
Verified that when the haste map is updated, the update is propagated out to all workers.

Nice one, thanks! ✨

Codecov Report

Merging #8201 into master will decrease coverage by 0.02%.
The diff coverage is 21.05%.

@@            Coverage Diff             @@
##           master    #8201      +/-   ##
==========================================
- Coverage    62.3%   62.27%   -0.03%
==========================================
  Files         265      265
  Lines       10473    10482       +9
  Branches     2542     2544       +2
==========================================
+ Hits         6525     6528       +3
- Misses       3366     3372       +6
  Partials      582      582

Impacted Files
Coverage Δ

packages/jest-runner/src/testWorker.ts
0% <0%> (ø)
:arrow_up:

packages/jest-config/src/getMaxWorkers.ts
100% <100%> (ø)
:arrow_up:

packages/jest-runner/src/index.ts
64.44% <100%> (+0.8%)
:arrow_up:

packages/jest-haste-map/src/ModuleMap.ts
65.51% <40%> (-1.15%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e4e170...67ea28f. Read the comment docs.

As @jeysal pointed out, the reason only half of the available CPUs are used in watch mode is because otherwise Jest will grind your system to a halt. Ideally, watch mode should be unobtrusive. With the change from this PR, Jest will run faster at the cost of developer experience because all of their other tooling will be slower (at Facebook consider Buck, Jest, Flow, Nuclide etc. all fighting for resources).
Initially, we started out with using all available CPUs in Jest and people complained which is why we changed it to half of the available CPUs. I feel strongly that the change in this PR should be reverted back, even if it is at the cost of watch performance.
(Apologies for not adding a code comment in the past, I thought that this could be blamed back to the original PR that most likely has an explanation).

Alternatively, I'm definitely happy if you wanna go for an adaptive approach that checks for recent CPU utilization and adjusts CPU usage for Jest accordingly.

Shouldn't that work the same regardless of watch mode? Why should watch mode use less cores than a normal run?

Mainly because watch mode is something you have open as a service, often in the background, and it runs automatically while writing/saving code. When you invoke jest on the other hand, the user intentionally invokes the test runner knowingly and is more likely to be ok with the resource usage.

Right, makes sense

@cpojer I actually checked the blame but it was lost to an earlier refactor. :)
It was only a small part of this PR anyway, if anything I thought it might have been a mistake. I’ll submit a PR to revert that piece.

Can that PR include doc changes which explains what these values are and why? That was part of the confusion in #7341

Sure, will do.
I just validated (as is pretty obvious) that even without the CPU change this is a massive performance boost. At 300k files in the map, I’m seeing things run almost twice as fast.
I’ll work on reverting that piece with documentation today.


[no-unused-modules] Dynamic import doesn't mark exports as used

Repro:
// foo.ts
export const foo = "foo"

// index.ts
async function test() {
  const { foo } = await import("./foo")
  const foo2 = await import("./foo").then(mod => mod.foo)
  const mod = await import("./foo") // should mark all non-type exports as used
}

My specific use case is:
import { lazy } from "react"
const Foo = lazy(() => import("./Foo"))

exported declaration 'foo' not used within other modules

Config:
{
  "extends": [
    "plugin:import/recommended",
    "plugin:import/typescript",
    // and more ...
  ],
  "rules": {
    "import/no-unused-modules": ["error", { "unusedExports": true }],
  },
}

Versions:
@typescript-eslint/parser: 4.8.0
eslint: 7.13.0
eslint-plugin-import: 2.22.1

This was intentional during the design of the rule (#1142, cc @rfermann).
When a dynamic import is done with a static, hardcoded path, it does seem possible for this plugin to detect it, but it would have to ignore any other forms of import(). A PR that detects these would be appreciated.

This was intentional during the design of the rule (#1142, cc @rfermann).
When a dynamic import is done with a static, hardcoded path, it does seem possible for this plugin to detect it, but it would have to ignore any other forms of import(). A PR that detects these would be appreciated.

me too.
components are lazy imported.

Related PR: https://github.com/benmosher/eslint-plugin-import/pull/1660


[FLINK-12438][doc-zh]Translate Task Lifecycle document into Chinese

Translate Task Lifecycle document into Chinese

cc @RocMarshal , do you want to help reviewing this page?

Good job. @hapihu . And thanks @wuchong for assigning. I'll review this PR. Wait a moment, please.

Hello, @RocMarshal, I made some changes in response to your suggestion. plz help me review again~
Thank you very much!

Hello, @RocMarshal,
Excuse me for taking up your time.
I have finished the modification according to your suggestion. Would you like to review it for me again.
Thank you very much!

@wuchong
Excuse me for taking up your time.
Can you help me to review it again? thanks


Add search feature to let users search the content and history.

It would be nice to add search capability to let the users search the history and content of the discussions in the website for specific keywords or queries.
e.g. someone might know that there is specific treasury or motion proposal but they might not have the direct link or the proposal  number, they should be to search the topic or keyword to find that discussion.
Currently the workaround is to search using google and scope the search to polkassembly site, but would be nice if the polkassembly  provide such feature.

We are pleased to announce that the issue regarding the improvement of searching for posts and discussions on Polkassembly has been successfully addressed and closed with https://github.com/polkassembly/polkassembly/pull/333.
The following improvements that have been implemented:

Enhanced search algorithm: We have upgraded the search functionality to ensure more accurate and relevant results. The new algorithm takes into account exact title matches, allowing users to find posts and discussions more efficiently.

Customized search options: We have implemented additional search filters that enable users to narrow down their searches. These options include searching within discussions only, filtering by specific categories, and more.

Real-time indexing: To eliminate the delays caused by Google indexing, we have implemented a real-time indexing system. This ensures that new entries are promptly available for search, improving the overall user experience.

We appreciate your patience and valuable feedback during the resolution of this issue. Your suggestions and insights have been instrumental in driving these improvements.
Thank you for your continued support and contribution to the Polkassembly ecosystem.


Pluralsight Working Settings Found

Hi there,
This is not a support request, however I have seen many users (including myself) struggling with downloading from Pluralsight and with accounts being banned.
After experimenting (a lot), getting banned twice (and somehow talking my way out of the bans), I have found some settings which work.
My last ban was 21 days ago and I haven't had any problems since.
You may wish to include this is support documentation if appropriate.
Considerations:

Log into the site from your browser and navigate to the course index page. This allows your browser to download page content and update the site's cookie. Use this as the referrer URL in the config below.
Start playing the first video in your browser then pause it. After that, I tend to leave Pluralsight open and logged in while running youtube-dl.
Run youtube-dl with the below settings.
Do not download more content than you could reasonably watch in a day (8hrs or so).
Do not leave to download overnight. Use only in regular "waking" hours for your timezone.
Rate is intentionally limited to 100k which is slightly faster than regular playback in most cases. This means you should be able to run youtube-dl in the background.

youtube-dl.conf
-u ****

-p ****

-i

-c

--no-warnings

--console-title

--batch-file='batch-file.txt' <- [Text file in the youtube-dl root directory containing course URLs]

--max-sleep-interval 70

--min-sleep-interval 50

-o '%(playlist_title)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s-%(title)s.%(ext)s'

-f 'bestvideo[height<=720]+bestaudio/best[height<=720]/worst'

-r 100k

--referer='https://app.pluralsight.com/paths/certificate/mcsa' <- [Insert relevant referrer URL]

Hope this helps :)

@mrsd859 thanks very much. I can confirm that this works. Pluralsight users of youtube-dl are in your debt.


Suggestion: Handle Varargs in message

Hi,
I want to suggest a feature I would like before I completely agree on migrating to Logger. I think you could implement varargs feature in message string. For example, in Timber, I used to do something like that:
Timber.d("Data: %d %d %d %d %s", left, right, top, bottom, input);

I'll check it out and try to find a good solution for this. I may need to change the method signature and add a different style. Apparently this feature is really nice.

This is added in v1.5

Thanks, officially migrating ;) :+1:


[Docs-Sprite.FromFile] Is it true, Atlased sprites are not implemented?

Getting this when trying to use an Atlas file.
[SK diagnostic] sprite_create: Atlased sprites not implemented yet! Switching to single.
[SK warning] A GPU asset is blocking its thread until the main thread is available, has async code accidentally shifted execution to a different thread since SK.Initialize?
I've spent days building all the supporting structures for atlased handling and get down to this line straight out of the documentation,
Note: fi is a FileInfo object val.Key is a string with the value "00001" where this points to the atlas image 00001.png.
var sprite = Sprite.FromFile(fi.FullName, SpriteType.Atlased, val.Key);
It is in fact hanging the thread. The code never returns after the call to the method.
There are some other issues around this call. If the file name is invalid a hard exception is thrown somewhere down low in the C++ that is not trappable by the C#.

Atlas support is currently in-progress in a feature branch! It'll get merged at some point, but this won't impact your code any, the fallback is sufficient. Atlasing will give a nice reduction in draw calls, but that's the only difference you'll see when that lights up. If you continue coding as though atlases do work, you'll get the performance boost when the feature is finished automatically!
The GPU asset is blocking warning may come up in some cases with async code near or between SK.Initialize and SK.Step/SK.Run. Async code can invisibly switch the current thread, which can be disruptive to StereoKit if it breaks initialization and stepping into separate threads. I'd love to know more about your code here! This warning is almost certainly the root cause of the hang.
I'll look into the crash on Sprite.FromFile as well, which version of StereoKit is this?

I'm not able to reproduce a crash by passing an invalid path name to Sprite.FromFile, could you provide the callstack, or other additional details for that crash?

On the crash issue, I will roll back through my code and hopefully find the offending snippet. That was last week, which is a long time ago in the code :)
I am using 0.3.7 preview 5

The GPU asset is blocking warning may come up in some cases with async code near or between SK.Initialize and SK.Step/SK.Run. Async code can invisibly switch the current thread, which can be disruptive to StereoKit if it breaks initialization and stepping into separate threads. I'd love to know more about your code here! This warning is almost certainly the root cause of the hang.

You asked to know more about the code... so TL;DR
First, it is based on the holographic remoting using an edge compute service as the actual application execution. The edge computing service also does a lot of security, user asset/action control, and cloud data management. With all this, the application generates everything, so there is a no-code solution for HoloLens 2. It is successfully deployed now and there is no UWP involved. What I am adding is video/animation capability. I am also using voice commands and audio player now. SK is the heart of the delivery to the user. The edge application is also generating a ThreeJS for computer users and a WebGL rendering for Teams when using Microsoft Remote Assist. Latency is managed by a quasi-CDN because we know the users and the work schedules, minimizing the dynamic data loading requirements.
Code approach: I am trying to load assets in the background to local disk from Azure blobs. The user is experiencing a "bait & switch" screen with some user interactions to keep him occupied while I grab the application's current asset needs to my edge compute running the remote rendering package. The main asset load is initiated at the Program.cs level before any calls to SK. I am maintaining an app level static global "state-machine" (AppState) that is updated via api calls to the static service.
As soon as the load thread is kicked off it runs independently and sets a collection of "stateful" flags in AppState class that is visible to the entire app. As soon as the background operations are started, I call my class the represents SK.
`				#region Launches the 3D Remoting service
// AppRemote is effectively the "application". It has its own "Step" method independent of all other scenes.
// Avoid long running calls at this point because the user is not yet seeing anything from the remote app.
Console.WriteLine("Launching...");
app = new AppRemote(ipAddrs, appManager);				// Initialize the remote app services and passes the requesting HoloLens IP address
app.Initialize();										// Now call the Initialize method, before calling the SK.Run(app.Step()) method.
app.AddAppScenes(appManager.AppConfig.SplashSceneName);	// Makes the SceneSplash the currently "ActiveScene".
			Console.WriteLine("Running...");
			#endregion

The call to the "new AppRemote" method initiates the constructor on my SK framework with this simple code:		public class AppRemote : IStepper
...
public AppRemote(string ipRemoteDevice, AppManager appMgr)
{
appManager = appMgr;	// receives an instance of the AppManager
		// Network IP address of HoloLens Device using this instance.
		StereoKit.SK.AddStepper(new HolographicRemoting(ipRemoteDevice));

		// Initialize StereoKit, must be done very early in the process
		IsSKready = StereoKit.SK.Initialize(startupSettings);

	}

I have found that this method must return (seems to be synchronous) before doing anything else that involves async code. That said, my next call (coming from the Program) calls the SK initialize method.		public bool Initialize()
{
// Awaits the VideoPlayer on its constructor. This allows the async Initialize method to load files
// without blocking on the main thread.
VideoRunner(new AppServices(), GetAssetPath(AppState.defaultTexturesFolderName), "lavengimg").GetAwaiter().GetResult();
		micSprite = Sprite.FromFile("sk.png", SpriteType.Single);
		micMaterial = Default.MaterialUnlit.Copy();
		micSpritePose = new Pose(new Vec3(-.5f, 0, -.1f), Quat.Identity);
		boundsMat = Default.MaterialUIBox;  // now set the bounds material
		micBounds = new Bounds(new Vec3(.1f, .1f, .1f));

		menuSelectPose.position = new Vec3(0, -0.3f, -0.6f);
		menuSelectPose.orientation = Quat.LookDir(-Vec3.Forward);
		InitMenuAsync();

		sceneManager = new SceneManager(appManager);  // creates an instance of the SceneManager. See class docs for DI use.
		SceneManager.FindAllScenes(AppConstants.AssemblyNameForScenes); // the name of the assembly where the application scenes are located

		icon = Sprite.FromFile(Path.Combine(AssetsFolderPath, AppConstants.AssetsFolderName + "\\sk.png"), SpriteType.Single);
		HolographicTheme.Apply();

		// TODO: add any initialize activities here to cleanup before ending app.
		return true;
	}

Since this method is not async, I am having to manage the threads carefully to ensure I don't go tripping into limbo land. Once the Initialize method is completed, an initial scene (splash) is set as the active scene, then the SK run is called.			#region Starts the render SK Engine
// Now pass execution over to StereoKit
SK.Run(app.Step, () => Log.Info("Bye!"));
		Console.WriteLine("...App closed.");
		#endregion

`
From here it is fairly, normal operation in SK.
My problem currently is the necessity for control over the video playback as a scene object, not as an independent video player. I need much more finesse over the video playback and its visual location. So, the seemingly simple approach was to paint a sprite animation on a 3D object (plane for example). My concept there is to have the "video player" created as an object derived from IStepper while my scenes all stem from my version of a scene manager that ultimately derives from IStepper. This separates the scene actions from the VideoPlayer, yet allows me to handle scene action affecting the video. (e.g. Gaze controlled auto-pause/play (gaze control -rewind/fast-forward, etc.)
My primary customer base is HoloLens industrial-base customers where users don't normally have a lot of free hand capability. I am not concerned in any way with cross platform capability.
In case you are not aware. Engineering information is presented to field technicians as "imaged" technical drawings. The most efficient means of delivery is a sight-controlled interface. Also, a must is the delivery of video of the actions to be performed (how-to examples) or for inspections, previous video or stills of the same area (rusting bridges for example).

Git did a crappy job of code display!

Yeah, okay, the async calls are almost certainly still tripping things up here! The key thing to note is that async does not behave the way one intuitively expects it to. When you start an async method, the current thread is used for the async call, and the rest of the code continues on a new thread!
You can find a few extra details about this over here which is where I first learned about all this.
I think I'd recommend using Task.Run instead? Not 100% sure, but I believe this does manage to dodge the thread split issue.
(I also edited your post a bit so the code shows up nicer :) )

Well after reading the" thread" over in #316 looks like some refactoring is in order.

I have it working now. I moved all the async code that involved loading Sprites from either the FromFile or FromTexture to a new class that is instantiated through its constructor as an async class. I read in the SK documentation that files and textures are handled async in the C++. Because this is on its own thread, my c# try/catch can't see any errors. It also means that if I try to use any of the async SK operations, I must ensure that I am returning to the thread where it was initially called.
By adding the GetAwaiter to the class and using a Task/Run in the GetAwaiter method I am able to use the built-in SK async operations without losing my thread. I also changed the signature to all async methods in the class to return a Task, no async void methods.
		// constructor
                public VideoPlayer(AppServices appServices, string textureSourcePath, string videoName, bool useAtlasSource = false)
		{
			_fso = appServices;
			_texPath = textureSourcePath;
			_srcVidName = videoName;
			_UseAtlas = useAtlasSource;
		}

		/// <summary>
		/// Gets the awaiter. Allows class to be "awaited" via its constructor.
		/// </summary>
		/// <returns>TaskAwaiter.</returns>
		public TaskAwaiter GetAwaiter()
		{
			return Task.Run(async () =>
			{
				await LoadInitialImageSequencer();
			}).GetAwaiter();
		}

In my app's code derived from IStepper and in its Initialize method I am calling a local private method.
		public bool Initialize()
		{
			// Awaits the VideoPlayer on its constructor. This allows the Initialize method to load files
			// without blocking on the main thread.
			VideoRunner(GetAssetPath(AppState.defaultTexturesFolderName), "lavengimg\\z0001").GetAwaiter().GetResult();

               ... rest of the initialize code follows

Then the private method:
		public async Task VideoRunner(string textureSourcePath, string videoName, bool useAtlas = false)
		{
			videoPlayer = new VideoPlayer(new AppServices(), textureSourcePath, videoName, useAtlas); // auto initialize to this video
			await videoPlayer; // causes the GetAwaiter method to be called in the class as an async

			if (useAtlas)
			{
				await videoPlayer.LoadVideoBufferFiles(0, 10);
			}
			else
			{
				// TODO: Handle the loading with parameters possibly
			}
		}

With this setup I can now use async in my class and it will ultimately return back awaited to its called point even with the SK using its own async services not exposed to the C#.

I now have a fully functional video player. It only has one external dependency on my framework. That is to load files from the device. I'm sure that could be implemented by anybody. My next improvement is to include the video file as a stream to frame-by-frame. Since I am using Holographic remoting, I am not dependent on the HoloLens 2 device to do the work.
I can share the code with you Nick - how should I do that? I only have one issue at the moment, I have not figured out how the Time.Elaspedf relates to actual time in milliseconds. Reading in the C++ it states clearly that there is no direct correlation to the system time (I assume for cross-platform), that it only allows for calculations of time passing. Video is rather sensitive to time intervals.
My code accumulates time slices used during the frames until I reach a threshold of time "delay" to trigger a new frame load.
			lastElasped += Time.ElapsedUnscaledf;
			fpsCalculator.CalculateSmoothedFrameRate();
			if (lastElasped * videoFPS >= videoFPS / fpsCalculator.SmoothedFrameRate || !firstFrameLoaded)
			{
				firstFrameLoaded = true;
				lastElasped = Time.ElapsedUnscaledf;

                       ... rest of the code to acquire the next frame

For some reason that I have not understood, the video is running faster that it should. FYI the videoFPS is set to 24.

There's also a Time.Totalf you can use here to avoid accumulation errors! If you're doing a flipbook of images, I'd probably approach it something like this:
float startTime = Time.Totalf;
// ...
float currTime  = Time.Totalf-startTime;
float framerate = 1.0f / 24.0f;
int   frame     = (int)( currTime / framerate ) % maxFrames;


Add "First method line is empty" check

OK
fun bar() {
   val a = 2
}

Fail
fun bar() {

   val a = 2
}

Probably we should also add an equiwalent check for last empty method line
OK
fun bar() {
   val a = 2
}

Fail
fun bar() {
   val a = 2

}

The last empty method line check should be covered by the rule NoBlankLineBeforeRbraceRule. Probably a NoBlankLineAfterLbraceRule should cover the first scenario.

Created a PR for first method line empty rule. In addition to the scenarios present above, few others that would be covered are
fun bar() {
   if(someCondition) {

    val a = 2
   }
}

Fixed in https://github.com/pinterest/ktlint/pull/474

This method triggers no-empty-first-line-in-method-block error:
fun whatever() {
    window.addMouseListener(object : MouseAdapter() {

        override fun mouseClicked(e: MouseEvent) { /*...*/ }

        override fun mouseEntered(e: MouseEvent) { /*...*/ }
    })
}

Should it be this way? I prefer to keep first line in complex object expressions empty, just like in classes.

https://github.com/pinterest/ktlint/pull/461#issue-286397143

In addition to checking for first line blank in a method block, it will check for any first blank line in code blocks of the method.Please let me know if the subsequent code blocks in the method need to be ignored from this check.

Since, the object expression is inside the method, it triggers a violation for the same.

Both Kotlin Coding Conventions and Android Kotlin style guide don't mention anything about such a requirement. Why is it forced then? I believe object expressions should be excluded from this check.

Actually the Android Kotlin style guide explicitly mentions this whitespace:

Optionally before the first statement in a function, before the first member of a class, or after the last member of a class (neither encouraged nor discouraged).

Sorry about not making it clear in the first place, my statement was specifically about object expressions inside methods.

That is an anonymous definition of a class which has the same rules as any other class declaration. If that's not clear, we can amend the guide to explicitly denote that syntactical construct as being synonymous with a class definition.


Links appear to be invisible

Can't tell if the text is white or not there at all
This happens on my Nexus 6P, screenshot below, the hyperlink should be on the third line (where the gap followed by a slash is)

thanks @peteryates, I'll take a look asap!

I'm getting the same issue (Nexus 6, Android 6.0.1).

Me too, thanks for the fix

Me too, thanks for the fix

Thanks for the quick fix!
On Dec 31, 2015 8:55 PM, "Peter Yates"<EMAIL_ADDRESS>wrote:

Me too, thanks for the fix
—
Reply to this email directly or view it on GitHub
https://github.com/malmstein/yahnac/issues/29#issuecomment-168273952.

Thanks for the quick fix!
On Dec 31, 2015 8:55 PM, "Peter Yates"<EMAIL_ADDRESS>wrote:

Me too, thanks for the fix
—
Reply to this email directly or view it on GitHub
https://github.com/malmstein/yahnac/issues/29#issuecomment-168273952.


Configure xunit output filename through env

Prerequisites

[x] Checked that your issue hasn't already been filed by cross-referencing issues with the faq label

Description
I want to run the xunit reporter while in CI, and the spec reporter in dev. I'm using mocha-env-reporter to accomplish this. In CI I set the mocha_reporter environment variable in production and it switches the reporter.
However I also need to set the filename for each test suite. With mocha-junit-reporter I can do this with the MOCHA_FILE environment variable, however with the built-in xunit reporter I have to do it on the command line. This is inconvenient because it requires duplicating a bunch of parameters on the mocha command line into the CI config.
It would be helpful to be able to configure the output file for the xunit reporter through the environment, in the same way I can with mocha-junit-reporter.

I just learned https://github.com/peerigon/xunit-file exists for the same purpose.
I've used Mocha for a long time and really like it. After some recent experiences with other test tools, I appreciate it even more. 😄
That said, config and reporters can be frustrating and fiddly to manage, especially across many small projects.
I was glad to hear about upcoming improvements to the config in #3612 and hoping there are more to come. I know often there's a goal to push use cases out to plugins, and appreciate that. I'm glad that Mocha does not take as much install footprint as, say, Jest.
However there are some things, like a reliable way to write reports to a file, which are not specialized, and really belong in core. If there's interest, I'd be happy to put some work into documenting and improving ease of use in this area.

You can use the js config file .mocharc.js for that:

define your own environment variables
set reporter and reporter-option via process.env in your .mocharc.js.


show the communication in a dialog without make more complex the UX

In the past I use some dialog that I think can be reused in this application to communicate any kind of information like an exception or others stuff
I extract the implementation here https://github.com/vincenzopalazzo/trash/pull/4 but I guess it still need some more love to support last version of dart

There is the same problem when I will go to request an invoice in the request view.
cc @Harshit933

I guess this is fixed


set_visible_device_list("") in c++ not work

I use tensorflow 1.12 cuda 9.0 build from source.
My code have follow lines, but session still use gpu. I not use CUDA_VISIBLE_DEVICES='' because my program have two session.
auto options = SessionOptions();
options.config.mutable_gpu_options()->set_visible_device_list("");

Please provide details about what platform you are using (operating system, architecture). Also include your TensorFlow version. Also, did you compile from source or install a binary?
Make sure you also include the exact command if possible to produce the output included in your test case. If you are unclear what to include see the issue template displayed in the Github new issue template.
We ask for this in the issue submission template, because it is really difficult to help without that information. Thanks!

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

I use tensorflow 1.12 cuda 9.0 build from source.
My code have follow lines, but session still use gpu. I not use CUDA_VISIBLE_DEVICES='' because my program have two session.
auto options = SessionOptions();
options.config.mutable_gpu_options()->set_visible_device_list("");

Have you solved this problem?I meet the same problem, and when I use this function, I still see all the gpu cards were occupied by tensorflow.
Thank you


[MODULES-10781] Fix defined type defined_with_params()

An edge case was missed previously where calling the
defined_with_params() function from inside a defined type on another
instance of the same defined type would always return a match because it
would match against itself.
This updates the code to ignore itself and also adds a debug line output
for any resource that was matched.
MODULES-10781 #close

Wrong repo :-(


Add tests coverage for OpTypeVector column count validation

Fixes #2064
Fixes #2086

Failing checks are a known upstream issue.


Fix Ruby 2.7 keyword deprecations

Another attempt to address https://github.com/ruby-grape/grape/issues/2090 properly

Not sure what's up with CI, force push?

Much thanks.


[Docs] update roadmap for homepage, search, techdocs

Signed-off-by: Emma Indal<EMAIL_ADDRESS>Hey, I just made a Pull Request!
Came across the roadmap and just wanted to update it with some things around homepage, search and TechDocs. Let me know if there are any other things that can be moved around.

:heavy_check_mark: Checklist

[ ] A changeset describing the change and affected packages. (more info)
[ ] Added or updated documentation
[ ] Tests for new functionality and regression tests for bug fixes
[ ] Screenshots attached (for UI changes)
[x] All your commits have a Signed-off-by line in the message. (more info)

Triple approved, thanks!


not working on updated tweetdeck

not working on new updated tweetdeck. they removed "data-tweet-id" from the tweet.

For me it worked fine since today. From today it stopped working. Probably because of the new and terrible view restrictions per day of Twitter to prevent scraping that probably implemented some new code that breaks the addon.


Report page is broken when URL is visited directly

Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/1779
Originally created by @DouweM on 2020-02-21 17:42:06

Steps to reproduce:

Visit https://meltano.meltanodata.com/analyze/model-google-analytics/google_analytics/google_analytics_website_overview/reports/meltano-com-website-total-users
Notice the missing title ("Untitled Report") and spinners that never stop spinning

Compared to:

Visit https://meltano.meltanodata.com
Click "Dashboards"
Click "Meltano Web Traffic"
Click "Edit" on "Meltano.com Website - Total Users"
Notice that the title does show up, and that the spinners do eventually make place for the actual data!

View 8 previous comments from the original issue on GitLab


[2.8]Update rke state file

Back port of https://github.com/rancher/shepherd/pull/356
2.8 PR has rke version bumped in go.mod as the changes related to rke secret were introduced in later versions of rke. Bumped the version to align with rancher 2.8 https://github.com/rancher/rancher/blob/release/v2.8/go.mod#L129

@caliskanugur done.


convert to constant pattern assist in the wrong place

consider this code :
void foo(dynamic value)  => switch (value) {
      String => 'the value is String',
      int => 'The value is an int',
      bool => 'The value is a bool',
      List => 'The value is a List ',
      _ => throw Exception("other types")
    };

this code will trigger convert to constant pattern assist , i guess this is a wrong suggestion in this case beacause the code would became :
void foo(dynamic value)  => switch (value) {
      const (String) => 'the value is String',
      const (int) => 'The value is an int',
      const (bool) => 'The value is a bool',
      const (List) => 'The value is a List ',
      _ => throw Exception("other types")
    };

@FMorschel could u confirm this ?

That looks correct.
It preserves the behavior of the existing code, while making it more readable what it's actually doing. That's the point of the conversion.
The reason the result looks wrong is likely that the code is wrong, but now you can see it.
(The code never worked as intended. It only triggered if the value was a Type object for one of the type String, int, bool or List<dynamic>. The String => code is easily misread as meaning String _ => or String() =>, but it means const (String) => because that's the backwards compatible meaning of case String: in existing pre-pattern switches.)

Hmm ,what's the meaning of String() in this context then ?

The object pattern String() matches a value of type String. It could check properties of the value too, like String(length: > 4), but it doesn't have to.

The object pattern String() matches a value of type String. It could check properties of the value too, like String(length: > 4), but it doesn't have to.

I see i searched docs for any simular exemples but found none ,i may add one

Also String _ is triggered by using convert to wild pattern assist  is this behavior also correct?

The String _ is a declaration pattern with a "wildcard" binding, so "wild pattern" sound reasonable.
It changes the meaning of the pattern, but likely to what you would have wanted.
The biggest issue here is how one can figuring out which assist to use.

The String _ is a declaration pattern with a "wildcard" binding, so "convert to wildcard pattern" sounds reasonable.
It changes the meaning of the pattern, but likely to what you would have wanted.
The biggest issue here is how one can figuring out which assist to use. The analyzer gives a warning of
Use 'TypeName _' instead of a type literal.

but it doesn't link that to the "convert to wildcard pattern".
Maybe if the message had been
Use the wildcard pattern `String _` instead of a type literal.

it would be easier to know to choose "convert to wildcard pattern".

I guess so , should i close this now then?

Use the wildcard pattern `String _` instead of a type literal.

This would be better, yes. And also as mentioned:

I see i searched docs for any simular exemples but found none ,i may add one

I believe this would help a lot of users.

Use the wildcard pattern `String _` instead of a type literal.

This would be better, yes. And also as mentioned:

I see i searched docs for any simular exemples but found none ,i may add one

I believe this would help a lot of users.

Will be done soon

@lrhn I was chatting with @AbdeMohlbi before this issue was made. I think there's a misunderstanding about why this issue was made.
Specifically with regards to:

It preserves the behavior of the existing code, while making it more readable what it's actually doing. That's the point of the conversion.

What @AbdeMohlbi wanted here was not to preserve the original behavior. Because the original behavior was incorrect. They misused patterns and forgot to specify () after types.
They didn't truly want to do Type comparison. They wanted to use pattern matching.
In short, what was expected here was an assist that converts:
switch (any) {
  case Type:
}

into:
switch (any) {
  case Type():
}

I think when we use Type comparisons on anything that's not strictly type, we should suggest converting the Type into patterns instead.

@lrhn I was chatting with @AbdeMohlbi before this issue was made. I think there's a misunderstanding about why this issue was made.
Specifically with regards to:

It preserves the behavior of the existing code, while making it more readable what it's actually doing. That's the point of the conversion.

What @AbdeMohlbi wanted here was not to preserve the original behavior. Because the original behavior was incorrect. They misused patterns and forgot to specify () after types.
They didn't truly want to do Type comparison. They wanted to use pattern matching.
In short, what was expected here was an assist that converts:
switch (any) {
  case Type:
}

into:
switch (any) {
  case Type():
}

I think when we use Type comparisons on anything that's not strictly type, we should suggest converting the Type into patterns instead.

That's what i meant but i guess idon't have enough dart-related-knowledge to say that

When I check the example program in DartPad, I get two suggestions: "convert to wildcard pattern" and "convert to constant pattern", in that order. (And then some "ignore " here or in the entire file options.)
The first one does what you want. It converts a String type literal pattern to something matching a String. It uses String _ rather than String(), but that shouldn't matter in most cases.
The second one converts the String pattern to const (String), which preserves the existing meaning but gets rid of the warning.
That's what you should do if you intended to switch on Type objects, which can happen. (You really shouldn't IMO, but people still do.)
I think having both fixes is a good compromise. By writing just String, it's hard to read and very likely a mistake. There are two ways to fix that: Fix it if it was a mistake, or enforce the existing meaning in a more explicit way if it was intended.
It's not a problem to have the second fix. My only worry is that it's not easy to understand which fix does what, and why.

Yes, also in the original example on Discord, the switch was on runtimeType and I'm not sure if maybe we could add a lint to make people avoid that since it's most of the time (if not always) something that the person wouldn't want and that type checking can be achieved the same way by using either the wildcard pattern or by using ().

It's not a problem to have the second fix. My only worry is that it's not easy to understand which fix does what, and why.

That's why I agree about adding more explicit cases to the docs for both switch expressions and expressions.
Explaining why this should be done over type checking in most cases.

About the fixes, I'm not sure how we can solve this right now. Maybe adding a link to the docs in cases like this similar to what lints do at the end on their names. There is an issue to add a link to the docs on keywords that would help as well: https://github.com/dart-lang/sdk/issues/50085.

Here is one linter issue related to this discussion but I don't see any mentions of calling out that the user is switching on runtimeType as I proposed above, so I created https://github.com/dart-lang/linter/issues/5097.