Add REV to KEV Collection

💡 Summary
Add REV=true/false to the kev collection of the CyHy Database based on knownRansomwareCampaignUse="Known"/"Unknown in the KEV catalog
Motivation and context
In support of Ransomware Vulnerability Warning Pilot, the stakeholders REV values need to be tracked in the KEV collection for pulling of various metrics to incorporate into specific CSV files and metrics gathering.
Implementation notes
On https://www.cisa.gov/known-exploited-vulnerabilities-catalog the values should map as follows for the "Known To Be Used in Vulnerability Campaigns" column:
-Known maps to True for the REV key value in database
-Unknown maps to False for the REV key value in database
Acceptance criteria

[ ] New key value named REV in the KEV collection of CyHy Database with values of True/False (Known/Unknown)

@KeithBonesJr - You have listed two identical Acceptance Criteria items.  Did you mean to have two different items there or is the second one unintentional and should be deleted?

@dav3r  just the single Acceptance Criteria

We are thinking in the lines of:
Under cyhy/db/database.py
Under KEVDoc class definition,
Add REV to document structure
structure = {“_id”: basestring, “REV”: bool}
Should not be required, can be defaulted to None/null
Under bin/cyhy-kevsync,
Line 51, gather knownRansomwareCampaignUse along with CVE data
Line 54, Convert knownRansomwareCampaignUse into boolean type
Store true if “Known”, false if “Unknown”, null if neither, ignoring case
Text
rev = i.get(“knownRansomwareCampaignUse”).lower()
if rev == “known”:
rev = True
elif rev == “unknown”:
rev = False
else:
rev = None
Expand (7 lines)
line 61
Write to database based on knownRansomwareCampaignUse value from KEV JSON data
entry_doc = db.KEVDoc({“_id”: cve, “REV”: rev})

@jeffkause which repository should this be under?

@dav3r  does it make more sense to create a PR draft instead or is this fine? We plan to bring this up during the 1 o'clock.

cyhy-core

I will take care of the code changes for this issue since I will be in the best position to easily test them.  I added myself as the assignee for this issue.

Thanks! @dav3r

Is there a particular reason you want to leave the rev field null if knownRansomwareCampaignUse is not "Known" or "Unknown"?  Wouldn't it make more sense to simply set it to True if "Known" and False if anything else?
Also, I'm planning to name the database field known_ransomware, rather than rev since it's more explanatory.

@dav3r  we were thinking of it from an input validation standpoint. If a knownRansomwareCampaignUse value is fat fingered, a misspelled "Known" value could be flagged as "Unknown". I believe the issue here is we don't know what type of input validation is happening on the KEV side for those values reported on the webpage.

I don't think we as consumers of the KEV JSON feed are in a good position to make those sorts of determinations.  We are trusting the KEV/REV data source to be correct, otherwise we wouldn't be using it.  If there is a mistake, it is up to the provider of the data feed to correct it.  Once it's fixed, we will ingest the corrected data the next time we run our script.
In this particular case, anything other than "Known" would imply that the ransomware status is unknown, hence my suggestion.  Also, it's cleaner from a dev/DB standpoint if we can safely assume that we will always be populating the known_ransomware field with either True or False.

@dav3r looks good to us! Sure it can be deployed to production or held off until the other changes are made. It makes no difference to us.


How do you use swagger authorization after docker-compose starts up?

docker-compose is helpful to get the services running.   What are the steps for authorization in the docker test environment?
I've connected to
https://cwms-data.localhost:8444/cwms-data/swagger-ui.html
And clicked the 'Authorize' button.   There are several prompts, and one that looks promising is OpenIDConnect (OAuth2, password)
I see example passwords in the docker-compose-README.md, but the prompt also requests client_id and client_secret.

Here are the options:

Api Key
value=?

CwmsAAACacAuth APIKey
value=?

OpenIDConnect (OAuth2, authorization_code)
client_id=?
client_secret=?

OpenIDConnect (OAuth2, implicit)
client_id

OpenIDConnect (OAuth2, refresh_token)
(no input) -- looks like for refreshing only

OpenIDConnect (OAuth2, password)
username=?
password=?
client_id=?
client_secret=?

OpenIDConnect (OAuth2, client_credentials)
client_id =?
client_secret =?

OpenIDConnect (OAuth2, urn:ietf:params:oauth:grant-type:device_code)
(no inputs)

OpenIDConnect (OAuth2, urn:openid:params:grant-type:ciba)
(no inputs)

If I put data into the Oracle database table at_sec_session, would the first option be practical?

try implicit.

Using Implict with client_id:  cwms   After clicking the authorize button, a new tab opens with this url:
https://auth.localhost:8444/auth/realms/cwms/protocol/openid-connect/auth?response_type=token&client_id=cwms&redirect_uri=https%3A%2F%2Fcwms-data.localhost%3A8444%2Fcwms-data%2Foauth2-redirect.html&scope=offline_access%20openid%20profile%20phone%20acr%20web-origins%20address%20subjectDN%20email%20roles%20microprofile-jwt&state=TW9uIE5vdiAyMCAyMDIzIDE1OjIwOjM0IEdNVC0wODAwIChQYWNpZmljIFN0YW5kYXJkIFRpbWUp

Here is the image

well, that does mean it was the correct choice but there's still an issue with the config. in the file compose_files/keycloak/realm.json on like 665, it's possible that needs https://cwms-data.localhost

if that doesn't work i'll need to experiment a little tomorrow.

I get the same error with the tweak to realm.json.  Here is the error from the docker log:
auth_1| 2023-11-20 23:44:04,236 WARN  [org.keycloak.events] (executor-thread-0) type=LOGIN_ERROR, realmId=cwms, clientId=cwms, userId=null, ipAddress=<IP_ADDRESS>, error=invalid_redirect_uri, redirect_uri=https://cwms-data.localhost:8444/cwms-data/oauth2-redirect.html

hmm, yeah, that redirect is wrong. I'm going to have to experiment a little.

Okay, so it is (OAuth2,password) and you just leave the client_secret blank.
I still wasn't able to POST a CLOB (easiest end point to test) but it's entirely plausible that's an issue with checking the authorization header values without a ignoreCase.

... well, now I remember
String username = token.getBody().get("preferred_username",String.class);
// TODO: get roles from JWT and DB
return new DataApiPrincipal(username, new HashSet<RouteRole>());

I was waiting to pull all the values from the CWBI keycloak so I could go and match things like preferred username and mimic that configuration and never filled in the route roles. If you add role of "CWMS Users" to that set it will work, or at least allow writes for anything with a valid JWT, the l1hectest account wouldn't behave correctly as it's supposed to not have a role set.
As an alternatively solution to allow writes to the docker-compose instance one could just login to the generated oracle database as the CWMS_20 user and manually add an appropriate API key.

I logged into oracle as CWEMS_20, and inserted data like this:

Each apikey is tied to a specific user. so it will look up and see the that user is 'karl-test' and set the roles according that that users's permissions.

Thanks -- here is what I did to get authorization:
SQL> insert into CWMS_20.AT_SEC_SESSION values ('L2HECTEST', 'sessionkey-for-testing', timestamp '2025-1-01 23:30:30.10');

1 row created.

SQL> insert into CWMS_20.AT_api_keys VALUES ('L2HECTEST', 'key001', 'sessionkey-for-testing', TO_DATE('2023-01-01', 'YYYY-MM-DD'), NULL);

The upper case in the username was important.


EXR maultilayer next/previous channel hotkeys not working

