"LocalFileSystem.ListDirectory error: Not a directory" in some tests

[----------] 3 tests from SparsePageDMatrix
[ RUN      ] SparsePageDMatrix.MetaInfo
unknown file: Failure
C++ exception with description "[20:30:01] ****/xgboost/dmlc-core/src/io/local_filesys.cc:91: LocalFileSystem.ListDirectory  error: Not a directory" thrown in the test body.
[  FAILED  ] SparsePageDMatrix.MetaInfo (0 ms)
[ RUN      ] SparsePageDMatrix.RowAccess
unknown file: Failure
C++ exception with description "[20:30:01] ****/xgboost/dmlc-core/src/io/local_filesys.cc:91: LocalFileSystem.ListDirectory  error: Not a directory" thrown in the test body.
[  FAILED  ] SparsePageDMatrix.RowAccess (16 ms)
[ RUN      ] SparsePageDMatrix.ColAccess
unknown file: Failure
C++ exception with description "[20:30:01] ****/xgboost/dmlc-core/src/io/local_filesys.cc:91: LocalFileSystem.ListDirectory  error: Not a directory" thrown in the test body.
[  FAILED  ] SparsePageDMatrix.ColAccess (16 ms)
[----------] 3 tests from SparsePageDMatrix (32 ms total)

[----------] 3 tests from SimpleDMatrix
[ RUN      ] SimpleDMatrix.MetaInfo
unknown file: Failure
C++ exception with description "[20:30:01] ****/xgboost/dmlc-core/src/io/local_filesys.cc:91: LocalFileSystem.ListDirectory  error: Not a directory" thrown in the test body.
[  FAILED  ] SimpleDMatrix.MetaInfo (0 ms)
[ RUN      ] SimpleDMatrix.RowAccess
unknown file: Failure
C++ exception with description "[20:30:01] ****/xgboost/dmlc-core/src/io/local_filesys.cc:91: LocalFileSystem.ListDirectory  error: Not a directory" thrown in the test body.
[  FAILED  ] SimpleDMatrix.RowAccess (15 ms)
[ RUN      ] SimpleDMatrix.ColAccessWithoutBatches
unknown file: Failure
C++ exception with description "[20:30:01] ****/xgboost/dmlc-core/src/io/local_filesys.cc:91: LocalFileSystem.ListDirectory  error: Not a directory" thrown in the test body.
[  FAILED  ] SimpleDMatrix.ColAccessWithoutBatches (0 ms)
[----------] 3 tests from SimpleDMatrix (15 ms total)

[----------] 1 test from SimpleCSRSource
[ RUN      ] SimpleCSRSource.SaveLoadBinary
unknown file: Failure
C++ exception with description "[20:30:01] ****/xgboost/dmlc-core/src/io/local_filesys.cc:91: LocalFileSystem.ListDirectory  error: Not a directory" thrown in the test body.
[  FAILED  ] SimpleCSRSource.SaveLoadBinary (16 ms)
[----------] 1 test from SimpleCSRSource (16 ms total)

[ RUN      ] MetaInfo.LoadQid
unknown file: Failure
C++ exception with description "[20:30:01] ****/xgboost/dmlc-core/src/io/local_filesys.cc:91: LocalFileSystem.ListDirectory  error: Not a directory" thrown in the test body.
[  FAILED  ] MetaInfo.LoadQid (0 ms)
[----------] 3 tests from MetaInfo (0 ms total)

Compiled with the latest MinGW-W64, the OS is 32 bit Windows 7.

By any chance, have you observed this error in other OS?

@hcho, not tried

@KOLANICH Got it. Let me try re-producing this on my Windows machine

@KOLANICH Can you compile and run the following code on your machine?
https://github.com/dmlc/xgboost/blob/72cd1517d6b1d145c34e13a063fadd31b507b01d/tests/cpp/helpers.cc#L5-L13
The returned string should refer to a path that actually exists.

1
https://en.cppreference.com/w/cpp/io/c/tmpnam

Creates a unique filename that does not name a currently existing file

2

tmp.find("C:")

other drive can be used
3 on my machine it returns strings like /s2n8. tmpnam returns strings like \s2n8..

.
On Tue, Oct 2, 2018 at 5:39 AM KOLANICH<EMAIL_ADDRESS>wrote:

1
https://en.cppreference.com/w/cpp/io/c/tmpnam
Creates a unique filename that does not name a currently existing file
2
tmp.find("C:")
other drive can be used
3 on my machine it returns strings like /s2n8. tmpnam returns strings
like \s2n8..
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dmlc/xgboost/issues/3708#issuecomment-426211679, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHTrEWf-8btWqX9XEpNEGqurV3VrIBQrks5ugzRJgaJpZM4WubqB
.

Jjhcxzzhkkhcccvb
On Tue, Oct 2, 2018 at 7:12 AM Heewon Cho<EMAIL_ADDRESS>wrote:

.
On Tue, Oct 2, 2018 at 5:39 AM KOLANICH<EMAIL_ADDRESS>wrote:

1
https://en.cppreference.com/w/cpp/io/c/tmpnam
Creates a unique filename that does not name a currently existing file
2
tmp.find("C:")
other drive can be used
3 on my machine it returns strings like /s2n8. tmpnam returns strings
like \s2n8..
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dmlc/xgboost/issues/3708#issuecomment-426211679, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHTrEWf-8btWqX9XEpNEGqurV3VrIBQrks5ugzRJgaJpZM4WubqB
.

We need a better mechanism for creating temporary files.

@KOLANICH The TemporaryDirectory class in dmlc-core looks like a suitable replacement. It is cross-platform and works with multiple Windows drives:
https://github.com/dmlc/dmlc-core/blob/e3377de933d3e069635150fb330ce6cc33b57950/test/unittest/unittest_inputsplit.cc#L38-L125

TemporaryDirectory

std::temp_directory_path

A directory suitable for temporary files. The path is guaranteed to exist and to be a directory. The overload that takes error_code& argument returns an empty path on error.

c++17 though.

Wish we could use std::filesystem. That would prevent many headaches.

Unfortunately we have to use C++11.

__cplusplus is used by some compiler to report c++ version date. I guess we can support later versions optionally.


BZ1289575: Fix errors downloading png and pdf for large BP's

@tsurdilo   will you take a look at this?

+1 looks good.

Thanks!
master: 90daba36750955e2b74655f1f01e32e98b85bdcf


Web Map "Model Geography" references services/layers that do not exist

Item id b39c3bbdf13e4f829f78dc9c2ab6e96a references the following services/layers that do not exist:
https://nsec.esri.com/ags/rest/services/Hosted/ModelGeography_WFL/FeatureServer/2
https://nsec.esri.com/ags/rest/services/Hosted/ModelGeography_WFL/FeatureServer/1
https://nsec.esri.com/ags/rest/services/Hosted/ModelGeography_WFL/FeatureServer/0
Also references service external to NSEC server/portal site:
https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer

Deleted, no longer needed


EmrEtlRunner: bump Elasticity to 6

This is required to handle the recent AWS EMR API changes. New users of Snowplow (who haven't run a cluster on AWS before) won't be able to monitor their EMR jobs through EmrEtlRunner (though the job will start).
Depends on https://github.com/rslifka/elasticity/issues/87
The manual workaround in the meantime is to:

Run your job as usual with EmrEtlRunner
The job will submit to the cluster but then monitoring of the job will fail
Wait for the job to complete in the AWS EMR console
Run the EmrEtlRunner job again but with --skip staging,emr

@fblundun - in the meantime (i.e. while waiting for the Elasticity 6 release), please get EmrEtlRunner upgraded to the latest Elasticity release (5.0.3), so that we can fix any Ruby dependency issues in good time.

Current status on this:
Using Ruby 2.2.1 and an existing AWS account, EmrEtlRunner:
works with Elasticity 5.0.1
doesn't work with Elasticity 5.0.2 (apparently because of https://github.com/rslifka/elasticity/issues/86, which was fixed in 5.0.3)
doesn't work with Elasticity 5.0.3 - for some reason, the JobFlow.steps method is returning nil.

Hey @fblundun - thanks for diving into this. I'll /cc @rslifka in this thread so that he is aware of the 5.0.3 issue we are having...

I just edited my comment above to say that it is JobFlow.status, not JobFlow.steps, which is returning nil.

Cool, thanks @fblundun . BTW - I have pinged Rob to ask if there's any way we can help out on the Elasticity 6 release to get it out sooner...

Good idea!

More information on what's going wrong:
Here in 5.0.1, the AwsRequest returns an XML string which is correctly parsed by Nokogiri::XML.
Here 5.0.3, the AwsSession instead returns a JSON string which Nokogiri basically ignores. This is what causes the nil value for JobFlow.status.

@fblundun Yep, AWS has changed the return and submission protocols, hence our conundrum :)  Fortunately they're backwards compatible on the submission protocols but it turns out when Elasticity was updated to the V4 signature format, it switched to the new format on the send side.  In the process of implementing the new APIs now.  Follow along for 6.0 - https://github.com/rslifka/elasticity/milestones/6.0 - New Amazon API

Thanks for the update @rslifka ! Looks like it's going well.

