Pre-release test for TileDB-SOMA 1.2.3

Not to be merged. Just a check for "is the putative TileDB-SOMA 1.2.3 Conda-CI green?".

I don't know why this is failing:

https://github.com/TileDB-Inc/tiledbsoma-feedstock/pull/18
https://github.com/TileDB-Inc/tiledbsoma-feedstock/pull/18/checks?check_run_id=13182539344
https://dev.azure.com/TileDB-Inc/CI/_build/results?buildId=31883&view=logs&j=656edd35-690f-5c53-9ba3-09c10d0bea97&t=e5c8ab1d-8ff9-5cae-b332-e15ae582ed2d

package libtiledbsoma-1.2.2-h25619bb_0 requires tiledb >=2.15.2,<2.16, but none of the providers can be installed

given that at
https://anaconda.org/conda-forge/tiledb/labels
https://anaconda.org/conda-forge/tiledb/files
we do have 2.15.2 available ... :thinking_face:

I don't think it's related to the test changes in this PR. I just synced "main" on my fork of the feedstock, and it failed with the same error
https://github.com/jdblischak/tiledbsoma-feedstock/tree/bb3fbeb622d88809cf20bc8b58c3a480803334c7
https://dev.azure.com/jdblischak/feedstock-builds/_build/results?buildId=248&view=results

I'm having trouble reproducing the solver error locally on Ubuntu. In the CI builds, libtiledbsoma builds fine, but then fails to solve the env once it tries to build the Python client:
mamba create --dry-run -n test-soma \
  --override-channels -c conda-forge -c tiledb \
  libtiledbsoma=1.2.2=h25619bb_0
##   + libtiledbsoma           1.2.2  h25619bb_0        tiledb/linux-64           246kB
##   + tiledb                 2.15.2  heaeb544_0        conda-forge/linux-64        6MB

mamba create --dry-run -n test-soma \
  --override-channels -c conda-forge -c tiledb \
  libtiledbsoma=1.2.2=h25619bb_0 \
  python=3.10 \
  tiledb-py \
  tiledbsoma-py
##   + libtiledbsoma              1.2.2  h25619bb_0               tiledb/linux-64           246kB
##   + tiledb                    2.15.2  heaeb544_0               conda-forge/linux-64        6MB
##   + tiledb-py                 0.21.3  py310hf537494_0          conda-forge/linux-64        1MB
##   + tiledbsoma-py              1.2.2  py310h40e830b_0          tiledb/linux-64           278kB

Pre-release green CI verified; closing as intended.

The nightly binaries from #19 have already been uploaded, so you could even locally install the latest version built from "main"
https://anaconda.org/tiledb/libtiledbsoma/files?channel=nightlies
https://anaconda.org/tiledb/tiledbsoma-py/files?channel=nightlies
You can install them locally by running the following:
mamba create -n soma-nightly --override-channels \
  -c conda-forge -c "tiledb/label/nightlies" -c tiledb \
  tiledbsoma-py="*20230503"
conda activate soma-nightly
conda list soma
## libtiledbsoma             1.2.2.dev20230503      hc1eed26_0    tiledb/label/nightlies
## somacore                  1.0.0              pyh4471522_1    tiledb
## tiledbsoma-py             1.2.2.dev20230503 py310h7717f27_0    tiledb/label/nightlies
python -c "import tiledbsoma; print(tiledbsoma.pytiledbsoma.version())"
## libtiledb=2.15.2

Actually there was contentful stuff on here -- this PR was conflating two things:

Pre-release test;
It folded in #17

@Shelnutt2 @jdblischak would it be better to re-open #17 and get it merged, then do the 1.2.3 release per se? Or, would it be better to fold the #17 content into the (upcoming) actually-release-1.2.3 PR?

would it be better to re-open https://github.com/TileDB-Inc/tiledbsoma-feedstock/pull/17 and get it merged, then do the 1.2.3 release per se?

If the updated version restriction applies to 1.2.2, then I think it makes sense to merge that first (just bump the build number), and then later update to 1.2.3 (and return the build number to 0).

Ah of course @jdblischak ; I should have looked at it that way.
The restriction on TileDB core >=2.15.2 and TileDB-Py >= 0.21.3 is specifically for TileDB-SOMA 1.2.3. So, doing separate PRs would not make sense after all.


No CSRF cookie presented with CookieStorage results in 500 Error (not 403 Forbidden)