Describe the bug
By default, the hotkeys for next channel and previous channel (of multilayer exr's) are mapped, but do not seem to be working.
To Reproduce
Load a multi layer .exr image.  Change the displayed layer using the UI button in the TopBar, and the layer changes correctly.  Then try and use the default "[" and "]" does not work.
I tried mapping the action to different key-bindings, but that did not work either.  I have not tried mutlipart exrs.
Expected behavior
The layer (channel) will change using the hotkeys.
Desktop (please complete the following information):
Win10 using the latest release .exr installer (mrv2 64 bits - v1.2.1 - Built Jul 12 2024 06:53:52)

I confirm the bug and have a fix for it already in place for v1.2.2.

You can try the beta at:
https://sourceforge.net/projects/mrv2/files/beta/

Got the beta, and can confirm it works.  Thanks so much!
Do you want me to close this, or leave it open until the release?

I am closing it.  Thanks.


Use distributed Token Caching in .NET Core based applications

What: Use a distributed token cache for APIs
Why: This will result in improved performance for our APIs as they wont have to fetch tokens for each individual replica of a given API

[ ] Read @ https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-net-token-cache-serialization
[ ] Read @ https://dev.to/425show/implement-a-distributed-token-cache-for-asp-net-core-apps-with-azure-cosmos-db-23ai
[ ] Read @ https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-5.0
[ ] Implement distributed token caching in existing applications
[ ] Test
[ ] Demo

Closing as usecase is not imminently active.


Switch to Sass!

I know you don't like the whole compass / ruby dependence thing, but LESS is not great compared to Sass, so here's a version that seems to work.

Only reason I went with LESS is because that is what Bootstrap uses. When they switch to SASS in version 4 I will switch to SASS


fix: could not distinguish no enough blocks to sample or no sampled blocks

Issue
The bug is introduced since #121.
https://github.com/nervosnetwork/ckb-light-client/blob/0ef32b0bcca0a379a5c44ce1adbe1c77fda3e085/src/protocols/light_client/components/send_last_state_proof.rs#L603-L618

Let $b_{\text{start}}$ denote the start block in the request, it's also the previous last state.

Let $b_{\text{last}}$ denote the block in the last state in the request.

Let $B_{\text{all}}$ denote all blocks which requires verification.
Obviously,

The first block in $B_{\text{all}}$ is $b_{\text{start}}$.

The next block of $B_{\text{all}}$ is $b_{\text{last}}$.

Let $B_{\text{last}}$ denote the real last n blocks.
Obviously, $B_{\text{all}}$ contains $B_{\text{last}}$.

Let $B_{\text{sampled}}$ denote the sampled blocks.
Obviously, $B_{\text{all}}$ contains $B_{\text{sampled}}$.

Let $C_{\text{all}}$ denote the count of $B_{\text{all}}$.

Let $C_{\text{last}}$ denote the count of $B_{\text{last}}$.

Let $C_{\text{sampled}}$ denote the count of $B_{\text{sampled}}$.

Let $N_{\text{last}}$ denote the paramter LAST_N_BLOCKS.

https://github.com/nervosnetwork/ckb-light-client/blob/0ef32b0bcca0a379a5c44ce1adbe1c77fda3e085/src/protocols/mod.rs#L28

Before that PR #121, we only checked if $B_\text{last}$ are continuous, but didn't check:

whether $B_{\text{last}}$ are continuous with $b_{\text{last}}$.

whether $B_{\text{last}}$ contain $b_{\text{start}}$, when $C_{\text{all}}$ is small.

The bug happened in the check-2.
If $C_{\text{all}} \le N_{\text{last}}$, CKB node will send all blocks of $B_{\text{all}}$ to the client, so the check-1 and check-2 will be satisfied.
But it's a necessary and insufficient condition, its opposite is not true.
If $C_{\text{all}} = N_{\text{last}} + \beta \gt N_{\text{last}}$, when $\beta$ is small enough, the $C_{\text{sampled}}$ also could be $0$.
So, even there are no sampled blocks in the response, the check-2 also could be NOT satisfied.
Solutions
There are 3 solutions:

Remove the check-2.

Update the check-2: remove the check when $C_{\text{all}} = N_{\text{last}}$, only do the check when $C_{\text{all}} \lt N_{\text{last}}$.

If the $C_{\text{sampled}}$ which computed from the formula is $0$, but $C_{\text{all}} \gt N_{\text{last}}$, set $C_{\text{sampled}}$ to $1$.
To make sure there always has at least sampled 1 block  ( $C_{\text{sampled}} \gt 0$ ) when $C_{\text{all}} \gt N_{\text{last}}$.
Then no sampled blocks ( $C_{\text{sampled}} = 0$ ) will only happened when $C_{\text{all}} \le N_{\text{last}}$.

This PR choose the 3rd solution.

Codecov Report
Base: 79.07% // Head: 79.07% // No change to project coverage :thumbsup:

Coverage data is based on head (34c22fd) compared to base (0ef32b0).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #124   +/-   ##
========================================
  Coverage    79.07%   79.07%
========================================
  Files           23       23
  Lines         4880     4880
========================================
  Hits          3859     3859
  Misses        1021     1021

Flag
Coverage Δ

unittests
79.07% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

src/protocols/light_client/sampling.rs
97.77% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


[WFLY-14389] Resource-adapters: correctly marshall application elemen…

…t with expression value
https://issues.redhat.com/browse/WFLY-14389
This fix seem to work for me. In case of application being set to true, it is marshalled as an empty element. In other cases, expression included, it is fully marshalled.

hi @bstansberry, I have attached an update to test configuration; with this configuration current master fails and this branch succeedes

Thanks, @tadamski


RxDelay Part 2

This expands upon PR #531

Expand rx2_window() to use RxDelay

This branch was tested in dev environment with @michaeldjeffrey and @lthiery using the Rust based command-line tools for verification.
We'll create a Part 3 branch for rx_delay change during same session with a device.  (Currently, the device must re-join for rx_delay to be set.)


[Bug]:  failed to solve with frontend dockerfile.v0

Is there an existing issue for this?

[X] I have searched the existing issues

Description
expected the app to get build and start
[22:01:37.054] GitHub importer started. [22:01:37.308] Cloning scshiv29-dev/next-auth-firebase:main branch. [22:01:38.408] Configuration changed. [22:01:38.455] Building image started. [22:01:38.665] #1 [internal] load build definition from Dockerfile [22:01:38.665] #2 [internal] load .dockerignore [22:01:38.669] #1 sha256:f3a23f9a45b8c05fa37a21628bf9a7994cf6c786eeb8da8154fb8a1ce767428c [22:01:38.670] #2 sha256:822e9dc4185e9a518ed61fe4935837c651df9475b35ef93c2ab2a102edc20d2c [22:01:38.673] #1 transferring dockerfile: 1.50kB done [22:01:38.675] #2 transferring context: 2B done [22:01:38.677] #1 DONE 0.0s [22:01:38.678] #2 DONE 0.0s [22:01:38.681] failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 4: ARG names can not be blank
Steps To Reproduce
1.Make a nextjs nextauth app
2.Try to host it on coolify
Version
3.10.16

Could you please test it again? And if it still persist, please reopen the issue with an example repository.
Thanks!


"Not all defined tags for registry ResourceKey[minecraft:root / minecraft:item] are present in data pack: morefoods:cooked_meat" shows up in server logs when pack is reloaded

This bug only affected me, specifically. Strange!
Anyways, I've closed it since it won't reappear for anybody else. (or shouldn't anyhow)


azure_monitor_configure() breaks when used with Credentials

Package - azure.monitor.opentelemetry
Version - 1.4.0
OS - Win 10 & Win 11
Python - 3.10.11

Describe the bug
Using the correlated_logs sample (https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-opentelemetry/samples/logging/correlated_logs.py) - when we set the credentials (required for App Insights with local authentication turned off) we see 500 results coming back and no logs stored in AppInsights,
To Reproduce
Steps to reproduce the behavior:

Set up the sample as follows:

Run it
Expected behavior
I expect to see the 6 logs in App Insights within a few minutes. When we run it, we do not see this. The first connection is AppInsights is successful:

(interestingly, our connection string points to uk-south, but this connection is to westeurope)
Subsequent calls (we assume are the actually telemetry being sent) return a 500 response

@codesmon
We only support clientsecret or managed identity methods of authentication. See samples here

As Leighton mentioned, this is not one of the credential types we support. Additionally, I've tested and cannot reproduce this issue. When passing in even a Default credential, all 4 logs arrive as expected in a regular application insights resource (The log level is set at warn by default, so not all 6 are expected). Please check that your application insights resource is configured correctly, and that the connection string used is appropiate.

Why can't you use Managed credentials or secrets? Are you "on prem" or in Azure?


FAQ improvements/expansion

@StevenLocke Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@StevenLocke Thank you for signing the Contributor License Agreement!


Simplify sticky headers logic

Summary of changes
Asana Ticket: Clicking on the nav link on the left should expand the corresponding month
A different approach in an attempt to achieve the desired behavior. Related to #940.
Also a refactor: adding class sticky-top to the sections replicates the behavior of the function that is removed in this PR.

The first 5 or so events of the month are visible, but you can't scroll to the end of the event list for a month.  Here's a gif of trying to scroll to the end of April, but the events are covered by the May header

Ouch that's not good...reverting.


add check for progress at 100%

Coverage increased (+0.006%) to 85.993% when pulling f9ad8b7170fd0d54e0932e7c71f9822ca725a67e on abemassry:add-check-for-finish-progress into 6851995c69311f7a063d379006e03b1366c32a46 on linode:master.

The status change only matters once the progress has reached 100%. There may have been multiple status change dispatches that were unnecessary before. This PR only dispatches the status change when the status has actually changed.


awesome embedded and IoT security list

Added an embedded and IoT security list

anything useful?

Thank you for the contribution !


add staking dep gen mappings

Describe your changes and provide context
Added staking dep gen mappings.
Questions about the PR
There are hooks that can be called when the message is processed. Eg for Delegate, it has the following hooks BeforeDelegationSharesModified, BeforeDelegationCreated. These hooks can be Set dynamically with SetHooks(sh types.StakingHooks), not 100% certain if this is a point of concerns but just wanted to bring it up (since user's can't really set hooks, only other modules can that have access to the StakingKeeper).
Based on the bank mappings, we set the read and write operation so I did in this PR as well. However, based on my understanding, the write operation is a more restriction ACL operation. Does it make sense for us to include both read and write ACL operations or would it suffice to just specify a write ACL operation (assuming write has stricter requirements than reads).
Testing performed to validate your change

Does delegation have any interactions with module accounts? We need to be careful with module accounts
The hooks should be fine if we're not using any right now

Does delegation have any interactions with module accounts? We need to be careful with module accounts

Yes, there is some interaction with the module account, For example, for MsgDelegate, it will call DelegateCoinsFromAccountToModule. However, all module accounts accessed are owned by the validator which should be covered by the this ACL Operation. I treat staking/validator_addr to represent validators and their corresponding module accounts.
Not certain if this is the best way, might be better to be more granular if there is ever a time where we might access the validator and not their corresponding module accounts or vice versa.


Update netpol to allow traffic to coredns

towards https://github.com/giantswarm/giantswarm/issues/31685
Checklist

[x] Update changelog in CHANGELOG.md.

LGTMIIW

tested - works as expected.


Suggestion: read jit types from annotations

The @jit allows supplying expected types
@jit(int32(int32, int32))
def f(x, y):
    return x + y

Function type annotations in Python 3.5+ look like a good fit for this use case, annotations are easy enough to read from the decorated function properties , allowing you to write:
@jit
def f(x: int32, y: int32) -> int32:
    return x + y

With the added bonus that the same type annotations could improve IDE support (e.g. completions and error checking in PyCharm) and mypy tests.
This might not cover every use case, but could probably cover a lot of common cases, including when several types are accepted using Union[]

This will definitely be a post 1.0 feature.

@seibert I'd be willing to help give this a shot. It looks like it'd just be a matter of parsing the signature like @mangecoeur said, which I guess would happen right in here: https://github.com/numba/numba/blob/master/numba/decorators.py#L154-L170

One thing I'm curious to know is how we should represent NumPy array types in annotations.  Numba specializes the code it generates on 3 array attributes:

Number of dimensions of the array
Element layout: C order (right most index has stride 1), FORTRAN order (leftmost index has stride 1), "any" order (arbitrary strides)
Element dtype

In order for Numba to compile the most efficient code at module load time (which I assume is the goal here), that level of detail should be specified for the input types.  We could skip the element layout attribute and accept some loss of performance and compile assuming the "any" layout.  (For example, I'm pretty sure that SIMD instruction usage is severely limited unless we know we have C or FORTRAN order arrays.)
I think it would also be important to be able to tell Numba to ignore the annotations for the purposes of compilation.  That way they could still be used for static type checking tools and IDEs.

I was envisioning a new kwarg signature,  and the developer would have to explicitly opt into signature checking with jit(signature=True).  That would also prevent any kind of new inference method from breaking legacy annotated code. So you'd have to write (forgive any off-by-one errors, I'm doing this on my phone):
import numba as nb
import numpy as np

@nb.jit(signature=True)
def row_similarity(X: nb.float64[:,:]) -> nb.tuple(nb.float64[:], nb.float64[:]):
    n = X.shape[0]
    norms = np.empty((n,))
    for i in range(n):
        norms[i] = np.sum(X[i]**2)

    sims = np.empty((n*(n-1)/2,))
    k = 0
    for i1 in range(n):
        for i2 in range(i1+1, n):
            sims[k] = np.dot(X[i1], x[i2]) / norms[i1] / norms [i2]
            k += 1

    return sims, norms

It still makes sense to use Numba types, rather than Numpy types. You can't yet specify Numpy array dimensions in annotations. AFAICT that is an unsolved problem.
The problem is that Numba types don't inherit from builtin types or Numpy types, so Mypy (and every type checker that depends on it) would be very unhappy with these signatures.
Nevertheless, it does lead to much cleaner code in my opinion. Since it's opt-in in anyway, would there be any harm in doing it, knowing that actual type checkers would not be able to handle it?
The truly correct answer of course, would be to write a PEP 544 Protocol class for the Numpy ndarray API, and then convince people to use that in their annotations. That's a bigger issue than Numba, but personally I think it would be a good thing for even non-Numba users, and I don't think there'd much adoption friction.

I don't want to encourage users to annotate function types.  I think the current numba type system is very limiting and it should be replaced.  With type annotation, there is an implicit cast that is very unpythonic.  Users can always put explicit casts inside the function body.  That way, the function definition will still work without numba.
The only benefits that function type annotation is providing are forced compilation at decoration time.  However, if controlling and reducing compilation overhead is important, users can always enable caching.

@sklam What are your goals/vision for the new type system? Will it integrate with function/variable /class annotations?
Would we then be able to type functions with abstract types for multiple dispatch?

Cython has done a similar thing: https://github.com/cython/cython/issues/1672. They also discus the tradeoffs of using the type annotations to change behavior (which is what PEP 484 says).
Eventually, they decided to use type annotations to compile functions (which would change Python's behavior). They eventually decided to use the type annotations with Cython, but I'm not sure if their motivation applies here. Their discussion starts here: https://github.com/cython/cython/issues/1672#issuecomment-295919502

The same applies to @jitclass:
Instead of
@jitclass([('bar', int32)])
class Foo:
    pass

you could have
@jitclass
class Foo:
    bar: int32

Now that @dataclass is a part of Python 3.7, this would make even more sense consistency-wise.

This would also be useful for variable annotations, so that the locals= dictionary could be avoided (which is ugly and necessary if you are using float32's).

I did some checking on this last week and discovered (to my disappointment) that variable annotations inside of a function are effectively comments.  They don't show up in any of the function attributes (unlike the argument and return type annotations) and they do not show up in the bytecode.  As a result, the Numba compiler can't see them unless we start trying to locate function source code and parse it again (which has its own issues).
If there is a way to obtain the local variable annotations programmatically that I've missed, please let me know!

@seibert MyPy might have some magic that could help.
I feel like Python ought to have programmatic access in this case. Maybe a PEP is in order? I could see some sort of data structure in which type declarations/annotations are indexed by their equivalent positions in bytecode, but that would only apply for CPython AFAIK.

Also, our reluctance base a Numba feature on source code comes from the difficulties in obtaining function source (or equivalent ASTs) in all of the situations where Numba can be used:

Python source files (easy, inspect.getsource())
Jupyter Notebooks (less easy, and sometimes fragile)
Functions constructed from string templates that are exec'ed on the fly
Cloudpickled functions sent over the network
Functions imported from .pyc files (not that common, but currently works)

@seibert as I understand it at the moment numba does not actually support any kind of variable type annotation inside a function (?) In which case the function argument/return types and class variable types could still be equivalent to using signature/class type definitions in the jit decorator, since those annotations are included in the __annotations__ variable. It's only variable annotations inside functions/methods which don't appear anywhere.
def test(foo: float):
    bar: int

test.__annotations__

>>> {'foo': float}

Yes, it is correct that Numba could use the type information from the function signature.
We haven't devoted any effort to Numba support for function argument / return type annotations in the @jit decorator for several reasons.  We find that describing the types with the level of detail Numba requires is (1) quite tedious for users, (2) almost always not necessary due to type inference, and (3) very easy to get wrong.
In particular, the complexity comes from NumPy array types, which are a lot like C++ template types as far as Numba is concerned.  Since Numba uses types for dispatch to different implementations, it captures the element dtype, number of dimensions, and the array layout (C, FORTRAN or "any/unknown") in the Numba type for the array.  That lets Numba generate the most optimized code, and it also ensures that the type inference algorithm can figure out the return types from array slicing.  Manually putting type declarations on functions is likely to lead Numba astray, or unnecessarily limit the compiler when generating customized implementations.
Currently, the only cases where explicit signatures are necessary are for ahead of time (AoT) compilation, and for @guvectorize because of implementation limitations that we want to eliminate soon.  For AoT cases, we often need multiple type signatures, and it is also not clear how to express that with Python type annotations.
The ugliness of @jit(locals) (needed to override the Numba type-casting rules, usually for performance reasons) is one situation where type annotations on variables would be a perfect replacement.  Unfortunately, that's also the one situation we can't use at the moment...

@seibert  what about JIT function annotations for overloads?

It's not like you can currently declare a typed variable in the middle of a Numba method, right?

See the numba example here: https://github.com/henryiii/framework_compare/tree/master/lin_regression
If you don't set the locals=..., it's much slower due to mixed doubles and floats.

If there is a way to obtain the local variable annotations programmatically that I've missed, please let me know!

I played around with this for a while and realized that this was not available; I think it's only available class level and module level. It seems like this should have been added to the function attributes.

In [1]: class A:
   ...:     bar: float
   ...:

In [2]: A.__annotations__
Out[2]: {'bar': float}

For python 3.6 and 3.7, class-level annotation shows up in the cls.annotations

And that's what collides with the current implementation of jitclass by the way! (see #2947)
Class-level annotation are easily accessible, yea. It's the locals that aren't.

You know what I want? To annotate local variables/assignments:
def azimuth_elevation_from_equirect(u: f4, v: f4) -> typing.Tuple[f4, f4]:
    pano_cx: f4 = (pano_width-1) * 0.5
    pano_cy: f4 = (pano_height-1) * 0.5

    azimuth: f4 = (u-pano_cx) * f4(2*pi / pano_width)
    elevation: f4 = (v-pano_cy) * f4(pi / pano_height)

    return (azimuth, elevation)

This would replace the locals= dict argument to jit/njit.

Python does not store this information in the bytecode. Local annotations in a function can’t be accessed later.
You’d need something like the syntactic macros PEP to access this sort of thing. That didn’t seem to be going anywhere last I heard.


Supported Platform.sh provided environmental vars, fixes #82

Closes #82
Adds a list of Platform-provided environmental variables that are currently supported in DDEV.
List of variables that are "missing" or not yet implemented:

PLATFORM_APPLICATION
PLATFORM_BRANCH
PLATFORM_DOCUMENT_ROOT
PLATFORM_ENVIRONMENT_TYPE
PLATFORM_OUTPUT_DIR
PLATFORM_SMTP_HOST
PLATFORM_SOURCE_DIR
PORT - not always available
SOCKET

There are two PLATFORM_* environmental variables in DDEV that do not map to ones we provide.

PLATFORM_DIR - is this possibly supposed to be PLATFORM_DOCUMENT_ROOT that is "missing"?
PLATFORM_MOUNTS

@gilzow

if PLATFORM_DIR is not an appropriate thing, it should be removed. I don't see any usages of it.
If PLATFORM_MOUNTS is not used by platform, it should be removed. It's not used by code in this add-on, so it must be a redirection of some type.

@rfay I sent you a direct message, re: PLATFORM_DIR
I've never seen PLATFORM_MOUNTS and it isn't in the docs. I've always accessed mount information via
$ echo $PLATFORM_APPLICATION | base64 --decode | jq -r '.mounts'
Looks like it was added here?
I guess we could rename it to DDEV_PLATFORM_MOUNTS just to designate that it's a DDEV env var related to PLATFORM, vs an "official" PLATFORM_* env var?


c8y_configuration_plugin --init and c8y_log_plugin --init are overwriting exiting files

Signed-off-by: Pradeep Kumar K J<EMAIL_ADDRESS>Proposed changes
tedge/tedge_mapper/tedge_agent/c8y_config_plugin/c8y_log_plugin --init must create the config files only if the config files does not exists.
Types of changes

[x] Bugfix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
[ ] Documentation Update (if none of the other choices apply)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue

Checklist

[ ] I have read the CONTRIBUTING doc
[x] I have signed the CLA (in all commits with git commit -s)
[x] I ran cargo fmt as mentioned in CODING_GUIDELINES
[x] I used cargo clippy as mentioned in CODING_GUIDELINES
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] I have added necessary documentation (if appropriate)

Further comments

Looks good to me. Just a two things:

The name of the enum could be changed to something else so that when we create a new directory there is no return Ok(FileCreateStatus::CreateNew)?
The file create status is required only for the file, not for the directory. So, I removed the code.
Is it possible to have a test to check existing files are not overwritten?
Yes, added a test to check if the file already exists.

There is a bug.
Precondition:

/etc/tedge directory exist.
/etc/tedge/c8y directory doesn't exist.

Run:
sudo ./c8y_log_plugin --init

Result:
sudo ./c8y_log_plugin --init
2022-06-23T12:17:21.383339143Z  INFO c8y_log_plugin: Creating supported operation files
Error: Unable to open file: /etc/tedge/c8y/c8y-log-plugin.toml. Error: Invalid argument (os error 22)

You should run as tedge user.
sudo runuser -u tedge -- ./target/debug/c8y_log_plugin --init

Note: this doesn't happen for c8y_configuration_plugin.

Its not happening here because the c8y directory is getting created by root, as eblow
create_directory_with_user_group(&format!("{config_dir}/c8y"), "root", "root", 0o775)?;
So, we must make some decision here  about which owner the root or tedge user owns this folder.

You should run as tedge user.
sudo runuser -u tedge -- ./target/debug/c8y_log_plugin --init

I know it's not related to this PR's scope, but I'm totally surprised the design is like this. I see no reason c8y_log_plugin must be run as tedge user.

I fully agree with @rina23q. In practice c8y_log_plugin must run as root to have access to restricted logs like those of mosquitto.

Its not happening here because the c8y directory is getting created by root, as eblow
create_directory_with_user_group(&format!("{config_dir}/c8y"), "root", "root", 0o775)?;
So, we must make some decision here about which owner the root or tedge user owns this folder.

I also checked the code. On one hand, c8y_configuration_plugin creates /etc/tedge/c8y owned by root, and c8y_log_plugin creates /etc/tedge/c8y owned by tedge.
In my opinion, I support to make all owned by root. Our systemd file for the log plugin starts the process as root, I see no reason why we need to make the plugin file and c8y directory owned by tedge.
https://github.com/thin-edge/thin-edge.io/blob/main/configuration/init/systemd/c8y-log-plugin.service

Here, I disagree with @rina23q. I would prefer to have these files and directories owned by tedge. Otherwise this will add another constraint to an operation plugins that declares supported operation.

You should run as tedge user.
sudo runuser -u tedge -- ./target/debug/c8y_log_plugin --init

I know it's not related to this PR's scope, but I'm totally surprised the design is like this. I see no reason c8y_log_plugin must be run as tedge user.

I fully agree with @rina23q. In practice c8y_log_plugin must run as root to have access to restricted logs like those of mosquitto.

Its not happening here because the c8y directory is getting created by root, as eblow
create_directory_with_user_group(&format!("{config_dir}/c8y"), "root", "root", 0o775)?;
So, we must make some decision here about which owner the root or tedge user owns this folder.

I also checked the code. On one hand, c8y_configuration_plugin creates /etc/tedge/c8y owned by root, and c8y_log_plugin creates /etc/tedge/c8y owned by tedge.
In my opinion, I support to make all owned by root. Our systemd file for the log plugin starts the process as root, I see no reason why we need to make the plugin file and c8y directory owned by tedge.
https://github.com/thin-edge/thin-edge.io/blob/main/configuration/init/systemd/c8y-log-plugin.service

Here, I disagree with @rina23q. I would prefer to have these files and directories owned by tedge. Otherwise this will add another constraint to an operation plugins that declares supported operation.

I agree with @didier-wenzek. Even in the c8y-configuration-plugin, some files (c8y_UploadConfigFile, c8y_DownloadConfigFile, operations/c8y) are owned by tedge. So, let's get rid of this inconsistency by changing the owner for all the files to tedge. I will make the changes accordingly

Now we are talking about /etc/tedge/c8y directory

I missed that point.

Otherwise this will add another constraint to an operation plugins that declares supported operation.

I don't get this point fully.

Even if an operation plugin doesn't need to run as root, it will have to create its configuration file as root.
But I see a real benefit of not having the --init option creating this directory as owned by tedge: it will be really good to move away from that model where thin-edge works only with a user named tedge.
A solution can be to have the directory owned by root but allowing anybody to add a configuration file there:
$ ls -ld /etc/tedge/c8y
drwxrwxrwt 8 root root 4096 Jun 24 10:32 /etc/tedge/c8y


"Browse" and "commit" actions are reversed for git

From<EMAIL_ADDRESS>on 2012-05-21T08:08:40Z
What steps will reproduce the problem?

Open a project that is a git repo
Choose "Commit" or "Browse repository" from context meny on any file in that project in project explorer What is the expected output? What do you see instead? Expected is "Commit" opening a "git gui" where you can actually commit, and "Browse repository" opening "gitk", where you can browse repo history.
Instead these two are reversed - "Commit" launches "gitk" (where you can not commit per se) and "Browse repository" starts "git gui". What version of the product are you using? On what operating system? Spyder 2.1.9 on Mac OsX 10.7, but from the look of the sources 2.2 is also affected, and the OS is not relevant.

Please provide any additional information below
. Very easy fix - just swap the values for these commands concerning git in spyderlib/utils/scm.py (for spyder 2.1) or spyderlib/utils/vcs.py (for spyder 2.2). I will attach the actual patches later.
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1035

From<EMAIL_ADDRESS>on 2012-05-21T06:32:21Z
Patch for Spyder v.2.1.x
Includes patch from issue #908 ( https://code.google.com/p/spyderlib/issues/detail?id=908 )
Attachment: scm.patch

From<EMAIL_ADDRESS>on 2012-05-21T06:32:54Z
Patch for Spyder v.2.2
Includes patch from issue #908
Attachment: vcs.patch

From pierre.raybaut on 2012-05-22T07:00:10Z
This issue was closed by revision 4cf56792af28 .
Status: Fixed


add review member for ru content

add member
/language ru
/assign @Potapy4

@msheldyakov / @aisonaku / @dianaabv happy with this change?

/lgtm
/approve

/approve
Remember to update https://github.com/kubernetes/org/blob/master/config/kubernetes/sig-docs/teams.yaml as well


Add more documentation about installing library

Codecov Report

Merging #7 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop       #7   +/-   ##
========================================
  Coverage    93.81%   93.81%
========================================
  Files            5        5
  Lines           97       97
========================================
  Hits            91       91
  Misses           6        6

Continue to review full report at Codecov.

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


Better handling of SakuraApiConfig.dataSources

right now, it returns null if config is missing... it should probably return a valid SakuraMongoDbConnection object with no connections.

included in 0.7.0-2


detailed error message

Ah already deployed. Nice error for:
https://graphhopper.com/maps/?point=48.123299%2C11.543011_GraphHopper+GmbH%2C+Lipowskystra%C3%9Fe+30%2C+81373+Munich%2C+Germany&point=48.118435%2C11.539495_Lindenschmitstra%C3%9Fe+52%2C+81373+Munich%2C+Germany&profile=car&layer=Omniscale&key=bloed


Feature Request - Pre-populate a template for all collection items.

It would be very handy to have a feature where all items contained in a collection could be pre-populated with a template of your choosing.
For example, I plan to use Koillection to track a video game collection and I'd like every single item in the collection to show fields for progress, items owned (cartridge/box/manual/etc) and cosmetic condition, rating, etc.
Having to apply the template to each item we add is just a bit of a slow process, the option to have it pre populate all new items being added would be excellent.
This is a hard feature to describe in words, if there's any question about this please let me know.

This feature is available in the latest release


Fix typos found by codespell

Checklist

[x] documentation is added or updated

This pull request is ready to merge

Why the bot added a fips-change lable to this PR?

Merged to the master branch. Thank you for your contribution.


Failed to connect to the  AWS IoT

Hi,
I upload the BasicPubSub example to the Arduino Yún board. But it connected failed!
We could see the serial port printed as shown below:

We also see the python file run.

And Yesterday evening the connection was successful.

Please give the answer to us. Thanks!

Hi,
I upload the BasicPubSub example to the Arduino Yún board. But it connected failed!
We could see the serial port printed as shown be
We also see the python file run.

And Yesterday evening the connection was successful.

Please give the answer to us. Thanks!

Hi,
I upload the BasicPubSub example to the Arduino Yún board. But it connected failed!
We could see the serial port printed as shown below:
"
AWS IoT SDK Version(dev) 1.0.0-
Connect failed!
-5
Subscribe failed!
-7
Publish failed!
-6
loop 0 done
Publish failed!
-6
loop 1 done
loop 2 done
loop 3 done
loop 4 done
Publish failed!
"
We also see the python file run.
1777 root     13232 S    python aws_iot_mqtt_client.py
And Yesterday evening the connection was successful.
"
AWS IoT SDK Version(dev) 1.0.0-
loop 0 done
CALLBACK:
new message 0
loop 1 done
CALLBACK:
new message 1
"
Please give the answer to us. Thanks!

I have the same problem, what's wrong with  arduino yun sdk ?

@Jack1314 @Pillar1989 - thank you for trying out the Arduino Yún SDK. Could you please tell us whether you have successfully created and registered your certs with AWS IoT?
Please reference the below and let us know if you run into issues.
http://docs.aws.amazon.com/iot/latest/developerguide/secure-communication.html
https://github.com/aws/aws-iot-device-sdk-arduino-yun/blob/master/README.md

Yes, we can use the same certs file on Beaglebone green. it's work fine. so I guess the arduino yun SDK problem

@amirthar   I used the same  AWS IoT CA file, private key and certificate file with Arduino yun.   The night before the connection to AWS IoT was successful, but it connected failed yesterday.

Hi @Pillar1989. Thank you for your response.
Below are a list of steps that will help diagnose the issue:

In “aws_iot_config.h” in the application example check that the connection settings (server endpoint, port) are the same as for your Beaglebone board.
The port should be 8883 the server endpoint for your account can be retrieved e.g. by using the AWS CLI “aws --region us-east-1 iot describe-endpoint”.
Please ensure that your Arduino board is connected to a WiFi network that has internet access and allows for traffic on TCP port 8883 (Secure MQTT).
Verify that the filenames for your credentials (rootCA, private key and certificate) match the files copied to the ones on the openWRT side to which they were copied following the setup instruction from readme. Ensure that those credentials are the same as for your Beaglebone board (which apparently works).
Ensure that you are using a unique ClientID for your Arduino Yun. Note that using the same client ID on multiple boards running with certificates for the same account at the same time will lead to disconnection of clients (per MQTT spec)
We are able to cause connectivity issues if OpenWRT is not fully booted up by the time the sketch is flashed. Make sure the board is fully booted up and connected to WiFi before uploading and running the sketch on Arduino. This can take up to 80 seconds.

In order to diagnose the issue further we kindly ask you to open a support ticket, to allow for exchange of account specific information.
Thanks,
The AWS Device SDK team

I checked the filename. They are right. We didnt modify any source code. Just test the SDK.
Any way. If there are any runtime environment problem, The SDK  should print "setup failed".
and  "config failed".

About 5, After we can ping http://wiki.com/,we test sdk. So there is no internet problem.

Hi @Pillar1989. Thank you for your response.
In order to further diagnose the issue, we need to take a look at your configuration files and the file list under /root/certs/ on openWRT. Please create customer support ticket and pass the values for the following variables into the ticket:
AWS_IOT_MQTT_HOST
AWS_IOT_MQTT_PORT
AWS_IOT_CLIENT_ID
AWS_IOT_MY_THING_NAME
AWS_IOT_ROOT_CA_FILENAME
AWS_IOT_CERTIFICATE_FILENAME
AWS_IOT_PRIVATE_KEY_FILENAME
Thanks,
The AWS Device SDK team

@Jack1314
Instructions
In “AWS-IoT-Arduino-Yun-Library/examples/BasicPubSub/“:
In “aws_iot_config.h”, modify macro “AWS_IOT_CLIENT_ID” from “My_ClientID” to something else. For example:
#define AWS_IOT_CLIENT_ID “My_ClientID” —> #define AWS_IOT_CLIENT_ID “New Client ID”
2. Now re-flash the example sketch onto the board.
@liuszeng
Thanks

I had the issue that the second poster reported.
Connect failed!
-5
Subscribe failed!
-7
Publish failed!
The resolution was to examine the AWS_IOT_ROOT_CA_FILENAME referenced in the aws_iot_config.h  It turns out that the file was actually a template that didn't contain the actual certificate.  After pasting in the cert body into the template, my connections worked.

Hi,
I had this after uploading the sketch to the board:
AWS IoT SDK Version(dev) 1.0.2-
Setup failed!
-17
It does not even setup...

Hi @smartleoyu
Thank you for trying out AWS IoT Arduino Yún SDK.
Error code -17 means that there is a communication error in Serial1 between Atmega and AR9331, which can be caused by the baud rate used for Serial1 communication. You can check the following things:

Verify the OS version of openWRT on your Arduino Board. To check that, you can ssh into OpenWRT and use command uname -a.
Verify Serial1 communication using Arduino Official example YunSerialTerminal. Check to see if this example is working for baud rate115200 and 250000. If it is working, you should be able to use the serial monitor as a terminal on OpenWRT.
Are you experiencing this error each time powering up the board or each time uploading the sketch?

It will be really helpful if we can gather these information.
Thanks,
The AWS Device SDK Team

hello,
I am a newbie to aws iot,
and I am thinking about integration aws iot with an Arduino mkr1000 directly using any methods, so is it possible or not??,
please help me.....

AWS_IOT: Error(-28) connecting to a1sc5ik8p3xc6d-ats.iot.us-east-1.amazonaws.com:8883,


[REQUEST] to widen the area in which a object can be grabbed

howdy,
just to ask if the grab area of the collision.Shape can be widened. so rather than keeping to the middle with the Circle and the top left with the Rectangle. it would be good if that white spot can be made bigger. and even to make the entire area clickable, rather than kept to just one point.
thanks

Added as a task on the Dragging card on Trello


Custom text for back and main menu buttons

Hi,
Is there any way to customize (ie. localize) texts for buttons created by createBackMainMenuButtons command?

The method has two Arguments which you can use for that.
https://github.com/EdJoPaTo/grammy-inline-menu/blob/4566012777e8f935bc272b21f86680cb3bfb0b69/source/row-creators/back-main-buttons.ts#L4
const buttonFunction = createBackMainMenuButtons(
  ctx => ctx.t('backbutton'),
  ctx => ctx.t('mainbutton'),
);

I hope this helps

thanks


chore: remove unneeded extra backtick quotes

I won't admit how many times I'd read this warning while working on #2996 before I realised there were these (cosmetic) double backticks 😅

They're intentional, to demarcate a JS property path versus prose words.

ah ok - that doesn't entirely surprise me, but is that a typical thing? I don't think I've ever seen double backquotes used, and meanwhile the sentence starts with a single backquote of a property which is why I decided to open the PR.
Either way no biggie, feel free to close if you want to keep it as is 🙂

ohhh i get it, no, this is indeed just a typo :-) thanks, good catch

sorry I should have included an actual snippet or screenshot 😅


#596 Dump "camera" info should dump information about all options

you may want to rebase on master

you need to rebase against master.


Performance issue on too many popovers ?

Nuxt 3.5.1
"floating-vue": "^2.0.0-beta.24"
I have a table with 200+ rows.. each row has 10 popover-tooltip elements = 2000 tooltips (with dynamic content)
Everything works smooth, until I leave route/page. It takes proportionally longer with number of rows in table (for 200 rows, 5seconds)
If I remove the v-tooltip directives from those elements, the route leaves instantly (as it should) even for 1000 rows.
<div v-for="i in 5" :key="i" class="hero-icon c-pointer" :style="`background-image: url('/images/parser/icons/heroes/64/terrorblade.png`" v-tooltip="{ content: `<b>Terrorblade</b><br><span class='text-gold'>Played by Ruffalo</span>` }" />

I also tried with simple text
v-tooltip="`nnnnn`"

The issue remains. So it's something related to unmount , cleaning process.

I have the same issue. Is there a workaround?

Does it happen with the <Tooltip> component?

Does it happen with the <Tooltip> component?

Yes exactly the same issue

same here, did not found a solution yet


Updated the Title and definitions to align them better with the other guides.

Updated the Title and definitions to align them better with the other guides.

Thanks!


tf.raw_ops.Send/Recv fail within MultiWorkerMirroredStrategy

I want to use tf.raw_ops.Send and tf.raw_ops.Recv to transfer tensor between different machines, but the Recv fails after Send operation is finished.
Here is the error log:
2021-02-20 01:42:11.421182: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
2021-02-20 01:42:11.424571: I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU Frequency:<PHONE_NUMBER> Hz
WARNING:tensorflow:/job:worker/replica:0/task:0 seems down, retrying 1/3
WARNING:tensorflow:/job:worker/replica:0/task:0 seems down, retrying 2/3
ERROR:tensorflow:Cluster check alive failed, /job:worker/replica:0/task:0 is down, aborting collectives: Deadline Exceeded
Additional GRPC error information from remote target /job:worker/replica:0/task:0:
:{"created":"@1613785391.258566931","description":"Deadline Exceeded","file":"external/com_github_grpc_grpc/src/core/ext/filters/deadline/deadline_filter.cc","file_line":69,"grpc_status":4}

And here is my code to reproduce this issue:
def test_multi_worker_mirrored_strategy_send_recv(args):
    # specify cluster resolver
    import os, json

    # set visible gpus
    os.environ['CUDA_VISIBLE_DEVICES']= ""

    # set log leverl
    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1' # 1 show all, 2 for warning and error, 3 for only error

    port = "12345"
    ips = [host1, host2]
    os.environ['TF_CONFIG'] = json.dumps({
        'cluster': { "worker": [ip + ":" + port for ip in ips] },
        "task" : {'type': 'worker', "index": args.task_id}
    })
    resolver = tf.distribute.cluster_resolver.TFConfigClusterResolver()

    # create stratey
    options = tf.distribute.experimental.CommunicationOptions(
        implementation=tf.distribute.experimental.CommunicationImplementation.AUTO)
    strategy = tf.distribute.MultiWorkerMirroredStrategy(resolver, options)

    print("num_accelerators = ", strategy.cluster_resolver.num_accelerators())
    print("task_type = %s, task_id = %s" %(strategy.cluster_resolver.task_type, strategy.cluster_resolver.task_id))

    @tf.function
    def _test_step(task_id):
        send_device = "/job:worker/replica:0/task:0/device:CPU:0"
        recv_device = "/job:worker/replica:0/task:1/device:CPU:0"
        if task_id == 0: # send
            tensor = tf.constant([1.0, 2.0], dtype=tf.float32)
            tf.raw_ops.Send(tensor=tensor,
                            tensor_name="test_send_tensor",
                            send_device=send_device,
                            send_device_incarnation=123,
                            recv_device=recv_device,
                            client_terminated=True)
            print("Send tensor from: ", tensor.device)
        else: # recv
            tensor = tf.raw_ops.Recv(tensor_type=tf.float32,
                                     tensor_name="test_send_tensor",
                                     send_device=send_device,
                                     send_device_incarnation=123,
                                     recv_device=recv_device,
                                     client_terminated=False)
            print("Recv tensor from: ", tensor.device)
        return tensor

    tensor = strategy.run(_test_step, args=(args.task_id,))
    print(tensor)

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='test')
    parser.add_argument('--task_id', type=int,
                        help='specify the task id in Multi Worker Mirrored Strategy cluster.',
                        required=True)
    args = parser.parse_args()

    test_multi_worker_mirrored_strategy_send_recv(args)

This is not supported. With MultiWorkerMirroredStrategy, you only have access to your local devices. Normally people use collective operations like all-reduce and all-gather to communicate between devices.

This is not supported. With MultiWorkerMirroredStrategy, you only have access to your local devices. Normally people use collective operations like all-reduce and all-gather to communicate between devices.

Then what is the mechanism to communicate between remote machines?

Normally people use collective operations like all-reduce and all-gather to communicate between devices.

Normally people use collective operations like all-reduce and all-gather to communicate between devices.

Could you please give an usage example about how to do that between two remote workers?

Normally people use collective operations like all-reduce and all-gather to communicate between devices.

And if I want to do broadcast between those remote workers, what is the option?

It's not supported yet but is on our roadmap. You can try use all-gather for the interim.

OK. Thanks.

Hi,
Thank you for opening this issue. Since this issue has been open for a long time, the code/debug information for this issue may not be relevant with the current state of the code base.
The Tensorflow team is constantly improving the framework by fixing bugs and adding new features. We suggest you try the latest TensorFlow version with the latest compatible hardware configuration which could potentially resolve the issue. If you are still facing the issue, please create a new GitHub issue with your latest findings, with all the debugging information which could help us investigate.
Please follow the release notes to stay up to date with the latest developments which are happening in the Tensorflow space.


feat: winston plugin

Which problem is this PR solving?

Fixes #707

Short description of the changes

It adds auto instrumentation for winston logger

I agree that it automatically instrumenting the logger is questionable.
It's easy enough to add a formatter.
https://github.com/open-telemetry/opentelemetry-js/issues/707#issuecomment-602996525

@pauldraper this PR has been dormant for quite some time now due to the beta push, but I believe the resolution was that @obecny's company is going to host plugins like these in their own repos. Users can enable them if they want.

this seems to be outdated and unwanted, might be hosted somewhere else, closing


Add setting to hide netcore installation prompt

Fixes https://github.com/microsoft/azuredatastudio/issues/15247 by adding a "Don't ask again" option to not prompt the user to install .NET core if it's not found.
However, adding a third button causes everything to get truncated:

Thoughts?

Pull Request Test Coverage Report for Build 840655808

4 of 8 (50.0%)  changed or added relevant lines in 1 file are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage decreased (-0.002%) to 43.533%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

extensions/sql-database-projects/src/tools/netcoreTool.ts
4
8
50.0%

Files with Coverage Reduction
New Missed Lines
%

extensions/sql-database-projects/src/tools/netcoreTool.ts
1
56.41%

Totals

Change from base Build 840396184:
-0.002%

Covered Lines:
26521

Relevant Lines:
55436

💛  - Coveralls

What about Update location Install and Don't ask again as the options?

Yup, that's pretty much what I was thinking.  Any additional definition can be (/is already) done in the text above.

I think a lot of times the "Don't Show Again" is a menu item that is available from the Gear icon.  You could consider that if the buttons are too crowded.


Make lwAFTR independent of NIC driver

This branch builds on #949 by making the lwaftr NIC-independent (based on work by @teknico and @takikawa).
I thought it might be a good idea to base the main patches on wingo-next instead of lwaftr so that if we switched wingo-next over to intel_mp, that wouldn't cause problems on upstream's lwaftr CI.  So that's what I did.  However of course when merging that upstream branch there were a couple of conflicts, resolved in the merge.  Anyway, should be no functional change.  I have tested with a bump-in-the-wire "lwaftr run" and loadtest.

This PR also removes "snabb lwaftr transient", which is an old version of "snabb lwaftr loadtest"; loadtest completely replaces it.


get tap coordinates

How can we get the tap coordinates?

Right now getting tap coordinates isn't possible through the package. What is the scenario you are thinking about? You could just use a GestureDetector to get the tap coordinates.


Characters are being counted as words

Characters are being counted as words.
Dash, question mark, exclamation, all count as words.
I write in Portuguese, and here we use a dash (—) separated from the words, so it counts as a word.
Example:
—  Oi, tudo bem? (3 words)

I understand it's not an urgent “bug,” but in my language, it changes the count quite a bit.

Thanks for raising. Could you provide an example where question mark and exclamation mark are being counted as additional words? Are they being counted where there is a space between the word and the character?

Could you provide an example where question mark and exclamation mark are being counted as additional words? Are they being counted where there is a space between the word and the character?

Yes! When they are separated by space, they are counted. So, the biggest problem is the dash :)