I've updated to use the new API. Here's a sample error message from when I manually terminate a job:
Snowplow::EmrEtlRunner::EmrExecutionError (EMR jobflow j-3J8LOJN8AWOOU failed, check Amazon EMR console and Hadoop logs for details (help: https://github.com/snowplow/snowplow/wiki/Troubleshooting-jobs-on-Elastic-MapReduce). Data files not archived.
r67 Job: TERMINATING [USER_REQUEST] ~ elapsed time n/a [2015-07-20 10:25:24 +0000 - ]
 - 1. Elasticity S3DistCp Step: Raw S3 -> HDFS: COMPLETED ~ 00:01:53 [2015-07-20 10:25:24 +0000 - 2015-07-20 10:27:17 +0000]
 - 2. Elasticity Scalding Step: Enrich Raw Events: CANCELLED ~ elapsed time n/a [2015-07-20 10:27:17 +0000 - ]
 - 3. Elasticity S3DistCp Step: Enriched HDFS -> S3: CANCELLED ~ elapsed time n/a [ - ]):

I've tried to make it identical to the error messages from the last version.

Looks great Fred!

6.0.2 released, will help with some of the error messages you're getting.  Let me know if there's anything else!

Thanks so much @rslifka!


Range Input: Order of Attributes Bug

I stumbled upon a bug while working with Preact today. If you create an input range, the initial render of the slider position may be wrong, depending on the order of the attributes. The value attribute needs to be set after min/max/step. If value is applied before min/max/step are properly set, the value will be forced to match the default min=0/max=100/step=1 on a slider.
E.g. if you create two sliders:
// This one renders with the slider at 0
<input type="range" value={0.5} min="0" max="1" step="0.05" />

// This one renders with the slider at 0.5
<input type="range" min="0" max="1" step="0.05" value={0.5} />

See minimal code to reproduce here
When creating an dom element from a vnode, it looks like attributes are applied one at a time via a for...in loop. Since the ordering of keys in an object is arbitrary, it seems like diffAttributes needs to apply the attributes in a sorted way. I can't think of other potential ordering pitfalls with attributes (maybe the react source code would have insights), but at the very least, applying value last should fix this issue.

Interesting! We might also be able to work around this by setting value as an attribute.

@developit - isn't value already being passed as an attribute to diffAttributes? Or did you mean pulling value out into its own property during h?

I mean special-casing value like we do type and list:
https://github.com/developit/preact/blob/master/src/dom/index.js#L76
Basically, forcing a value prop from VDOM/JSX to be applied to the DOM using setAttribute() instead of as a property.

Hm, but the problem is the order in which value is applied relative to other attributes, not whether it's applied via prop or attribute (vanilla js example). I might be missing something, but by the time we're in setAccessor, it's too late to adjust the order without doing something async.

Interesting, I would have thought the step validation would only apply to the value property, not the attribute itself. You're right, this likely requires a bit of insane workaround magic in diffAttributes.

Happy to contribute a PR to fix it if someone isn't already working on it.

That would be awesome.

Here's the special input attr cases in react for reference: https://github.com/facebook/react/blob/8ab56e5c8b8f797a6b2bdd4188b4082c55a5190b/src/renderers/dom/stack/client/wrappers/ReactDOMInput.js#L58-L71

I ran into this issue too. When will this be released?

plz fix :)

@marvinhagemeister thanks! Closing my PR


Use memory-aligned data structures in qmux protocol

I am currently looking into implementing a TCP-in-TCP connection tunneling protocol very similar to qmux or OpenSSH in Devolutions Gateway + jetsocat, a project written in Rust. The cleaned up protocol specification  used in qmux is exactly what I'm looking for, but I've noticed that the message headers haven't been modified to respect memory alignment rules commonly enforced in certain types of processors like ARM. To read a uint32 (4-bytes) then it should be at a memory address that is a multiple of 4 bytes, etc. This is the primary reason why a lot of protocols try hard to align their data structures, and why compilers automatically pad data structures that don't respect those rules. You can still read data structures that are not memory aligned, but it comes with a performance cost.
I know this would be a breaking change, but would you be interested in making the change anyway? I will likely implement the memory aligned variant on my side and keep everything else as-is. Here is what the current header structure looks like:
  byte      QMUX_MSG_CHANNEL_OPEN
  uint32    sender channel
  uint32    initial window size
  uint32    maximum packet size

And what a memory-aligned variant would look like:
  byte      QMUX_MSG_CHANNEL_OPEN
  byte     reserved[3]
  uint32    sender channel
  uint32    initial window size
  uint32    maximum packet size

This would free 1 byte and a uint16 for other use like flags, etc, if you have such needs. What do you think? Everything else that follows would be nicely memory-aligned with those 3 bytes.

Oh, fascinating. Definitely open to it. For reference/docs here is more info I found: https://developer.ibm.com/technologies/systems/articles/pa-dalign/
So this would be for all messages I'm assuming?

Yes, this would be for all messages. If am I to fix the message alignment, I might as well define a common header structure to make it much easier to know the expected message size. I will make significant changes to the document structure, and then you can take a look and see if you want to adopt the changes. It would be great if we end up both using a common protocol, otherwise it's no big deal, I'll just use a different name. I also want to ensure that the protocol can evolve with some backward compatibility.

@progrium okay, I've begun my work and I am clearly going to redesign the whole thing my way at this point, so you may not want to the final result when I'm done. We still have a common goal, so there are bits and pieces we can share. I've reviewed QMUX and the original SSH protocol, and there's one thing that eludes me so far: how would you support SOCKS5 on top of QMUX?
OpenSSH has this nice SOCKS5 tunneling feature that is an improvement over the regular TCP tunnel, and I intend to support SOCKS5 as well. However, I couldn't find the part of QMUX or the original SSH protocol that lets you specify the destination of the channel to open (IP address or hostname + port). Unlike a tunnel with a fixed destination, SOCKS5 requires that you specify where to connect. Is this something you wanted for QMUX as well?

Here's my draft revised protocol draft, let me know if you're interested, otherwise you can just close this issue and I'll move on with my own variant: https://github.com/awakecoding/qmux/blob/protocol-update/SPEC.md

I like some of the improvements but you're right we might be diverging pretty quickly. Is there a benchmark or test that could be done to show the performance difference of memory-aligning vs not (assuming a target platform/architecture)?

I don't have benchmarks, but to be honest, the performance will likely be very similar. It is just a good idea to pre-pad the data structures so the compilers won't, making it much easier to just transfer data structures as-is with minimal transformation between the wire format and the memory format (aside from little endian vs big endian).
I don't want to steer you in a different direction, I have already modified the protocol beyond recognition with the following:

structure memory alignment
common header structure
maximum fragment size (65535)
type-length-value (TLV) encoding
move variable-length field to body
assign 'variable' names to each field
channel destination URL encoding
reintroduce reason code and string

This new draft is what I'll use for my V1 of "JMUX" in jetsocat. It'll mostly be interesting to follow what happens on my side, but it's no longer relevant for QMUX unless you wish to significantly change it and take the same direction I'm taking.
I'll close this issue, thanks for your help


Issue#95 added graceful string concatenation

This is a pull request for issue#95

Why not? Thanks


I have change the user interface in the contact.html file

add the background image and make the form transparent , and makes it looks good

#617


[ompl] upgrade to v1.5.1

Describe the pull request

What does your PR fix?
Upgrade OMPL to 1.5.1.

Which triplets are supported/not supported? Have you updated the CI baseline?
I don't expect this change will make any regression on CI baseline.

Does your PR follow the maintainer guide?
Yes

cc @mamoll

Thanks!

Thanks, @seanyen


gyms aren't updated.

Is this behavior expected?  I don't see anywhere in the code where gyms are updated.

There was an issue with the api, while getting the map_objects. PGOAPI#47

if you are talking about gyms.py - yes it is intended to not autoupdate

@Aiyubi I think he means that after X amount of time the Gyms change from team to team on the map. Or in the report using more recent data but my map has been running 10 hours and the gym's are added to the db, one sighting is added after that Gym's are not touched. Which means the data is oudated.
Generated 0 minutes ago using data from 1054 minutes ago gathered by pokeminer

Same here. Gyms don't update.

Mine seem to be updating fine, using MySQL for database.

Reporting the same issues using sqllite

I think I found several logical issues with the sorting and caching. Im on it right now.

Is this related to the live map, or to the entries in database? Entries in database are updating fine (at least for me), and gyms.py also uses new results. I'm not sure about the live map.

@modrzew since I am bad with sql and stuck I will tell you my first finding:
        existing = session.query(FortSighting) \
            .filter(FortSighting.fort_id == fort.id) \
            .filter(FortSighting.team == raw_fort['team']) \
            .filter(FortSighting.prestige == raw_fort['prestige']) \
            .filter(FortSighting.guard_pokemon_id ==
                    raw_fort['guard_pokemon_id']) \
            .first()
        if existing:
            # Why it's not in cache? It should be there!
            FORT_CACHE.add(raw_fort)
            return

So what if:

I capture a gym with my pigeon it has 2000 prestige
Someone from another team captures it
I capture it again with the same pigeon
-> existing is true and it is not in the cache

told you earlier I'm bad with sql? turns out I am not as bad as I thought
running the query in get_forts results in always the oldest data
query the sql from get_forts through mysql interface: works perfectly fine and results in newest data

@modrzew The problem is in both. (In python 2.7)
Gyms are not updated on live map or neither in the gym report.
This is my gym report footer:
Generated 0 minutes ago using data from 2403 minutes ago gathered by pokeminer
data is more then 40 hours out of date. From what I can see, the gym's are updating in the database.

Might this be the same issue as in #172? If so, you could try upgrading to v0.5.1 and see whether the issue goes away.

@modrzew as I tried to comment on that issue: get_forts now returns all entrys
len(db.get_forts(session))
80219

okay #198 is a fix that works for me


Notification window placement too high.

If notifications were being displayed when the wallet restarts, the placement of the notifications windows is too high. This issue can be seen when running the cold wallet and importing blockchain data. After you click to import the blockchain file and select a file to import, a couple of notifications are displayed and then the wallet restarts. On restart the placement of the notifications will be too high as they are placed as if the notifications being displayed during the restart are still visible.

The issue was that the number of visible messages was not being reset when the wallet restarts. This has been fixed.

Verified Notification messages after wallet restarts, hence closing this ticket.


:construction: refactoring

still need to sweep back for better SSL and updating SSL tests but looking for feedback from @kangas and @judahschvimer on this refactoring to make this all more human.

Overall, I think I like this direction. Will look at it more carefully later.

Published in v1.0.0


Null scoped access token can be created from the Gitea API

Description
If you submit to the /users/{username}/tokens endpoint with basic auth and your json does not include the "scope" key, it will create a token with null scope that isn't useful.
E.G.
curl -X 'POST'
'https://try.gitea.io/api/v1/users/dandre456drfth/tokens'
-H 'accept: application/json'
-H 'authorization: Basic ZGFuZHJlNDU2ZHJmdGg6ZGNhM0FOTTh6amIzYm5yX2hmdg=='
-H 'Content-Type: application/json'
-d '{
"name": "string"
}'
This can be replicated from the swagger page as well. If I send an invalid scope, it returns an error, but if I send an empty scope it creates a null scoped token that is unusable.
The settings UI will not let me create a token without a scope. I think the API should similarly not allow creation of a null scoped token.
We have many existing clients that create tokens via this endpoint. Many are in remote locations where bandwidth is restricted and we cannot update them. We would be willing to submit a PR to address this issue and add a config option for a default scope for requests to this endpoint that do not provide a scope key at all, if that functionality would be welcome.
Gitea Version
1.21.3
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots

Git Version
No response
Operating System
linux/docker
How are you running Gitea?
docker
Database
MySQL/MariaDB

I can take a look on this.

Is there documentation on how to specify scope?


Error when trying to update

When I run bobarr.sh update, I get the following error:
error getting credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY
The complete log:
./bobarr.sh update

    /$$                 /$$
    | $$                | $$
    | $$$$$$$   /$$$$$$ | $$$$$$$   /$$$$$$   /$$$$$$   /$$$$$$
    | $$__  $$ /$$__  $$| $$__  $$ |____  $$ /$$__  $$ /$$__  $$
    | $$  \ $$| $$  \ $$| $$  \ $$  /$$$$$$$| $$  \__/| $$  \__/
    | $$  | $$| $$  | $$| $$  | $$ /$$__  $$| $$      | $$
    | $$$$$$$/|  $$$$$$/| $$$$$$$/|  $$$$$$$| $$      | $$
    |_______/  \______/ |_______/  \_______/|__/      |__/

        https://github.com/iam4x/bobarr

[+] Pulling 0/0
 ⠋ jackett Pulling                                                                                0.0s
 ⠋ web Pulling                                                                                0.0s
 ⠋ redis Pulling                                                                                0.0s
 ⠋ postgres Pulling                                                                                0.0s
 ⠋ flaresolverr Pulling                                                                                0.0s
 ⠋ api Pulling                                                                                0.0s
 ⠋ transmission-web Pulling                                                                                0.0s
 ⠋ transmission Pulling                                                                                0.0s