Thanks for this project.
If I use curl to hit a CSRF protected page with a POST request, but without a cookie, the server throws a 500 rather than 403 Forbidden.
% curl -X POST http://localhost:8081/trigger/set-verbose -v
* Connected to localhost (::1) port 8081 (#0)
> POST /trigger/set-verbose HTTP/1.1
> Host: localhost:8081
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain; charset=utf-8
< Content-Length: 55
< Date: Thu, 07 Apr 2022 08:53:04 GMT
< Server: Python/3.9 aiohttp/3.8.1
< Connection: close
<
500 Internal Server Error

* Closing connection 0
Server got itself in trouble

The 500 occurs due to an untrapped exception from the csrf_middleware due to the policy trying to do a constant time comparison with compare_digest between a str and None:
2022-04-07 09:43:34.413 ERROR    Error handling request
Traceback (most recent call last):
  File "/Users/chris/repos/project/venv/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/Users/chris/repos/project/venv/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/Users/chris/repos/project/venv/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/Users/chris/repos/project/web/webapp.py", line 811, in user_auth_middleware
    return await handler(request)
  File "/Users/chris/repos/project/venv/lib/python3.9/site-packages/aiohttp_jinja2/__init__.py", line 264, in context_processors_middleware
    return await handler(request)
  File "/Users/chris/repos/project/venv/lib/python3.9/site-packages/aiohttp_csrf/__init__.py", line 175, in csrf_middleware
    return await handler(request)
  File "/Users/chris/repos/project/venv/lib/python3.9/site-packages/aiohttp_csrf/__init__.py", line 140, in wrapped
    and not await _check(request)
  File "/Users/chris/repos/project/venv/lib/python3.9/site-packages/aiohttp_csrf/__init__.py", line 117, in _check
    return await policy.check(request, original_token)
  File "/Users/chris/repos/project/venv/lib/python3.9/site-packages/aiohttp_csrf/policy.py", line 23, in check
    return compare_digest(token, original_value)
TypeError: unsupported operand types(s) or combination of types: 'str' and 'NoneType'
2022-04-07 09:43:34.419 INFO     ::1 [07/Apr/2022:08:43:34 +0000] "POST /trigger/set-verbose HTTP/1.1" 500 244 "-" "curl/7.64.1"

The aiohttp-csrf setup code looks like:
    app = web.Application(middlewares=middlewares)

    aiohttp_jinja2.setup(
        app,
        loader=jinja2.FileSystemLoader("web/templates"),
        context_processors=[aiohttp_jinja2.request_processor],
    )

    csrf_policy = aiohttp_csrf.policy.FormPolicy("_csrf_token")
    csrf_storage = aiohttp_csrf.storage.CookieStorage(
        "csrf_token", secret_phrase="SECRET"
    )
    aiohttp_csrf.setup(app, policy=csrf_policy, storage=csrf_storage)
    app.middlewares.append(aiohttp_csrf.csrf_middleware)

And requirements.txt includes:
aiohttp==3.7.4.post0
aiohttp-csrf==0.1.1
aiohttp-jinja2==1.4.2
aiohttp-session==2.9.0
aioredis==2.0.0a1

For completeness, the case when the cookie is provided, albeit with a bad value so the comparison fails 'normally':
% curl -X POST http://localhost:8081/trigger/set-verbose --cookie "csrf_token=silly" -v
* Connected to localhost (::1) port 8081 (#0)
> POST /trigger/set-verbose HTTP/1.1
> Host: localhost:8081
> User-Agent: curl/7.64.1
> Accept: */*
> Cookie: csrf_token=silly
>
< HTTP/1.1 403 Forbidden
< Content-Type: text/plain; charset=utf-8
< Content-Length: 14
< Date: Thu, 07 Apr 2022 08:56:12 GMT
< Server: Python/3.9 aiohttp/3.8.1
<
* Connection #0 to host localhost left intact
403: Forbidden
* Closing connection 0

same, I wanna try to do PR with fix this bug

#3


Prepare lib for Odoo PDF import

This PR contains my work of these last days on this lib to make it work with my module on Odoo PDF import.
The fact is that I modified several different things:

try to fix bug #1
add UTF-8 headers
update date parsing
add templates for several French companies

This is still a bit a "work in progress", as I'll continue to work on this branch in the coming days. But this PR should help you see what changes I'm doing and maybe get your feedback if you disagree on some changes I make.

Awesome. Can you also add some sample files, so I can try out the new templates? And maybe add them to a test folder? Just drop them here. No need to add them in the PR.

@manuelRiel
I'm glad that you like my work.
FYI, the code of my Odoo module that use your invoice2data lib is here: https://github.com/akretion/account-invoicing/tree/8.0-add-pdf-invoice-import/account_invoice_pdf_import (AGPL licence)
About the template files: I should be able to add a few, but I got some of them via friends and I told them that I would keep their invoice confidential. Some of them are phone bill invoices with detailed call records, so you can understand that it's not a good idea for privacy reasons to add it to the "test" folder... but in the meantime I understand the need to have a test suite to check the templates.

@manuelRiel FYI, I just announced the availability of the Odoo module "account_invoice_pdf_import" on my company blog: http://www.akretion.com/blog/akretions-christmas-present-for-the-odoo-community So you will know the story behind our work !
I hope it will bring more contributors to your great project.

Thanks for the contribution. I added a license, merged your code and added you to contributors. And will upload to Pypi.
I'll probably work on this again when I do my own accounting. What other features would be interesting? The main goal is to recognize new invoices without templates. But to train a ML algo, I don't have enough sample data right now.


Fix path to main script.

Sorry, but that path is correct since we transpile from ES2015 to ES5 with Babel

Ah, Babel-greenhorn mistake. My apologies. :)
For other noobs who happen along this path, from: https://babeljs.io/docs/usage/cli/
"Compile Directories: Compile the entire src directory and output it to the lib directory. You may use --out-dir or -d."


API returned unexpected status code: 400: you must provide a model parameter

I trying to add documents into Pinecone with the sample code provided in pinecone_test.go file:
        godotenv.Load()

	llm, err := openai.New()
	if err != nil {
		log.Fatalf("error creating OpenAI LLM: %v", err)
	}

	e, err := embeddings.NewEmbedder(llm)
	if err != nil {
		log.Fatalf("error creating embeddings: %v", err)
	}

	store, err := pinecone.New(
		context.Background(),
		pinecone.WithAPIKey(os.Getenv("PINECONE_API_KEY")),
		pinecone.WithEnvironment(os.Getenv("PINECONE_ENV_NAME")),
		pinecone.WithIndexName(os.Getenv("PINECONE_INDEX_NAME")),
		pinecone.WithProjectName(os.Getenv("PINECONE_PROJECT_NAME")),
		pinecone.WithEmbedder(e),
	)
	if err != nil {
		log.Fatalf("error creating Pinecone store: %v", err)
	}

	id := uuid.New().String()

	_, err = store.AddDocuments(
		context.Background(),
		[]schema.Document{
			{PageContent: "The color of the house is blue."},
			{PageContent: "The color of the car is red."},
			{PageContent: "The color of the desk is orange."},
			{PageContent: "The color of the lamp beside the desk is black."},
			{PageContent: "The color of the chair beside the desk is beige."},
		},
		vectorstores.WithNameSpace(id),
	)
	if err != nil {
		log.Fatalf("error adding documents: %v", err)
	}

	log.Println("Successfully added documents")

But received an error saying: error adding documents: API returned unexpected status code: 400: you must provide a model parameter.
Anyone can help? how to provide a model parameter? in which API?

Issue: API returned unexpected status code: 400 - "you must provide a model parameter."
To resolve this issue, instantiate the Language Model (LLM) with an embedding model option, as demonstrated in the code snippet below:
embeddingModelName := "text-embedding-3-small" // use the model name that you prefer
// Instantiate LLM with embedding model
llm, err := openai.New(openai.WithEmbeddingModel(embeddingModelName))
if err != nil {
       log.Fatal(err)
}

e, err := embeddings.NewEmbedder(llm)
if err != nil {
      log.Fatal(err)
}

thank you so much @nikhilnarayanan623!


fix(deps): update required_provider to latest for the deployable architecture solution

This PR contains the following updates:

Package
Type
Update
Change

ibm (source)
required_provider
patch
1.64.1 -> 1.64.2

random (source)
required_provider
patch
>= 3.6.0, <4.0.0 -> >= 3.6.1, < 4.0.0

Release Notes

IBM-Cloud/terraform-provider-ibm (ibm)
v1.64.2
Compare Source
BugFixes

fix(ibm_database resource): Fix cpuEnforcement multitenant bug
(5271)

hashicorp/terraform-provider-random (random)
v3.6.1
Compare Source
BUG FIXES:

all: Prevent keepers from triggering an in-place update following import (#385)
resource/random_shuffle: Prevent inconsistent result after apply when result_count is set to 0 (#409)
provider/random_password: Fix bug which causes panic when special, upper, lower and number/numeric are all false (#551)
provider/random_string: Fix bug which causes panic when special, upper, lower and number/numeric are all false (#551)

Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.

[ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

/run pipeline

/run pipeline

:tada: This PR is included in version 1.2.7 :tada:
The release is available on:

GitHub release
v1.2.7

Your semantic-release bot :package::rocket:


Add exception to Batoto when manga removed + regex update

closes #5847
Checklist:

[x] Updated extVersionCode value in build.gradle for individual extensions
[ ] Updated overrideVersionCode or baseVersionCode as needed for all multisrc extensions
[x] Referenced all related issues in the PR body (e.g. "Closes #xyz")
[ ] Added the isNsfw = true flag in build.gradle when appropriate
[x] Have not changed source names
[ ] Have explicitly kept the id if a source's name or language were changed
[x] Have tested the modifications by compiling and running the extension through Android Studio
[ ] Have removed web_hi_res_512.png when adding a new extension

only keep the regex change and revert rest, I'll do the other change later

only keep the regex change and revert rest, I'll do the other change later
done


Reading all channels info feature

This is associated with issue #21
Major Changes
Add channels_interface.py and extend messages.py
Add test_channels_interface.py
Update README.md
Tests
All tests passed. channels_interface.py and extend messages.py achieve 86% and 95% coverage respectively.

Everything looks great, and the overall performance has improved significantly!
Could you please implement read_channel_status from channels_interface into cycler_interface?
The purpose of cycler_interface is to allow users to read all the information from the cycler, while channel_interface is more focused on reading channel-specific information after detailed configuration.
If possible, I suggest adding a read_all_channels_status method to cycler_interface and merging channel_interface and channels_interface, as they seem to have many similarities.

Everything looks great, and the overall performance has improved significantly!
Could you please implement read_channel_status from channels_interface into cycler_interface?
The purpose of cycler_interface is to allow users to read all the information from the cycler, while channel_interface is more focused on reading channel-specific information after detailed configuration.
If possible, I suggest adding a read_all_channels_status method to cycler_interface and merging channel_interface and channels_interface, as they seem to have many similarities.

Sure. I'll work it after the holiday break.


Main Menu UI Updates Don't Take TextFieldName / ImageFieldName into account

Bug Report
When uploading a MenuCell, we need to check menuCommandSecondaryText, menuCommandTertiaryText, menuSubMenuSecondaryText, menuSubMenuTertiaryText, menuCommandSecondaryImage, and menuSubMenuSecondaryImage
Reproduction Steps

Connect to a head unit that doesn't support secondary text, tertiary text, or secondary image.
Attempt to send a menu cell with secondary text, tertiary text, or secondary image.

Expected Behavior
The unsupported text and image are not sent / uploaded.
Observed Behavior
The unsupported text and image are sent / uploaded.
OS & Version Information

Android Version: n/a
SDL Android Version: n/a
Testing Against: n/a

Test Case, Sample Code, and / or Example App
n/a

Fixes #1629


write tests that work despite differences in store path / can we bring some of home-manager's testing infra in nixpkgs ?

Project description
In https://github.com/NixOS/nixpkgs/pull/119467 I wanted to write tests and check that the generated vimrc matches a certain template
set nocompatible
set packpath=/nix/store/xxxxx
....

Now because the generated vimrc contains store paths, I can't just diff it against a saved valid vimrc (since store paths would change).
home-manager allows to check the generated file is similar via assertFileContent cf https://github.com/nix-community/home-manager/blob/master/tests/modules/programs/neovim/plugin-config.vim and https://github.com/nix-community/home-manager/blob/master/tests/modules/programs/neovim/plugin-config.nix
Do we have something similar in nixpkgs ? could we bring these from home-manager ? @rycee

The test assertions used in HM: https://gitlab.com/rycee/nmt/-/blob/master/bash-lib/assertions.sh

yes thanks, I've already started playing with
   nmt = pkgs.fetchFromGitLab {
    owner = "rycee";
    repo = "nmt";
    rev = "d2cc8c1042b1c2511f68f40e2790a8c0e29eeb42";
    sha256 = "1ykcvyx82nhdq167kbnpgwkgjib8ii7c92y3427v986n2s5lsskc";
  };

importing nmt fulfills my need.


add in readme.md, examples of use...

Hello @ahuca ,
add in readme.md, examples of use, images, etc....
thanks you, Víctor.

Hello, for the time being I don't have enough time to work on documentation. As an alternative please refer to the tests to see how to use the functions.


io.read() (Lua)

I am using lua but it does not recognize the data input per user. that is, io.read (). Could you tell me what extension to install to solve this problem? thanks

I don't understand the problem, can you explain some more?

I am testing the Lua language in visual code and I do not recognize the io.read () sentence, which is the one used to receive data from user.
example:
io.write ("Name?")
a = io.read ()
io.write ("Hi" ..a)
in this case the code is not executed because when the code arrives where the user should enter the name does not recognize the sentence. Thank you

I don't know Lua but this sounds like it might be a problem with your program?

NO, es un problema con la plataforma no reconoce la sentencia, en cualquier tutorial para principiantes de lua se puede ver estas mismas lineas de codigo, pero lo ejecutan con "scite"

@Pablobun are you using an extension for the LUA support. If so, please report the issue to them. VS Code doesn't have any LUA support in the box.

I know. I have already tried extensions but none activate data entry. That is why I ask by this means if they know which is the correct one. Thank you

I also have this problem. Someone decided it?


Added PHP-CS-Fixer config + run it

I took the config from https://github.com/jolicode/starfleet/blob/master/.php_cs

@damienalexandre Not really :/ The CI is dead, we should migrate to GA, so let's add later with GA?


Stacksets

Please check if the PR fulfills these requirements

[x] The commit message describes your change
[x] Tests for the changes have been added if possible (for bug fixes / features)
[x] Docs have been added / updated (for bug fixes / features)
[x] Changes are mentioned in the changelog (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

adds stacksets

What is the current behavior? (You can also link to an open issue here)

no stackset support

What is the new behavior (if this is a feature change)?
allows stackset manipulation

Does this PR introduce a breaking change? (What changes might users need to make in their setup due to this PR?)
no

Other information:

The changelog entry is now gone
Please qualify with this
Please avoid wildcard imports

I can fix the latter two after merging if you like

I merged #54 into this and it looks good. everything should be using 'this' qualified instance field/method access and no wildcards.


Remove excess OAuth logs

Change-type: patch
Signed-off-by: Josh Bowling<EMAIL_ADDRESS>
Remove temporary logs added to help debug Outreach sync issues

@balena-ci I self certify!


A simple program to reverse an integer

ok

@xaster-Kies

Hi @janWICKEDpro, can you try to squash your commits into one and push. That will help reduce the number of commits.


Defer configuration loading in dedicated method instead of controller

#1090  Library

[ ]<EMAIL_ADDRESS>or<EMAIL_ADDRESS>[ ]<EMAIL_ADDRESS>[ ]<EMAIL_ADDRESS>[X]<EMAIL_ADDRESS>[ ]<EMAIL_ADDRESS>
Description
Hi everyone,
In my situation, I need to load oidc configuration from a remote server, so I need to make an http call to retrieve it. I have read all the docs and tryed all the ways to load configurations but nothing suits my need and I think I won't be the only one looking for this.
I am working on a security library which will be embedded in many other project, the goal is to obfuscate any auth security process within this lib which will expose only basic methods to hosts projects. The libs needs then to handle all Msal init (service instanciation, interceptors, etc) and retrieve the config url via an injection token injected by host app.
The only way to load asynchronously a config file from doc is to use platformDynamic, but I don't want to duplicate that Msal specific configuration scheme in all the applications that will use the library. Also the APP_INITIALIZER provider is not delaying the app bootstrap so the configuration is not loaded on time because MsalService load configuration in constructor.
What I needed to do is to build a custom wrapper service to handle remote configuration loading and manual MsalService instanciation (loading config from constructor). Then set a flag init to true, and use my inner MsalService instance.
It would be nice to have a configure(config) method to be able to manage the lib initilization flow entirely. Instead of init in constructor.
Here is the code I made to have an idea, I would be able to make a PR if you think it is interesting.
@Injectable({
  providedIn: 'root'
})
export class ConfigService {
  public msalService: MsalService;
  private http: HttpClient;
  public configInit = new Subject();
  constructor(httpClient: HttpClient, private router: Router, private broadcasService: BroadcastService) {
    this.http = httpClient;
  }

  configure(uri) {
    this.http.get(uri).pipe(map(res => res))
    .subscribe((value: any) => {
      msalConfig.auth.clientId = value.client_id;
      msalConfig.auth.postLogoutRedirectUri = value.post_logout_redirect_uri;
      msalConfig.auth.redirectUri = value.redirect_url;
      msalConfig.auth.authority = value.stsServer;
      msalAngularConfig.consentScopes = value.scope.split(" ");
      this.msalService = new MsalService(msalConfig, msalAngularConfig, this.router, this.broadcasService);
      this.configInit.next(true);
    },
      (error) => {
      });
  }
}

@vlafranca Thanks for the feedback! This is an interesting use case. Feel free to open a PR that shows what you think this might look like, thanks!

@jasonnutter great ! I am working on it and will be soon able to make a PR

Hi @jasonnutter I juste submitted a PR #1715
Labeler / label (pull_request)  checks fails, can you explain me why ?

@vlafranca The labeler wasn't setup to work with forks, that will be fixed.

Ok thanks for your reply, is there any log output in azure to know why is
the build failing ? It succeed on my machine ..
Le jeu. 28 mai 2020 à 22:01, Jason Nutter<EMAIL_ADDRESS>a
écrit :

@vlafranca https://github.com/vlafranca The labeler wasn't setup to
work with forks, that will be fixed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1665#issuecomment-635713021,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB2NUS357IATOZGZY43EGATRT4JQDANCNFSM4NBT5HWA
.

Any news or estimation about this ?

@vlafranca Not yet, sorry, been busy. We'll update the ticket when we get a chance, apologies for the delay.

Ok no problem

Hello, any news into this? It's a really good functionality and we really need it for our project, thanks!

We will look to support updating the MSAL configuration dynamically in MSAL Angular v2 (alpha available now.

Ok so this PR is abandoned or need to adapt for v2 ?
On Wed, Nov 11, 2020 at 9:35 PM Jason Nutter<EMAIL_ADDRESS>wrote:

We will look to support updating the MSAL configuration dynamically in
MSAL Angular v2 (alpha available now
https://github.com/AzureAD/microsoft-authentication-library-for-js/releases/tag/msal-angular-v2.0.0-alpha.0
).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1665#issuecomment-725790093,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB2NUS6T3MDLCDNEXVAQVRDSPNCYPANCNFSM4NBT5HWA
.

Yes they bring this feature with MSAL 2.
On Wed, Mar 10, 2021 at 1:55 PM Vinay Sorout<EMAIL_ADDRESS>wrote:

This can be achieved easily using the Factory providers with
APP_INITIALIZER, check following repo
https://github.com/vinusorout/msal-angular-dynamic-configuration-sample
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1665#issuecomment-795910016,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB2NUS2HJHUW2FQZMSDYE3LTC66DDANCNFSM4NBT5HWA
.

No, It was also working with MSAL 1.x too, check following https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1403

@jo-arroyo any news on this? I'm using msal-angular 2.0.0-beta.5 and msal-browser 2.14.1 and sometimes I get an error because the MSAL initialization starts before APP_INITIALIZER  finishes reading the JSON configuration file:

My project uses PathLocationStrategy(like the angular10-sample-app) but with all routes guarded by MsalGuard, so the users are logged in as soon as they hit the app as explained in the documentation.
You can reproduce the problem in the sample provided by @vinusorout by adding the MsalGuard as I explained in this issue.
Any tip regarding how to make sure MSALInstanceFactory is executed after reading a file asynchronously would be much appreciated.

hey @ozkoidi did you find a solution for this? I have the same issue.

Hello @Depechie,
They may have fixed the issue in the meantime but in case it helps you, the workaround that worked for me is the following:
Disable the initial navigation in the routing module
@NgModule({
  imports: [
    RouterModule.forRoot(ROUTES, {
      initialNavigation: 'disabled'
    })
  ],

In app.module.ts pass the Router to the initializer method
...
providers: [
  ...,
  {
    provide: APP_INITIALIZER,
    useFactory: initializeApp,
    deps: [Router],
    multi: true
  },
  ...

to call  router.initialNavigation(); after reading the configuration file
  export const initializeApp = (router: Router) => async () => {
    await config.load(); <- This is where you load the config file
    router.initialNavigation(); <- This enables the navigation we disabled in the routing module
  };

@ozkoidi thx for the details... but no matter what I try, as soon as I hit the http.get in my config.Load to read out the /assets/config.json, I see in the logging that other elements will still get called before the file is read.
Cfr screenshot: the config parsed is placed above the router.initialNavigation().

.
Is there any running example I can look at? Otherwise I can always try to put a test example on my github ofcourse.

Got it working, by refactoring the original example by @vinusorout

@jo-arroyo Are we still planning official support for this feature?

We haven't decided on it, no. It looks like there are workarounds, though.

This is exactly what i need


Default projectRoot is not computed properly

Currently projectRoot is ".".
This means, for instance, when running "gradle migrate" from "hivemigration" folder, the projectRoot property for the "hivemigration-gradle-sample" project is "hivemigration".
The right value should be path for the "hivemigration/hivemigration-gradle-sample" folder.
This way projectRoot+location("/db/changelog") references the folder with the script files.

Fixed.


Make Linux aarch64 binaries on release too

Fixes: https://github.com/quickjs-ng/quickjs/discussions/417

Looks good to me, but I have little experience with this release script.

Looks good to me, but I have little experience with this release script.

Thanks for taking a look! I'll merge and sicne this runs when a new release is made, I'll take care of any problems when it's launched. I don't foresee any.


Scalable

Thanks for the PR! Unfortunately, it looks like most of the changes you have are focused on your own specific needs, rather than what the project is doing. But, feel free to comment and help explain a little more about the intent of your PR. Thanks!


Using absolute path in binding.gyp

Node Version: v8.2.1
Platform: Linux 4.10.0-27-generic (Ubuntu)
Compiler: gcc v5.4.0
Module: NodeJS C++ Addon

I am using an external library for building a custom nodejs c++ addon. I need to include on of the files from that library that exists in "/opt/lib/file.cpp".
This doesn't work:
...
"include_dirs": [
  "/opt/lib"
],
"sources": [
  "processor/Processor.cc",
  "/opt/lib/file.cpp"
],
...

The error I get is this:
make: *** No rule to make target 'Release/obj.target/processor//opt/lib/file.o', needed by 'Release/obj.target/processor.node'. Stop.
make: Leaving directory '/home/username/project/build'

But this works:
...
"include_dirs": [
  "/opt/lib"
],
"sources": [
  "processor/Processor.cc",
  "../../../opt/lib/file.cpp"
],
...

So in brief it works if I use relative path. Is there any way to use absolute path in sources of binding.gyp?
Thank you

I believe the answer is: no, there is not; source paths are always made absolute relative to the project root.

@bnoordhuis that makes is almost impossible to build the addon on CI environment :(

As a workaround, you can symlink the external directory in the project directory.


Backport Bluetooth: Host: Set SID in bt_le_per_adv_sync_recv_info to v2.7 branch

Describe the bug
The host does not set the SID in bt_le_per_adv_sync_recv_info, leading to incorrect SID values in the Periodic Advertising Report.
Issue is fixed by #40141

Fixed by merging #40141


Elastalert_Aggregation_Alerting_Problem

I am using Elasticsearch and Elastalert to send simple alerts to my slack channel.
Everything was fine until I started using aggregation and now it says that alert_sent:false. I read some questions about aggregation not alerting. Is there a way to do it anyway ?
Cause when im using --save-json FILENAME option all related alerts are there!
But still I need to be able to send that alert, it used to work once i cant remember what i did but i received 1 alert containing 2 events on slack.
Rule
name: Malicious_File_Detected_Agg

type: any

index: test_win*

filter:

terms:
event_id: ["1116", "1117"]
-and:
query:
query_string: "source_name: Microsoft-Windows-Windows Defender"
aggregation:
seconds: 1
aggregation_key: 'computer_name'
aggregate_by_match_time: true`

**config**
`rules_folder: /etc/elastalert/rules

run_every:
minutes: 2

buffer_time:
minutes: 4

es_host: <IP_ADDRESS>

es_port: 9200

writeback_index: elastalert

alert_time_limit:
days: 2

Can you post logs of what happens? When you get a alert log with alert_sent: false it's generally going to be deleted and the alert actually sent once alert_time elapses. This should be on the next elastalert cycle, since you've set it to just 2 seconds ahead.


Coda daemon crashed on Ubuntu 18 on boot

Log on terminal:
2019-08-08 09:29:45 UTC [Info] Coda daemon is booting up; built with commit "fd4fb3983fcc7d094ee84e305dd3bc6fc80e1c50" on branch "release/0.0.1-beta.2"
2019-08-08 09:30:08 UTC [Info] Starting Bootstrap Controller phase
2019-08-08 09:30:08 UTC [Info] Coda daemon is now connecting
2019-08-08 09:30:08 UTC [Info] Pausing block production while bootstrapping
2019-08-08 09:30:08 UTC [Info] Daemon ready. Clients can now connect
2019-08-08 09:30:13 UTC [Error] Kademlia stderr output: All peers failed
2019-08-08 09:30:13 UTC [Error] Kademlia stderr output: to respond!
2019-08-08 09:30:13 UTC [Fatal] Kademlia process died: "exited with code 1"
Last 20 lines of .coda-config/coda.log
{"timestamp":"2019-08-08 09:29:54.267653Z","level":"Debug","source":{"module":"Coda","location":"File "app/cli/src/coda.ml", line 477, characters 63-70"},"message":"Long async cycle: $span milliseconds","metadata":{"pid":21562,"span":"7.185243431s"}}
{"timestamp":"2019-08-08 09:29:54.326949Z","level":"Trace","source":{"module":"Coda","location":"File "app/cli/src/coda.ml", line 533, characters 64-71"},"message":"Creating database of type $typ in directory $directory","metadata":{"directory":"/home/grana/.coda-config/receipt_chain","pid":21562,"typ":"receipt_chain_database"}}
{"timestamp":"2019-08-08 09:29:54.363035Z","level":"Trace","source":{"module":"Coda","location":"File "app/cli/src/coda.ml", line 541, characters 62-69"},"message":"Creating database of type $typ in directory $directory","metadata":{"directory":"/home/grana/.coda-config/transaction","pid":21562,"typ":"transaction_database"}}
{"timestamp":"2019-08-08 09:30:07.991595Z","level":"Debug","source":{"module":"Coda","location":"File "app/cli/src/coda.ml", line 477, characters 63-70"},"message":"Long async cycle: $span milliseconds","metadata":{"pid":21562,"span":"744.585253ms"}}
{"timestamp":"2019-08-08 09:30:08.002573Z","level":"Debug","source":{"module":"Kademlia__Membership","location":"File "lib/kademlia/membership.ml", line 191, characters 56-63"},"message":"Kademlia command-line arguments: $argv","metadata":{"argv":["test","<IP_ADDRESS>","("<IP_ADDRESS>", 8303)","("<IP_ADDRESS>", 8303)"],"pid":21562}}
{"timestamp":"2019-08-08 09:30:08.032908Z","level":"Info","source":{"module":"Transition_router","location":"File "lib/transition_router/transition_router.ml", line 98, characters 53-60"},"message":"Starting Bootstrap Controller phase","metadata":{"pid":21562}}
{"timestamp":"2019-08-08 09:30:08.033088Z","level":"Debug","source":{"module":"Network_pool__Transaction_pool","location":"File "lib/network_pool/transaction_pool.ml", line 224, characters 69-76"},"message":"no frontier","metadata":{"pid":21562}}
{"timestamp":"2019-08-08 09:30:08.033128Z","level":"Debug","source":{"module":"Network_pool__Transaction_pool","location":"File "lib/network_pool/transaction_pool.ml", line 224, characters 69-76"},"message":"no frontier","metadata":{"pid":21562}}
{"timestamp":"2019-08-08 09:30:08.033757Z","level":"Info","source":{"module":"Coda_lib","location":"File "lib/coda_lib/coda_lib.ml", line 150, characters 63-70"},"message":"Coda daemon is now connecting","metadata":{"pid":21562}}
{"timestamp":"2019-08-08 09:30:08.033823Z","level":"Info","source":{"module":"Proposer","location":"File "lib/proposer/proposer.ml", line 224, characters 57-64"},"message":"Pausing block production while bootstrapping","metadata":{"pid":21562}}
{"timestamp":"2019-08-08 09:30:08.033857Z","level":"Trace","source":{"module":"Web_pipe","location":"File "app/cli/src/web_pipe.ml", line 122, characters 58-65"},"message":"Not running a web client pipe","metadata":{"pid":21562}}
{"timestamp":"2019-08-08 09:30:08.033903Z","level":"Info","source":{"module":"Coda","location":"File "app/cli/src/coda.ml", line 600, characters 56-63"},"message":"Daemon ready. Clients can now connect","metadata":{"pid":21562}}
{"timestamp":"2019-08-08 09:30:13.045524Z","level":"Error","source":{"module":"Kademlia__Membership","location":"File "lib/kademlia/membership.ml", line 277, characters 65-72"},"message":"Kademlia stderr output: All peers failed ","metadata":{"pid":21562}}
{"timestamp":"2019-08-08 09:30:13.045747Z","level":"Debug","source":{"module":"Kademlia__Membership","location":"File "lib/kademlia/membership.ml", line 303, characters 64-71"},"message":"Creating instance","metadata":{"kademlia_level":"DBUG","pid":21562}}
{"timestamp":"2019-08-08 09:30:13.045806Z","level":"Debug","source":{"module":"Kademlia__Membership","location":"File "lib/kademlia/membership.ml", line 303, characters 64-71"},"message":"Attempting to connecting to peer: \"<IP_ADDRESS>\":8303, \"nvs0lNH8gOlIewTboq/+CA90mNp+UR6Hz0K0dERMxxY=\"","metadata":{"kademlia_level":"DBUG","pid":21562}}
{"timestamp":"2019-08-08 09:30:13.045874Z","level":"Debug","source":{"module":"Kademlia__Membership","location":"File "lib/kademlia/membership.ml", line 303, characters 64-71"},"message":"Connection to peer failed NodeDown","metadata":{"kademlia_level":"EROR","pid":21562}}
{"timestamp":"2019-08-08 09:30:13.045959Z","level":"Error","source":{"module":"Kademlia__Membership","location":"File "lib/kademlia/membership.ml", line 277, characters 65-72"},"message":"Kademlia stderr output: to respond!\n","metadata":{"pid":21562}}
{"timestamp":"2019-08-08 09:30:13.046879Z","level":"Fatal","source":{"module":"Kademlia__Membership","location":"File "lib/kademlia/membership.ml", line 228, characters 68-75"},"message":"Kademlia process died: $exit_or_signal","metadata":{"exit_or_signal":"exited with code 1","pid":21562}}
{"timestamp":"2019-08-08 09:30:13.047031Z","level":"Debug","source":{"module":"Coda_run","location":"File "app/cli/src/coda_run.ml", line 70, characters 52-59"},"message":"Successfully wrote the visualization of the registered masks at location: /home/grana/.coda-config/registered_masks.dot.","metadata":{"coda_run":"Logging state before program ends","pid":21562}}
{"timestamp":"2019-08-08 09:30:13.048965Z","level":"Debug","source":{"module":"Coda_run","location":"File "app/cli/src/coda_run.ml", line 83, characters 58-65"},"message":"Could not visualize transition frontier since daemon is currently bootstrapping","metadata":{"coda_run":"Logging state before program ends","pid":21562}}
Please:
Open an issue:
https://github.com/CodaProtocol/coda/issues/new
Briefly describe what you were doing, and include the last 20 lines from .coda-config/coda.log.
And then paste the following:

(monitor.ml.Error (Kademlia.Membership.Child_died)

("Raised at file "lib/kademlia/membership.ml", line 233, characters 18-34"
"Called from file "src/job_queue.ml" (inlined), line 131, characters 2-5"
"Called from file "src/job_queue.ml", line 170, characters 6-47"

We're no longer using Kademlia, which caused this crash. Closing.


Auto-Detect SD Card presence/removal

SD card can be detected throuth CD/DAT3 Pin.

[ ] Check if SD Pin is high --> mount sd card
[ ] Check if SD Pin low --> unmount sd card
[ ] Handle SD Pin in an interrupt to react faster
[ ] Add option to manually mount/unmount SD card e.g. via Bluetooth

NOTE: This requires a HW modification!

Why didn't i think of that?  Haha
Schematics have been updated to support this feature and will be implemented in ELOC3.1
SD CD pin is routed to IO4 of the IOextender.

Blocked by #62


E-Mail Validation Artifact

As a process designer, I want to get confirmation from a process participant at certain points - for example, to verify that an email is correct, or to double-check a declaration of intent.
To do this, the following requirements must be met:

I can request a verification link from within the process. (In the best case, there is a small prefabricated subprocess for this, which I can include via an element template).
This verification link has a certain validity. After the expiration of this period, the link can no longer be called. (This must be caught in the process of course).
The verification link is constructed in such a way that no user data (e-mail, correlation key, etc.) is given to the outside. For example, a random and unique token can be generated here.
If the user clicks on the link within the defined expiration period, the...

The Correlation Key is sent to the (hopefully) waiting process.
Feedback is given to the user whether the transaction was successful (the process was activated) or not.
Cannot click the link a second time with a positive result (i.e. the Correlation Key is sent).

The following data is needed to get the verification link:

Correlation Key: The key that can be uniquely assigned to a message catch event in an active process instance.
Subject: Additional information such as e-mail or similar. In a scenario with a long context (for example, a user account), this parameter could prevent a user from having to verify n times.

In the scenario described above, it does not take into account that the process instance is no longer present at the time of verification (although it still happens in the required time period). The user would then still receive positive feedback because the correlation key was sent to the - supposedly - waiting instance.

Hi @xdoo - can you elaborate a little bit on

provide a reusable process (+ element) template that connects verification and mail.

What is the anticipated functionality and parameters we must provide from the process modelling perspective?
Suggestion is:
provide an Element template to call a service, which, depending on status/conditions/rules can a) send an e-mail to the recipient and reply to the calling process via direct response (sync) and (conditionally, later) via a message to the process, to inform about successful verification and b) simply just lets the calling process know what the status of the verification of the provided e-mail address is.
In that case element template parameters are:

sender
reply-to
recipient
e-mail body
(the obvious parameters to send an email)

plus parameters to connect to the process and specify behaviour:

process-id
message name (to correlate the message in the process for successfull verfiication)
timeout duration (max. time to wait for the recipient to click on the verification-link)

Synchronous response of the service would be the (changed) status of the verification of the provided e-mail address like:

verification in progress
e-mail already verified (deluxe version includes the date of the verification)
e-mail verification timeout (in case the service can provide this)

This would mean the service must store something like these values in a persistent layer:

e-mail address
verification-ID
process-ID
status
valid until (timeout duration)

So this service / element template can be used to

send an e-mail to the recipient to verify the validity of an e-mail
check the verification-status of an e-email-address

Does that makes sense to you?

@hloydl
I don't know if you really want to include sending the email in the subprocess at this point. You could also want to display such a link on the interface. I would potentially make that a little more fine-grained.
I've highlighted in orange potential places that I think could be made generic.

@xdoo - yes, proposed solution makes sense to me. An additional thought on how to use the email verification in a business setup, curious on your feedback:
Instead of waiting for verification the business process could also work like this:
After registering the verification key and (in our business case) sending an email to the applicant, the business process needs to continue and must not necessarily wait for verification. I would then start a parallel event-based subprocess which itself waits for the verification, while the main business process continues with whatever is needed (e.g. approvals in user tasks). When verification occurs the subprocess updates the verification status process variable, which the main process checks whenever needed. There is a pseudo “race condition”, at some point in time the process / the clerk has to decide what to do based on the verification status (send email or use post mail). Could we use the email verification like this, do you see any issues here?

@hloydl The business process should really only be seen as an example here. Whether there are one or more is ultimately irrelevant. The focus of this epic is on what the integration component must be able to do - not on the business process part (with the exception of the orange areas ;).


Show Restaurants,Monuments, and Shopping Malls with proper icons in the map

When selecting Monuments,Shopping,Hangout or restaurants from any city detail page there is just a map that comes up. We need some proper location markers to highlight the places that we want to show the user. Currently this is what comes up -

The description is not clear. @knightcube, Can you specify what you want exactly by posting some screenshots?

Yes sorry for the late reply....saw your comment a little late

Mc

Actually all the places(selecting Monuments,Shopping,Hangout or restaurants from any city) are showing the same location in map.

Did you check the response from here API?

No, but in app it is showing the same map for every city and the locate buttons aren't working.

I'll look into it & create relevant issues for the same. You can work on any other issue.


Invariant Violation: Your JavaScript code tried to access a native module that doesn't exist

I have installed the packages
yarn add @allboatsrise/expo-gigya
yarn add<EMAIL_ADDRESS>And added the following to app.json
"plugins": [
[
"@allboatsrise/expo-gigya",
{
"gigyaSwiftSdkVersion": "1.5.0"
}
]
]
When I added the following,
import { Gigya} from '@allboatsrise/expo-gigya';
Gigya.initFor("XXXXXX");
The following Error occured:
Invariant Violation: Your JavaScript code tried to access a native module that doesn't exist.
If you're trying to use a module that is not supported in Expo Go, you need to create a development build of your app. See https://docs.expo.dev/development/introduction/ for more info., js engine: hermes
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:102:17 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:148:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:39 in handleError
at node_modules/expo/build/errors/ExpoErrorManager.js:25:19 in errorHandler
at node_modules/expo/build/errors/ExpoErrorManager.js:30:24 in
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules/metro-config/node_modules/metro-runtime/src/polyfills/require.js:237:40 in guardedLoadModule
at node_modules/metro-config/node_modules/metro-runtime/src/polyfills/require.js:131:23 in metroRequire
at http://<IP_ADDRESS>:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:null in global
Invariant Violation: "main" has not been registered. This can happen if:

Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:102:17 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:148:19 in handleException

... 7 more stack frames from framework internals

Did you find any solution? How did you implement gigya to your expo app?

Released version 50.0.0 for expo SDK 50. Please open a separate issue if you're still having issues.


Expand thread safety section with respect to singleton factory

The thread-safety section talks about services:

Thread safety
Singleton services need to be thread safe. If a singleton service has a dependency on a transient service, the transient service may also need to be thread safe depending how it's used by the singleton.

However, it would be help to add a word or two about the thread-safety of a singleton factory when using something like AddSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>), as in:
services.AddSingleton<IFoo>(sp =>
{
    // initialization code...
    return new Foo(/* ... */);
});