What about these examples?
— Ei, você está bem? Qual seu nome? – pergunta o enfermeiro. (10 words?)
— Em que posso ajudá-la, Maria? (5 words?)

What about these examples?

It appears as 12 words and 6 words, instead of 10 & 5.
In fact, only the dash is counted as words in these examples.

The “Better Word Count” plugin makes the correct count. I use it in Obsidian because of this.

Should be fixed in 0.8.3

It worked! Thank you!! <3


Changing VMware.WorkstationPro version 16.1.1

[x] Have you signed the Contributor License Agreement?
[x] Have you checked that there aren't other open pull requests for the same manifest update/change?

[x] Does your manifest conform to the 1.0 schema?

Note: <path> is the name of the directory containing the manifest you're submitting.

Microsoft Reviewers: Open in CodeFlow

Looks like validation has been stopped for a while.
Also winget isn't working

@KaranKad this was due to an upgrade of the pipelines, and a rebuild of the PreIndexed package. We're looking at a way to eliminate the temporary outage caused when this happens. It was part of publishing the duplicate hash check feature. We've got one more PR to merge on the back end, and then we will enable the feature. You should see "Possible-Duplicate" tag added to PRs when we detect a duplicate "InstallerSha256" one this is fully implemented.

@denelon Any reason why some of my PRs are stuck on the Installer check? Some of them went through, but these appear to be stuck. I tried rerunning them myself by closing and opening the PR, but it still gets stuck.
#18327
#18332
#18334
#18425
#18421