error getting credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`

You need to install 'pass'. Depending on your OS this can be done in different ways. What OS are you using?


UI is lagging or not loading properly

While creating a new plan , I change the provider , but namespace and network map doesnt update and goes to "" - How do we fix this? check screenshot -- https://github.com/jsakil14/forklift-console-plugin/issues/1 @yaacov If i retry after sometime , it will show up properly but takes likes 30 secs

BUMP! this is still an issue, I need to keep on changing the namespace and finally after some 2-3 mins , it will load the network name properly instead of """"

we just have to wait it out , since we dont have a parameter to modify to query the inventory fetch.


Default property value unit test is not named correctly

https://github.com/softlayer/ember-style-guide/blob/master/ember-testing.md#naming-unit-tests

@notmessenger taking this.


Add short description

short version of article (not abstract)

How much meta-learning is in image-to-image translation?
...in which we discover how meta-learning and transfer learning are fundamentally about distinguishing the general from the domain-specific and how we can discover this by examining the loss functions of image-to-image translation methods and GANs.

is this too short?

it is fine.
But what does ... stand for?
At which point does our sentece fragement complete something else?


Fix/web context menu

PR Checklist
Please check all that apply to this PR using "x":

[x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
[x] I have checked that this PR does not introduce a breaking change
[ ] This PR introduces breaking changes and I have provided a detailed explanation below

PR Type
What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting)
[ ] Refactoring (no functional changes)
[ ] Documentation changes
[ ] Other - Please describe:

Fixes
If the context is outside of the electron app, the context menu will not be handled.
Issue Number: #3065
What is the current behavior?
Right clicking will bring up a context menu in the elctron app within lbry.tv
Right clicking in a browser on content will not bring up the context menu, and will print errors in the console.
What is the new behavior?
Electron app continues to behave as normal.
Native context menu now appears in browsers.
Other information
import { clipboard, remote, isDev } from 'web/stubs'; // eslint-disable-line

Would have loved to be able to include the import clipboard on line 6 in /ui/util/context-menu.js, but it seems that despite attempting to add an eslint-disable-line comment, eslint will return this anyways:
4 | // @endif
5 | // @if TARGET='web'
> 6 | import { clipboard, remote, isDev } from 'web/stubs'; // eslint-disable-line
  |          ^
7 | // @endif
8 |
9 | function injectDevelopmentTemplate(event, templates) {

✖ 1 problem (1 error, 0 warnings)

@hackily , thank you and congrats on the first contribution! We'll get a review on this soon.
Can we show you some appreciation for the contribution?
Also, we're giving away some Hacktoberfest bonuses and goodies for this month.


If not set explicitly hours default to 00

In a field without any time already saved open react-times widget.

It shows current time (hours and minutes)
Click on the minutes and set them.  Do not set hours to anything.
After the time is saved to the field the hours are set to 00 rather than the current hours.

Smells like a bug, feels like a bug ;)

Thanks for submitting this, @bearoutthere! This issue will be resolved shortly. In a forthcoming PR, the timepicker will default to your current user time.
Note: In progress 🚀

@bearoutthere
Thanks for your help!
It will be resolved in the following version by @carlodicelico


fix(merge-tree sequence): resolve failing stickiness fuzz tests

Fixes eventual consistency bugs related to segments containing 2 or more references with heterogenous sliding preferences. These issues were found through the SharedString fuzz tests, and were missed by the local reference fuzz tests (localReferenceFarm).

I had originally planned for this to merge separately, but appears this fix will merge as part of the endpoint PR. Closing.


Made images in README visible again

1. Why is this change necessary?
Images in README.md haven't been shown any more. This is because our website changed and with it, all assets apparantly disappeared.
2. What does this change do, exactly?
replaced old image links with new ones
3. Describe each step to reproduce the issue or behaviour.
not applicable
4. Please link to the relevant issues (if any).
not applicable
5. Checklist

[ ] I have rebased my changes to remove merge conflicts
[ ] I have written tests and verified that they fail without my change
[ ] I have created a changelog file with all necessary information about my changes
[ ] I have written or adjusted the documentation according to my changes
[ ] This change has comments for package types, values, functions, and non-obvious lines of code
[x] I have read the contribution requirements and fulfil them.

Hello,
thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/NEXT-24592
Please use this issue to track the state of your pull request.


Failed to compile. (npm start)

Related to this: https://codedump.io/share/JVC44fmZDwQC/1/error-in-react-tap-event-pluginsrcinjecttapeventpluginjs, I think
Failed to compile in my machine.
Error in ./~/react-native-web/dist/modules/injectResponderEventPlugin.js
Module not found: 'react/lib/EventConstants' in /var/www/html/test/testme/hak_news/node_modules/react-native-web/dist/modules
@ ./~/react-native-web/dist/modules/injectResponderEventPlugin.js 1:20-55
Error in ./~/react-native-web/dist/modules/injectResponderEventPlugin.js
Module not found: 'react/lib/EventPluginRegistry' in /var/www/html/test/testme/hak_news/node_modules/react-native-web/dist/modules
@ ./~/react-native-web/dist/modules/injectResponderEventPlugin.js 4:25-65
Error in ./~/react-native-web/dist/modules/injectResponderEventPlugin.js
Module not found: 'react/lib/ResponderEventPlugin' in /var/www/html/test/testme/hak_news/node_modules/react-native-web/dist/modules
@ ./~/react-native-web/dist/modules/injectResponderEventPlugin.js 5:26-67
Error in ./~/react-native-web/dist/modules/injectResponderEventPlugin.js
Module not found: 'react/lib/ResponderTouchHistoryStore' in /var/www/html/test/testme/hak_news/node_modules/react-native-web/dist/modules
@ ./~/react-native-web/dist/modules/injectResponderEventPlugin.js 6:32-79
Error in ./~/react-native-web/dist/apis/PanResponder/index.js
Module not found: 'react/lib/TouchHistoryMath' in /var/www/html/test/testme/hak_news/node_modules/react-native-web/dist/apis/PanResponder
@ ./~/react-native-web/dist/apis/PanResponder/index.js 9:21-58
Error in ./~/react-native-web/dist/apis/UIManager/index.js
Module not found: 'react/lib/CSSPropertyOperations' in /var/www/html/test/testme/hak_news/node_modules/react-native-web/dist/apis/UIManager
@ ./~/react-native-web/dist/apis/UIManager/index.js 2:27-69

maybe outdated deps? I'll look at it, thanks

@kenpeter it seems React Native has problems with old projects, I've updated the dependencies as much as possible. Try to:
git pull
rm -rfv node_modules
yarn # instead of npm
yarn run start

Ok, I reinstall everything with npm install xxx --save, now seems working. It is deps problem. Haven't tried yarn.

Ok, thanks. I close this for now


403 Forbidden

I install this in Vercel by using free mysql database from clever-cloud.com.
But when the site is deployed, I keep redirect to /login pages instead of /dashboard page. And the pages saying 403 forbidden.
Here's the website https://nayakayp-com-analytics.vercel.app
And here's the screenshot:

I'm running into this too on my dev branch in Vercel. It must be something wrong on their end. I will keep investigating.

@nayakayp I just redeployed on vercel and it seems to be working again


289 allocation of emissions bugs

✏ Notes

This PR addresses bugs/tech debt from #2553
The issue "Save'" and "Save and Continue" buttons do the same thing (which bypasses the 100% allocation check) was introduced in #2519...and is
Fixed in  #2567 (also applied to this branch):

🐛 Issues addressed:
Backend:

Records are being saved to the report_emission_allocation table in the database when the allocated value is 0.
Carry the emission category Ids in the schema & use them in the service
(new) Update reporting.models.report_product_emission_allocation\allocated_quantity field max_digits from 10 to 20

Frontend:

Carry the emission category Ids in form data as hidden fields (and use them in the payload)
The details box when methodology is other is too small & the font is different
Field Totals in tCO2e\Total emissions attributable for reporting is of inconsistent width with the rest of the page.
(new) Category sections display header emission_category_name

🔬 Local Testing:

From terminal command, start the api server:

cd bc_obps
make reset_db
make run

From terminal command, start the app development server:

cd bciers && yarn dev-all

Navigate to http://localhost:3000
Click button "Log in with Business BCeID"
Navigate to http://localhost:3000/reporting/reports
On row Operation 3, click button Start
Complete the report pages until http://localhost:3000/reporting/reports/3/facilities/f486f2fb-62ed-438d-bb3e-0819b51e3aff/allocation-of-emissions
Expected results:

Allocation of Emissions page displays under step Report Information, task Allocation of Emissions

Category product names display as title for each emission allocation section
Products emissions reported on form Production Data display as expected in product category Total Emissions

Totals in tCO2e\Total emissions attributable for reporting displays total as expected
Button Save is enable
Button Save and Continue is disabled
Message displays All emissions must be allocated to 100% before saving and continuing

Allocate some emissions across category products
Expected results:

Allocation divisions and totlas are reflected as expected in Totals in tCO2e

Complete required fields, click Save
Expected results:

POST request is successful
Page does not route to another page

Enter all emission allocations
Expected results:

Button Save and Continue is enabled
Message does not display All emissions must be allocated to 100% before saving and continuing

Click Button Save and Continue
Expected results:

POST request is successful and page routes to  Additional Reporting Data

Nice work! This makes things much more smooth & no extraneous data is getting into the database.
One thing I'd check with PO / BA is the behaviour of the "Save" button when 100% of emissions are not yet allocated. There is a message at the bottom that says you cannot "save & continue" without 100% allocation, which is good & that button is greyed out. However, the "Save" button looks live but when clicked, nothing gets saved. If the preference of the PO/BA is to not allow saving data at all until 100% of emissions are allocated then this button should also be greyed out, if they want to be able to save the data as-is at that point, then we'll need to wire that button to actually save when clicked.
^ That can be handled in another ticket when we get clarity on what the expectation is there around saving data when 100% of emissions have not been allocated. Screenshot:

@dleard
When you "However, the "Save" button looks live but when clicked, nothing gets saved" did you complete the required field Methodology?  If not then Save will trigger the field validation errors; otherwise; the data should save, as it did for me (according to the test steps).

Ahh, that might have been it. I do forget to update that field sometimes and jump right into allocating. I'll check again, thanks!


Refactoring Basics lesson: there's a mismatch between one step description and the code

0.8.54
The fourth step says
"Press Ctrl+Alt+V and select new FileReader(...)"
while there's actually new BufferedReader() in the code.

fixed in 0.8.56


PyLance crashes immediately no matter what I do

 Environment data

Language Server version: 2024.5.1
OS and version: linux x64
Python version (and distribution if applicable, e.g. Anaconda):
python.analysis.indexing: true
python.analysis.typeCheckingMode: off

 Code Snippet

N/A
 Repro Steps

Purged all VSCode cache and config files from both my local machine and the remote server I'm connected to via SSH. Created a single .py file, opened it, and installed the Python extension pack. Immediately get a crash from PyLance:
2024-05-23 14:08:48.139 [info] (Client) Pylance async client (2024.5.1) started with python extension (2024.6.0)
2024-05-23 14:08:48.230 [info] /home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1
(function(_0x4d4841,_0x1df26e){const... # I'm truncating a super long line here, looks like the entire `server.bundle.js`
2024-05-23 14:08:48.623 [info] [Error - 2:08:48 PM] Server initialization failed.
2024-05-23 14:08:48.623 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097

I tried:

Many versions of the PyLance extension, back about 6 months
Using a custom Node executable (suggested in a VSCode dialog)

How do I debug this further? I have absolutely no way to edit any Python files on this machine now.

Thanks for the issue.
The super long line would help. Or at least the start of the line. It should show what line is crashing. We can then use our internal source maps to figure out where that is in our code.

Sure thing:
log.txt

Unfortunately the log doesn't have any meaningful info.
can you make sure the log contains things described here? https://github.com/microsoft/pylance-release/wiki/Collecting-data-for-an-investigation.#collecting-trace-logs
for your case, since it crash almost right away, set the setting in settings.json and reload vscode and we need full log in the python language server output window regardless how big it is.

I have "python.analysis.logLevel": "Trace", in my settings.json (both user and remote), but it doesn't seem to change anything. Here is the full log:
log.txt
It might also be worth noting that most PyLance commands (e.g., Pylance: Start Logging) gives me "command 'pylance.logging.start' not found".

Hmm, maybe VS code is truncating the output for some reason. It should have something like this in it somewhere:
TypeError: Cannot read properties of undefined (reading 'call')
    at _0x13e5f3 (c:\Users\rchiodo\.vscode\extensions\ms-python.
2024-05-23 15:33:39.726 [info] vscode-pylance-2024.5.1\dist\server.bundle.js:1:977217)
    at 78268 (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:2537)
    at _0x13e5f3 (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:977225)
    at 80332 (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:578016)
    at _0x13e5f3 (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:977225)
    at 47100 (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:954056)
    at _0x13e5f3 (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:977225)
    at c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:977459
    at _0x13e5f3.O (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:978466)
    at _0x13e5f3.x (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:977509)
    at _0x13e5f3.x (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:981005)
    at c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:981053
    at Object.<anonymous> (c:\Users\rchiodo\.vscode\extensions\ms-python.vscode-pylance-2024.5.1\dist\server.bundle.js:1:981086)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49

(I forced that on my machine by editing some bytes in the server.bundle.js).
Prior to that line it dumps the entire server.bundle.js for some reason.
Can you try setting this value higher?
    "terminal.integrated.scrollback": 10000,

Hmm I see, I can't seems to get rid of the truncation. I set "terminal.integrated.scrollback" to a high value and it didn't change anything. When I hovered over the line, I also got a message from VSCode suggesting to modify "editor.stopRenderingLineAfter", but when I actually put that in my settings.json it says the setting does not exist. I also checked the raw log file at ~/.vscode-server/data/logs/20240523T134940/exthost23/ms-python.python/Python\ Language\ Server.log, and the line is still truncated at the same point.

have you tried to delete .vscode-server and re-install?

Yep, I've tried that several times. I also tried some more aggressive purging (reinstall VSCode locally, clearing all configuration files locally + remotely, clearing ~/.cache).

I just confirmed that it works on a different remote machine, so it's definitely a problem with that machine. However, I'm not sure what else to try, since I'm not familiar with what else could possibly affect PyLance. Let me more comprehensively enumerate what I tried:

Deleting ~/.vscode-server and reloading, which also requires re-installing the Python extension pack
Deleting ~/.cache
Uninstalling and reinstalling python3 using apt
Using a custom Node interpreter (Node v22.0.0) instead of the one bundled with vscode-server
Uninstalling VSCode locally, deleting all local configuration files, and reinstalling

All of these have led to the exact same outcome as far as I can tell. Any other suggestions?

What if you change server.bundle.js to just throw new Error('Server crash');? (After copying it to a new file).
server.bundle.js would be in the .vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist folder.
Does that show a callstack?

I can only guess that some global node option on that machine is messing something up. Although if that were the case, I wouldn't expect any extensions to load either.

I uninstalled everything node-related that I could fine from my machine. I was using NVM so I just deleted ~/.nvm. Crash is still happening.
If I add throw new Error("server crash"); to the top of server.bundle.js, the stacktrace looks fine:
2024-05-23 16:56:36.821 [info] /home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1
throw new Error("server crash");
^

Error: server crash
    at Object.<anonymous> (/home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1:7)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
    at node:internal/main/run_main_module:23:47

Node.js v18.18.2

Does an older version work on this machine? Like 2024.4.1?

We changed our obfuscation in 2024.5.1. I wonder if that's breaking something somehow.

No, I tried a bunch of different versions (all the way back to 2023.12.1) and more or less the same thing happens. I just double-checked with 2024.4.1.

Do any of the older versions give you a callstack for the crash?

Another thing to try is go on the machine and just run node server.bundle.js. It shouldn't work, but it might actually give us a callstack. Normally doing this will start the server and it will give an error message like so:
You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.

But if something is messed up in the bundle or in your node, maybe running it from the command line will give us a callstack.

Ah nice, that gave me the traceback! Here it is:
TypeError: Cannot assign to read only property 'noDeprecation' of object '#<process>'
    at 47100 (/home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1:952786)
    at _0x13e5f3 (/home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1:977225)
    at /home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1:977459
    at _0x13e5f3.O (/home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1:978466)
    at _0x13e5f3.x (/home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1:977509)
    at _0x13e5f3.x (/home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1:981005)
    at /home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1:981053
    at Object.<anonymous> (/home/black/.vscode-server/extensions/ms-python.vscode-pylance-2024.5.1/dist/server.bundle.js:1:981086)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)

(same error in2023.12.1, this is using vscode-server bundled node)

Not sure why we have this in our code but this is the failing line:
if (process.env.NODE_ENV === 'production') {
    // Silence Buffer deprecations from onnx.
    (process as any).noDeprecation = true;
}

It must mean you have an environment variable NODE_ENV is set to production. Would explain why this is failing on just the one machine.

This is very strange, since I definitely don't have the NODE_ENV variable set. In fact:
$ .vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node -e "console.log(process.env.NODE_ENV)"
undefined

Oh my god, I figured it out. It's because I had set the environment variable NODE_OPTIONS="--no-deprecation", because otherwise a completely unrelated command-line tool I was using would spit out tons of deprecation warnings.
Seems like globally setting NODE_OPTIONS is very dangerous, I definitely shouldn't have done that. I'm pretty unfamiliar with Node so I didn't think for a second that other things could be affected. I'm a bit shocked that VSCode extensions are so affected by environment variables that I set in my .bashrc, though.

Glad you figured out. Thanks for the help.

Thanks for the real-time support!


Sync validality status with TextField Foundation

Beforehand, the invalid prop in the react component is not synced with TextField Foundation

Thanks so much for this!
Issues like this are giving me more reason to look into a direct foundation implementation but this is great. Will put it out as a patch before the next release.


RFC: parse git commit log for fragments

Seeking comments on a complimentary approach for extracting fragments - parse the git log for marked up parts. Similar to the approach used in nodejs/node (e.g. https://github.com/nodejs/node/commit/c3dd0d001abdb983d19987c76cad7ef30ef82a25).
As I imagine this:

Author adds some marked up metadata to the commit message (.feature: add foo to bar)
During release creating towncrier either infers the commit range, or is given manually
towncrier parses message in commit range for fragments
git fragments and file fragments lists are merged
profit

Towncrier explicitly doesn't do this for several reasons:

Git history is malleable and not trustworthy (e.g. if someone squash merges something by accident)
Merge commits are done at merge time, and not always by the person working on the actual task. This means that one has to do extra work to have the news text actually be part of the review, vs just part of the diff.
Things that check the newsfile then need a significant amount of history and can't be shallow clones.
uuuuuuuuuuuuuugh interfacing with git

But, yeah, it's designed to make it as separate as possible, as the person doing the git may not be the one writing the newsfile, It also means that you'd need to figure out which commit messages override which, which depends on your local tree if one cherry-picks a fix with a newsfile commit and then merges that in later. Also, editing newsfiles either means editing commits and force-pushing, or relying on the above "which one has precedence" figuring out in the git graph.


⚠ Mitsubishi has degraded performance

In b9a3701, Mitsubishi (https://mitsubishimotorsid-mobileapp.com/app/login) experienced degraded performance:

HTTP code: 200
Response time: 16591 ms

Resolved: Mitsubishi performance has improved in de17612 after 7 minutes.


JSON Schema for optional fields is incorrect.

Initial Checks

[X] I confirm that I'm using Pydantic V2

Description
JSON Schema Draft 2020-12 explains the way to display optional (nullable) values.
https://json-schema.org/draft/2020-12/json-schema-core.html#section-7.6.1-3
Example:
{
    "type": ["string", "null"],
    "maxLength": 255
}

But pydantic v2 displays it like:
{
    "anyOf": [
        {
            "type": "string"
        },
        {
            "type": "null"
        }
    ],
}

The variant with anyOf displays strange in ReDoc For example

The toll_free_phone has "type": ["string", "null"], and after_hours_phone has a schema with anyOf
Also I faced an issues with other libraries that uses this JSON Schema.
Example Code
import json
from pydantic import BaseModel

class Model(BaseModel):
    field: str | None = None

schema = Model.model_json_schema()

print(json.dumps(schema, indent=4))

### Python, Pydantic & OS Version

```Text
pydantic version: 2.1.1
        pydantic-core version: 2.4.0
          pydantic-core build: profile=release pgo=false mimalloc=true
                 install path: /Users/viktor/.virtualenvs/gv2/lib/python3.11/site-packages/pydantic
               python version: 3.11.3 (main, Apr 25 2023, 00:40:12) [Clang 14.0.3 (clang-14<IP_ADDRESS>.1)]
                     platform: macOS-13.4.1-arm64-arm-64bit
     optional deps. installed: ['email-validator', 'typing-extensions']