One would imagine that the factory will be called lazily, when the service is requested for the first time. What happens, though, if multiple threads request the singleton service simultaneously that in turn incurs its initialization?

Does the initialization code run once and run by one thread alone, like a static type constructor?
Does the factory need to be idempotent and so may be called more than once, by more than one thread? The assumption here is that one of those will win (rest discarded) but will effectively return the same result that's used for all subsequent requests.

I'm guessing it's the first case but it would help to clarify in that section. It avoids:

people being paranoid and adding locks in their factory code.
asking Luke to use The Source. 😉

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

ID: 0d78f540-81fd-1ba9-cb90-591e4ec27d9b
Version Independent ID: 2251f557-dd3a-ec35-2558-6243337db009
Content: Dependency injection in ASP.NET Core
Content Source: aspnetcore/fundamentals/dependency-injection.md
Product: aspnet-core
GitHub Login: @ardalis
Microsoft Alias: riande

Hello @atifaziz ... I'm working on this topic TODAY! 😄
Samples are updated, and I'm getting into the topic content now. I'll get back to you soon.

... and the Force says to ping @davidfowl ...
@davidfowl, I can convert your answers to questions 1 & 2 for that section of the topic.

btw ... My name is "Luke," so rest assured I'll use the Force on this...and the Force says to ping @davidfowl ...