Seems like the 5 PRs that I mentioned above are still stuck, I'll try to close them and open new ones.


chore: rename project to Powertools for AWS Lambda (TypeScript)

Description of your changes

Found and replaced references of the old name to the new one: Powertools for AWS Lambda (TypeScript)
Related issues, RFCs

Issue number: #1471
Checklist

[X] My changes meet the tenets criteria
[X] I have performed a self-review of my own code
[X] I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
[X] I have made corresponding changes to the documentation
[X] My changes generate no new warnings
[X] I have added tests that prove my change is effective and works
[X] The PR title follows the conventional commit semantics

Breaking change checklist
Is it a breaking change?: NO

[ ] I have documented the migration process
[ ] I have added, implemented necessary warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

I agree with the docs/we_made_this.md file, I'll revert it.


Use influxdb 2.18 as in Camel 3.3.0

Not easy because influxdb-java 2.18 brings a major upgrade to okhttp3 4.5.0 that need some work on our (or maybe Quarkus) side.

okhttp3 3.x is used by Kuberenetes client.


Error in 1.0 + massive lag

Posted > a month ago on the mod discussion page @ https://mods.factorio.com/mod/Orbital Ion Cannon/discussion/5f4c9240baee241b82382060 :
I've added the Ion cannon mod to my server and noticed that once I researched the tech finally, there was a noticeable lag. Looking at the server console, I see nothing but this spammed constantly:
1159.771 Script @stdlib/stdlib/area/chunk.lua:38: WARNING: Area for Position not found in package.loaded
Removing the Ion Cannon mod eliminates this error from spamming the console. Also, while this is spammed, I cannot connect to my server. Removing the mod (which removes the ion cannons and the tech from the save) makes it where I can connect again. Adding the mod back adds about a 7 second lag while I'm connected versus not having the mod. Researching the tech again makes the error show in massive amounts and increases lag substantially. Before re-researching the tech, I did cheat in 10 or so ion cannons pre-tech and the error did not show in the console and there did not seem to be a lag difference having the cannons pre-tech-researched. (Of course, I did not have a targeting device nor was auto-targeting researched at this point...)