Selected Assignee: @hramezani

Thanks @grabov  for reporting this.
I think the section of the doc that you've mentioned in your issue is about Assertions and Instance Primitive Types and the type in the example is for restricting the assertion. as it's mentioned in the doc.
Optional[str] or str | None means str or None, and I think the current definition is correct

It's definitely valid to use anyOf: [{"type": "string"}, {"type": "null"}] — we've had the generated schemas reviewed by the maintainers of JSON schema. The "type": ["string", "null"] is also valid, but it's not required to be generated that way.
It's a bit more complicated to generate the type as an array, because that can only be done if all of the elements of the list are primitive types (i.e., this works for str | None but not MyModel | None), and also obviously requires that the other keywords can be applied in a semantically equivalent way (i.e., there is no way to express anyOf: [{"type": "string", "maxLength": 3}, {"type": "string", "minLength: 5}, {"type": "null"}] without an anyOf somewhere, even if not in the exactly the same place).
Given ReDoc is a common use case for the generated JSON schema, I would be open to changes that make it easier to generate the form of JSON schema that ReDoc handles better, but I don't think it's worth much additional complexity to get it to just format the description of the field a bit better, and although this is some of the most common use of optional, getting it to handle edge cases correctly at all is more important than getting it to be formatted nicely in ReDoc.
Open to a PR, I think there may be an approach where GenerateJsonSchema attempts to add a filter pass that simplifies common schemas comprised of primitives, but ideally I'd like to see some broader interest in this change before making it because it may affect downstream user code that modifies the generated JSON schema and relies on it having a specific format. (Or we could somehow make it a config option for the JSON schema generation, e.g. exposed by overriding the GenerateJsonSchema class.)

Another issue with optional fields arises when we only want to make certain fields not required, but "null" is not a valid value for the client.
A workaround for this is to define fields without using Optional and instead set None as the default value, even though it may be an incorrect type hint.

Another issue with optional fields arises when we only want to make certain fields not required, but "null" is not a valid value for the client and should not be exposed in schema.
A workaround for this is to define fields without using Optional and instead set None as the default value, even though it may be an incorrect type hint.

Trying to understand this. What you're saying is when a field is not required it should be omitted completely ?

@sander76 Simply put, when defining an API, an optional field means that it doesn't have to be provided. The default value, on the other hand, implies that if the field is not given, a specific predetermined value will be used instead. It does not mean that the client can pass a value of "None" for that field.
What I want is marking some fields as not required but without a default value in JSON schema.
Here is a example:
from typing import Annotated
from pydantic import BaseModel
from fastapi import Depends, FastAPI

app = FastAPI()

class Query(BaseModel):
    """
    Those query params are optional, but a client should not set them to `null`.
    """
    q: str | None = None
    boolean_filter: bool | None = None

@app.get("/demo")
def demo_get(query: Annotated[Query, Depends()]):
    ...

What I want is marking some fields as not required but without a default value in JSON schema.

Its exactly this.  Does Optional[str] = None mean "key and value can be omitted" OR does it mean "give me a string or give me an explicit NULL"?  It is now ambiguous in the field definition.  In pydantic v1, this would have been rendered as just a "string" type and then not included in the list of "required" params.  Now that it is defined as an "anyOf" type, it is much more confusing.  Tools still understand that the field is optional but the requirement to display the union type makes the final rendering confusing since the intended use of the None default is to allow omission of the key entirely.
For the record, I use "openapi-explorer" to render my schemas and it suffers from the same problem interpreting this schema as ReDoc does.  Although the anyOf definition is certainly legal, it is ambiguous for optional fields and very confusing to end users.
What may be more helpful here is way to flag that the None type should not be included in the schema definition (even if it is the defined default) and then if that exclusion leads to a single type, do not wrap it in an anyOf.

Technically, since Optional[T] is just Union[T, None], it's correct to generate the anyOf type since the JSON equivalent of NoneType in Python is null and not "undefined" or "not present". null and "not present" are distinguishable in JSON schema, but not in Python. The closest I've gotten to defining such a type is
T = TypeVar("T")

def not_none(v: Optional[Any], info: ValidationInfo):
    if v is None:
        raise ValueError(f"{info.field_name} is not nullable")

    return v

Omissible = Annotated[Optional[T], BeforeValidator(not_none), Field(default=None)]

class Testing(BaseModel):
    omitted: Omissible[int]

# no explicit None set, but it's value is None
empty = Testing()
empty.model_dump_json(exclude_unset=True) # => {}

try:
    explicit = Testing(omitted=None)
except ValidationError:
    # Fails validation, because when omitted is explicitly set, it must be an int

This is "good enough" for me, however there is still the issue of the anyOf schema which gets generated in the same way, because Omissible is just a nullable type. My solution to that so far has been to use a custom generator and override nullable_schema in the way described by @adam-homeboost:
class CustomGenerate(GenerateJsonSchema):
    def nullable_schema(self, schema: core_schema.NullableSchema) -> JsonSchemaValue:
        """Copied from GenerateJsonSchema.nullable_schema and modified"""
        null_schema = {"type": "null"}
        inner_json_schema = self.generate_inner(schema["schema"])

        if inner_json_schema == null_schema:
            return null_schema

        flattened_anyof = self.get_flattened_anyof([inner_json_schema, null_schema])

        if len(flattened_anyof["anyOf"]) == 2:
            return inner_json_schema

        return flattened_anyof

json.dumps(Testing.model_json_schema(schema_generator=CustomGenerate))
# =>  { "properties": { "omitted": { default": null, "title": "Omitted", "type": "integer" } }, "type": "object", "title": "Testing" }

Although I don't like this approach, I would prefer if the Omissible type could be annotated such that it generates the correct JSON schema representation wherever this type gets used. Is that possible to do in v2?