Thanks for picking this up so quickly! 💯

Yes initialization code runs once and everything waits on it.

@davidfowl Thanks for the clarification.
Here's a proposal of the section could be expanded:

Thread safety
Singleton services need to be thread safe. If a singleton service has a dependency on a transient service, the transient service may also need to be thread safe depending how it's used by the singleton.
The factory method of single service, such as the second argument to AddSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>), does not need to be thread-safe. Like a type (static) constructor, it's guaranteed to be called once and by one thread alone.

Thanks ... I'll get this on the PR that I'm putting up today.


Fix inaccurate docs

Output file is named test-report.xml by default, not test-results.

Good catch :)


Help:  chezmoi: .config/iterm/com.googlecode.iterm2.plist: duplicate source state entries (dot_config/iterm/com.googlecode.iterm2.plist, dot_config/iterm/symlink_com.googlecode.iterm2.plist.tmpl

Question

When I config iterm2, I meet the problem. How to solve?

Had the same issue. Will there be work on this?


打包问题

python 和 html、css、js等脚本文件， 有办法一起打包成exe吗

In English, please :)

Is there any way to package Python, HTML, CSS, JS and other script files together as EXE

As for the exe - look at PyInstaller or py2exe.
Or just a ZIP archive.


Could we have an example of how to use O.Either?