Can you upload save and exact mods?


STRUCTURE - Where to store static data?

Sorry if this is covered in the docs, but I can't seem to find/work it out.
If I have a large, unchanging array of constants, where do I store this in the Bulletproof React structure? For example, a large list of options for a select menu that is used in several places throughout the app (so not appropriate to co-locate with the select component).

The best way is to create a constants folder in src folder and there you create a file like options.ts.
interface Foo {
    [key: string]: string;
 }
export const ErrorMessage: Foo = {
    "user-not-found": "User with this email not found!",
    "invalid-credentials": "Incorrect password!",
    "invalid-role-user": "Invalid role! You are not a user",
    "invalid-role-admin": "Invalid role! You are not an admin"
}


dsa and oauth updates

OPS Build status updates of commit 078576f:
:clock10: Preparing: average preparing time is 1 min(s) 2 sec(s)

OPS Build status updates of commit 078576f:
:clock10: Incremental building: average incremental building time is 33 sec(s)

OPS Build status updates of commit 078576f:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

BingAds/bingads-12/bulk-service/dynamic-search-ad.md
:white_check_mark:Succeeded

BingAds/bingads-12/campaign-management-service/dynamicsearchad.md
:white_check_mark:Succeeded

BingAds/bingads-12/guides/authentication-oauth.md
:white_check_mark:Succeeded