I've answered my own question. I think this should work:
class NotNullable:
    def __get_pydantic_core_schema__(self, source: Type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:
        schema = handler(source)
        assert schema["type"] == "nullable"
        return schema["schema"]

def not_none(v: Optional[Any], info: ValidationInfo):
    if v is None:
        raise ValueError(f"{info.field_name} is not nullable")
    return v

T = TypeVar("T")

Omissible = Annotated[Optional[T], NotNullable(), BeforeValidator(not_none), Field(default=None)]

@dmontagu this issue is actually breaking interop of pydantic generated schemas with NSwag, since they only recognize either the type list annotation or the oneOf constraint, but not anyOf.
I found this comment in the source code for nullable schema:
https://github.com/pydantic/pydantic/blob/da468c48624b202685af4baebf0edf0df4402a81/pydantic/json_schema.py#L1021-L1023
If we could at least change this to output oneOf instead of anyOf a whole swath of .NET applications would become interoperable with pydantic generated schemas.

@glopesdev
I did mark in the code that that might be a good idea: https://github.com/pydantic/pydantic/blob/e3f3fd0a1b28b93d24ee4605ef2864dbb12dc3f6/pydantic/json_schema.py#L1046
However, I'll note that I vaguely recall that some JSON schema tools error if you match multiple of a oneOf schema, so if we use oneOf instead of anyOf we may need to modify the implementation in a way that ensures that null does not match any of the items in the non-{'type': 'null'} item in the oneOf, I worry that might get complicated to implement but I'm not opposed in principle.

@7opf

I've answered my own question. I think this should work:

class Testing(BaseModel):
    omitted: Omissible[int] = None # type hinting will work

This precisely fits the bill! Has the desired effect on the schema output, but is still Mypy-safe. Many thanks!

Working with OpenAPI in other languages and tools I found this behavior to be very surprising, and I agree with much of the reasoning above. In addition, the produced anyOf also broke Scala client code I was generating with openapi-generator.
What I would expect for foo: Optional[float] = None, and what I have seen in other projects, is this:

in the JSON Schema the field is not included in required
if the field is equal to None the entire key is omitted from the serialized JSON. If it's something else, the field is included.

Using foo: float = None # type: ignore was an acceptable workaround for me.

We've just upgraded to pydantic V2 and are hitting the same issue, we generate api specs with pydantic and then generate C# code for our client with NSwag. But the code generation fails due to the use of anyOf, while if I override it with oneOf it works just fine.

I'd like a ConfigDict property json_schema_serialization_nullable that

when True  includes any None default type/values as allowed the schema documentation, and serialises these values when present. (current behaviour)
when False, omits any None default from schema documentations, and omits the key from serialisation (a .model_dump(exclude_none=True) restricted to these attributes)

Is there a more elegant workaround to make None defaulted fields optional rather than nullable in json schema than this?
from pydantic import BaseModel, ConfigDict, Field, GetJsonSchemaHandler
from pydantic_core import core_schema as cs
from pydantic.json_schema import JsonSchemaValue

class MyBaseModel(BaseModel):

    model_config = ConfigDict(extra="allow", use_enum_values=True)

    @classmethod
    def __get_pydantic_json_schema__(
        cls, core_schema: cs.CoreSchema, handler: GetJsonSchemaHandler
    ) -> JsonSchemaValue:
        """Removes nullablity from optional fields."""
        _json_schema = handler(core_schema)
        json_schema = handler.resolve_ref_schema(_json_schema)
        if 'properties' not in json_schema:
            return _json_schema
        required = json_schema.get('required', [])
        changed = False
        for key, prop in json_schema['properties'].items():
            if prop.get('default','') is not None:
                continue
            if key in required:
                continue
            # remove nullablilty
            changed = True
            del prop['default']
            if prop.get('anyOf') is None:
                continue
            non_nullable = [ t for t in prop['anyOf'] if t.get('type') is not 'null']
            if len(non_nullable) == 1:
                del prop['anyOf']
                prop.update(non_nullable[0])
            else:
                prop['anyOf'] = non_nullable
        return json_schema if changed else _json_schema

This also breaks generated clients in the swift-openapi-generator; "anyOf" does not generate optional types in the same way the nullable types do.

This also gives surprising behavior with https://www.oasdiff.com/, an OpenAPI diff and breakage detection tool. When upgrading from pydantic v1 to v2 we now get tons of errors of the form:
  error	[response-property-type-changed] at openapi-new.json
  	in API GET /channels/{channel_id}
  		the 'project/address' response's property type/format changed from 'string'/'' to ''/'' for status '200'

for fields of type:
class MyModel(pydantic.BaseModel):
    address: str | None = None

The 'string'/'' to ''/'' part is due to the type being an anyOf instead of a simpler "type": ["string", "null"].
Note that our model definition hasn't changed between v1 and v2, just the generated schema.

I was also hit by this issue, I am using JsonForms https://jsonforms.io/ and for an optional field, I got a tabbed view with two entries, this is not what I wanted, I wanted a string field that was not required.
It seems currently Pydantic does not have a way to do  that, the Omissible trick above does that.
Basically I think a python Optional field should translate to json schema to a one type field and should not appear in the list of required fields, this seems like the logical expectation.

This is also causing a lot of problems with OpenAI's new structured response output. It doesn't not consider this a valid JSON schema.

I also needed a way to treat a field marked as X | None = None for any X (be it a single type or a union) as effectively ommisible (or undefined), meaning the JSON schema will neither provide a "default": null nor mark it as required:
from pydantic.json_schema import GenerateJsonSchema, core_schema, JsonSchemaValue
import pydantic_core

class DefaultNullAsUndefined(GenerateJsonSchema):
    # Modify default implementation to treat X | None = None as optional without default, rather than default=null
    def default_schema(self, schema: core_schema.WithDefaultSchema) -> JsonSchemaValue:
        """Generates a JSON schema that matches a schema with a default value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        """
        json_schema = self.generate_inner(schema['schema'])

        if 'default' not in schema:
            return json_schema
        default = schema['default']
        # Note: if you want to include the value returned by the default_factory,
        # override this method and replace the code above with:
        # if 'default' in schema:
        #     default = schema['default']
        # elif 'default_factory' in schema:
        #     default = schema['default_factory']()
        # else:
        #     return json_schema

        try:
            encoded_default = self.encode_default(default)
        except pydantic_core.PydanticSerializationError:
            self.emit_warning(
                'non-serializable-default',
                f'Default value {default} is not JSON serializable; excluding default from JSON schema',
            )
            # Return the inner schema, as though there was no default
            return json_schema

        # ========== START OF MODIFICATION ========== #
        # this field type is like `X | None = None` for any X
        # in this special case, we want to treat it as omitted WITHOUT the null default value!
        # so we remove null from its anyOf and also drop the default, simply rely on optional
        if schema.get("schema", {}).get("type") == "nullable" and encoded_default is None:
            # remove null from anyOf
            json_schema["anyOf"] = [x for x in json_schema["anyOf"] if x.get("type") != "null"]

            if len(json_schema["anyOf"]) == 1:
                return json_schema["anyOf"][0]
            else:
                return json_schema
        # ========== END OF MODIFICATION ========== #

        if '$ref' in json_schema:
            # Since reference schemas do not support child keys, we wrap the reference schema in a single-case allOf:
            return {'allOf': [json_schema], 'default': encoded_default}
        else:
            json_schema['default'] = encoded_default
            return json_schema

class MyModel(BaseModel):
    x: str | None # required, null is a valid explicit value
    y: str | None = None # optional, null should be treated as undefined

MyModel.model_json_schema(schema_generator=DefaultNullAsUndefined)

This creates a JSON schema like:
{
  "properties": {
    "x": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "X"
    },
    "y": {
      "title": "Y",
      "type": "string"
    }
  },
  "required": [
    "x"
  ],
  "title": "MyModel",
  "type": "object"
}

This give me the desired behavior when using this JSON schema to generate react forms, which is forcing the user to input x but not y, producing a json like {"x": "test"} instead of {"x": "test", "y": null} when the user didn't input y at all.

On this issue, I had a slightly different approach of fixing it.
We can start with allowing field level json overrides that can be used to update the default behaviour of pydantic's json schema generator. I find this a better approach than to create new pydantic types.
For example:
class Item(BaseModel):
    a: int  | None = Field(json_schema_override={'nullable': False})