There is no example docs https://millsp.github.io/ts-toolbelt/modules/object_either.html

import { O } from 'ts-toolbelt'

type Food = {
  carrot: boolean
  orange: boolean
  banana: boolean,
}

type Either = O.Either<Food, 'carrot' | 'banana'>

Will add to the docs soon!

@millsp I think it's best if every example can show what the result type would look like. : )
eg. in your example, I still have a hard time imagining what your result type Either looks like. And hovering over types only works in VSCode. : P

Yhea, this brings us back to adding a playground button. Or an iframe to the ts playground?

@millsp try the iframe! Seems simple and fast enough! And very beneficial


Update CocoaPods install instructions to use Homebrew

This is consistent with the rest of the iOS toolchain.

@jakobr-google


Feature request: platform support

Hello,
Could you add support for having multiple platforms? For example, an ability to put down platforms and switch between them?

For multiple platforms, you could handle in a similar fashion as multiple themes. Add a theme for each to swap between.


anchor_labeler: batch_label_anchors issue with single bounding box

Hi @rwightman
Thank you so much for making this repo.
I am currently experiencing an issue calling batch_label_anchors when ground truth bounding box list only has 1 bbox. Not sure what might caused this issue, I am wondering if you can take a look. Thanks in advance :)
Issue:
anchor_labeler.batch_label_anchors () has index out of range error. Trace attached
Setup anchor:
model_config = get_efficientdet_config('tf_efficientdet_d0')
model = EfficientDet(model_config,pretrained_backbone=True)
model_config.num_classes = 1
model_config.image_size = 512

anchors = Anchors(
    model_config.min_level,model_config.max_level,
    model_config.num_scales, model_config.aspect_ratios,
    model_config.anchor_scale, model_config.image_size
    )

anchor_labeler = AnchorLabeler(anchors,model_config.num_classes,match_threshold=0.5)

Reproduce:
tb = torch.tensor([[468.,353.,52.,386.5]])
tb = tb.int().float()
tlbl = torch.tensor([1.])
cls_targets, box_targets,num_positives = anchor_labeler.batch_label_anchors(1,[tb],[tlbl])

Trace:
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-45-e8bceaf11fb2> in <module>
----> 1 cls_targets, box_targets,num_positives = anchor_labeler.batch_label_anchors(1,[tb],[tlbl])

/opt/conda/envs/fastai2/lib/python3.7/site-packages/effdet/anchors.py in batch_label_anchors(self, batch_size, gt_boxes, gt_classes)
    394             # cls_weights, box_weights are not used
    395             cls_targets, _, box_targets, _, matches = self.target_assigner.assign(
--> 396                 anchor_box_list, BoxList(gt_boxes[i]), gt_classes[i])
    397
    398             # class labels start from 1 and the background class = -1

/opt/conda/envs/fastai2/lib/python3.7/site-packages/effdet/object_detection/target_assigner.py in assign(self, anchors, groundtruth_boxes, groundtruth_labels, groundtruth_weights)
    144         match_quality_matrix = self._similarity_calc.compare(groundtruth_boxes, anchors)
    145         match = self._matcher.match(match_quality_matrix)
--> 146         reg_targets = self._create_regression_targets(anchors, groundtruth_boxes, match)
    147         cls_targets = self._create_classification_targets(groundtruth_labels, match)
    148         reg_weights = self._create_regression_weights(match, groundtruth_weights)

/opt/conda/envs/fastai2/lib/python3.7/site-packages/effdet/object_detection/target_assigner.py in _create_regression_targets(self, anchors, groundtruth_boxes, match)
    167         zero_box = torch.zeros(4, device=device)
    168         matched_gt_boxes = match.gather_based_on_match(
--> 169             groundtruth_boxes.boxes(), unmatched_value=zero_box, ignored_value=zero_box)
    170         matched_gt_boxlist = box_list.BoxList(matched_gt_boxes)
    171         if groundtruth_boxes.has_field(self._keypoints_field_name):

/opt/conda/envs/fastai2/lib/python3.7/site-packages/effdet/object_detection/matcher.py in gather_based_on_match(self, input_tensor, unmatched_value, ignored_value)
    171         input_tensor = torch.cat([ss, input_tensor], dim=0)
    172         gather_indices = torch.clamp(self.match_results + 2, min=0)
--> 173         gathered_tensor = torch.index_select(input_tensor, 0, gather_indices)
    174         return gathered_tensor

IndexError: index out of range in self

Here are some values:
ipdb> p input_tensor
tensor([[  0.,   0.,   0.,   0.],
        [  0.,   0.,   0.,   0.],
        [468., 353.,  52., 386.]])

ipdb> p gather_indices.shape
torch.Size([49104])

ipdb> p gather_indices
tensor([    1,     1,     1,  ...,     1,     1, 24554])

ipdb> p self.match_results
tensor([   -1,    -1,    -1,  ...,    -1,    -1, 24552])

@heye0507 thanks for repro, wonder if a dim is benig dropped somewhere in the n=1 case, hmm

Any updates on this? I believe I'm facing the same error:
self = <effdet.object_detection.matcher.Match object at 0x7f27110ba210>
input_tensor = tensor([[  0.0000,   0.0000,   0.0000,   0.0000],
        [  0.0000,   0.0000,   0.0000,   0.0000],
        [188.3483,  88.2405, 385.1532, 447.3587]])
unmatched_value = tensor([0., 0., 0., 0.])
ignored_value = tensor([0., 0., 0., 0.])

    def gather_based_on_match(self, input_tensor, unmatched_value, ignored_value):
        ss = torch.stack([ignored_value, unmatched_value])
        input_tensor = torch.cat([ss, input_tensor], dim=0)
        gather_indices = torch.clamp(self.match_results + 2, min=0)
>       gathered_tensor = torch.index_select(input_tensor, 0, gather_indices)
E       IndexError: index out of range in self

I don't know if this is the cause, but I get the same error if  match_results has a value > 2:
match_results = tensor([3])

input_tensor = tensor(
    [
        [0.0000, 0.0000, 0.0000, 0.0000],
        [0.0000, 0.0000, 0.0000, 0.0000],
        [188.3483, 88.2405, 385.1532, 447.3587],
    ]
)
unmatched_value = tensor([0.0, 0.0, 0.0, 0.0])
ignored_value = tensor([0.0, 0.0, 0.0, 0.0])

ss = torch.stack([ignored_value, unmatched_value])

input_tensor = torch.cat([ss, input_tensor], dim=0)
gather_indices = torch.clamp(tensor(match_results) + 2, min=0)

gathered_tensor = torch.index_select(input_tensor, 0, gather_indices)

    gathered_tensor = torch.index_select(input_tensor, 0, gather_indices)
IndexError: index out of range in self

Hi @rwightman, @lgvaz
Thanks for the response.  Sorry for the late reply, was pulled to another project forgot to comment back.
Two things I want to confirm here,

Using Bench train everything works pretty well. (I was in the kaggle wheat detection, pretty sure you are aware of it :) ) I have tested Eff-det0, Eff-det5 and Eff-det6, things working very well.