BingAds/bingads-12/guides/dynamic-search-ads.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


_LOAD_BALANCING_LOSS returns empty list sometimes

Hello, I am using Eleuther AI's gpt-neox implementation with megablocks, but I get 2 errors related to the _LOAD_BALANCING_LOSS.

the tokens_per_expert gives me this error at this line.  ValueError: Expected 14 token_per_experts but found 7.  Here's the stack trace.

  File "/home/etnguyen/test/savanna/train.py", line 10, in <module>                                                                                [53/1963]
    pretrain(global_config=global_config)
  File "/home/etnguyen/test/savanna/savanna/training.py", line 228, in pretrain
    iteration = train(
                ^^^^^^
  File "/home/etnguyen/test/savanna/savanna/training.py", line 1004, in train
    loss_dict, skipped_iter = train_step(
                              ^^^^^^^^^^^
  File "/home/etnguyen/test/savanna/savanna/training.py", line 919, in train_step
    loss = forward_step(
           ^^^^^^^^^^^^^
  File "/home/etnguyen/test/savanna/savanna/training.py", line 515, in forward_step
    moe_loss = mb_moe_loss_func(global_config, loss_mask, outputs)[0]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/etnguyen/test/savanna/savanna/training.py", line 464, in mb_moe_loss_func
    lbl = moe.batched_load_balancing_loss(megablocks_args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/etnguyen/.local/lib/python3.11/site-packages/megablocks/layers/moe.py", line 43, in batched_load_balancing_loss
    raise ValueError(
ValueError: Expected 14 token_per_experts but found 7.
num_layers = 14
pipeline_model_parallel_size = 1
num_layers_per_virtual_pipeline_stage = None

I get this error when the expert_interval=2, ie when the default value is used, and so the number of experts is actually half the number of layers (14 layers, 7 Megablocks layers used). This error gets fixed when I set the expert_interval=1 so that there are 14 Megablocks, and 14 layers.  But I don't know the root cause of this discrepancy, especially if I want to change the expert_interval and number of Megablocks to every other layer.

The second issue is, let's say I do use expert_interval=1 to get around the issue above, so every layer uses a Megablock, then my next error I get is that the return value of get_load_balancing_loss occasionally returns an empty list, which then errors out, meaning the _LOAD_BALANCING_LOSS is an empty list.  Critically, this happens part way through training, like 30 secs in, so some batches it's fine and returns the expected losses.

Does this sound familiar to anybody?  I'd very much appreciate any insights, thank you!

Can you double check num_layers is appropriately passed in Arguments to dmoe/moe when expert_interval=2? It should be equal to 7.
Hm... I'm a little less sure since I'm not as familiar with Eleuther's harness. You can check out an example with LLMFoundry here if helpful. I'm not sure what's going on here... it should save every time you do a forward pass 🤔. Could you ensure it is in train mode? If the model is in eval mode, it won't save LBL loss, and then if you try to backprop it will error


Update testing docs for RTM

@danroth27

Instead of replicating the unit testing link in multiple places you should just define a link target in one doc and then reuse it, like this:
Some text about `Unit testing`_.

.. _Unit testing: .. https://docs.microsoft.com/en-us/dotnet/articles/core/testing/unit-testing-with-dotnet-test

It looks like this won't work for the TOC entry though, so you'll still have to inline the link in the index.rst file.

@danroth27

@danroth27

@danroth27  ok now it's sorted out

:shipit:

bfe9e0a7983c4025ea0256490806ea0a82c401f4


#3 Add simple CI.

https://github.com/input-output-hk/cardano-shell/issues/3
Adding simple BuildKite CI.

Am I missing something or are they really all different?

./cabal list --installed
stack ls dependencies
nix-shell release.nix --run 'ghc-pkg list' | grep universum

There are three situations where I really have no clue what's happening.

This fails for me - haskell.lib.buildStackProject { ... }, changing the shell to the one we had before simply doesn't  work.
Try finding universum with nix-shell release.nix --run 'ghc-pkg list'.
Try switching to Stack, change the Universum to 1.3.0 in the release.nix and rebuild. After that, try stack ls dependencies. What is the version? 1.2.0! But it uses Nix, or at least it should.

Requested a review from DevOps since I don't know if this is sensible.

CI works correctly, removed old nix files.


justfile + pre-commit-config.yaml interaction -- just treating staged files as recipe names

#pre-commit-config.yaml
repos:
-   repo: local
    hooks:
    -   id: flake8
        name: flake8
        entry: just flake8
        language: system
        types_or: [python, flake8]

#justfile
flake8:
		poetry run flake8

When running pre-commit run flake8 the output is:
pre-commit run flake8
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

error: Justfile does not contain recipe `src/application/hello_world.py`.

The expected behavior is for just to parse the file path of the staged file as an argument to be passed to flake8, not as a separate recipe.
I have moved from using this setup with a Makefile and so I'm sure I've missed something in the docs about passing arguments to recipes, but any help would be greatly appreciated.

Here's how to give the flake8 recipe an argument:
flake8 file:
		poetry run flake8 {{file}}

Let me know if that works!

Hi @casey,
I do find myself in the same situation described above (https://github.com/casey/just/discussions/1984 for reference).
As I just found this issue, I've tried to modify both the justfile and the pre-commit-config.yaml as per your indication with no luck.
Plus, given that within my github action workflow the following works without the need to provide recipes with arguments
  - name: Setup just
    uses: taiki-e/install-action@just

  - name: Enforce code style (Ruff)
    run: just ruff-show-violations

  - name: Verify code formatting (Ruff)
    run: just ruff-format-check

  - name: Run tests
    run: just test

I was wondering which should be go-to procedure to reference files via just commands.
Thank you!:)
justfile
help:
  @just --list

install:
  @echo "🚀 Installing dependencies"
  @poetry install --with dev

install-pre-commit:
  @echo "🚀 Setting up the hooks"
  @poetry run pre-commit install

check-project:
  @echo "🚀 Checking consistency between poetry.lock and pyproject.toml"
  @poetry check --lock
  @echo "🚀 Running the hooks against all files"
  @poetry run pre-commit run --all-files

ruff:
  @echo "🚀 Linting the project with Ruff"
  @poetry run ruff check .

ruff-show-violations:
  @echo "🚀 Linting the project with Ruff and show violations"
  @poetry run ruff check --output-format="grouped" .

ruff-fix:
  @echo "🚀 Linting the project with Ruff and autofix violations (where possible)"
  @poetry run ruff check --fix .

ruff-format:
  @echo "🚀 Formatting the code with Ruff"
  @poetry run ruff format .

ruff-format-check:
  @echo "🚀 Listing files Ruff would reformat"
  @poetry run ruff format --check .

lint-and-format: ruff-fix ruff-format

test:
  @echo "🚀 Testing code with pytest"
  @poetry run pytest --verbose tests

.pre-commit-config.yaml
default_language_version:
  python: python3.10

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.4.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-toml
  - repo: local
    hooks:
      - id: ruff-lint
        name: ruff (linter)
        entry: just ruff-fix
        language: system
        types: [python]
      - id: ruff-format
        name: ruff (formatter)
        entry: just ruff-format
        language: system
        types: [python]

I don't think I understand the issue.
If you want to pass a file to a recipe, you can give that recipe an argument:
check file:
  ./run/check {{file}}

And then call:
$ just check path/to/file

Let me know if I'm missing something!


[Windows] Occasional crash on startup

Occasional crash on startup, likely caused by the get_info function on the libfmod dsp. Investigation ongoing.
Does not occur on Linux.

Fixed with the latest libfmod version


nth fibonacci term using matrix.

This program calculates the nth fibonacci term using matrix method with O(logn) time.

Please star this repository to show your support, in the meantime I am reviewing your code.

Hey, have you reviewed this PR?

Can you review this one also?


Add back updated project scaffolds

Description
Adds back project scaffolds that were migrated to Cadence v1.0. This is in draft, since the dependant PRs haven't been merged yet, so the commit hash is not yet known.
Depends on:

https://github.com/sideninja/flow-basic-scaffold/pull/2
https://github.com/nvdtf/flow-nft-scaffold/pull/6

For contributor use:

[ ] Targeted PR against master branch
[ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work
[ ] Code follows the standards mentioned here
[ ] Updated relevant documentation
[ ] Re-reviewed Files changed in the Github PR explorer
[ ] Added appropriate labels

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 29.48%. Comparing base (d49c4cf) to head (04f5643).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1729   +/-   ##
=======================================
  Coverage   29.48%   29.48%
=======================================
  Files          88       88
  Lines        5166     5166
=======================================
  Hits         1523     1523
  Misses       3456     3456
  Partials      187      187

Flag
Coverage Δ

unittests
29.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Parameter 'toolPath' cannot be null or empty.

@xutpuu commented on Feb 28, 2019, 12:57 PM UTC:
I add Python task and wrote inline script to run on self-hosted pool. In the build it failed with error "Parameter 'toolPath' cannot be null or empty." I tried to add tool "Use Python Version" but I can't undetstand where I should add $AGENT_TOOLSDIRECTORY.
I installed Python on build machine and added python to PATH.

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

ID: 1eeb2956-beca-447d-c9a6-a859f3cfc4bf
Version Independent ID: 89f2a014-99bb-420d-265c-42515d30c80b
Content: Python Script task - Azure Pipelines
Content Source: docs/pipelines/tasks/utility/python-script.md
Product: devops
GitHub Login: steved0x
Microsoft Alias: brcrista

This issue was moved by davidstaheli from MicrosoftDocs/vsts-docs#3514.

We use mariner image in our pipeline and this issue came up adding pythonInterpreter: '/usr/bin/python3' resolved it.

I used mariner and adding pythonInterpreter: '/usr/bin/python3' really helps.


change label archived to unavailable [PEOPLE-25]

In teams tab when user is archived label should state unavailable instead of archived

Looks fine :+1:


Anybody got a simple map?

Hey,
I'm searching for a map as simple as possible, preferably only with one lane, just some curves and straights. The setup for building an own map is quite difficult so maybe anyone has map they could send me.
Best regards,
Jakob

Hi Everybody!
Here I Shared 2 Maps recently!
https://github.com/carla-simulator/carla/discussions/7181


Add new clock app - Weather Clock

Weather Clock is a clock face which displays the current weather conditions using the data from Gadgetbridge and the weather app. I have tested on my bangle.js 2.

Nice - thanks! Do you think this would work on Bangle.js 1 as well? Or should we just tag it as Bangle.js 2 only?

I don't have a Bangle 1 to test on so not sure. I have used the layout library which should be compatible but someone actually already opened an issue about it not working on Bangle.js 1:
https://github.com/espruino/BangleApps/issues/1012


Dynamically loading second-level Marktplaats categories

Hi!
I want to follow up on this issue: https://github.com/RSS-Bridge/rss-bridge/issues/3613
Which was partly resolved in this pull request: https://github.com/RSS-Bridge/rss-bridge/pull/3761
There's two levels of categories: L1 and L2.
There's just a few L1 categories, but every one of those has a ton of L2 categories.
Hardcoding the L1 categories is fine but there's too many L2 categories to hardcode those too.
Perhaps these can be dynamically loaded though?
L2 categories are returned with a GET request to https://www.marktplaats.nl/lrp/api/search?l1CategoryId=1744 and can be searched using https://www.marktplaats.nl/lrp/api/search?l1CategoryId=1744&l2CategoryId=1745

dynamically loaded is possible but dont like it.
can we please just have two textboxes for the category numbers? or herhaps for the subcategory?
also i might be overreacting but the frontpage have very much html and loads badly for slower devices.
also annoying to scroll through a gigantic <select>.
the html standards do have an autocomplete option for `<input type=text'> but that would require rssbridge core modification.

dynamically loaded is possible but dont like it.
can we please just have two textboxes for the category numbers? or herhaps for the subcategory?
also i might be overreacting but the frontpage have very much html and loads badly for slower devices.
also annoying to scroll through a gigantic <select>.
the html standards do have an autocomplete option for `<input type=text'> but that would require rssbridge core modification.

Way less annoying to scroll through a gigantic <select> than having to check the ID of a certain category every time. The categories are in alphabetical order so not too hard to find one.
Why do you not like dynamically loading them? Then you'd have two <select>s, one with the main categories, and when you select one there it'll load the sub categories into the second <select>. I see this as being the best possible solution. (And Marktplaats themselves do it in a similar way too: first you select a main category, then you search, and then you can choose a subcategory of the  chosen main category with that same select box)

Something like https://select2.org/ or https://dselect.vercel.app/ would be very nice to have as a option. But it would require some JS libraries. It should not slow the loading of the page that much. Maybe the first time when the libraries are loaded. But after that only when u use it.
In case of Marktplaats it could even integrate both levels. So it only requires one select with a search.

how is the current solution working out without the convenience of a second-level cat?

For me it does not matter that much but for users that are less aware of the technical stuff it would be hard i guess.

how is the current solution working out without the convenience of a second-level cat?

I've made a version of my own using hard coded categories. Haven't used marktplaats recently though, only to sell stuff. But when I will have to look for something again I will use that.
Even if you have the knowledge of how to get the category id's it's very nice to be able to get it directly if you search in different categories each time, so you don't have to get the id manually each time.


Word Segmentation

Hi,
I couldn't manage to access the correctedString and segmentedString fields of Word Segmentation, so I locally changed them to public fields and now it works.
Not sure if that's the correct way of doing it though?
Thanks for the port!

Hi, I'll look into this sometime soon.
Sounds weird, looking at the code it seems that you're correct. I can't recall exactly how I tested it anymore.. Perhaps it was local testing within the file.
I'll get back to you but good that you managed to fix it in the meantime!

Thank you for the reply, if it helps I can submit a merge request

Let's do that! @Tyruiop


Unable to upload image asset (as Blob) from NextJS Route Handler

When trying to upload an image as Blob using the client.assets.upload method inside the Nextjs 13 Route Handler, the method throws error:
Error: Request body must be a string, buffer or stream, got object
    at httpRequester (webpack-internal:///(sc_server)/./node_modules/get-it/dist/index.cjs:468:15)
    at Object.eval (webpack-internal:///(sc_server)/./node_modules/get-it/dist/index.cjs:134:30)
    at Object.publish (webpack-internal:///(sc_server)/./node_modules/get-it/dist/index.cjs:80:28)
    at Observable.eval [as _subscribe] (webpack-internal:///(sc_server)/./node_modules/get-it/dist/middleware.cjs:311:34)
    at Observable._trySubscribe (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:36:25)
    at eval (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:30:121)
    at Object.errorContext (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/util/errorContext.js:26:9)
    at Observable.subscribe (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:28:24)
    at Observable.eval [as _subscribe] (webpack-internal:///(sc_server)/./node_modules/@sanity/client/dist/index.cjs:815:51)
    at Observable._trySubscribe (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:36:25)
    at eval (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:30:121)
    at Object.errorContext (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/util/errorContext.js:26:9)
    at Observable.subscribe (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:28:24)
    at eval (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/operators/filter.js:11:16)
    at OperatorSubscriber.eval (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/util/lift.js:16:28)
    at eval (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:30:48)
    at Object.errorContext (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/util/errorContext.js:26:9)
    at Observable.subscribe (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:28:24)
    at eval (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/operators/map.js:11:16)
    at SafeSubscriber.eval (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/util/lift.js:16:28)
    at eval (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:30:48)
    at Object.errorContext (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/util/errorContext.js:26:9)
    at Observable.subscribe (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/Observable.js:28:24)
    at eval (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/lastValueFrom.js:12:16)
    at new Promise (<anonymous>)
    at Object.lastValueFrom (webpack-internal:///(sc_server)/./node_modules/rxjs/dist/cjs/internal/lastValueFrom.js:9:12)
    at AssetsClient.upload (webpack-internal:///(sc_server)/./node_modules/@sanity/client/dist/index.cjs:901:21)

The code is as following:
import { createClient } from '@sanity/client';
const client = createClient({
  projectId: 'sdfsd',
  dataset: 'sdfdsf,
  apiVersion: '2023-02-23',
  useCdn: false,
  token: process.env.SANITY_TOKEN,
});

The route handler file /app/api/myform/route.ts
import { type NextRequest, NextResponse } from 'next/server';
export const dynamic = 'force-dynamic';

export async function POST(req: NextRequest) {
   const form = await req.formData();
   const file = form.get('file') as Blob;

   if (!file) {
      return new NextResponse('Bad request', { status: 400 });
   }

   await client.assets.upload('image', file, { filename: 'image'});
   return NextResponse.json({});
}

I checked that the blob is valid and has the proper image file.
I guess the get-it package under the hood always expects Nodejs type of body (not the browser/Web API)
There is a duplicate issue submitted for the same problem on next-sanity repo https://github.com/sanity-io/next-sanity/issues/348

Hi there, i am facing the same issue, i am using pdfMake to spill out the blob and sending it as part of the client's upload function throws the same error:
Upload failed: Error: Request body must be a string, buffer or stream, got object
const invoiceTemplateData = await getInvoiceTemplate(result.invoice.uniqueReferenceNumber);
                const invoiceJson = JSON.parse(invoiceTemplateData);
                const pdf = pdfMake.createPdf(invoiceJson.data);
                pdf.getBlob((blob) => {
                    createClient.assets
                        .upload('file', blob, {
                            filename: `${customer?.name} - ${result.invoice.uniqueReferenceNumber}.pdf`,
                            title: `${customer?.name} - ${result.invoice.uniqueReferenceNumber}`
                        }).then((document) => {
                            console.log('====================================')
                            console.log('The file was uploaded!', document)
                            console.log('====================================')
                        })
                        .catch((error) => {
                            console.log('====================================')
                            console.error('Upload failed:', error)
                            console.log('====================================')
                        })
                });

It says body can contain string, but when i send a string part of the body, it says function can't accept string.
Did you manage to solve this? Mind sharing how you solve this problem? Thanks.

I did not solve the problem and I don't think I can.
This should be fixed by Sanity team or whoever maintains the javascript library.
I am surprised they state the library is "Edge" compatible in the docs but it is not true.
More disappointing is the fact that this issue is open for three weeks already but there was not a single comment yet whether there is any plan to address it.
With Next 13 released almost half a year ago and "Edge" growing rapidly, this is concerning.

Hi there,
Ya, I also got frustrated, anyhow, I managed to get it work with below approach, not sure if this will help you.
I first get the base64 string, since i use pdfMake, i can convert to buffer as below:
pdf.getBase64((base64) => {
const bufferValue = Buffer.from(base64, "base64"); // this will get the buffer value, then can be passed to the upload function.
});

Let me know if it works for you. :)

Hi 👋
Will follow up here: https://github.com/sanity-io/client/pull/176

It might be addressed by #176, but I'll guess it probably won't since I can see it's loading the ./dist/middleware.browser.cjs file.
With edge-light it should change to ./dist/middleware.browser.js but the only difference between the two are ESM versus CJS syntax.
As long as it's a middleware.browser file it's supposed to be free of any of the node globals 🤔
You can test this before #176 lands though by npm install get-it to force update to v8.1.0 so you'll get the edge-light fix.

I'm perplexed, I can't find any 'buffer' reference in here<EMAIL_ADDRESS>or here<EMAIL_ADDRESS>🤔  🤔
Can you show me what line 162 and its surroundings looks like @benderillo ?

Here is an excerpt of contents of the middleware.browser.cjs
function injectResponse() { // **<== LINE 138**
  let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  if (typeof opts.inject !== "function") {
    throw new Error("`injectResponse` middleware requires a `inject` function");
  }
  function inject(prevValue, event) {
    const response = opts.inject(event, prevValue);
    if (!response) {
      return prevValue;
    }
    const options = event.context.options;
    return Object.assign({}, {
      body: "",
      url: options.url,
      method: options.method,
      headers: {},
      statusCode: 200,
      statusMessage: "OK"
    }, response);
  }
  return {
    interceptRequest: inject
  };
}
const isBuffer = typeof Buffer === "undefined" ? () => false : obj => Buffer.isBuffer(obj);   // **<=== LINE 162**
const serializeTypes = ["boolean", "string", "number"];
function jsonRequest() {
  return {
    processOptions: options => {
      const body = options.body;
      if (!body) {
        return options;
      }
      const isStream = typeof body.pipe === "function";
      const shouldSerialize = !isStream && !isBuffer(body) && (serializeTypes.indexOf(typeof body) !== -1 || Array.isArray(body) || isPlainObject.isPlainObject(body));
      if (!shouldSerialize) {
        return options;
      }
      return Object.assign({}, options, {
        body: JSON.stringify(options.body),
        headers: Object.assign({}, options.headers, {
          "Content-Type": "application/json"
        })
      });
    }
  };
} // **<== line 184**

Here is the version info from yarn.lock
get-it@^8:
  version "8.0.11"
  resolved "https://registry.yarnpkg.com/get-it/-/get-it-8.0.11.tgz#c489c46eba3e7b94e411e4e831ae34696662086c"
  integrity sha512-x7AlRWAWJKDve52Sk9Nkki1Ne9TwH2cZ4KknCswya88nM6IGoK/kDKv+FKAzBZ1QzhZGqTaqb+qzrectzYdTHw==
  dependencies:
    debug "^4.3.4"
    decompress-response "^7.0.0"
    follow-redirects "^1.15.2"
    into-stream "^6.0.0"
    is-plain-object "^5.0.0"
    is-retry-allowed "^2.2.0"
    is-stream "^2.0.1"
    parse-headers "^2.0.5"
    progress-stream "^2.0.0"
    tunnel-agent "^0.6.0"

"<EMAIL_ADDRESS>  version "5.3.0"
  resolved<EMAIL_ADDRESS>  integrity sha512-GUu33gDy5Lx9FNyRGeRNrn2ZYNNthn3Qj2y4GPtb3MkdUtdWHKXmCi3S7nqusTshwS0Uz/w+wX9/h5Nbq9iofg==
  dependencies:
    "@sanity/eventsource" "^4"
    get-it "^8"
    rxjs "^7"

@benderillo yeah I can see a reference to the Buffer global sure, but that alone shouldn't trigger the error you're seeing.
I would expect that error if we were doing something like:
import Buffer from 'buffer'

anywhere in the code we're shipping. Which means there's something happening in the NextJS pipeline that attempts to polyfill Buffer even though it's unnecessary 🤔

We have shipped #176 https://github.com/sanity-io/client/releases/tag/v5.4.0 and perhaps it's enough to trigger the right behavior in the Edge runtime 🙇

I think the issue occurs mainly because you're using FormData. Maybe, it's changing the metadata somehow. I tried many ways to solve this and finally got one.
// Next JS Frontend
export default function App() {
  const handleChange = async (e: ChangeEvent<HTMLInputElement>) => {
    if (e.target.files) {
      const file = e.target.files[0];
      try {
        const imageBuffer = await file.arrayBuffer();
        const response = await fetch("/api/uploadImage", {
          method: "POST",
          body: imageBuffer,
        });
        const {_id} = await response.json();
        console.log(_id);
      } catch (error) {
        console.log(error);
      }
    }
  };

  return (

      <input onChange={handleChange} type="file" id="image" />

  );
}

So, in the frontend we are sending the data as ArrayBuffer. But here comes another issue, if the file size is too large, you can't access the whole buffer on the api EndPoint. So, I had to take help of getRawBody module. Also, don't forget to disable the default JSON parser.
// Api EndPoint
import type { NextApiRequest, NextApiResponse } from "next";
import { client } from "../../../lib/client";
import getRawBody from "raw-body";

type Data = {
  _id: string;
};

type Error = {
  error: string;
};

export const config = {
  api: {
    bodyParser: false,
  },
};

export default async function handler(
  req: NextApiRequest,
  res: NextApiResponse<Data | Error>
) {
  const requestBuffer = await getRawBody(req);

  try {
    const { _id } = await client.assets.upload("image", requestBuffer);
    res.status(200).json({ _id });
  } catch (error) {
    if (error instanceof Error) {
      console.log(error.message);
      res.status(400).json({ error: error.message });
    }
  }
}

@am79041 your comment is off-topic.
The issue is specifically about using Blob as an input to client.assets.upload().
First of all, suggesting to use stream instead is like saying "well don't use it the way you do" instead of fixing it.
Secondly, the issue is about using this API in Route Handler. Route handlers do not have NodeJs types (including NodeJs Streams) hence the Blob and form data are used.
Please refrain from posting irrelevant code and comments because it distracts anyone later reading through the thread if they come across this issue.

@benderillo You're saying route handlers don't have Nodejs runtime. I'll suggest you to go through the docs before commenting anything.
https://beta.nextjs.org/docs/routing/route-handlers#edge-and-nodejs-runtimes.

Route handlers do  have req.arrayBuffer() to read the arrayBuffer. So, you can still POST the data as an arrayBuffer from client.
Here how can you do that.
import { NextRequest, NextResponse } from "next/server";
import { client } from "../../../../lib/client";

export async function POST(req: NextRequest) {
  const requestBuffer = (await req.arrayBuffer()) as ArrayBuffer;
  const response = await client.assets.upload(
    "image",
    Buffer.from(requestBuffer)
  );

  return NextResponse.json(response);
}

Now coming to your main issue. You can't upload the file which you POST through formData from the client. I'll say it has nothing to do with @sanity/client itself. I can't say how route handler's await req.formData() is parsing the data. I tried uploading the formData file directly from the client and I got success. But got the same issue when tried your example.
//uploading data directly from the client
export default function App() {
  const handleChange = async (e: ChangeEvent<HTMLInputElement>) => {
    if (e.target.files) {
      const file = e.target.files[0];
      try {
        const form = new FormData();
        form.append("file", file);
        const imageFile = form.get("file") as Blob;

        const response = await localClient.assets.upload("image", imageFile);
        console.log(response);
      } catch (error) {
        console.log(error);
      }
    }
  };

  return (

      <input onChange={handleChange} type="file" id="image" />

  );
}

** Uploading assets from client side will expose the Bearer token on the browser.
I will suggest you to ask someone from NextJs community to get your answers.

@benderillo and @am79041: I sense some frustration on both sides in your interaction above here. While we’re trying to figure out what’s going on and hopefully be able to help, I ask you to consider that other folks are reading this thread as well and that kindness goes a long way. Thanks for understanding!

Just a quick update, we're tracking this issue as part of a larger problem in get-it where it's not supporting web idl features like FormData, File, ArrayBuffer and Blob when using the node env.  Beyond next we've seen this affect astro users and others.
A possible workaround, while we look into this and work on a proper fix, is to use edge, deno or cloudflare-worker runtimes as get-it will in those runtimes defer to the global fetch API just like on browsers with how to handle the request body formats.


MoM Sanctum of Twilight : Floating Tiles

For Mansions of Madness, the floats tiles are supposed to overlap street tiles without covering spaces of the board entirely, but it is impossible to do in Valkyrie due to the grid in which the tiles snap.
Is there a way to do it, or is it a feature that is yet to be added in Valkyrie?
I couldn't find an other post related to that issue.
Valkyrie 2.0.1

Don't use the grid, use free positioning. Look to the "Position" button.

I cannot find any free positioning button for tiles, unlike tokens.

I can add a free place button to tiles. To do this without the editor you can open the .ini file and directly edit the X and Y positions.

I added it in https://github.com/NPBruce/valkyrie/pull/835

Pull request for development branch https://github.com/NPBruce/valkyrie/pull/837

Thanks @redwolf2 .