This allows the user to make a field non-nullable in json schema even though it can accept None in the model definition.
This approach allows users to create then own types based on requirements:
RequiredInt: TypeAlias = Annotated [int,  Field(json_schema_override={'required': True}]

class Item(BaseModel):
    a: RequiredInt = Field(default = 1)
# So now, even though we have supplied a default value, the field will still be a required field in the json schema.

NonNullableOptionalStr: TypeAlias = Annotated[str, Field(default=None, json_schema_override={'nullable': False}

class MyModel(BaseModel):
    x: str | None # required, null is a valid explicit value
    y: NonNullableOptionalStr

For now I can think of nullable and required as two overrides that can be useful.
Final step in json schema generation:
def _check_and_apply_schema_overrides(self, schema: CoreSchema, json_schema: JsonSchemaValue) -> JsonSchemaValue:
        sub_schema = schema.get('schema', None)
        if sub_schema is None:
            return json_schema

        fields = sub_schema.get('fields', None)

        if fields is not None and isinstance(fields, dict):
            for field_name, field in fields.items():
                if metadata := cast(_core_metadata.CoreMetadata, field.get('metadata')):
                    if pydantic_js_schema_override := metadata.get('pydantic_js_schema_override'):
                        nullable = pydantic_js_schema_override.get('nullable')
                        required = pydantic_js_schema_override.get('required')
                        default_value = pydantic_js_schema_override.get('default')

                        if nullable is True:
                            self.emit_warning(
                                'skipped-choice',
                                f'Nullable field {field_name} in schema override cannot be set to True; skipping',
                            )
                        elif nullable is False:
                            json_schema = self._make_field_non_nullable(json_schema, field_name)

                        if required is not None:
                            json_schema = self._update_required_field(json_schema, field_name, required)

                        if 'default' in pydantic_js_schema_override:
                            json_schema = self._update_field_default(json_schema, field_name, default_value)

        return json_schema

    def _make_field_non_nullable(self, json_schema: JsonSchemaValue, field_name: str) -> JsonSchemaValue:
        if 'properties' not in json_schema or field_name not in json_schema['properties']:
            return json_schema

        for union_type in ['anyOf', 'oneOf', 'allOf']:
            if union_type in json_schema['properties'][field_name]:
                for i, item in enumerate(json_schema['properties'][field_name][union_type]):
                    if 'type' in item and item['type'] == 'null':
                        del json_schema['properties'][field_name][union_type][i]
                        break
                if len(json_schema['properties'][field_name][union_type]) == 1:
                    json_schema['properties'][field_name] = json_schema['properties'][field_name][union_type][0]
                    break
        return json_schema

    def _update_required_field(self, json_schema: JsonSchemaValue, field_name: str, required: bool) -> JsonSchemaValue:
        if required is None:
            return json_schema

        if required is False:
            if 'required' in json_schema and field_name in json_schema['required']:
                json_schema['required'].remove(field_name)
                if len(json_schema['required']) == 0:
                    del json_schema['required']
        else:
            if 'required' not in json_schema:
                json_schema['required'] = [field_name]
            else:
                if field_name not in json_schema['required']:
                    json_schema['required'].append(field_name)

        return json_schema

    def _update_field_default(
        self, json_schema: JsonSchemaValue, field_name: str, default_value: Any
    ) -> JsonSchemaValue:
        if 'properties' not in json_schema or field_name not in json_schema['properties']:
            return json_schema
        try:
            default_value = self.encode_default(default_value)
        except pydantic_core.PydanticSerializationError:
            self.emit_warning(
                'non-serializable-default',
                f'Default value provided for json schema override {default_value} \
                    is not JSON serializable; excluding default from JSON schema',
            )
            return json_schema

        json_schema['properties'][field_name]['default'] = default_value
        return json_schema

O


Add map bounding box to region model

Motivation
We want to implement maps in the Integreat app. The app function needs to know which map tiles it needs to download. For this we need to provide two bounding box coordinates.
Proposed Solution
Add a property to region model and output in the APIv3.
The property should be named bounding_box. Values are nested arrays consisting of two numbers: [[32.958984, -5.353521],[43.50585, 5.615985]]
Reference in WordPress CMS: https://issues.tuerantuer.org/browse/WP-42

We do not need to implement this before the migration, if we do not have the time. The maps feature will not be released in may. Please address other issues first.


fix: default to having no social_links

Issue:
Having default social links under the theme configuration file, results in those items showing up, if the user does not override them with their own.
_config.yml
 minima:
   social_links:
     mastodon:
       - username: test
         instance: example.com

Result:

Solution:
Removal of default theme social configuration settings to ensure the only social_links are ones the user defines.

@ticoombs The change you're proposing should not be necessary.

If you're using this theme by forking the repository, then you must make the desired change in that fork.
Or if you're using this theme as a remote_theme along with Jekyll 4, then it is a bug with Jekyll 4. Try using Jekyll 3.8.6 in your Gemfile. If the issue gets resolved when you downgrade, please  open an issue ticket at the jekyll/jekyll repository.

Thank you.

hey @ashmaroli
Looks like its a bug with Jekyll 4. Sorry for the wrong repo.
Cheers!


Fix risky uses of __anext__()

Calling __anext__() on an async iterable is dangerous, because not all iterables act as their own iterators, so may not have that method. These changes ensure that those calls explicitly get an iterator first (by calling __aiter__()).
Note: __aiter__() is called implicitly in async for constructs, so they don't have this risk.

Marvellous! A joy to review and merge!


Publishing multiple reviews at the same time

 Freshdesk Ticket ID: 366
 Freshdesk Ticket Agent: Milan Kolar
 Freshdesk Ticket Agent Email<EMAIL_ADDRESS> Ticket Priority: Urgent
 Freshdesk Ticket Description:

FlorianToday at 1:58 PM

I have a scene with two cameras. When I publish two reviews for those cameras (named reviewCam01 and reviewCam02), the playblast gets the same filename. So they overwrite each other. Is there any way in anatomy to name the two playblasts differntly? The two cameras have the Subset as part of the filenames when they are published. The playblasts dont.

Milan KolarToday at 1:59 PM

you should be able to change the subset name for Review family like any other. Will have to check. if it doesn't work, then it's certainly a bug.

FlorianToday at 2:00 PM

The two review subsets are named differently in Maya.(edited)

Milan KolarToday at 2:00 PM

Then it's most likely a ug

FlorianToday at 2:01 PM

which part of default.yaml is responsible for naming review output?

Milan KolarToday at 2:04 PM

it uses. publish template from there. But the important bit is how we create the subset name inside maya. I'll have to check in the code. maybe it's being accidentaly overriden

FlorianToday at 2:06 PM

the Playblast is named fvb_projekt_porscheTT_v002_cameraReview

Milan KolarToday at 2:07 PM

are you attaching the review to camera subsets>

FlorianToday at 2:08 PM

No

Milan KolarToday at 2:09 PM

can you post a screenshot of what the outliner looks like? so I can re-create

FlorianToday at 2:10 PM

Milan KolarToday at 2:10 PM

is the task named 'camera'?

FlorianToday at 2:10 PM

yes

[2:11 PM]

[2:12 PM]you can connect to my machine. I have the scene open

Milan KolarToday at 2:12 PM

I can't jump in right now, actually, just wanted to suck as much info out

[2:13 PM]I reckon the ideal would be to publish 3 cameras, with each having it's own playblast attached to it.

FlorianToday at 2:13 PM

No problem

[2:13 PM]Should I parent the cam to the review or the other way around?

[2:14 PM]It would be great, if we could piblish playblasts without publishing the camera. We create more cameras than we need, playblast them and only publish those that we like

Milan KolarToday at 2:15 PM

i see. for that usage, what you have would be best. we just have to try.  But I'm guessing right now

FlorianToday at 2:16 PM

Pleas look into it then.

Milan KolarToday at 2:20 PM

of course

Agent Milan Kolar linked Freshdesk ticket 366 for this issue.


add work dir! fix inconsistent problems when "gop run ." an "gop build ."

add work dir! fix inconsistent problems when "gop run ." an "gop build."

https://github.com/goplus/spx/pull/141 - use this pr to solve the problem.

is this issue to resolve the problem of clicking app to run in macOS?

#141

yes


added create from existing volume or snap as option

This PR enables the ability to specify volumename, volumeid, snapshotname, snapshotid as volume options through the Docker vdm.  If these options are specified, the new volume will be created from an existing volume.

Could be useful, but let's address more detailed logging standardly for the package in another PR.


Why is wf high performance

Also based on epoll, what are the main optimizations that wf does to get better performance than nginx?

I don't know. We don't even use memory pool or any lockfree technology.

nginx and muduo both handle events synchronously after calling epoll_wait,while wf handle events  asynchronously.  Why did wf
do that? For better performance?

Yes, the IO results will be pass over to the handler threads through a message queue. This is a very common method of networking framework. If the message queue is removed and the IO threads call handlers directly, we will gain about 10% performance increase.

We have to separate handler threads from IO threads to prevent user's handlers blocking our IO threads. And in some scenarios the number of handler threads can be very large, we should not let all threads to wait for IO events.


Addes support for fill-down and force ResizeType values

See:
https://docs.imgproxy.net/usage/processing#resizing-type

Thanks!


Can't use session_cookies, or need example to do that

Using origin fbchat
Before i am using asyncio version, this code works for me:
with open('session', 'r') as f:
	session_cookies = eval(f.read())
client = AyraMessenger('my_fb_id', 'my_password', session_cookies=session_cookies, logging_level=logging.INFO)

To generate session file:
client = Client(FB_USERNAME, FB_PASSWORD)
with open('session', 'w') as f:
	f.write(str(client.getSession()))

Session file should be a dict, so i am save it as str then get it again as dict with eval
After move to fbchat-asyncio
Now it look like everything was changed, here is my code from Echo bot example:
async def start():
    client = EchoBot(loop=loop)
    print("Logging in...")
    with open('session', 'r') as f:
        session_cookies = eval(f.read())
    await client.start("my_fb_id", "password", session_cookies=session_cookies)
    client.listen()

I am not using password because fb will block me from to do this, and need to change password again and again.
So i am using session, but when using session_cookies args it doesn't work or not using that session.
Please add session_cookies support or if it already support, please add guide how to use session_cookies instead of password.
Thanks

It does already work, but I'm guessing storing it as a string won't work. Looks like I'm storing it with pickle, so I'd recommend you try that.
For more specifics of how I'm using it, see these links

Manual login: https://github.com/tulir/mautrix-facebook/blob/master/mautrix_facebook/commands/auth.py#L123-L127
Save session: https://github.com/tulir/mautrix-facebook/blob/master/mautrix_facebook/user.py#L93
Restore session: https://github.com/tulir/mautrix-facebook/blob/master/mautrix_facebook/user.py#L145-L146

Note that .start() just calls set_session, so both should work. I'm only using set_session instead of start for more control over the process.

Alright got it, thanks for reply

Btw how can you solve account locked after login with fbchat?
Everytime i login with fb chat even with simple code my account got locked and need verifying account.
I'm using this code:
client = Client()
await client.start(FB_USERNAME, FB_PASSWORD)

Then it raise error:
fbchat._exception.FBchatException: Login failed. Check email/password.
After that my account got locked and need to verify.

Logging in in your browser and copying cookies, matching the user agent in your browser and having 2fa enabled generally help

Okay, now it works maybe, but it says Unclosed client session
2019-11-27 18:10:05,984 - root - INFO - Set-Cookie: c_user=1000050260xxxxx
Set-Cookie: xs=blablabla
2019-11-27 18:10:10,162 - asyncio - ERROR - Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x042036F0>
2019-11-27 18:10:10,164 - asyncio - ERROR - Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x041EE998>, 180654.859)]']
connector: <aiohttp.connector.TCPConnector object at 0x04203790>


Clean Metadata CSV before using

Need to remove empty lines from CSV Metadata file before using.

also remove highlighted info lines that aren't useful to us


Fix non-SSE variant of convert_special_to_empty_and_full_to_deleted

As a bonus, it is now faster too!

bors r+


agglomerateByRank(agglomerateTree = TRUE) fails with highest rank

Hi,
using rank="Kingdom" or rank="Domain" breaks agglomerateByRank() when using agglomerateTree = TRUE:
data(GlobalPatterns)
agglomerateByRank(GlobalPatterns, rank = "Kingdom", agglomerateTree = TRUE)
# Error: rownames of 'x' mismatch with node labels of the tree
#  Try 'changeTree' with 'rowNodeLab' provided.
# In addition: Warning message:
# In toTree(td) : The root is added with label 'ALL'
agglomerateByRank(GlobalPatterns, rank = "Phylum", agglomerateTree = TRUE) # this works

Best,
Bela

Hi,
thanks!
It seems that there is a small error when that new tree is built.
Information for building that tree is fetched from rowData(x). When there is only one taxonomic level left (Kingdom), the data is subsetted so that it includes only one column
--> it is a vector, and now it does not include name of taxonomic level. --> tree tips are named incorrectly --> they do not match with rownames
-Tuomas


In mirrored network mode, the adb devices command will be blocked

Windows Version
Microsoft Windows [Version 10.0.22631.3296]
WSL Version
<IP_ADDRESS>
Are you using WSL 1 or WSL 2?

[X] WSL 2
[ ] WSL 1

Kernel Version
<IP_ADDRESS>-2
Distro Version
Ubuntu 22.04
Other Software
adb version:
Android Debug Bridge version 1.0.41
Version 31.0.2-7242960
Installed as /usr/lib/android-sdk/platform-tools/adb
adb.exe version
Android Debug Bridge version 1.0.41
Version 31.0.2-7242960
Installed as D:\Program Files (x86)\Android\SDK\platform-tools\adb.exe

Repro Steps

Turn on the computer, start wsl2
Use the adb devices command, it will be blocked
Use the adb.exe devices command, you can get the machine list
Use the wsl --shutdown command, kill wsl2
Reopen wsl2, use the adb devices command, you can get the machine list

Why do you have to restart once before you can use the adb devices command?
Expected Behavior
the first time use adb devices ， you can get the machine list
Actual Behavior
the first time use adb devices ， you can get the machine list
Diagnostic Logs
No response
### Tasks

here is log file：
WslLogs-2024-03-30_10-46-28.zip

there is all logs；

Hi. Can you please collect networking logs by following the instructions below?
https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

I'm having the same or similar issue when networking mode is set to mirrored. In my case adb server takes too long to respond (2 to 3 mins).
This is the networking log file I created while the server was trying to run: WslNetworkingLogs-2024-12-07_15-42-28.zip

Current workaround:

Remove adb from wsl: sudo apt remove android-tools.
Install adb on Windows.
Make a symlink of adb.exe to adb.

Try this if you don't know where adb is on Windows.
eval "ln $(which adb.exe) $(dirname $(which adb.exe))/adb"

Now run adb start-server in wsl.

face to same issue, any updates here?


How can I get pretrained Model with xception as backbone?

@neiheih Did you ever find out? I want this too.


Document certs needed for development

To run cargo test, the developer will need to first create a certificate for Trow to use. We should document this better.

#193 might help under ./dev/ca or ./dev/tls

Closing via https://github.com/ContainerSolutions/trow/commit/78972e683fff90e9686e3d685ccb1da7c9208d6e (I did mention hostctl and mkcert).


TdApi.GetChatHistory() getting newer messages from second time

I'm using tdlib java on Android. I know the TdApi.GetChatHistory() is for getting older messages and that there is the last known message idea and I have to open the chat and listen for message updates to get the newer messages.
When I call getChatHistory() with lastMessage?.id I get a result. But when I specifically don't call openChat, clear the app from memory and reopen the app, which calls getChatHistory() again - I get newer messages than the last time. Where do these messages come from? Does Tdlib remember my last call with my app id and know which newer messages to provide? Does this mean the last known message has now changed?
How can I make sure I get newer messages from the first launch? Appreciate any pointers!

If you get newer messages, then definitely the last known message has changed. There is no way to receive newest messages other than opening the chat and waiting for updates.

What if I provide a negative offset in TdApi.GetChatHistory()? Let's say TdApi.GetChatHistory(chat.id, lastMessage.id, -10, 11) - would this give me newer messages from the previous last known message?

No.

Thanks. Further to that, I do open the chat (TdApi.OpenChat()) and I have an active onUpdate() method that receives updates, but I don't receive any messages. I'm not talking about messages that are sent after the chat is open, but those that are already sent but newer than the last known message. How long does it usually take for those messages to be received?

There is no upper bound on the time for new updates to be received. But you should also be aware that in supergroups and channels not all new messages are received through updateNewMessage updates. If this happens, then an update updateChatLastMessage with last_message == null will be sent: "If last_message is null, then the last message in the chat became unknown". The update means that a message gap could have been created in the channel and newer messages can be received only by explicit getChatHistory request by the user.

So if I understood correctly, I need to watch if I receive an updateChatLastMessage with last_message = null and then I can send another getChatHistory request. This is very helpful - thank you!


fought, anerythroplasia

This pull request was generated by the 'mq' tool
[test]
flake rate: 0.4
logical conflict every: 100
sleep for: 300s
[pullrequest]
requests per hour: 30
deps=[a,f]

/trunk merge


Write a Kotlin program to convert string to kebabcase

Description
Write a Kotlin program to convert string to kebabcase
Kebabcase is a style of writing in which all letters are lowercase and spaces are replaced with hyphens.
Input  : "hello world"
Output : "hello-world"

How to contribute

Save the solution in program/ConvertStringToKebabcase.kt file
Add ConvertStringToKebabcase.kt file in convert-string-to-kebabcase folder

!assign


ECA-NS implementation

Thanks for your great works.
I want to apply ECA-NS. I found previous issue and below was your answer.
Use nn.functional.unfold() and conv1d with inchannel=C, outchannel=C and group=C.
I can't get it how to use it. is there any code for it?

Thank you for your attention, we have updated the implementation of ECA-NS in models.

Thank you for your good job! I am a beginer, what is the ECA-NS?

@whjzsy One of ECA's variant. Read the paper and you will find it.

@BangguWu I did ECA-NS using different way (but similar with yours) but it was slow compared to SE or ECA.
As kernel size become larger, it would be much slower. Am i right?


istio_tcp_sent_bytes_total and istio_tcp_received_bytes_total are swapped

Bug description
TCP bytes sent on outgoing connection and received are reversed
This is a screen shot of sending request at 50 qps and receiving 2k responses: (mislabelling a fortio http echo as tcp on purpose to demonstrate the issue:)

It's not just Grafana but the actual prometheus metrics istio_tcp_sent_bytes_total and istio_tcp_received_bytes_total are swapped
[ ] Docs
[ ] Installation
[x] Networking
[ ] Performance and Scalability
[x] Extensions and Telemetry
[ ] Security
[x] Test and Release
[x] User Experience
[ ] Developer Infrastructure
[ ] Upgrade
Expected behavior
Bytes sent to be sent and received to be received (from the perspective of the pod; seems to be maybe from perspective of envoy)
Steps to reproduce the bug
See description
Version (include the output of istioctl version --remote and kubectl version --short and helm version --short if you used Helm)
1.8.5
How was Istio installed?
helm
Environment where the bug was observed (cloud vendor, OS, etc)
AWS EKS

Indeed looks like a bug.. Bytes received / sent logic should be direction aware: https://github.com/istio/proxy/blob/e02cbbe2e3f390afd9711c5d5e9f4bb5462059ea/extensions/stats/plugin.h#L369-L378

cc @douglas-reid

This is working as intended. @ldemailly the confusion is from the fact that we report from the perspective of the proxy. The metrics should be interpreted bytes sent from source to destination as reported by reporter. In that sense, the metrics are intentionally almost identical from both sides.

cough cough. hi kuat, no you can't quite say that bytes sent on outgoing connection is actually bytes received :-)

hi Laurent. I think the chart needs to be better explained. The outgoing connection is not what most assume (it's not from pod, it's to the proxy).

all the http sent/received are consistent except for tcp, it's not an explanation it's inconsistent/ a bug

In other words, I understand that's true from
the proxy's point of view but that doesn't mean it's the right name. Istio is about then workloads, the bytes the workload receives and sends; same as for http. the proxy is "transparent"

Hi
I also ran into this issue when building a custom dashboard. Using the hipstershop demo app I noticed that the traffic between the cartservice and the redis service that it uses is the same on both sides. So both sender and receiver report the same about of bytes for sent and received, which does not make any sense. Sure, it can be solved in a grafana dashboard by swapping the metrics, but I think it makes more sense to fix this in the proxy itself.


Niantic detect the Bot

Currently using dev branch.
First minutes using the bot works (5 minutes), then it dont find pokemons anymore, it keep running without finding pokemons, When I change my connection (IP) it works again for a few minutes and stop.
It means Niantic knows exactly who is using the bot.

Yep exacly i saw this same. After morning git pull my bot was banned... i Create new server with new IP and login/password after 10 minutes i get ban.

if you are using more than 2 bots, you will get IP softban less than 30 min. it will wore of after 1 hour or so. i use the 1 bot, and it run 7 hours now.

fari-99: are you using 3G/4G connexion ?

https://github.com/PokemonGoF/PokemonGo-Bot/issues/3720
@k4n30

I tested, new connection using only one bot, I have the same problem, banned after a few minutes.

i use new login/password, new installed server and i use new IP address and after 10 minutes get ban...
So they find a way to detect a bots...

game over?

Takenek, what was your move speed?

It seems that Niantic should be detecting if your connection is 3G/4G. After I connect my laptop to the hot spot of my cell phone, the bot works again.

After I connect my laptop to the hot spot of my cell phone, the bot works again.
Try connect phone to wi-fi than PC to phone

@MeowoeM thats not right. if someone in cafe and play pokemon with wifi then they get banned? i don't think so.
@z4ppy i'm using home wifi

its a simple  ip ban..   dont worry

I switched on my phone to 3G connection but still there are no pokemon or stops on the map.

Exactly the same situation. It works the whole past night until about an hour ago.

tes, same ban with 2 bot, now i try with one

4G works for me... both on dev as on master / Desktop

@fari-99 @divrot
IP ban is more probable. As you said, when i reconnect my phone to wifi, nothing appears in pg. My last guessing is misleading. sorry for that

@fari-99.  You don't understand the problem? this is a real issue, you should not close a not solved issue.

@MeowoeM no problem.
@mariuserik the developer need more information!! if you just give the dev like followspiral bug, can't spinfort and etc. you can't work with it!! there is already issue like this everywhere in this repo, maybe if you kind enough to search it, maybe your issue get solved!!

Woah i think niantic figured out how to terminate the bots

@fari-99 I say exactly what is happening. Niantic detects that you are using bots. I've opened a Issue so that we can discuss it. Thats how this "Issue" page from github works like. Its easily reproduced, so that developers may debug it.

Might have been coincidence but this happened to me after doing a "git pull" wish I knew which SHA I was on before doing so. I think everyone started to get hit about the same time as when I did this (so we can just all blame me xP)
According to chat some guy was running many other bots ~1600, around 40 of which were this bot and they had around a 75%+ ban rate, while his other bots sound to be un-touched.¿ Time will tell...

@mariserik: You do not understand, niantec does not detect robots but the type of connection you use. I think for now they only accept connections from that IP telephone operator! (Some ISPs still work elsewhere;)

@mariuserik yes, use that issue page for discussing, please. not create another issue. thats why we want you to see the other issue and begin discussion there. btw that's why we use search engine.

when u run at least 2 bot, the bot just walk , but when u stop it walk attribute say 0 km, you have to reset the modem and if u play with only one both work fine

I am not sure, but this could be a different issue. The references above suggested that the problem could be solved by manually changing one's location. I just did - nothing changed.

i failed to get game data from the server on one of my accounts

@PokeProgress maybe this will help #3694

#3308 #3394 #3475 #3646 #3692 #3700 #3711 #3721 #3722

I would recommend to anyone not to use the bot, till this is fixed. There are cases of permanent ban. And a few discussions are running on Reddit
https://www.reddit.com/r/pokemongodev/comments/4xct8f/psa_permabans_have_arrived_stop_all_use_of_3rd/
https://np.reddit.com/r/TheSilphRoad/comments/4xcvl1/bots_and_spoofers_receiving_permanent_bans/

Same problem today after I did a Git pull.
But I reverted back to an older version from last night (11/08/2016) and it works again.  So some recent commit seems to be causing an issue.
I didn't run it for very long however because of the rumours of permabans going around now until there is more information...

2016-08-12 13:24:53,011 [pgoapi.rpc_api] [DEBUG] Protobuf structure of rpc response:
status_code: 3
request_id:<PHONE_NUMBER>2972132
returns: ""

2016-08-12 13:24:53,067 [pgoapi.rpc_api] [DEBUG] Decode raw over protoc (protoc has to be in your PATH):
Couldn't find protoc in your environment OR other issue...

@k4n30. You just closed alot of duplicate. But dont even say which Issue is the "original", in which ticket is this Issue being discussed?

@mariuserik trying to set that up now

#3682 - META Server busy or offline issues
#3308 - META Stuck between two forts / Moving to 2 forts at the same time / Constant Loop
#3700 - META Soft bans - Try again spins / Pokemon vanishing

I got the same problem after git pulling today. Checking out d7cb7df27516b588252a767260176f92586489fa fixes the problem for me.

from what i read from this, it is NOT safe to use this bot any more. Am I right?