The issue reported here seems to related to specific data / frame work you are using. I was porting Effdet to Fastai2, and randomly encountered this issue. (I later refactored my code and the issue seems gone, apologize that I still didn't find root cause of it).

But here is one of my testing example, if you want to take a look. (I do have a better version that I packed everything into a Fastai callback class, but I forgot to push it to github).
Running in Fastai2
Best,

TL;DR: The error seems to be specific to CPU

Hello @heye0507, thanks for the update!
Funnily I was getting this error only on my unittests and not when actually training the model. which got me to the question: WHY?
The only difference is that my unittests are run on CPU, moving the tests to GPU "solves the issue"
I found this old issue (from 2017) about index_select not returning out of bound of errors on GPU. The issue is closed, but it's not very clear if the issue was fixed.
@rwightman Is it possible that we have a bug in Match that is being shadowed by this?

@lgvaz certainly possible there is a bug or corner case that's being missed on the GPU, back in the day there were a number of ops that didn't check bounds or error conditions well on the GPU, thought that was all fixed.
Also possible that the input is not valid. What's the test case that triggers this? Have you tried training with COCO data on the CPU (for a bit). @heye0507 original test case would never happen in reality, batch size of 1 is not an input you'd ever see, batchnorm doesn't work in train mode with batch size 1. Also, 1 bounding box at the point it's fed to the network is not something you'd typicall see.
The whole batch needs to have the same box instances dimension, fixing that to 1 means your ground truth targets can have at most 1 bbox for all images. While not impossible to imagine a dataset where you have one box or not, doesn't seem that common and if indeed it is a dim size == 1 issue, you coudl set max instances to 2 and not see any performance impact.
All of this anchor code was adapted by me from the Google autml/efficientdet code base, which took the anchor code from the  official retinanet tensorflow impl. I converted it from TF 1 graph ops into Pytorch eager in a couple of evenings with a glass (or two) of scotch. Ran through a debugging evening where I fixed issues mostly in the gather -> gather/select ops (the most different) and then a few performance adjustments later. The original code and my own adapation are certainly NOT defensive, there are not many checks so making sure the input is valid is quite important. I'm hoping to find a chunk of time to look into the IOU PR and possible improvements, perhaps I can get normal training running on the CPU and do some checks of this while I'm fiddling....

Interesting, from tf.gather that I use torch.index_select,
https://www.tensorflow.org/api_docs/python/tf/gather Note that on CPU, if an out of bound index is found, an error is returned. On GPU, if an out of bound index is found, a 0 is stored in the corresponding output value
Possibility also that the original code has some issues that are ignored for GPU (and likely TPU).

Instead of trying to train COCO on cpu maybe you can try this dataset? It's very small and we can be sure the error will pop up very quickly.
The dataset is in VOC format, but there are a lot of tools that convert voc to coco.
I believe the error should appear regardeless of the batch size, I still don't understand why the error is happening still, any thoughts on what might be happening?

On a side note, I laughed quite hard at:

in a couple of evenings with a glass (or two) of scotch.
Convert TF graphs to pytorch really doesn't sound pleasant hahahahaha

I can confirm I am also being bitten by this error in the case where I have a single bounding box, irrespective of batch size, running on cpu.

@Chris-hughes10 @lgvaz  to be clear, when one says 'single bounding box', does that mean a single valid bounding box in an N instance batched tensor, or that your bbox/cls tensors only have a dim of 1 for the number of instances? If it's the latter, what happens if you change the dim to say 2?

Hi @rwightman, by single bounding box I mean a Nx4 tensor; one ground truth bbox per image. When I used an image with two ground truth boxes I didn't hit the problem.

@rwightman @heye0507
This appears to be bug of torch.argmax
`
torch.argmax(torch.tensor(np.random.rand(1, 30000)), 0)[-1]
Out[36]: tensor(0)
torch.argmax(torch.tensor(np.random.rand(1, 40000)), 0)[-1]
Out[37]: tensor(30000) # should always be 0
torch.argmax(torch.tensor(np.random.rand(2, 40000)), 0)[-1]
Out[38]: tensor(1)
torch.argmax(torch.tensor(np.random.rand(2, 40000)), 0)
Out[39]: tensor([1, 0, 0,  ..., 1, 0, 0])
`

@world2vec weird, I can't reproduce that, but I did notice that the torch argmax behaviour is not consistent with numpy when values are the same, torch cpu returns the highest same index, GPU seems rather arbitrary. That was apparently just fixed this month.

@rwightman
torch.__version__ Out[3]: '1.5.0+cu101'
kindly be noted CUDA was disabled.
You are right,  loooks 1.6 has solved the bug:

In [2]: torch.cuda.is_available()
Out[2]: False

In [3]: torch.__version__
Out[3]: '1.6.0+cu101'

In [4]: torch.argmax(torch.tensor(np.random.rand(1, 40000)), 0)[-1]
Out[4]: tensor(0)

Here is my temporary solution.
git diff argmax_matcher.py
diff --git a/effdet/object_detection/argmax_matcher.py b/effdet/object_detection/argmax_matcher.py
index 2b8d9b1..c73fc3b 100644
--- a/effdet/object_detection/argmax_matcher.py
+++ b/effdet/object_detection/argmax_matcher.py
@@ -115,7 +115,10 @@ class ArgMaxMatcher(object):  # cannot inherit with torchscript
             matches:  int32 tensor indicating the row each column matches to.
         """
         # Matches for each column
-        matches = torch.argmax(similarity_matrix, 0)
+        if similarity_matrix.shape[0] == 1:
+            matches = torch.tensor([0]*similarity_matrix.shape[1])
+        else:
+            matches = torch.argmax(similarity_matrix, 0)

         # Deal with matched and unmatched threshold
         if self._matched_threshold is not None:
@@ -135,7 +138,11 @@ class ArgMaxMatcher(object):  # cannot inherit with torchscript
         if self._force_match_for_each_row:
             force_match_column_ids = torch.argmax(similarity_matrix, 1)
             force_match_column_indicators = one_hot(force_match_column_ids, similarity_matrix.shape[1])
-            force_match_row_ids = torch.argmax(force_match_column_indicators, 0)
+
+            if force_match_column_indicators.shape[0] == 1:
+                force_match_row_ids = torch.tensor([0]*force_match_column_indicators.shape[1])
+            else:
+                force_match_row_ids = torch.argmax(force_match_column_indicators, 0)
             force_match_column_mask = torch.max(force_match_column_indicators, 0)[0] != 0
             final_matches = torch.where(force_match_column_mask, force_match_row_ids, matches)
             return final_matches

Interesting, I've almost exclusively used this codebase with PyTorch 1.4 and 1.6. 1.5 had some big performance regerssions for the JIT scripting fusion that I use for the Swish activation and some of the post-processing for these models. Wonder if everyone having these issues like this using 1.5?

@Chris-hughes10 @lgvaz @heye0507 Can anyone confirm if this issue happens on PyTorch 1.6? I'm going to ignore any problems with 1.5 due to the issue @world2vec mentioned (that I have confirmed).

I can confirm that I am running into same issue with effdet 0.1.6, under Python ver 3.8.2, torch 1.6.0, torchvision 0.7.0, fastai 2.0.13, pytorch_lightning 0.9.1rc3, icevision 0.1.5
ValueError                                Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/fastai/learner.py in _with_events(self, f, event_type, ex, final)
    154     def _with_events(self, f, event_type, ex, final=noop):
--> 155         try:       self(f'before_{event_type}')       ;f()
    156         except ex: self(f'after_cancel_{event_type}')

/usr/local/lib/python3.8/dist-packages/fastai/learner.py in _do_epoch(self)
    190     def _do_epoch(self):
--> 191         self._do_epoch_train()
    192         self._do_epoch_validate()

/usr/local/lib/python3.8/dist-packages/fastai/learner.py in _do_epoch_train(self)
    182         self.dl = self.dls.train
--> 183         self._with_events(self.all_batches, 'train', CancelTrainException)
    184

/usr/local/lib/python3.8/dist-packages/fastai/learner.py in _with_events(self, f, event_type, ex, final)
    154     def _with_events(self, f, event_type, ex, final=noop):
--> 155         try:       self(f'before_{event_type}')       ;f()
    156         except ex: self(f'after_cancel_{event_type}')

/usr/local/lib/python3.8/dist-packages/fastai/learner.py in all_batches(self)
    160         self.n_iter = len(self.dl)
--> 161         for o in enumerate(self.dl): self.one_batch(*o)
    162

/usr/local/lib/python3.8/dist-packages/fastai/learner.py in one_batch(self, i, b)
    178         self._split(b)
--> 179         self._with_events(self._do_one_batch, 'batch', CancelBatchException)
    180

/usr/local/lib/python3.8/dist-packages/fastai/learner.py in _with_events(self, f, event_type, ex, final)
    154     def _with_events(self, f, event_type, ex, final=noop):
--> 155         try:       self(f'before_{event_type}')       ;f()
    156         except ex: self(f'after_cancel_{event_type}')

/usr/local/lib/python3.8/dist-packages/fastai/learner.py in _do_one_batch(self)
    163     def _do_one_batch(self):
--> 164         self.pred = self.model(*self.xb)
    165         self('after_pred')

~/.local/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
    721         else:
--> 722             result = self.forward(*input, **kwargs)
    723         for hook in itertools.chain(

~/.local/lib/python3.8/site-packages/effdet/bench.py in forward(self, x, target)
     92         class_out, box_out = self.model(x)
---> 93         cls_targets, box_targets, num_positives = self.anchor_labeler.batch_label_anchors(
     94             x.shape[0], target['bbox'], target['cls'])

~/.local/lib/python3.8/site-packages/effdet/anchors.py in batch_label_anchors(self, batch_size, gt_boxes, gt_classes)
    410             cls_targets, _, box_targets, _, matches = self.target_assigner.assign(
--> 411                 anchor_box_list, BoxList(gt_boxes[i]), gt_classes[i])
    412

~/.local/lib/python3.8/site-packages/effdet/object_detection/box_list.py in __init__(self, boxes)
     53         if len(boxes.shape) != 2 or boxes.shape[-1] != 4:
---> 54             raise ValueError('Invalid dimensions for box data.')
     55         if boxes.dtype != torch.float32:

ValueError: Invalid dimensions for box data.

I can bypass it by hacking my pipeline to insert a bogus extra box when there is only 1 labeled box on an image.

@bguan I think that's a different, expected issue wrt to the tensor format for the boxes that's not specific to CPU/GPU.

@rwightman can you advice how to go about doing it the right way?

@bguan I think your issue is more related to #71 , if you invoke a debugger and check the value of boxes I think you will find an empty tensor.
@rwightman I'm still a bit confused on the resolution of #71, what should be passed as targets if no bboxes and present on the image?
Just to be clearer on that, let's say I have 2 images on my batch, one of then has 2 bboxes and the other has 0, what I'm currently feeding as targets for the model is:
targets['bbox'] = [tensor([[10, 10, 20, 20], [5, 5, 15, 15]]), tensor([])]

This last tensor([]) is what is causing the problem, what should the target be in that case?
For faster_rcnn I'm doing:
target["labels"] = torch.zeros(0, dtype=torch.int64)
target["boxes"] = torch.zeros((0, 4), dtype=torch.float32)

Will that work here as well?

@bguan @lgvaz the target bbox tensors passed to the bench by my code are shape [B, N, 4] ... where B is the batch size, and N is the number of detection instances. classes are [B, N] for scalar class targets. The bench currently iterates over the batch dimension and passes bbox [N, 4], and class targets [N] to the anchor labeller. For the boxes you cannot strip the first dimension N in the case where there is one (or no boxes).
As per the TF implementation I fix the size of N for all samples regardless of the number of actual boxes. This is done in my collate fn for efficiency. So by default for my training routine I pass one bbox tensor and one class tensor for the batch of size [B, 100, 4], and [B, 100] as 100 is the default max number of instances for coco. I tried setting N to 1 for my batch tensors in the past and it worked fine.
For the fixed N instances, I currently pad the unused instances with zeros. However, in taking another pass over the original code recently I noticed the original looks like it pads out boxes and classes to -1, which ends up as -2 for the classes after subtracting the background, and -2 is treated as a different sentinel value than -1 (background) by the loss/anchor/match code. I've had good results as is, but I'm trying runs with -1 padding to see if it has an impact.
Making targets a list of tensors as in your example, with differing N... well I've certainly never tried that. I can't say it wouldn't/shouldn't work for the anchor/matching code. An empty dim [] tensor certainly won't. (0, 4) might. I never thought about this approach as it seems less efficient, you'll be moving more tensors separately to the GPU, should be less latency to move it in fewer transfers.
With fixed size N dimension padding is required,
Either way, you definitely cannot pass boxes that don't have a leading N dimension.

Hi @rwightman, I ran the same code again with PyTorch 1.6 and can confirm that the issue seems to have been resolved!

I think this is likely fixed, or a non issue in PyTorch 1.6 and 1.7 w/ proper use of the model. Feel free to open w/ a reproduction if there is still an problem.


Multiple bond selection changes all bonds order

Steps to Reproduce

Select multiple bonds with mixed bond order.

Enter "edit" menu of the bonds. Optional: change reaction center or topology value.

Save changes. Bond order has changed for entire selection.

The same happens if you enter edit with single bond:

Expected behavior
In edit bond window the bond order is unselected if mixed order bonds were selected. Saving changes should not change bond orders unless explicitly changed.
Ketcher version
v2.7.1

Hi @mwojcikowski thank you for using Ketcher! What exactly you mean "Bond order has changed for entire selection"?

Hi @Zhirnoff,
What I meant is that the bonds are converted to single or double, depending on the bond you click to edit. Compare the images in 1 vs 3.
Hopefully this image is clearer. Top one is when you click on single bond. Bottom when on doulbe.

Other software handles such issue, that the bond order is not set at all (or set to an empty value).

@mwojcikowski Thanks for the more detailed information. We will try to fix this behavior in future releases.

Steps to Reproduce

Open Ketcher
Add structure on canvas ketcher (42).zip
Highlight the top of the structure with a double bond and single bonds
Double click on Double bond
Select 'Topology'=Ring and press Apply

Actual behavior
Topology is assigned to all selected bonds, but single bonds became double
Expected behavior
Topology is assigned to all selected bonds, single bonds have not changed
Note: This behavior is due to the fact that during multiple selection and further editing in the 'Bond Properties' window, the type of bond is already selected, which is applied to the multiselect.
Screenshots
https://user-images.githubusercontent.com/62464241/220167659-7a162c9d-8893-4de4-b4e7-5e28e2440c5c.mp4
Desktop (please complete the following information):

OS: Windows 10
Browser Chrome
Version 109.0.5414.120 (Official Build) (64-bit)

Ketcher version
Version 2.8.0-rc.3
Additional context


override slugify function using marked.js regex

The slug generated by string.js does not match the id generated for heading by marked.js.
The string.js slugify function removes all periods - marked.js converts periods to dashes.
This PR overrides the slugify function with a replace method using the regex from marked.js.

Any feedback on who might be blocking this PR from being merged?

why the "lib" folder has been remove from the gitignore?

Wow this is still open. Thanks for keeping it updated @styson. 🤗

Wow this is still open. Thanks for keeping it updated @styson. 🤗


[Fixed]First Draft: Enable Tool Calling for Llama 3.1 Models in Bedrock API

This PR contains:

[x] New features
[ ] Changes to dev-tools e.g. CI config / github tooling
[ ] Docs
[ ] Bug fixes
[x] Code refactor

What is the current behavior? (You can also link to an open issue here)
Currently, tool calling is not a feature for the Bedrock provider models, there is no handling of input message when tool calls are present. This means if we try to call tools, i.e by using the use_tools() caller the information from those tools is not passed through to the prompts, and even if they were; i.e the user manually puts tool instructions into the prompts there is no logic inplace for parsing the responses.
What is the new behavior?
This PR introduces some initial support for tool calling in Bedrock, specifically for Llama 3.1 models, although the refactoring changes included also affect the mistral handler. I have tried to follow the logic suggested here where we:

make use of the chat_api_input() function to format input messages with tool information
make use of the API handlers for response parsing, which enable the handling of tool outputs
Changed message handling to use the more simple ChatAPIMessage rather than ChatMessage
refactored other linked functions to use these new data structures correctly

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No breaking changes, It should (and does by my testing) behave the same when no tools are used. When tools are used they are called correctly but currently the 'chain' stops - the model is re-prompted but the response is not recorded.
Other information:
This is a first draft implementation and  requires further refinement and testing. Currently, tool calling is working for the llama3.1 models in bedrock, however it always fails to generate a message after. I.e after a tool call the next response_body from the model is a single token empty string, ""
here is an example response body:
Response Body:{'generation': '', 'prompt_token_count': 474, 'generation_token_count': 1, 'stop_reason':
'stop'}
is this something you guys have come across before? maybe when implementing tool calling for llama3.1 on Azure? I tried the same for a Mistral endpoint on bedrock and it successfully generated non empty strings after calling a tool.

The refactors look good! Are you running these against Llama 3.1 or Llama 3.0? (I ask because I actually didn't see the Llama 3.1 series listed on Bedrock when I checked the other day). Could that account for the empty response?
I wonder if we need some additional coaxing of the model after providing it a tool result? (you could experiment with this by deriving from Llama31Handler and overriding the tool_message method. Actually, now that I am looking at this method, that is very likely to be where this can be resolved! On the Llama3.1 model card it says to use role="ipython" for tool call responses however we found that role="tool" worked fine with Azure and CloudFront. Perhaps Bedrock has less filtering in front of the model and therefore needs role="ipython". Further, you could try using a normal role="user" message like this:
    @override
    def tool_message(self, message: ChatMessageTool) -> ChatAPIMessage:
        """Construct a chat REST API message from a tool message."""

        # might be an error in which case we prepend 'Error'
        results = f"Error: {message.error.message}" if message.error else message.text

        # try to clearly spell out that this 'user' message is the response to a function call
        content = f"The '{message.tool_call_id}' function was called. The results are:\n\n{results}"

        # return user message
        return {"role": "user", "content": content}

Okay, glad to see the basics working! Once you are satisfied that this is all set ping me back and I'll do final review and merge.

hey, I ran the 7b, 80b, and 405b models through a sample of 50 datapoints each whilst having access to 7 tools, there were no noticeable issues in terms of run times , excessive tokens usage or anything else.
The current input_with_tools() prompt in the llama31 handler seems to be working just fine, same with the formatting of tools via chat_message_str(). I tried playing around with adding role="ipython" but it didnt seem to make a difference, nothing I could notice over a hundred or so samples anyway.
On my end I think this is ok to be fully reviewed now.

Thanks again!


feat: Add solution to Portuguese challenges

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
[x] My changes do not use shortened URLs or affiliate links.

Add solution to 5 challenges:

curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/functional-programming/use-the-some-method-to-check-that-any-elements-in-an-array-meet-a-criteria.portuguese.md
curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.portuguese.md
curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.portuguese.md
curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/functional-programming/use-the-every-method-to-check-that-every-element-in-an-array-meets-a-criteria.portuguese.md
curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.portuguese.md

@MGenteluci Can you please put all of the changes for the challenges (solutions) into a single PR instead of separate PRs. Just close the extra PRs and have a single PR for all of the challenges you want to add solutions.
Thank you.

Sure, I can do that. Should I group it by language or should I submit both portuguese and english all together?

As the 5th bullet point indicates, PRs should not mix languages.

As the 5th bullet point indicates, PRs should not mix languages.

Oh right. That's done, all 5 portuguese solutions are grouped in this PR.

Note to moderators: To test solutions for non-English files such as these Portuguese challenges, you must run npm run test:curriculum after first changing TEST_CHALLENGES_FOR_LANGS=english to TEST_CHALLENGES_FOR_LANGS=portuguese in the .env file.  The problem is, many of the challenges are missing important sections such as the After or Before Test sections which the challenge tests use.  For example, the challenge named "24 Game" in the Coding Interview Prep section is currently failing the tests because it is missing the After Test section.
@raisedadead Until the existing challenge files on the master branch are fixed, I think we can not "test" any changes and be 100% confident the solutions will pass the existing test for the current state of the non-English files.  We can also not just test the solutions using the English version as we already know many of the non-English challenges were not updated when either solutions were added and/or tests were changed.   I propose blocking any further merging of the non-English curriculum PRs until each language on master can successfully pass all the existing tests for the applicable languages.

@MGenteluci Thank you for putting them all into the same PR.  Now you can just close the other ones and add a comment to them like "Added to PR #37161 instead".  This will create a reference to this PR in case anyone wonders why the others were closed.

for the current state of the non-English files

Do you mean the non-english curriculum needs update for the updated schema?

UPDATE:  After discussing this issue with @ojeytonwilliams, he made a suggestion which I have put into a new PR (#37188) to update the How to work on Coding Challenges documentation.  Basically, we can test individual challenges without worry about the rest of the challenges' correctness when validating solutions are correct for the tests in a file.
@MGenteluci You need to take the following steps to test the changes you have made:

Set the environment variable TEST_CHALLENGES_FOR_LANGS to portuguese in the .env file.
Change to the curriculum directory:

cd curriculum

Run the following for each challenge file for which you have added solution:

npm run test -- -g 'the full English title of the challenge'

I have already done this locally on my machine and found at least one challenge fails.  The reason is not your added solution, but problems in the testString which will need to be fixed as well.  They can be fixed by removing the assert message argument (which is no longer needed) for each test.  Some of the testString arguments were not properly created (i.e double quotes were not properly escaped), but since we only use the text for each test, they can be removed.  Once you tested each challenge file using the syntax above and the test results show all tests pass, then you should commit/push those changes back to this PR.

UPDATE: After discussing this issue with @ojeytonwilliams, he made a suggestion which I have put into a new PR (#37188) to update the How to work on Coding Challenges documentation. Basically, we can test individual challenges without worry about the rest of the challenges' correctness when validating solutions are correct for the tests in a file.
@MGenteluci You need to take the following steps to test the changes you have made:

Set the environment variable TEST_CHALLENGES_FOR_LANGS to portuguese in the .env file.
Change to the curriculum directory:

cd curriculum

Run the following for each challenge file for which you have added solution:

npm run test -- -g 'the full English title of the challenge'

I have already done this locally on my machine and found at least one challenge fails. The reason is not your added solution, but problems in the testString which will need to be fixed as well. They can be fixed by removing the assert message argument (which is no longer needed) for each test. Some of the testString arguments were not properly created (i.e double quotes were not properly escaped), but since we only use the text for each test, they can be removed. Once you tested each challenge file using the syntax above and the test results show all tests pass, then you should commit/push those changes back to this PR.

Fixed! I had to fix the asserts in both use-the-filter-method-to-extract-data-from-an-array and combine-an-array-into-a-string-using-the-join-method

@RandellDawson for future PRs, should I group tests, docs and feats all in the same PR if they are in the same language?

should I group tests, docs and feats all in the same PR if they are in the same language?

If you are adding solutions to curriculum files, keep those together in a PR.  If making changes to docs, put those changes in a separate PR.  For documentation PRs, there is nothing to test and would not hold up a PR as long as one that has both types of changes on it.  It makes it easier for the reviewers approving the PRs for merging.

should I group tests, docs and feats all in the same PR if they are in the same language?

If you are adding solutions to curriculum files, keep those together in a PR. If making changes to docs, put those changes in a separate PR. For documentation PRs, there is nothing to test and would not hold up a PR as long as one that has both types of changes on it. It makes it easier for the reviewers approving the PRs for merging.

I see. Thanks for the info!

I have tested these locally and they all pass. One thing I noticed which is beyond the scope of this PR is there are several places in these files (and many other non-English challenges), where the text inside the code tags (In Description, Instruction, and Test sections) has been converted to html entities, which will not show correctly when viewed on the site. For example, the following test text in the Use the filter Method to Extract Data from an Array challenge
  - text: 'filteredList deve ser igual a [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}] .'

should actually be:
  - text: 'filteredList deve ser igual a [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}] .'

Should probably create an issue to document this for others to work on.

I'm willing to start working on the Portuguese files, should I create the issue first or can I start working and then submit the PR?

@MGenteluci, please create an issue when you can for added visibility. There might be other contributors who can help fix the challenges in Portuguese and other affected languages.

Thank you for all of your hard work on these @MGenteluci. Looking forward to your future contributions :1st_place_medal:


fix: add missing quotation mark in faq docs

Description
Updated the register function in instrumentation.ts to fix a typo by adding a missing quotation mark.
How to Test
No testing is required for this documentation-only change.
Related Issues
None

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


Login (Remember Me ON)

Description
Login functionality
Steps to reproduce issue
Slide [Remember Me] to ON
Enter Username, [Next] activates
Enter Password, [Previous] & [Go] activate
Login - Spideroak Logo will appear
Enter incorrect password: 3-5 sec error message, fields not cleared
Enter correct password: success
Expected result
Log Out returns a message saying "Are you sure you want to sign out?"
Log Out returns user to home login screen with username still in the username spot.
Actual result
Not showing me the Stay Logged In dialogue.
Other information
Reported by: Renee Jackson
Test case number: TC04
Test run: http://spideroak.testlodge.com/projects/3096/runs/137336?tab=2&run_section_id=68049#executed_case_6977542

I'm totally perplexed by this report. (-:

It's hard to tell where you're starting from.

It could be the settings activity, where "Stay logged in" has a slider - but you can't actually enter a username and password there.
It could be the login page, but on the login page, the "Stay logged in" control is a checkbox, not a slider, as indicated.
However, the "Expected result" section of the report refers to Log Out returning the "Are you sure..." message - only the settings page has a logout.
So I'm beat, already. (I can often resolve a pretty good guess, even though I'll still ask because I want to push back against ambiguity to improve the communication process. This time I'm really unable to tell.)

You mention [Next], [Previous], and [Go] buttons activating.

I don't get [Next] or [Previous] on either iOS or Android, but I do get "<" and ">" next field and previous field arrows, when things are filled in, on iOS, and know that some Android devices have had Next and Previous. So I'm unable to tell which those are, but suspect it's iOS?
I can't tell if these details actually pertain to the problem, or are just for the sake of having all the details so an automated procedure could be concocted. I'm sympathetic to that, just trying to point out incidental details that are making finding the actual difficulty, difficult.

In the "Steps to reproduce" section of the report, you mention that fields are not cleared. If you're starting from the login screen, then we intend for only the password field to be cleared, all the rest should be preserved. I thought for a while that you were reporting that the Password field was not cleared (maybe because of the Next and Previous jockeying, or something), or that you were expecting the other fields to be cleared, but now suspect that's neither is the concern of the report.
Having "Actual result" be 'Not showing me the Stay Logged In dialogue." suggests to me that you're expecting the "Stay logged in dialog" to show every time you log in with "Stay logged in" set (though I'm genuinely still confused about being on the Login screen or the Setting screen).

In case this is it, the "Stay logged in" dialog is a one-time thing, per account. The purpose is to inform each user that "Stay logged in" stashes the credentials on the device, by notifying them until they accept it. If they do accept it, then they will not be warned again (on that device, unless the app is uninstalled and reinstalled, etc). If they do not accept it, then the login resumes, but "Stay logged in" is not maintained (as indicated on the settings page), and they will get the confirmation dialog again.
I'm leaning towards thinking that this concern is the reason for the issue, but genuinely unsure.

I suggest all this because I realize you're shaking out the process for reporting issues, from an external facility. I know that you're juggling a lot of concerns, including trying to be thorough and specific about the actions involved, trying to indicate different results possible, etc. You're concerned with audiences from various different roles, but in our particular role we need it clear what the specific problem is that's motivating the report.

So what TestLodge is apparently doing is just copying my test cases in and writing what I would normally put by itself in a bug report under the "actual results" The rest of it is just what's written in Testlodge as steps for QA staff to follow. Seems like either I need to just give up on @merickson's dream of integration or totally change how the tests are written.

Additionally, some of the language like [Go] and sliders vs checkboxes are anomalies left over from previous versions of the app or mockups that I apparently haven't quite scrubbed from our docs yet.

By the way this is showing the "Please Note" warning screen about staying logged in in Android, so this is iOS specific that I'm not seeing it.

Are you saying you're not seeing the "Please note" screen on iOS, ever? I'm seeing it on the very first time I try to log in with each account. (You may need to uninstall the app and reinstall it to ensure you're getting a very-first-time.)

@reneelynn can you confirm that you're not seeing it on the very first time stay-logged-in attempt for each account? I've been unable to replicate the behavior on any of my iOS devices.

I thought I had as I was using new accounts, but I just cleared everything out completely on my phone and tried again, and I got it this time so closing but keeping an eye out

Ok, definitely do keep alert for it - the warning keeps us honest re ZK. Thanks!


Smoother height differences between hexes

@alice-i-cecile and I were talking about the difficulties of unit animations across heights, and how we probably want to switch from "noisy heights" to more smooth hills. This got me thinking about how best to show and make use of that kind of terrain.
Proposal
I believe it is desirable to "smooth out" the terrain. Instead of the "basalt columns" approach, it would look more like natural hills and cliffs, but with a hex grid projected onto the floor plane.
Benefits:

More natural look and feel, more evocative of the natural environments we want the player to be thinking of
Makes walking animations for units much easier to build
Prevents issues of structures and units being hidden behind ledges
Allows for more interesting gameplay hooks with slopes and drop offs
More unique visuals (yay marketing)

Drawbacks:

Mesh batching will be more challenging
Rendering, in general, will be more challenging
Both buildings and units will need to look good on sloped surfaces, including potentially compound curvature
Understanding precise heights will be more challenging
There are some constraints on world generation. For example, single tile peaks will have a sharp top instead of a smooth one.

Implementation

Every tile still has a single height, which is the height of the center of the tile
Tile meshes are constructed now of 6 triangles for their "floor surface" (one for each wedge)
Triangles angle their circumference corners based on the heights of their neighbors

Consider a hex corner, C. Observe that it has three neighbors
Note that any three points can uniquely identify a plane
Construct the plane defined by the three heights of the three tiles which meet at C.
Project C's x,y coordinates onto this plane to determine its height

All these possible floor triangles can be enumerated and batched, as long as:

Tile heights are discretion (likely desirable for gameplay reasons anyway)
The number of distinct height differences is finite and relatively small

Define a height difference threshold (say, 3 units). Any height difference between tiles which is greater than this threshold uses a vertical wall, with some optional bending at the corners for visuals

This kind of reminds me of Settler III, which had a tile grid, but which was only visible while building. Otherwise the terrain was smoothed out:

But they had much smaller tiles than we have right now.
That's probably also a parameter we can look at in more detail: The tile size / radius.

I'm quite happy with the current look: unless we get stuck on unit animation this is a "won't fix".


Futures history mobile display

Improve the display of the futures history table on mobile.
Description

Implements a specific mobile table for futures history
Improves types and data handling of futures trade history
Adds drawer to futures history on mobile
Improves PositionType component to have a mobile version with no background

Related issue
No issue for the original changes, but follow-up issues:

#1479
#1480

Screenshots (if appropriate):

@asherism I addressed your comments, but I left the "spot history" table alone right now. I wrote a separate issue to fix that table, since we probably need a specific mobile design. It's doing the same thing running over the side of the container.

@asherism I addressed your comments, but I left the "spot history" table alone right now. I wrote a separate issue to fix that table, since we probably need a specific mobile design. It's doing the same thing running over the side of the container.

sounds good. another thing i wanted to mention- we should truncate the 24h vol numbers after 100k or 1m, open interest as well

@asherism I addressed your comments, but I left the "spot history" table alone right now. I wrote a separate issue to fix that table, since we probably need a specific mobile design. It's doing the same thing running over the side of the container.

sounds good. another thing i wanted to mention- we should truncate the 24h vol numbers after 100k or 1m, open interest as well

Noted, will ticket that out, sounds like a quick devdao ticket. Will test & merge this PR otherwise.


the getVisitNum source needs to be updated.

Issue in help/implement/vars/plugins/getvisitnum.md
The source is attacked here.
getVisitNum.txt

the above source file attachment is not minified. The below attachment has both the inminified and minified versions.
getVisitNum.txt

Hi there, I've reached out via Slack internally to continue this thread. Thanks!