fix(payload, ui): sends cropped image pixel values to server instead of percent values

Description
v2 PR here

[x] I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

[x] Bug fix (non-breaking change which fixes an issue)

Checklist:

[x] Existing test suite passes locally with my changes

Hey, I'm getting this error when I try to upload an image:
Error cropping image: Error: Expected integer for width but received NaN of type number
    at Object.invalidParameterError (/app/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp/lib/is.js:135:10)
    at Sharp.<anonymous> (/app/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp/lib/resize.js:475:16)
    at Array.forEach (<anonymous>)
    at Sharp.extract (/app/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp/lib/resize.js:470:38)
    at y (/app/.next/server/chunks/2048.js:286:108564)
    at H (/app/.next/server/chunks/2048.js:286:115242)
    at async T (/app/.next/server/chunks/2048.js:286:12554)
    at async Object.tR [as create] (/app/.next/server/chunks/3975.js:1:101317)
    at async /app/.next/server/chunks/3975.js:1:117120
    at async /app/node_modules/.pnpm/next@15.0.0-canary.35_react-dom@19.0.0-rc-58af67a8f8-20240628_react@19.0.0-rc-58af67a8f8-20240628/node_modules/next/dist/compiled/next-server/app-route-experimental.runtime.prod.js:14:39002

I looked at the network tab and I'm still seeing percentages.

If I've understood correctly, this is likely the cause of my issue?
I'm on 3.0.0-beta.57

Hey @HarleySalas - can you send me your uploads config and the file that you are trying to upload?
I'm currently unable to reproduce this behavior

Hey @PatrikKozak I apologize I didn't look at this again sooner and try to provide a reproduction, I've just been super busy.
I just ignored the issue and suddenly, it's not broken. I looked at the media query string and form state now and the method it's using now is completely different, using a proper form state and action, it looks like, rather than a big query string.
Between all version updates, I always clear my .next folder, but not always my pnpm-lock.yaml file. I can't remember deleting it recently, but I must have done something with it. I imagine this issue only existed due to a problem in there. To be honest, I've never had to remove the pnpm-lock file more often than I have had to with Payload. I'm not sure if theres something more that can be done to prevent it, or if perhaps it could be worth not only asking people what version they're on, but that one of the first troubleshooting steps should be to delete the pnpm-lock.yaml file. Genuinely, there have been a lot of issues due to it.

@HarleySalas Glad that the image cropping issue is resolved!
And apologies for the difficulties you are experiencing - hopefully these issues should dissipate once we reach stable for v3, we're almost there!
One thing I do recommend doing is the following though:
Whenever updating your payload version in your project, or any other dependency, it's good practice to yes delete your .next file but also your node_modules file - and then perform a pnpm install.
Often times if you perform a pnpm install without deleting your node_modules first, then your node_modules may include the latest version of your updated dependency and the previous version - deleting your node_modules beforehand should prevent this from happening.

Are you guys sure it isn't something more than that?
Keep in mind, I had this happen in both production and in my developer environment. In prod, it does a full pnpm install with each deploy.
The only thing that doesn't change is the pnpm-lock.yml. I've just never had to remove .next, pnpm-lock.yml and node_modules for other packages. Usually, running upgrade commands via pnpm for out of date packages is pretty smooth.
In any case, I'm fine removing the files and reinstalling each time. Just thought that maybe something could be done to mitigate it on your end. Thankfully I'm on Linux now and pnpm install takes a couple seconds, rather than 5~10 minutes like windows


SL Review: Data | Connect API endpoints to front end form

User Story
A short, simple description of a feature or issue told from the perspective of the user.
“As a user, I want the basic information section and Work Relationships and background section of the form to have all the fields in there prepopulated so that it saves time for me to fill out a long form.
Tasks

[ ] The given fields (as highlighted in attached screenshot) are auto-filled when I'm creating a new SL Review submission

Acceptance Criteria
When the above checklist has been checked off and the fields in the 2 sections have correct pre-populated info from the ODS/PeopleSoft
Link to draft form in DEV- https://digital-journeys-dev.apps.silver.devops.gov.bc.ca/form/62f6a0e509da98bcd4d3d73c
Technical Details

Current ODS (operational data store) endpoint is accessible at https://analytics-testapi.psa.gov.bc.ca/apiserver/api.rsc/Datamart_Telework_employee_demo (when connected to the BCGov VPN).
Mapping of this data so that a form can access it happens in employee_data.py
Fields are automatically pre-populated with data as long as the "Property Name" of the "API" tab of a component in the forms designer matches a key in the payload.

Screenshot to fields

These are the mapping of the fields in the form and the key of data we're getting from ODS. For the missing ones, I'll first look into the ODS table and if not found it there will talk to @T854236 for the possibility of adding the missing info to the ODS table.
Employee work relationship and background
Ministry/organization => organization
Branch/division
Deputy minister's (DM) name
Assistant to the deputy minister's (ADM) name
Manager/supervisor name => supervisorName
Manager/supervisor title => supervisorPositionTitle
Manager/supervisor email => managerEmail
Number of direct reports
Number of indirect reports
Personal Information
Employee name => name
Employee number => empId
Employee email => email
Employee position/title => positionTitle
City => city
Postal code => postal
Belong to diversity group? (Yes/No/Prefer not to say)

For branch/division, please have a look at level2_division.
Can you confirm at what lowest level leaders this form is form?  Depending on the level, this will dictate approach in getting the DM and ADM information.  It will most likely be in a separate endpoint.
We will need to check with PS BSAs for the indirect reports if/where it is stored.
For direct reports, a count on the existing endpoint where it matches the supervisor id should work?

Can you define how indirect reports should be counted?  For example, is it the number of employees that report to an employee that reports to a leader?

Decision needed: Can you confirm at what lowest level leaders this form is for? Depending on the level, this will dictate approach in getting the DM and ADM information. It will most likely be in a separate endpoint.
Decision needed to find out if it is technically possible: We will need to check with PS BSAs for the indirect reports if/where it is stored. For direct reports, a count on the existing endpoint where it matches the supervisor id should work?

@HasanSifat The currently available fields are added to the DEV and are ready for testing.

4 fields for Patrick to add to ODS

Personal information Panel pre-populated with correct info for my profile-

Employee work relationships panel: 2 fields not pre-populated

With ADM and DM information, can you confirm leaders to be returned when there are multiple ADMs?  For example, an ADM might report to another ADM.  Should ADM return the first one and then the DM (skipping the 2nd ADM).

Tested successfully in DEV. Ready to be transferred to TEST

@HasanSifat  Deployed to TEST and ready for testing

Tested successfully in TEST. Ready to be transferred to PROD

Simen will deploy to prod when we have more SL tickets - ready to be tested


Prefer cartesian2 representation in CZML for PolylineVolume.shape.

In CZML, cartesian always means a three-dimensional Cartesian3.
shape is a list of two-dimensional Cartesian2 values, which should be specified as cartesian2.
For backwards compatibility, the out-of-spec cartesian representation is still accepted.
Also adds polylineVolume to the CZML validation document assertions.

Thanks for the pull request @shunter!

:heavy_check_mark: Signed CLA found.
:grey_question: CHANGES.md was not updated.

If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

[ ] Cesium Viewer works.
[ ] Works in 2D/CV.
[ ] Works (or fails gracefully) in IE11.


added core interceptor for pipeline

Closes: https://issues.redhat.com/browse/RHOAIENG-5329
Description
continuation for updating interceptOdh for pipeline intercepts

How Has This Been Tested?
npm run test

Test Impact

Request review criteria:

Self checklist (all need to be checked):

[x] The developer has manually tested the changes and verified that the changes work
[x] Commits have been squashed into descriptive, self-contained units of work (e.g. 'WIP' and 'Implements feedback' style messages have been removed)
[x] Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
[ ] The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

[ ] Included any necessary screenshots or gifs if it was a UI change.
[ ] Included tags to the UX team if it was a UI/UX change (find relevant UX in the SMEs section).

After the PR is posted & before it merges:

[ ] The developer has tested their solution on a cluster by using the image produced by the PR to main

/retest

/retest

/retest

/lgtm
/approve


python3Packages.afdko: 3.7.1 -> 3.8.0; fonttools: 4.29.0 -> 4.30.0; and related updates

Description of changes

A ~big~ pile of font toolchain related package updates  which makes things easier since these packages all depend on each other.
Things done

Built on platform(s)

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

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

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

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

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

@ofborg build noto-fonts-emoji
@ofborg build twitter-color-emoji

@GrahamcOfBorg build cantarell-fonts

@jtojnar Tested cantarell-fonts with nix-build -A cantarell-fonts --check just now, since it's a fixed output derivation apparently and it seems to work fine still.

@ofborg build noto-fonts-emoji
@ofborg build twitter-color-emoji
Note hopeful ofborg will finish these based against staging, FWIW tested noto-fonts-emoji locally.


New leprechaun issue

poetry run python replay_commit.py fcaa4642198d41003bf8f29774c22ab523e2f407
fcaa4642198d41003bf8f29774c22ab523e2f407

964b1f99674d76e099f5c56a42c99fe2ad3188f0

This wasn't really a leprechaun issue it was a shop door issue! Or maybe a hybrid ...


The difference implementation of RPE between Point Transformer V1/V2 and V3

Hi, Pointcept Team,
I notice that the RPE implementation is different between V1/V2 and V3.
Background

In Point Transformer V1, it simply follow the general strategy, directly add the position relation features, which go through a linear layer, into the qk vector, to plus in some relative position information into the features.
relative code
p_r, x_k = x_k[:, :, 0:3], x_k[:, :, 3:]
p_r = self.linear_p(p_r)
r_qk = (
    x_k
    - x_q.unsqueeze(1)
    + einops.reduce(
        p_r, "n ns (i j) -> n ns j", reduction="sum", j=self.mid_planes
    )
)

In Point Transformer V2, you propose the position encoding multiplier, which in detail, is use linear layer generate the coefficient and the bias, than multiply and add to the qk features.
relative code
if self.pe_multiplier:
    pem = self.linear_p_multiplier(pos)
    relation_qk = relation_qk * pem
if self.pe_bias:
    peb = self.linear_p_bias(pos)
    relation_qk = relation_qk + peb
    value = value + peb

However, in Point Transformer V3, you use a different strategy, though it still call RPE.
In detail,,

you define a torch.nn.Parameters variable named rpe_table, the shape of which is [3 * self.rpe_num, num_heads].
the output of RPE depends on the idx of the grid that point located in. The idx as an index to select the corresponding rep_table item, or in other words, scatter the rpe_table item / trainable parameters into a same shape tensor based on the idx.

relative code
class RPE(torch.nn.Module):
    def __init__(self, patch_size, num_heads):
        super().__init__()
        self.patch_size = patch_size
        self.num_heads = num_heads
        self.pos_bnd = int((4 * patch_size) ** (1 / 3) * 2)
        self.rpe_num = 2 * self.pos_bnd + 1
        self.rpe_table = torch.nn.Parameter(torch.zeros(3 * self.rpe_num, num_heads))
        torch.nn.init.trunc_normal_(self.rpe_table, std=0.02)

    def forward(self, coord):
        idx = (
            coord.clamp(-self.pos_bnd, self.pos_bnd)  # clamp into bnd
            + self.pos_bnd  # relative position to positive index
            + torch.arange(3, device=coord.device) * self.rpe_num  # x, y, z stride
        )
        out = self.rpe_table.index_select(0, idx.reshape(-1))
        out = out.view(idx.shape + (-1,)).sum(3)
        out = out.permute(0, 3, 1, 2)  # (N, K, K, H) -> (N, H, K, K)
        return out

Question
If my understanding above is correct, although the strategy used in PTv3 is still reasonable, since I seems strange to some extent, I want to know, why you use another implementation of RPE in the PTv3?

I think RPE is not officially acknowledged as one component of PTv3 as we encourage CPE with sparse convolution. Yet for your mentioned RPE in PTv3 code, this is a way of RPE with a lookup embedding table that was also used in Stratified Transformer. I remember this way is easier to converge.


layout: allow arbitrary CSS attributes

Allow arbitrary CSS attributes when using app.add_css_file() on Sphinx.
It can be useful e.g. to insert media or any other attribute. Note
that rel and type are set by default.
Fixes #1100

Does feature for other sphinx themes? This is what the basic theme does, does this syntax work?
    {%- for css in css_files %}
      {%- if css|attr("filename") %}
    {{ css_tag(css) }}
      {%- else %}
    <link rel="stylesheet" href="{{ pathto(css, 1)|e }}" type="text/css" />
      {%- endif %}
    {%- endfor %}

@Blendify thanks for pointing that out! I was not aware of css_tag.

The change is good, however it requires sphinx 1.8 but currently we support versions down to 1.6 so this will need to be an if else block see https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html#L59 or wait until #1075.
If you use the if else block I will add this to the upcoming 1.0 release.

It seems to merge is blocked however, maybe because you force pushed a commit

We still support Sphinx 1.6 in 1.1... but will be dropped in 2.0. See: https://sphinx-rtd-theme.readthedocs.io/en/stable/development.html#release-2-0-0

any chance this can be merged? @Blendify

Note, this was merged in #1519


Draft: Improve performance of measure_all by inlining calls to barrier

Summary
Improve performance of measure_all by inlining calls to barrier
Details and comments
Benchmark:
import time
from qiskit.circuit import QuantumCircuit
def g():
    qc=QuantumCircuit(2)
    qc.measure_all()

x=[]
for ii in range(20):
    t0=time.time()
    for ii in range(1000):
        g()
    dt=time.time()-t0
    #print(dt)
    x.append(dt)

print(f'total: {sum(x):.2f} seconds')

Results:
main: total: 2.89 seconds
PR: total: 1.88 seconds

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

3 of 3 (100.0%)  changed or added relevant lines in 1 file are covered.
6 unchanged lines in 1 file lost coverage.
Overall coverage increased (+0.01%) to 87.028%

Files with Coverage Reduction
New Missed Lines
%

crates/qasm2/src/lex.rs
6
91.16%

Totals

Change from base Build<PHONE_NUMBER>:
0.01%

Covered Lines:
74169

Relevant Lines:
85224

💛  - Coveralls

I've just pushed up b4ff01e to correct the use of the fast path constructors both in normal cases and in the case of control-flow scopes.  That also had the effect of inlining the measurements, so it's good for about another ~20% speedup on the timings at the top of this PR comment.
Since I pushed up a non-trivial amount of code to the PR, it'll need an alternate reviewer now.

I've just pushed up b4ff01e to correct the use of the fast path constructors both in normal cases and in the case of control-flow scopes. That also had the effect of inlining the measurements, so it's good for about another ~20% speedup on the timings at the top of this PR comment.
Since I pushed up a non-trivial amount of code to the PR, it'll need an alternate reviewer now.

@jakelishman This PR still needs an update to current main. Do you want me to pick this up?

It's ok, thanks - it's not a problem that it's not updated to main, because part of our merge train will cause it to get automatically updated.  Unfortunately, I've broken the tests with my changes because I didn't test in enough detail, so that's my fault and I'll just fix it up quickly.

It transpires that the test failure is because of (imo severe) problems with NLocal via BlueprintCircuit, and I'm amazed it worked in any way before now.  The principle is that any subclass of BlueprintCircuit is fundamentally unsafe to general mutation, because if the "build" gets invalidated (e.g. here by adding a register), then the circuit is incredibly susceptible to being rebuilt completely out-of-order:
from qiskit.circuit.library import RealAmplitudes, XGate
from qiskit.circuit import CircuitInstruction, ClassicalRegister

qc = RealAmplitudes(num_qubits=2, reps=2)
qc.add_register(ClassicalRegister(2, "meas"))
qc._append(CircuitInstruction(XGate(), (qc.qubits[0],), ()))
qc.draw()

        ┌───┐┌────────────────────────────────────────────────┐
   q_0: ┤ X ├┤0                                               ├
        └───┘│  RealAmplitudes(θ[0],θ[1],θ[2],θ[3],θ[4],θ[5]) │
   q_1: ─────┤1                                               ├
             └────────────────────────────────────────────────┘
meas: 2/═══════════════════════════════════════════════════════

That's a problem with BlueprintCircuit in general, though, so best fix it in another issue (I can potentially do that).

Ok, said fix is in #11181, which this PR is now blocked on.  It turns out that the original iteration of this PR also triggered the bug of #11180, but because it was only Barrier that was using the _append call, it wasn't detected.

Closing in favor of #11345


Getting the exception while enabling the Share in Pinterest from the backend

Terms

[X] Before you openning this issue, i have checked if the issue has already been reported.

Bagisto Version(s) affected
Master
Issue Description
If the Share in Pinterest is enabled from the backend and the customer is trying to view any product then there is an exception.
Preconditions
1. Admin should be logged in
2. Some products should be created.
3. Social Share should be enabled for products from the backend.
Steps to reproduce
1. Go to the 'admin panel'
2. Click catalog inside the configuration tab.
3. Enable Share in Pinterest inside the  Social Share section.
4. Visit the shop.
5. Try to view any product.
6. See the error.
Expected Result
There should not be any exception if the  Share in Pinterest is enabled by the admin.
Actual Result
If the Share in Pinterest is enabled from the backend and the customer is trying to view any product then there is an exception.
Screenshots

Additional context
No response

Please assign this bug to me.

This needs to be fixed in the vendor package. So either reduce dependency and use inside this or make a pull request to that specific repo.

@Sanjaybhattwebkul Already done and merged - https://github.com/bagistobrasil/bagisto-product-social-share/pull/2


@charset should use double quotes

According to MDN (https://developer.mozilla.org/en-US/docs/Web/CSS/@charset#Syntax), the @charset at-rule should use double quotes.
Kind regards,
Johan

I know there is a comment about it a few lines further but maybe it's a good idea to keep it with double quotes to make editors not complain about it?

Hey there!
Thank you for opening an issue. I’m a little torn about this one. While @charset does need to use double quotes in CSS, this is a concern for Sass rendering, not for stylesheet authors.
I’d rather we keep it consistent across the code base using single quotes everywhere, and have Sass convert it to double quotes to follow the spec.
Hope it makes sense. :)

Hi Hugo,
I completely understand. The thing is that some editors display the incorrectly quoted charset as an error. So everytime my 'main.scss' is open I see a big red error at the top.
Feel free to close this PR if you still feel consistent quotes are better. It's up to you 😄
Kind regards,
Johan

I do think consistent quotes are better, but I agree that one should feel free to use double quotes to shut their editor complains. :D


[AutoPR azure-kusto/resource-manager] Added data connection check name availability operation

Created to sync https://github.com/Azure/azure-rest-api-specs/pull/5648

(message created by the CI based on PR content)

Codecov Report

Merging #4850 into restapi_auto_azure-kusto/resource-manager will decrease coverage by 0.06%.
The diff coverage is n/a.

@@                              Coverage Diff                              @@
##           restapi_auto_azure-kusto/resource-manager    #4850      +/-   ##
=============================================================================
- Coverage                                      49.56%   49.49%   -0.07%
=============================================================================
  Files                                           6351     6303      -48
  Lines                                         177623   176618    -1005
=============================================================================
- Hits                                           88033    87420     -613
+ Misses                                         89590    89198     -392

Impacted Files
Coverage Δ

...phrbac/models/application_update_parameters_py3.py
25% <0%> (-3.58%)
:arrow_down:

...re/graphrbac/operations/applications_operations.py
35.98% <0%> (-4.72%)
:arrow_down:

azure-batch/azure/batch/custom/patch.py
80.18% <0%> (-2.41%)
:arrow_down:

...ure-servicebus/azure/servicebus/receive_handler.py
21.33% <0%> (ø)
:arrow_up:

...ebus/azure/servicebus/aio/async_receive_handler.py
20.81% <0%> (ø)
:arrow_up:

...e/textanalytics/models/text_analytics_api_enums.py
100% <0%> (ø)
:arrow_up:

...vices/language/textanalytics/text_analytics_api.py
56.52% <0%> (ø)
:arrow_up:

...ac/azure/graphrbac/operations/oauth2_operations.py
28.57% <0%> (ø)
:arrow_up:

...iveservices/language/textanalytics/models/input.py
100% <0%> (ø)
:arrow_up:

...hrbac/models/graph_rbac_management_client_enums.py
100% <0%> (ø)
:arrow_up:

... and 73 more

Continue to review full report at Codecov.

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

This PR has been merged into https://github.com/Azure/azure-sdk-for-python/pull/4642


Add getOfflineRegion Kotlin API

Adds getOfflineRegion to the kotlin api for android so that we don't have to get the list of all regions and iterate through them.

After this is merged an issue should be created to add a similar API to iOS.


list: port filter provided on cli overrides auto-filter.

Now included in https://github.com/mattytrentini/mpbuild/pull/34


show all schema violations directly and not only one after another

This is resolved when merging the pull request regarding the errors in the gui editor

fixed by story of Paul


Make a subchart that is loaded from another chart file

Possibility to add a "subchart" that is linked and fetched from
another Draw.io chart file. At the moment I'm making three variations of the same plan, and it would be useful, if I could make
sure that some specific part in all of them is always the same. (I don't mean a template, because this subchart part should also be updated automatically as the subchart itself gets updated.)

""I greatly recommend that draw.io use "include another draw.io file" feature, i think this will make the wireframe work efficency, something like app project wireframe. " https://trello.com/c/RYhnVZkJ/250-diagram-embbeding


net/http: http.Transport leaks context from the request

What version of Go are you using (go version)?

$ go version
go version go1.17 linux/amd64

Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/juliens/.cache/go-build"
GOENV="/home/juliens/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/juliens/dev/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/juliens/dev/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/juliens/.gvm/gos/go1.17"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/juliens/.gvm/gos/go1.17/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3799944390=/tmp/go-build -gno-record-gcc-switches"

What did you do?
I use the http.Transport to make an HTTP request. I add a not empty struct in the request context.
You can reproduce it like this

What did you expect to see?
After the end of the request, the struct and the context are cleaned by the GC.
What did you see instead?
After the end of the request, the struct and the context are not cleaned by the GC.
Maybe this is the same issue as https://github.com/golang/go/issues/43966

CC @neild

We seem to be having the same problem. In long running instances, memory utilization is going up every day reaching 80-90% in ~12 days. We started seeing this issue when we upgraded from Go 1.11.3 (no modules) to 1.17 (with go-modules), before the Memory would stay under 30%. Servers have 4GBs.
When I run pprof I see something similar to the comment in the ticket referenced:
      flat  flat%   sum%        cum   cum%
    1.50MB  5.07%  5.07%    12.04MB 40.70%  net/http.(*Transport).dialConn
         0     0%  5.07%    12.04MB 40.70%  net/http.(*Transport).dialConnFor
    8.03MB 27.14% 32.21%     8.03MB 27.14%  bufio.NewWriterSize (inline)
    6.02MB 20.36% 52.57%     6.02MB 20.36%  bufio.NewReaderSize (inline)

Well I spotted in my case the solution, I have a global scope context that are aware when a term signal come and all of my workers need to be stopped when it comes. So every time a job start I create a new context with cancel and defer it. With this simple change the leak over bufio.NewWriterSize/bufio.NewReaderSize into transport disappear.

Any update on this issue?
When connecting to new hosts very often, the memory consumption increases very quickly, and never decreases.

We are seeing similar issue when we upgraded from Go 1.13 (no modules) to 1.17 (with go-modules). In our worker instances, memory utilization is going up every day reaching 80-90% in ~8 days. Even tried upgrading to 1.19 but issue still persists.

my pprof looks exactly the same. are there any workarounds? what can i do?

Request context is used to dial connection and there is also https://github.com/golang/go/issues/59017#issuecomment-1499653264 that suggests that it should not be used for that.

#61524 only fixes request context leakage but does not fix *persistConn leaks which I plan to address separately.

I am seemingly still hitting this in 1.23.3, should I open a new issue for this, or should this be reopened?
I am hitting exactly @nikita21's issue, I am seeing dialConn allocating more and more memory.


No differences between Text and FullText

Hello,
First of all thanks for this good library !
I'm having a problem retrieving the full length of tweets when they are truncated.
I'm using the following simple code :
api := anaconda.NewTwitterApi(accessToken, accessTokenSecret)

stream := api.PublicStreamFilter(url.Values{
	"track": trackingArray,
})
defer stream.Stop()

for v := range stream.C {
        t, ok := v.(anaconda.Tweet)
	if !ok {
		logrus.Warningf("received unexpected value of type %T", v)
		continue
	}
	fmt.Print(t.Text)
	fmt.Print(t.FullText)
}

Both printing methods print exactly the same tweet (the full tweet if its length is low and a truncated tweet if its length is over 140 characters).
It may be a dumb question as I'm not an expert in programming.
Anyway thanks for the time you spend responding to me.

@apaillarse: Thanks for your report! Can you check if the problem still exists if you initialize the stream like this:
...
v := url.Values{}
v.Set("tweet_mode", "extended")
v.Set("track", trackingArray)
stream := api.PublicStreamFilter(v)
...

Yep, I hit the same issue, but with tweet_mode set to extended it looks good now. Thanks.

It didn't change anything for me...
Can you share your code @krisiasty ?

I thought I had this issue but what I found was if it was a retweet, the FullText is always truncated (it's as received). If you check
if tweet.RetweetedStatus != nil { 		originalFull_text = tweet.RetweetedStatus.FullText }
you will get the >140 chars version

@jnflint I believe that is how the Twitter API behaves and how it is documented.

@muesli yes, I was just mentioning as the stream I am looking at has a very high level of retweets so it looked like there was a problem when there wasn't. Thought I would mention it in case someone else thought the shorten text in retweets was a problem


APIs comparison

Compare the API and formulate the final specification for the team

https://docs.google.com/spreadsheets/d/1rxEYt4RA7edDyMYucILNuYBYIntWnT1EwHhbqHoPd3o/edit?gid=692193875#gid=692193875

Sorry to reopen it. But where is lora support? When it will be added?

Something like that would be pretty cool https://loraexchange.ai/models/adapters/


It  seems it doesn't support for Mac mini (M1 chip , 2020)

Hey,
I try to create a commandline tool for Mac , integrating OHMySQL by dragging  its source code：

However, when I build the Xcode project it gives me such error messages :
“ Building for macOS, but the linked library 'libmysqlclient.a' was built for iOS + iOS Simulator."
" The linked library 'libmysqlclient.a' is missing one or more architectures required by this target: arm64."
The first problem is  so easy .I just need to remove the file built for IOS + IOS Simulator;
The sec problem, I consider going to its official website:https://dev.mysql.com/downloads/mysql/
then download the "mysql-8.0.27-macos11-arm64.tar.gz" and unzip it

Next, I copy the "libmysqlclient.a" build for arm64 from downloaded folder and replace the old one build for x86 in the project.

Try to build the project again , but still fail with warning and  errors.
warning:
no rule to process file '/Users/atomlee/Desktop/Demo/xcode_test/test_Controll_SQL/test_Controll_SQL/OHMySQL/lib/include/mysql/client_plugin.h.pp' of type 'sourcecode.pascal' for architecture 'arm64'
errors:
Undefined symbol: _BIO_free
Undefined symbol: _BIO_get_callback_arg
Undefined symbol: _BIO_new_bio_pair
Undefined symbol: _BIO_new_mem_buf
Undefined symbol: _BIO_set_callback_arg
Undefined symbol: _BIO_set_callback_ex
Undefined symbol: _BN_bin2bn
Undefined symbol: _DH_free
Undefined symbol: _DH_new
Undefined symbol: _DH_set0_pqg
Undefined symbol: _ERR_clear_error
Undefined symbol: _ERR_error_string_n
Undefined symbol: _ERR_get_error
Undefined symbol: _ERR_get_error_line_data
Undefined symbol: _EVP_CIPHER_CTX_free
Undefined symbol: _EVP_CIPHER_CTX_new
Undefined symbol: _EVP_CIPHER_CTX_set_padding
Undefined symbol: _EVP_CIPHER_block_size
Undefined symbol: _EVP_CIPHER_iv_length
Undefined symbol: _EVP_DecryptFinal_ex
Undefined symbol: _EVP_DecryptInit
Undefined symbol: _EVP_DecryptUpdate
Undefined symbol: _EVP_DigestFinal_ex
Undefined symbol: _EVP_DigestInit_ex
Undefined symbol: _EVP_DigestUpdate
Undefined symbol: _EVP_EncryptFinal
Undefined symbol: _EVP_EncryptInit
Undefined symbol: _EVP_EncryptUpdate
Undefined symbol: _EVP_MD_CTX_free
Undefined symbol: _EVP_MD_CTX_new
Undefined symbol: _EVP_MD_CTX_reset
Undefined symbol: _EVP_aes_128_cbc
Undefined symbol: _EVP_aes_128_cfb1
Undefined symbol: _EVP_aes_128_cfb128
Undefined symbol: _EVP_aes_128_cfb8
Undefined symbol: _EVP_aes_128_ecb
Undefined symbol: _EVP_aes_128_ofb
Undefined symbol: _EVP_aes_192_cbc
Undefined symbol: _EVP_aes_192_cfb1
Undefined symbol: _EVP_aes_192_cfb128
Undefined symbol: _EVP_aes_192_cfb8
Undefined symbol: _EVP_aes_192_ecb
Undefined symbol: _EVP_aes_192_ofb
Undefined symbol: _EVP_aes_256_cbc
Undefined symbol: _EVP_aes_256_cfb1
Undefined symbol: _EVP_aes_256_cfb128
Undefined symbol: _EVP_aes_256_cfb8
Undefined symbol: _EVP_aes_256_ecb
Undefined symbol: _EVP_aes_256_ofb
Undefined symbol: _EVP_sha1
Undefined symbol: _EVP_sha256
Undefined symbol: _FIPS_mode
Undefined symbol: _FIPS_mode_set
Undefined symbol: _OPENSSL_init_crypto
Undefined symbol: _OPENSSL_init_ssl
Undefined symbol: _PEM_read_RSA_PUBKEY
Undefined symbol: _PEM_read_bio_RSA_PUBKEY
Undefined symbol: _RAND_bytes
Undefined symbol: _RSA_free
Undefined symbol: _RSA_public_encrypt
Undefined symbol: _RSA_size
Undefined symbol: _SSL_CIPHER_get_name
Undefined symbol: _SSL_CTX_check_private_key
Undefined symbol: _SSL_CTX_ctrl
Undefined symbol: _SSL_CTX_free
Undefined symbol: _SSL_CTX_get0_param
Undefined symbol: _SSL_CTX_get_cert_store

I do need OHMySQL running perfectly on my M1 chip's Mac mini.
What should I do to solve this problem ? Please Help me !!!  Thanks...

Hey @AtomLee4279
Library was build on Intel-based Mac.
What's version of OHMySQL you use?

Hey @AtomLee4279 Library was build on Intel-based Mac.
What's version of OHMySQL you use?

I'm not sure the version. Maybe is 2.1.3 ?  I directly download the codes from "master", and add the folder
" OHMySQL"  into my mac commandline tool's project . (I don't use cocoapods because I encountered another trouble when using it integrating in my project.
It told me "The Podfile contains command line tool target(s) which are attempting to integrate dynamic frameworks.This may not behave as expected, because command line tools are usually distributed as a single binary and cannot contain their own dynamic frameworks".  Ofcourse ,  it's not the point now)

Try the latest version with CocoaPods. Soon, I'll update documentation how to use the library without CocoaPods.
Thanks


Update Composition.rst

corrected a typo and a punctuation mark

https://github.com/Mergifyio backport to iron and rolling


CLI tool idea. Video---> Mp3

Just an idea. If anyone find this interesting please comment and also if anyone finds that there is already a CLI tool for that, then also please comment with link to that tool.

I assume you want to extract audio from a video file. FFmpeg gets the job done, and is extremely powerful. Infact, majority of the video converter softwares you find online use it for encoding, decoding, transcoding purposes. You can find all the relevant details here: https://www.ffmpeg.org/
If you intend to convert YouTube videos to audio, you can do it using youtube-dl. Find more info here: https://rg3.github.io/youtube-dl/. It also supports lot more services besides YouTube.

Damm. Thanks, Closing this as this won't be useful.


[DebugInfo][NFC] Re-enable async-direct-arg.swift test

This test had been disabled back in 2021:
https://github.com/apple/swift/pull/36479
With this commit, it should now pass.
We also add a 64-bit target requirement, since this test relies on entry_values being produced.

@swift-ci please test

Thanks!


extend to more generic solution to support real-time syncing with a rag database

This is really awesome. I've been meaning to build something similar and extremely excited to see you've done such a great job @jahwag
I think this approach is much more sensible than re-invent-the-idea such as cursor.com
It would be great to turn this into a more generic project by also allowing to sync your code code with a vector database / RAG and then plug it into any model.
Next step would be to do the same as a github action to automate the workflow.
Let me know if you are interested in collaborating on this.

Welcome @ayushin! I'm glad you're enjoying ClaudeSync!
It's always great to receive suggestions for new workflows and use cases. Currently, the tool is tailored to what I needed at a particular point in time. However, I hope that through community effort, it can gradually evolve into something more universal. As you mentioned, Cursor takes a more opinionated approach to solving a similar problem, whereas ClaudeSync aims to be more like a toolbox than an excavator.
The current architecture has only one extension point: providers. So, the easiest way to implement syncing to a vector database would be to add it as a new provider. That said, since providers were initially envisioned as having LLMs, some surrounding changes would be beneficial for a good integration.
Running ClaudeSync as a GitHub action would certainly be easier if we could pass all prompted arguments. This is something I've been meaning to implement but haven't needed yet. Currently, it's inconsistently applied, with some newer arguments like --category being exposed while older ones like project ID are only prompted.
By the way, which vector database would you find most useful to support?


battle stage: some texture elements should be animated

example of Ifrit's cave shows animated lava.
Question is - how? (from the file view, not implementation)
I checked the documentation for stage files and:

there's 4 bits of unkown data for each triangle and quad that the other half is used for CLUT
Settings data that gets used by camera but actually holds variables for geometry rendering too

This is old news but I had done a hard coded animation. This could work till you come up with something more like how the game does it.


refactor: cmf after resolve hook

Summary

Require Documentation?

[ ] No
[ ] Yes, the corresponding rspack-website PR is __

!bench

!eco-ci


adds support for the React preview events by default

There is no need for these changes. Devtools work perfectly without it.


Security Alerts not generating security incidents on Microsoft 365 Defender

Hi,
We have multiple customers with alert policies configured in their tenants. Some of this alerts (for example "Email reported by user as malware or phish") generates an incident on Microsoft 365 Defender but there are some alerts policies (for example "Elevation of Exchange admin privilege") that is generating an alert but not an associated incident on Microsoft 365 Defender.
This is a very big problem because we have Sentinel with Microsoft 365 Defender connector and Sentinel only receives the incidents when the alert policy generates an associated incident on Microsoft 365 Defender but when the alert policy doesn't generate an incident on Microsoft 365 Defender, this is not sending to sentinel and there isn't incident on Sentinel (I assume that sentinel is a SIEM and it receives all alerts from all diferents connected sources and it seems that is not working as expected).
Please, fix ASAP.

Hello @aquiros17. It sounds like your feedback is more product related than documentation related. Is that correct?

@denisebmsft yes, my feedback is product related. Please, could you say me anything about our problem ASAP?

@aquiros17 Thank you very much for your kind feedback. Considering your valuable feedback, please log this issue as advised as here we are limited to documentation fixes and improvements only. Concerning team will evaluate and take the appropriate action, as per their schedule. We proceed here to close it. Thanks again for taking out some time and sharing your feedback.


Allow Custom Names for External Evidence in Attestation Process

With the introduction of automatic discovery of evidence types during the attestation process, the CLI currently uses the following method to generate random names to ensure uniqueness:
https://github.com/chainloop-dev/chainloop/blob/37f12c6a53461e81b876d5d572d5b6e5d7156369/internal/attestation/crafter/crafter.go#L483
This method guarantees that no name is repeated within the attestation, as duplicate names are not allowed. However, there is no strong reason why end users should not be allowed to provide their own names for pieces of evidence that are outside the contract.
Task
Allow end users to pass a custom name for a piece of evidence that is outside of the contract.
Behavior:

If a name is provided by the user, use that name.
If no name is provided, autogenerate one to ensure uniqueness.

Here there is quick decision tree on what method to use every time:
Decision Point: Check `materialName` and `materialType`

1. If `materialName == "" && materialType == ""`:
   - Call `AddMaterialContactFreeAutomatic` and generate `materialName`
     - If success:
       - Log "material kind detected"
     - If error:
       - Return error "adding material"

2. If `materialName != ""`:
   - Call `AddMaterialFromContract`
     - If success:
       - Done
     - If error:
       - Call `AddMaterialContactFreeAutomatic` with `materialName`
         - If success:
           - Log "material kind detected"
         - If error:
           - Return error "adding material"

3. If `materialType != "" && materialName == ""`:
   - Call `AddMaterialContractFree` and generate `materialName`
     - If success:
       - Done
     - If error:
       - Return error "adding material"

This feature will provide greater flexibility and control to the end users while maintaining the uniqueness of evidence names within the attestation process.

> 2. If `materialName != ""`:
   - Call `AddMaterialFromContract`
     - If success:
       - Done
     - If error:
       - Call `AddMaterialContactFreeAutomatic` with `materialName`
         - If success:
           - Log "material kind detected"
         - If error:
           - Return error "adding material"

about this last part I'd say that if a material name is in the contract make sure we use the kind in the contract and if it fails, just fail, do not fallback to automatic. We should only add the material kind that's in the contract. wdyt?


make bigfix search not require exact name

https://github.com/ucdavis/Peaks/blob/9c88159c83e006e370fb6f0242ed601267714e9f/Keas.Mvc/Services/BigfixService.cs#L54

Bigfix API has another common grouped query called GetComputerByNameContains() which can be used to implement this feature


Largest increasing sub sequence

In the Wiki, the largest increasing subsequence run time is given as O(Logn). It should be O(nLogn).

fixed


Fine-grained lock service in meta server

What problem does the new feature solve?
It ensures correctness during procedures and reduces the lock's scope, making the procedure execution faster.
What does the feature do?
Considers introducing a fine-grained lock service(memory-based) in the meta server's leader. And procedure acquires locks on demand.
The incorrect locking

If we didn't acquire the lock before operating the shared resource, it might incur data inconsistency.
coarse-grained locking

The procedure acquires the coarse-grained lock during the whole procedure. However, if the scope of locks overlaps, procedures are executed serially.
fine-grained locking

Implementation challenges
However, if the old leader loses the leadership(e.g., network partition), its running procedure can still write data into etcd, which also incurs data inconsistency.

Looks interesting. I wonder what's the plan of this issue. @WenyXu

Looks interesting. I wonder what's the plan of this issue. @WenyXu

The fine-grained locks currently have yet to be planned.  Let's implement the #3061 first.


New version

New version should be released in order to start using SPM. I would suggest doing a minor bump to 2.3.0.

Yes indeed, that also occurred to me while I was drinking my beer this evening 😀 Will do tomorrow!

Thanks a lot and enjoy that beer 💪

Done! Since nothing else changed, I labeled the version 2.2.2. Thanks again!


[QUESTION] Is this the correct way to save an uploaded file ?

Hello,
i am trying to save an uploaded file to disk, the following code works correctly but i wonder if it is the correct way to do that.
def parse(file: UploadFile = File(...)):

    extension = os.path.splitext(file.filename)[1]
    _, path = tempfile.mkstemp(prefix='parser_', suffix=extension)

    with open(path, 'wb') as f:
        f.write(file.file.read())

Basically i need to get the path of the temp file.
I also have tried with .rollover() but file.file.name does not return the path (only the file descriptor)

It's not clear why you making a tempfile - UploadFile already does that under the hood if file size is larger then some configured amount.

file.file.read() - this line can "eat" your entire memory if uploaded file size is larger than free memory space
you would need to read(chunk_size) in loop and write chunks to the copy

@vitalik i must save the file on the disk. I know UploadFile stores the file if it is larger than free mem space but i have to save all the files i receive.

well my point is - why you use tempfile ?...
from you code looks like you do not close the tempfile handle correctly (your "_" variable)
read more - https://www.logilab.org/blogentry/17873

@vitalik any suggestions of a good chunk size?

@vitalik any suggestions of a good chunk size?

to solve the out of memory issue the maximum chunk size should be:
chunk_size = free_ram / number_of_max_possible_concurent_requests
but these days 10kb should be enough for any case I guess

@vitalik because i have another library that waits a path. I use textract to read the content of the files (.pdf, .doc etc) Unfortunately i cannot pass an already opened file, so i thought to save it and then pass the path to that library.

@vitalik because i have another library that waits a path. I use textract to read the content of the files (.pdf, .doc etc) Unfortunately i cannot pass an already opened file, so i thought to save it and then pass the path to that library.

then my points stays the same:

you need correctly close tempfile handle

you need to prevent out of memory it is relevant  in your case

@vitalik because i have another library that waits a path. I use textract to read the content of the files (.pdf, .doc etc) Unfortunately i cannot pass an already opened file, so i thought to save it and then pass the path to that library.

then my points stays the same:
1. you need correctly close tempfile handle

2. you need to prevent out of memory if it is relevant  in your case

Ok, something like this:

def parse(file: UploadFile = File(...)):
    extension = os.path.splitext(file.filename)[1]
    _, path = tempfile.mkstemp(prefix='parser_', suffix=extension)

    with open(path, 'ab') as f:
        for chunk in iter(lambda: file.file.read(10000), b''):
            f.write(chunk)

    # extract content
    content = textract.process(path)

    # remove temp file
    os.close(_)
    os.remove(path)

I'm curious how best to store uploaded files too, flask has this for example:
@app.route('/', methods=['GET', 'POST'])
def upload_file():
        file = request.files['file']
        filename = secure_filename(file.filename)
        file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
        return redirect(url_for('uploaded_file',
                                    filename=filename))

http://flask.palletsprojects.com/en/1.0.x/patterns/fileuploads/

I've been digging through Flask's documentation, and their file.save function is a wrapper around shutils.copyfileobj() in the standard library.
Here's my working code:
@app.post("/files/upload")
def create_file(file: UploadFile = File(...)):
global upload_folder
file_object = file.file
#create empty file to copy the file_object to
upload_folder = open(os.path.join(upload_folder, file.filename), 'wb+')
shutil.copyfileobj(file_object, upload_folder)
upload_folder.close()
return {"filename": file.filename}
I would much appreciate a wrapper around this be built into fastapi

I would much appreciate a wrapper around this be built into fastapi

I'd be tempted to say it would out of the scope of the library given the number of ways this could be implemented, obviously you found a nice working solution and this is fine, but what if for instance you wanted the file.save had to be async, what if you wanted to save in memory instead of disk, etc...
there are so many ways to implement a file save, each one being a good one if it fits your requirements, that I don't see a good generic way for this, but maybe it's simpler than it looks, maybe that's just me liking he library to be not opinionated when it comes to those "goodies".
It's an interesting debate nonetheless. I think having questions like this, answered like you did gives people ideas and solutions and are very efficient.

Perhaps then the solution to making sure users/developers know how to do
persistent storage correctly would be to include something like this
function in the documentation?
I'm just getting started with API design, but persistent file
storage/uploads seem to be somewhat common. In keeping fastapi
non-opinionated: maybe rather than including a wrapper for shutils,
including examples of different ways of using the uploaded file in common
ways that applications would use.
On Wed, Oct 16, 2019, 12:54 AM euri10<EMAIL_ADDRESS>wrote:

I would much appreciate a wrapper around this be built into fastapi
I'd be tempted to say it would out of the scope of the library given the
number of ways this could be implemented, obviously you found a nice
working solution and this is fine, but what if for instance you wanted the
file.save had to be async, what if you wanted to save in memory instead of
disk, etc...
there are so many ways to implement a file save, each one being a good one
if it fits your requirements, that I don't see a good generic way for this,
but maybe it's simpler than it looks, maybe that's just me liking he
library to be not opinionated when it comes to those "goodies".
It's an interesting debate nonetheless. I think having questions like
this, answered like you did gives people ideas and solutions and are very
efficient.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tiangolo/fastapi/issues/426?email_source=notifications&email_token=AJIRQ35LWTSQYOWCTNESQGTQO23CVA5CNFSM4IK4APV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBLKW5I#issuecomment-542550901,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJIRQ374HTSL3O7EH3IBDS3QO23CVANCNFSM4IK4APVQ
.

@classywhetten FastAPI has almost no custom logic related to UploadFile -- most of it is coming from starlette. So if you want a "save" wrapper or a better example of usage, it probably makes sense to ask in the starlette repo.
@damianoporta This line:
_, path = tempfile.mkstemp(prefix='parser_', suffix=extension)

causes the file with location path to actually be opened by python, which is what @vitalik was referring to when he said you need to close the tempfile handle (which is the thing named _ in your code).
Here are some utility functions that the people in this thread might find useful:
from pathlib import Path
import shutil
from tempfile import NamedTemporaryFile
from typing import Callable

from fastapi import UploadFile

def save_upload_file(
    upload_file: UploadFile,
    destination: Path,
) -> None:
    with destination.open("wb") as buffer:
        shutil.copyfileobj(upload_file.file, buffer)
    upload_file.file.close()

def save_upload_file_tmp(
    upload_file: UploadFile,
    handle_file: Callable[[Path], None]
) -> None:
    suffix = Path(upload_file.filename).suffix
    with NamedTemporaryFile(delete=False, suffix=suffix) as tmp:
        shutil.copyfileobj(upload_file.file, tmp)
        tmp_path = Path(tmp.name)
    upload_file.file.close()
    handle_file(tmp_path)  # Do something with the saved temp file
    tmp_path.unlink()  # Delete the temp file

I haven't tested the above functions, just adapted them from slightly more complex functions in my own code.
I don't know whether it handles out-of-memory issues reasonably well or not, but that is not an issue in my application -- maximum request size is capped elsewhere, and the volume of concurrent requests I'm currently handling is such that OOM isn't really an issue.

Sounds also like a good plugin opportunity.  Is there a good pattern for plugins published?  I’ve been thinking about creating a plugin for my project that I’m reusing in multiple services, but I’m not sure the best way forward for that.

On Oct 16, 2019, at 2:19 PM, dmontagu<EMAIL_ADDRESS>wrote:
@classywhetten https://github.com/classywhetten FastAPI has almost no custom logic related to UploadFile -- most of it is coming from starlette. So if you want a "save" wrapper or a better example of usage, it probably makes sense to ask in the starlette repo.
@damianoporta https://github.com/damianoporta This line:
, path = tempfile.mkstemp(prefix='parser', suffix=extension)
causes the file with location path to actually be opened by python, which is what @vitalik https://github.com/vitalik was referring to when he said you need to close the tempfile handle (which is the thing named _ in your code).
Here are some utility functions that the people in this thread might find useful:
from pathlib import Path
import shutil
from tempfile import NamedTemporaryFile
from typing import Callable
from fastapi import UploadFile
def save_upload_file(
upload_file: UploadFile,
destination: Path,
) -> None:
with destination.open("wb") as buffer:
shutil.copyfileobj(upload_file.file, buffer)
upload_file.file.close()
def save_upload_file_tmp(
upload_file: UploadFile,
handle_file: Callable[[Path], None]
) -> None:
suffix = Path(upload_file.filename).suffix
with NamedTemporaryFile(delete=False, suffix=suffix) as tmp:
shutil.copyfileobj(upload_file.file, tmp)
tmp_path = Path(tmp.name)
upload_file.file.close()
handle_file(tmp_path)  # Do something with the saved temp file
tmp_path.unlink()  # Delete the temp file
I haven't tested the above functions, just adapted them from slightly more complex functions in my own code.
I don't know whether it handles out-of-memory issues reasonably well or not, but that is not an issue in my application -- maximum request size is capped elsewhere, and the volume of concurrent requests I'm currently handling is such that OOM isn't really an issue.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/tiangolo/fastapi/issues/426?email_source=notifications&email_token=AACZF56BYJKZT2USGOZ4B2LQO5LL5A5CNFSM4IK4APV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBNOR5Q#issuecomment-542828790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACZF55FS3EQO3HB3GAXKVTQO5LL5ANCNFSM4IK4APVQ.

Yep, as @dmontagu probably the best way to do it is with shutil.copyfileobj() something like:
with destination.open("wb") as buffer:
    shutil.copyfileobj(upload_file.file, buffer)

shutil and pathlib (both part of the standard library) can help a lot solving most of the cases, I think.
@wshayes I think this specific problem might depend too much on each use case to have a plugin that works for most of the cases and requirements... but still, if you want to develop a reusable package (that integrates with FastAPI or not), I would suggest Poetry or Flit. They make it very easy to create a package and publish it.

I was having issues with this problem, and found out the hard way I needed to seek(0) the uploaded file first:
uploaded_file.file.seek(0)  # <-- This.
with destination.open("wb") as buffer:
    shutil.copyfileobj(upload_file.file, buffer)

Hello @classywhetten, I liked your solution it works perfectly I am new at fastapi and wanted to know how to view/download that uploaded image/file using your code above? Thanks in advance.

@damianoporta  Why you using save_upload_file_tmp func (saving file to tmp) if ypu already has file in memory?
https://github.com/tiangolo/fastapi/issues/426#issuecomment-542828790

@david-shiko , I don't know about him, however I spent the whole day trying to use an uploaded .csv file in memory but it threw all kind of errors, one being JSONDecodeError: Expecting value: line 1 column 1 (char 0).
So I'm stuck, If someone knows a solution to that, it will be great. Ultimately, I want to upload and use in memory .feather files.

@david-shiko , I don't know about him, however I spent the whole day trying to use an uploaded .csv file in memory but it threw all kind of errors, one being JSONDecodeError: Expecting value: line 1 column 1 (char 0).
So I'm stuck, If someone knows a solution to that, it will be great. Ultimately, I want to upload and use in memory .feather files.

At least for .csv, now I could make it work using pd.read_csv(io.StringIO(str(upload_file.file.read(), 'utf-8')), encoding='utf-8')


Implement list_templates in YamlLoader

This allows listing all templates from the Jinja environment with
app.jinja_env.list_templates(), which can be helpful during debugging.
See here for the an official documentation:
http://jinja.pocoo.org/docs/2.10/api/#jinja2.Environment.list_templates
list_templates is a method of BaseLoader which must be overwritten
by subclasses, see Jinjas default loaders for examples:
https://github.com/pallets/jinja/blob/master/jinja2/loaders.py

Sorry, I had messed up the function name. BaseLoader.list_templates() is what I'm talking about, fixed it now.


update color reference from arXiv to The R Journal

Grant @grantmcdermott , just a mini-update in response to https://fosstodon.org/@devSJR/111838661757048332. Do you prefer if I send you such modifications as PRs or should I merge myself (or commit directly in main)?

Grant can say what workflow he prefers, but this is trivial so I feel I can just review and merge now.

Thanks, folks.
To Vincent's point. You should both definitely feel empowered to merge PRs, including your own, that you believe are simple and ready (i.e., pass all tests). For the bigger changes, I'd prefer us to have at least one other person review and I'd obviously like to be tagged in all the design-based changes.
(We can revisit a more formal process once the package hits CRAN. But I feel comfortable that we can just rely on individual judgment 'til then.)

Thanks for the explanation, Grant! That's perfect and works very well for me.
I definitely agree that bigger changes should be discussed first and wouldn't merge anything without tagging you first. It was really just about small typos and updates and stuff like that.

Super.
Seeing as we're talking PRs... Just a HU that I'd like to resolve the package name issue (#22 ) as the priority for the next release, since that would obviously be a breaking change if we do proceed. I'll try to summarise my thoughts in the relevant thread when I get a sec and then we can look to make a final call by the end of this week or the next.


Documentation is not accessible via mobile

What was expected to happen?
Users can't navigate since the link to Github and the hamburger menu are overlapping. Trying to click on the menu, actually triggers the Github link. So it's impossible to navigate.
Reproduction
To reproduce open the documentation website in a mobile device (tested with a iPhone 8 using Mobile Safari).

There is also a layout issue on the home page: the content of the page is way wider than the hero banner (blue bg):

Closing the issue, has been resolved.


Added support for nw.js

Lets make jshint happy!

looks great!
So what would be the steps for using angular-moment with nw.js? Perhaps you could add it to the README and send a PR, in favor of other nw.js / angular-moment users?

So what would be the steps for using angular-moment with nw.js? Perhaps you could add it to the README and send a PR, in favor of other nw.js / angular-moment users?

Well, npm install moment would do the trick, I wanted to modify the readme but then I included the "step" if you are using nw.js/browserify (require function) in the code itself. See: https://github.com/urish/angular-moment/blob/master/angular-moment.js#L17
Since the error tells you to reference to the readme I could write something though.
What do you think?

Yea, that makes perfect sense :)


Feature request - Return selected share method to client

react-native ActionSheetIOS.showShareActionSheetWithOptions api returns the method used to share the item to the success callback, anyway to add this functionality to this library as well?
I'm not familiar with objective-c or Java so unfortunately it will be hard for me to provide a PR :(
I can do with some guidance too and try to get a PR with some help though..
Thanks

IOS seem to not call the callback at all? is that a bug or by design?

I recently noticed this as well, I don't think there is any way for the call back to ever get called with the exception of a catastrophic failure on Android. I intend to implement a PR with the call back. Probably in my teams next sprint we'll need this so it'll probably be 2-3 weeks before I get to it.

I work in a new version with more features, I implementing ActionSheetIOS for IOS, today or tomorrow I'll upload a commit


Add a SIGPIPE signal handler for TCP Servers

While this doesn't affect Windows, on UNIX the OS can send this signal when a socket has gone away and the server's trying to write to it still. If uncaught, this will kill the runtime, taking the server with it... So that's basically a self-DOS waiting to happen (and it can appear "randomly", so it would be quite annoying to reproduce).
This test doesn't simulate a real-world scenario in order to keep the complexity low. It does verify that receiving a SIGPIPE won't crash the server, which is good enough. It should be safe to rely on the OS sending the signal if (and only if) it's appropriate, anyway.
This CAN be manually reproduced with the following steps:

Start TCP echo server in one shell
In another shell: nc localhost 12345 < /dev/zero > /dev/null
CTRL/C the netcat shell
TCP echo server will receive SIGPIPE while writing to the socket

This proved too annoying to reproduce in code, even with spawning child processes I couldn't get it to work. So I opted to just simulate the signal itself and simply call it a day.

The signal doesn't seem to be perpetuated to the runtime when running in the CI runner... I've no idea what's going on there, but since it works locally I guess I'll just leave it be for now.


⚠ ClamAV has degraded performance

In e5bdbac, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 84 ms

Resolved: ClamAV performance has improved in 877dc1e.


Support Hugo v0.62 - new approach to rendering Markdown

Hugo's v0.60+ renderer (Goldmark) does not directly support opening external links in new tabs (like it did to some extent with its Blackfriday renderer).
In Hugo v0.62 release notes a new approach is given for opening external links appearing within Markdown content in new tabs:

The markdownify template function does not, yet, support render hooks. We recommend you look at the new and more powerful .RenderString method on Page.

See https://gohugo.io/functions/renderstring/
Therefore,

[x] add a Markdown render hook to parse Markdown links, enabling external links to be opened in a new tab - ADDED IN v4.8.0
[ ] convert all instances of markdownify to the .RenderString equivalent so that any links within those instances can be processed by the render hook

UPDATE: unnecessary once Hugo team fix Hugo's markdownify to call render hooks - https://github.com/gohugoio/hugo/issues/6650

Hello.
I'm considering update the markdown parser from Blackfriday to Goldmark in my project (https://github.com/Axway/axway-open-docs), but  opening external links in new tabs is important to us.
So, can someone tell me if this checkbox "add a Markdown render hook to parse Markdown links, enabling external links to be opened in a new tab - ADDED IN v4.8.0" means that the issue is solved and external links are opened in new tabs?
Thanks,
Andrea

UPDATE: converting all instances of markdownify to the .RenderString equivalent is now unnecessary as Hugo team plan to fix Hugo's markdownify to call render hooks - see gohugoio/hugo#6650 . Currently Hugo team are planning to resolve this by the Hugo v0.73 release.
@andreamussap external links generally currently work fine in Goldmark, such as in the body of content. The remaining issue that Hugo team are working on relates to facilitating external links to open in new windows in other Markdown snippets such as in some shortcodes.


Better instructions for webpacking blockstack.js

Our readme does provide a hint that some types need to be whitelisted when uglifying/minifying -- but people get stuck pretty frequently when they use webpack. We should probably have a more detailed warning indicating that users of webpack should read that section, and an example config.
Related to report: https://github.com/blockstack/blockstack.js/issues/421

JustinRC also encountered this problem (reported on Slack).

The library now uses Webpack, this should no longer be an issue.


.at set unexpected behaviour

Description
Correct Behaviour:
test_arr = jnp.arange(7*2*3, dtype=jnp.float32).reshape(7,2,3)
jnp.zeros((7,2,3)).at[np.array([0,1,6,3,4,5,2], dtype=np.int32)].set(test_arr)

Incorrect Behaviour:
test_arr = jnp.arange(7*2*3, dtype=jnp.float32).reshape(7,2,3)
jnp.zeros((7,2,3)).at[np.array([0,2,6,3,4,5,1], dtype=np.int32)].set(test_arr)

Why isn't the highlighted

This:
 [[12. 13. 14.]
  [15. 16. 17.]]

And onwards ...
What jax/jaxlib version are you using?
0.4.20 0.4.20
Which accelerator(s) are you using?
CPU
Additional system info?
MacOS 14.1 (23B74)
NVIDIA GPU info
N/A

Thanks for the report – I'm able to reproduce the issue. I'll take a look today.

Confirmed that this error arises on CPU and GPU (no it's likely not some compiler optimization gone awry) and is present back as far as jax v0.4.1 (not something that's recently regressed)

Wait, it looks like this is actually working as expected: for example this:
jnp.zeros((7,2,3)).at[np.array([0,2,6,3,4,5,1], dtype=np.int32)].set(test_arr)

is similar to writing this in numpy:
x = np.zeros((7, 2, 3))
x[np.array([0,2,6,3,4,5,1], dtype=np.int32)] = np.array(test_arr)
print(x)

[[[ 0.  1.  2.]
  [ 3.  4.  5.]]

 [[36. 37. 38.]
  [39. 40. 41.]]

 [[ 6.  7.  8.]
  [ 9. 10. 11.]]

 [[18. 19. 20.]
  [21. 22. 23.]]

 [[24. 25. 26.]
  [27. 28. 29.]]

 [[30. 31. 32.]
  [33. 34. 35.]]

 [[12. 13. 14.]
  [15. 16. 17.]]]

The indices are broadcast with the leading dimension of test_arr, so index 1 corresponds to the last entry in the leading dimension of the array, so we expect the block starting with 36 to be in entry 1 of the result.
Does that make sense?

I'm having trouble understanding the broadcast over the leading edge part. Ideally I'd want to sort the indexes by axis=0 here.
And the reason I don't just mask set is I actually have two arrays with indexes that I want to properly sort into one array for context.

Oh I see it's doing it in reverse

Maybe it's simpler to see it this way. Here's a 1D version:
x = jnp.arange(7)
idx = np.array([0,2,6,3,4,5,1], dtype=np.int32)
print(jnp.zeros(7).at[idx].set(x))
# [0. 6. 1. 3. 4. 5. 2.]

This is effectively a batched version of this:
index 0 set to 0
index 2 set to 1
index 6 set to 2
index 3 set to 3
index 4 set to 4
index 5 set to 5
index 1 set to 6
[0. 6. 1. 3. 4. 5. 2.]

From your question, it sounds like you were expecgint index 1 to be set to 2, but index 1 is being (correctly) set to 6. Does that make sense?

Perhaps instead of
result = jnp.zeros((7,2,3)).at[np.array([0,1,6,3,4,5,2], dtype=np.int32)].set(test_arr)

you were hoping to compute this?
result = test_arr[np.array([0,1,6,3,4,5,2], dtype=np.int32)]

Appreciate it!


Fix skills and add Re:Build class changes

Description
Modified classes2.json for Re:Build. Also fixed class tooltips not showing properly (or at all).
Motivation and Context
Fixing critical features related to !rawr skill
How Has This Been Tested?
Tested live on forked bot.
python3.5 with virtualenv and requirements built from requirements.txt using pip install -r
Screenshots (if appropriate):

Types of changes

[x] Bug fix (non-breaking change which fixes an issue)

[ ] New feature (non-breaking change which adds functionality)

[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[x] My code follows the code style of this project.

[ ] I have updated the documentation accordingly.

[ ] I have added tests to cover my changes.

[ ] All new and existing tests passed.

Example of new class from Re:Build

Thanks for the hard work!


[Hub Generated] Review request for Microsoft.Capacity to add version 2019-04-01

If you are a MSFT employee you can view your work branch via this link.
Contribution checklist:

[x] I have reviewed the documentation for the workflow.
[x] Validation tools were run on swagger spec(s) and have all been fixed in this PR.

Automation for azure-sdk-for-ruby

Automation for azure-sdk-for-js

Automation for azure-sdk-for-python

Can one of the admins verify this patch?

Automation for azure-sdk-for-java

Automation for azure-sdk-for-node

Model validation check says there is one error but when I click View issues, it does not show any error.

Automation for azure-sdk-for-go

Automation for azure-sdk-for-net
A PR has been created for you:
https://github.com/azure/azure-sdk-for-net/pull/5477
.NET SDK Commits:
https://github.com/adxsdknet/azure-sdk-for-net/pull/5477/commits/2622d035d908b8451745319e92a50f1aae75dfc7

@corquiri in the future please separate reformatting the document and meaningful changes into separate commits.  https://github.com/Azure/azure-rest-api-specs/pull/5403/commits/b6983f0dd2db88d915d6756ca9a55c37dc2fee42 is very hard to reason about due to the mix of whitespace and content changes.
If you can summarize the impacted APIs in the PR it would be a big help.

@jhendrixMSFT Understood. There are 2 main changes

/providers/Microsoft.Capacity/calculatePrice added along with example "CalculateReservationOrder.json"
/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId} has addition method "put". Response example is the same as that of "get"

The rest of api's are unchanged, except I created new $ref called "ReservationQuantity"

question - can we hold onto merge of this request until changes are complete on RP side? If this PR gets merged, should the API be available immediately?

@corquiri Still waiting for ARM to review your API.  Also yes we don't merge swagger changes until the REST endpoints are live.

@jhendrixMSFT hello, could you please provide update on this PR? I have pushed more changes and this PR is still waiting for ARM feedback. Is there ETA for ARM feedback? It has been 2 weeks since last update.

Merging based on ARM and Joel approval and the service is conformed to be live


Fix Issue 40: update nativewind to 4.0.23 and regenerate package.lock

Before (nativewind 4.0.13)
After (nativewind 4.0.16)

there's still a cosmetic issue with the underline indicator not lining up with the selected item, but the screen no longer crashes which  is an improvement

fixes #40

@mrzachnugent Something happened. I discovered while testing #42 that nativewind at any version higher than 4.0.13 now causes a break with the declared version ranges in the current package.json on main. Therefore this is not safe to merge currently, I'll need to figure out what is causing a conflict with 4.0.23 and other dependencies

@Idan-Garay yeah I have a small workaround, but it might not fit your specific case. After upgrading to a later version of tailwind I noticed this also in the android builds. You can set the tabBarItemStyle property of the MaterialTopTabs. In this case, I used the window dimensions. This won't work if you want the scrollable "overflowing" tables but it works great if you need the tabs in thirds or some proportion of the screen.
     import { Dimensions, View } from 'react-native';
     const windowWidth = Dimensions.get('window').width;

      <MaterialTopTabs
          //...args
          tabBarItemStyle: { minWidth: windowWidth * 0.5 },
        }}
      >

this code example is for halves. You could probably do something like
windowWidth * /MY_TABS.length if you have dynamic number of tabs.

@Idan-Garay yeah I have a small workaround, but it might not fit your specific case. After upgrading to a later version of nativewind I noticed this also in the android builds. You can set the tabBarItemStyle property of the MaterialTopTabs. In this case, I used the window dimensions. This won't work if you want the scrollable "overflowing" tables but it works great if you need the tabs in thirds or some proportion of the screen.
     import { Dimensions, View } from 'react-native';
     const windowWidth = Dimensions.get('window').width;

      <MaterialTopTabs
          //...args
          tabBarItemStyle: { minWidth: windowWidth * 0.5 },
        }}
      >

this code example is for halves. You could probably do something like
windowWidth * /MY_TABS.length if you have dynamic number of tabs.

This is what I did after hours of debugging and it works on my end too


Disable default CPU fallback and conversion of TVM params

Speed up compile time and reduce memory consumption ~2x on host

Disabling CPU fallback by default:

Focuses more on the preferable way of running models (on the device)
Reduces compile time as well

Disabling conversion to TVM params:

Disables TVM verification as well (assert for checking it already exists)
Disables TVM consteval (adding assert with this check)

Fixes #285
Related TVM PR:

https://github.com/tenstorrent/tt-tvm/pull/32

Does this solve the issue of tensorflow params having there data type forced to fp32? https://github.com/tenstorrent/tt-forge-fe/issues/281

=

Does this solve the issue of tensorflow params having there data type forced to fp32? #281

Might be the case as this will disable setting params to TVM relay. Can you double-check it?

If it works, let's just add proper asserts as verification for TF will fail for these reasons as bug still exists.
Therefore, based on your check, let's ether:

Fix the TF issue if this doesn't work
Push TF issue as lower prio of ResNet 50 milestone, and we can tackle it once ResNet runs e2e

Fix the TF issue if this doesn't work

I've checked, it doesn't work. And the issue may actually be harder to solve than I previously thought. I've written more details in #281


[1345] Move Heroku deployment gems into separate heroku group

Resolves #1345

fix issue with missing logs
add extra Gemfile group to app.json
update Bundler call in application.rb

coolio. merge away


stuck / crash on react-native if state is long

I have a quite long state, and every time when redux-logger run, my app will stuck or even crash

Are you sure that the problem can't be reproduced with smaller state? Did you try that?
What version of the package are you using?

I'm using<EMAIL_ADDRESS><EMAIL_ADDRESS>when state is small, it's ok, but after fetching data and put it in redux store, state got pretty big and everytime redux-logger log, UI will freeze.
It will not stuck when the app is running on debug mode (Javascript run on chrome), but when run on iOS
and Android, It will stuck / crash.

@hitbear518, closing this for now as no detailed information was provided. In case you stumble upon this problem again, please, post here.


AssertionError in metrics.py

Thanks for your error report and we appreciate it a lot.
Checklist

I have searched related issues but cannot get the expected help.
I have read the FAQ documentation but cannot get the expected help.
The bug has not been fixed in the latest version.

Describe the bug
A clear and concise description of what the bug is.
Reproduction

What command or script did you run?

sh tools/slurm_train.sh test mmg_cifar10 configs/biggan/biggan_cifar10_32x32_b25x2_500k.py exps/biggan-cifar10

Did you make any modifications on the code or config? Did you understand what you have modified?
No

What dataset did you use?
CIFAR10

Environment

Please run python mmgen/utils/collect_env.py to collect necessary environment information and paste it here.
You may add addition that may be helpful for locating the problem, such as

How you installed PyTorch [e.g., pip, conda, source]
Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)

Error traceback
If applicable, paste the error trackback here.
INFO:mmgen:Sample 50000 fake images for evaluation
[                                                  ] 0/50000, elapsed: 0s, ETA:2021-09-05 15:49:32,938 - mmgen - INFO - `use_pil_resize` is set as True, apply Bicubic interpolat$on with Pillow backend. We perform type conversion between torch.tensor and PIL.Image in this function and make this process a little bit slow.
INFO:mmgen:`use_pil_resize` is set as True, apply Bicubic interpolation with Pillow backend. We perform type conversion between torch.tensor and PIL.Image in this function and make this process a little bit slow.
[>>>>>>>>>>>>>>>>>>>>>>>>] 50000/50000, 50.7 task/s, elapsed: 985s, ETA:     0s
Traceback (most recent call last):
  File "tools/train.py", line 163, in <module>
    main()
  File "tools/train.py", line 159, in main
    meta=meta)
  File "~/.local/lib/python3.6/site-packages/mmgen-0.3.0-py3.6.egg/mmgen/apis/train.py", line 198, in train_model
    runner.run(data_loaders, cfg.workflow, cfg.total_iters)
  File "~.local/lib/python3.6/site-packages/mmgen-0.3.0-py3.6.egg/mmgen/core/runners/dynamic_iterbased_runner.py", line 285, in run
    iter_runner(iter_loaders[i], **kwargs)
  File "~/.local/lib/python3.6/site-packages/mmgen-0.3.0-py3.6.egg/mmgen/core/runners/dynamic_iterbased_runner.py", line 236, in train
    self.call_hook('after_train_iter')
  File "~/.local/lib/python3.6/site-packages/mmgen-0.3.0-py3.6.egg/mmgen/core/runners/dynamic_iterbased_runner.py", line 181, in call_hook
    getattr(hook, fn_name)(self)
  File "~/.local/lib/python3.6/site-packages/mmgen-0.3.0-py3.6.egg/mmgen/core/evaluation/eval_hooks.py", line 283, in after_train_iter
    metric.summary()
  File "~/.conda/conda_envs/miniconda3/envs/openmm-lab/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "~/.local/lib/python3.6/site-packages/mmgen-0.3.0-py3.6.egg/mmgen/core/evaluation/metrics.py", line 575, in summary
    assert feats.shape[0] >= self.num_images
AssertionError
srun: error:task 0: Exited with exit code 1

Bug fix
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

In configs/biggan/biggan_cifar10_32x32_b25x2_500k.py, inception_pkl for evaluating FID is set as None, which means our code would use numbers of num_images images in the test set to extract inception stat before evaluation.
However, for the CIFAR10 dataset, the test set only contains 10k images, that's why the images number checking at line 575 failed.
We advise you to extract inception_pkl by yourself with the following command:
# For CIFAR10
python tools/utils/inception_stat.py --data-cfg configs/_base_/datasets/cifar10_inception_stat.py --pklname cifar10.pkl --no-shuffle --inception-style stylegan --num-samples -1 --subset train

# For ImageNet1k
python tools/utils/inception_stat.py --data-cfg configs/_base_/datasets/imagenet_128x128_inception_stat.py --pklname imagenet.pkl --no-shuffle --inception-style stylegan --num-samples -1 --subset train

More descriptions about how to extract inception state can be found in this link.

Many thanks!


issuer doesn't work

  "auth": {
    "token": {
      "issuer": "abc",
      "secret": "ZJApt91sS3bPV275hfobvCTSJYEgv+1n09A8D4bGlqI9S+lq3oePV1Xwla52ZipAXgaj8X/t17/3Tl6UFi1cOQ=="
    },
    "local": {}
  }

this is how i config the auth, but seems the token name retrieved is still feathers-jwt
btw, i am using localstorage to save the token

This is now fixed in auth v1.x. The only difference is you need to use jwt instead of token. Please see the migration guide for how to upgrade.


CRUD Mixin

Is there any reason you are not using the popular CRUD mixin? or its because of the rollbacks on your views? i'm learning your codebase and its very similar to https://github.com/sloria/cookiecutter-flask and they use that mixin i'm just wondering.
see screenshot http://take.ms/E17UT

I'm gonna close this but we can use this thread to chat, the model_class is indeed CRUDMixin https://github.com/gothinkster/flask-realworld-example-app/blob/master/conduit/extensions.py#L12 I'm passing it to the as a model_class (by default it's flask_sqlalchemy.Model) so that I don't have to inherit from CRUDMixin every time (see this https://github.com/gothinkster/flask-realworld-example-app/blob/master/conduit/database.py#L11) generally you don't want to use that class, sqlalchemy follows the data mapper pattern we are making it behave like an active record which is not a very good idea, and yes I generated the project skeleton with sloria's cookiecutter.

gotcha! thank you for the response, best flask codebase on api i've seen so far


Coq_nvim as the autocompletion tool

TY for the amazing job I would like to ask if it is possible to use the auto completion features without hrsh7th/nvim-cmp and with ms-jpq/coq_nvim. I have done everything except adding the source
{
name = 'nvim_lsp',
  option = {
    markdown_oxide = {
      keyword_pattern = [[\(\k\| \|\/\|#\)\+]]
    }
  }
},

In my configs as I don't use nvim-cmp and I am pretty close to a fully working functionality( see the screenshot)
So I was wondering if we can communicate to ms-joq and add markdown-oxide as a third party source.
In the next days I will try to manually add it and provide some configs. The next best thing  other than supporting it out of the box is to document the required work to support it.

Hey thank you so much!!
I'd love to work with you on this. I have certainly heard of coq but never tried it.
Let me know how you are developing and I will work on this at some point.
You can check what is being worked on in the linked github project

If coq_nvim doesn't stop giving completions when you press space (or another weird character), keyword_pattern should not be necessary.
In my opinion, the concept of keyword_pattern in nvim-cmp is slightly odd. It specifies the pattern that an ongoing completion search text must match - otherwise completions are dropped. This is fine for most LSs because they do not give completion with spaces (which is not in the keyword_pattern by default), but many do. VSCode has nothing like this; there was almost no configuration necessary to get moxide working on it. Keyword pattern is a little odd.
And you are right about the trigger characters.

NOTE that keyword_pattern is nvim-cmp specific and is not tied into the language server protocol

Let's close the issue, I think I had something misconfigured on my enormous configs(also maybe the problem happened because my vault is aLlogseq vault). Today I cleaned up my computer and coq_nvim also works. Furthermore, I tested a bit working with  vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc" and omnifunc works as well! Here is a screenshot after all :

Awesome!
Feel free to open an issue any time!


Is this project in progress?

Hello ,Is this project in progress?

Hi @jokemanfire
Yes. This is an LFX mentorship program. We are still waiting for the mentee to submit their PR. Thanks for your interest.

Thanks ,I am looking forward to this project. I want to use it on my device.


Change usage of ignore_empty to IGNORE_DEFAULT

In all these cases, IGNORE_DEFAULT is equivalent to IGNORE_EMPTY. Where you might want IGNORE_DEFAULT is an optional string foo in (say) an update request that allows zero-ing out a field on a resource (that's labeled with IGNORE_EMPTY).

Yea I know they're equivalent, I was just trying to standardize on a world where we wanted to have a recommended value of Ignore to use, and trying to model that behavior. IGNORE_DEFAULT seemed more like that?
Probably want to give people a recommendation in the Ignore docs too.

I don't think a recommendation makes sense, given that it's dependent on which semantics you want. The reason it has options is precisely because the meaning changes (in a subtle nuanced way, but still significant).

Changed to IGNORE_IF_UNPOPULATED


Updated README for clearer output location information

Updated the README to resolve issue #53 and make it clearer as to where the logs output too.

Codecov Report

Merging #58 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           master    #58   +/-   ##
=====================================
  Coverage     100%   100%
=====================================
  Files           2      2
  Lines         149    149
=====================================
  Hits          149    149

Flag
Coverage Δ

#HeliumLogger
100% <ø> (ø)
:arrow_up:

Continue to review full report at Codecov.

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


Folder Name as Tab Title

Please add a setting to have the tab title be the folder name. Ideally as (shell). Currently for me it just shows the shell title.
For example, if I have a PowerShell Core instance open in myApp folder then have the tab title be: "myApp (PowerShell)" or simply "myApp".
There's possibly an existing way to do this, but what I'm suggesting is to have an easy setting instead.

Please check the docs before filing issues like this: https://docs.microsoft.com/en-us/windows/terminal/tutorials/tab-title

Yup! This is totally possible with the cooperation of your shell.

I did see those docs, but I was wondering if there was an way that the tab title could be set with a simple, universal setting in Windows Terminal. This was rather a feature request. Such as having tabTitle configurations (for example, static string, absolute path, relative path), and based on the shell instance have code within Windows Terminal to do that for the most popular shells.
For anyone wondering I was able to set this up for PowerShell Core shell by adding the following code to my PowerShell Core profile in Documents\PowerShell\Microsoft.PowerShell_profile.ps1
function Prompt
{
  $host.UI.RawUI.WindowTitle = Split-Path (Get-Location) -Leaf
}

I'd love for us to offer this, but unfortunately it's difficult for Terminal to know what folder you're operating in. PowerShell doesn't update its process-level working directory; SSH targets a remote machine; you might have run a shell inside your shell (cmd -> wsl; which one should it report? what if you're running wmic and it changes to system32 just because?); WSL operates in a totally different filesystem environment;
The list goes on. We have a couple other things that would depend on the active working directory path that we'd love to land . . . but unfortunately we don't think we can.

That's unfortunate, but makes sense.
Maybe there could be some sort of api standards in the shell world to work with tools like Terminal better. I'm not sure if that would make sense or not, but if anyone could make that happen it would be a company like Microsoft. I guarantee Terminal is going to be hugely popular over time, so there would be leverage in that as well.
Thank you for your quick responses, and keep up the great work!

Maybe there could be some sort of api standards in the shell world to work with tools like Terminal better

FYI there is such a "standard", called Escape Sequences (also ANSI escape sequences, VT sequences). See this page for probably the most complete documentation. A shell can already use VT sequences to tell a terminal emulator to do all sorts of things,. For examplem, setting the title of the window with \e]0;YourTitleHere\a, which is exactly what we recommend doing 😉

The list goes on.

Then it would be easier to have a page in the docs describing how to set up "Folder Name as Tab Name" for each popular shell.
No, I won't be writing something like that. I don't currently use this application.


build ninja from source

motivation: more tightly control the version of ninja used
changes:

add download instricutions for ninja source
remove present patch since we are building ninja from source
cleanup tarball names

Similar work I was doing locally but also dropping all patch files - https://github.com/apple/swift-installer-scripts/pull/31


Look like elastic/elasticsearch-php passed away. Fork replace needed

https://github.com/elastic/elasticsearch-php

Holy moly, that is crazy!

everything seems to be ok now) They returned the repository

Ok, great. Thanks for keeping me updated!

https://status.elastic.co/incidents/9mmlp98klxm1

@blackshadev you'll like this story too 😄


Integration with more IaaS

We can use https://github.com/apcera/libretto to provide more iaas options.

more internal package drone autoscale: https://github.com/drone/autoscaler/tree/5dcf07f7ec82912d480c049c56c7ac6ad722d2b8/drivers


Provide Redux support

As a practical architecture of Meteor projects, it would be great if mantra provides a standard way of integrating Redux into mantra projects. The mantra guide does mention that we can manage applications' local states via Redux [ref]. Unfortunately, up till now, there are no "official" and easy ways of doing so in mantra.
Therefore, I have extended the mantra-core package to include Redux support.
First of all, a module might contain the definition of an map of reducer functions:
// definition of a module

const reducers = {
  foo: function(state, action) { return state; }
};

export default {
  actions,
  routes,
  reducers,
  load() {
  }
};

When the App instance "loads" the module by loadModule, as well as dealing with routes and actions, it also collects the module's reducers and adds them to app._reducers.
After all modules have been loaded, in init(), the App tries to combine the reducers, and from which a Redux store is created afterwards. The store will be added to the context, named ReduxStore.
For Redux containers to access the store, I use Provider and connect from the react-redux package to bind React, Redux and mantra together. All these behaviours are implemented in the withRedux function.
Imagine we want to build a Redux container, which maps the app's state to props and provide them to its children presentation components. We can do it easily with just one line of code:
import { withRedux } from 'mantra-core';

// defines mapStateToProps

const ReduxContainer = withRedux(mapStateToProps)(ChildComponent);

Then we can happily use the container:
render() {
  return (
    <ReduxContainer {...props} />
  );
}

I've forked mantra-sample-blog-app and added a Redux counter component to it, which may serve as a demo of the integration of Redux into mantra projects:
https://github.com/haizi-zh/mantra-sample-blog-app/tree/new-mantra-core/client/modules/redux_demo

+1

Should factor into this middleware, multiple dispatches, and other areas that affect the store before it is created. Here is an alternate consideration (click the arrow to expand it):

Modified redux code
```js
import { createApp } from 'mantra-core';
import initContext from './configs/context';
import { applyMiddleware,  combineReducers, compose, createStore } from 'redux'
import thunkMiddleware from 'redux-thunk'
import reduxMulti from 'redux-multi'
import { batchedSubscribe } from 'redux-batched-subscribe'
// modules
import coreModule from './modules/core';
import commentsModule from './modules/comments';
import reduxDemo from './modules/redux_demo';
// init context
const context = initContext();
const app = ((ctx) => {
const proto = createApp(ctx);
const result = {
_reducers: {},
loadModule(module) {
  this._checkForInit();

  // Load Redux reducers
  if (module.reducers) {
    const reducers = module.reducers;

    if (typeof reducers !== 'object') {
      const message = `Module's reducers field should be a map of reducers.`;
      throw new Error(message);
    }

    for (const key of Object.keys(reducers)) {
      this._reducers[key] = reducers[key];
    }
  }

  Object.getPrototypeOf(this).loadModule(module);
},

loadModules(...modules) {
  modules.forEach((m) => {
    this.loadModule(m);
  });
},

init() {
  this._checkForInit();

  const middleware = [
    thunkMiddleware,
    reduxMulti
    //loggerMiddleware
  ];

  const createStoreWithMiddleware = compose(
    applyMiddleware(...middleware),
    //we use Redux devtools via the a Chrome extension from
    //https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd
    //if it is installed, the icon will show up in chrome and our app can use it
    window.devToolsExtension ? window.devToolsExtension() : f => f
  )(createStore);

  // Ensure our listeners are only called once, even when one of the above
  // middleware call the underlying store's `dispatch` multiple times
  const finalCreateStore = batchedSubscribe(
    fn => fn()
  )(createStoreWithMiddleware)

  const reducers = this._reducers;

  if (Object.keys(reducers).length > 0) {
    const combined = combineReducers(reducers);
    this.context.ReduxStore = finalCreateStore(combined);
  }

  Object.getPrototypeOf(this).init();
}

};
Object.setPrototypeOf(result, proto);
return result;
})(context);
app.loadModules(coreModule, commentsModule, reduxDemo);
app.init();
</details>


segmentation ends with tuple index out of range

When run segmentation on 3d stack it ends with tuple index out of range As it is some error in the segmentation process it should be raised in a way which allow understanding what happens.

Ran into the same error message when segmenting 3D stack. Check "process stack as 3D" avoids the error. By default it is unchecked.

duplicate of #10


Semantic Segmentation S3DIS label annotations

Hi. Thanks a lot for the visualization code for Semantic Segmentation on S3DIS. However, I am unable to find the annotations for the 13 categories/labels anywhere in this repository or even the original S3DIS documentation. What I mean by that is what the labels stand for: eg. 0 is floor, 1 is chair, etc. It would be really helpful if you could point me to where I can find that information.
Thank you!

See https://github.com/AnTao97/dgcnn.pytorch/blob/master/prepare_data/meta/semseg_colors.txt

Thanks a lot! Sorry for not noticing these files earlier. I am closing this issue.


Add task for untagging from given policy

This work adds a rake task for untag all documents from a given policy.
Necessary to untag all documents from School and college funding and accountability policy.
Ticket: https://trello.com/c/5re0DXMD/288-split-dfe-policy
Prior work: https://github.com/alphagov/whitehall/pull/2423

Closing this. We decided we want them to explicitly agree on what to do with the remaining documents rather than untag all of them from the old policy.


Silly question

Hi! Sorry for the question, but I want to know how to deploy it in the cloud?
I can't even run the app after cloning the repo (trying node ./bin/codebox.js run test).
Thanks for the answer!

Bro, this project is no longer being maintained :(

Bro, this project is no longer being maintained :(

((((((

Lol


CLI mode for jora

Pull Request Test Coverage Report for Build 45

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

Totals

Change from base Build 43:
0.0%

Covered Lines:
169

Relevant Lines:
178

💛  - Coveralls

Pull Request Test Coverage Report for Build 45

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

Totals

Change from base Build 43:
0.0%

Covered Lines:
169

Relevant Lines:
178

💛  - Coveralls


[Google Workspace] ...

Extension
https://www.raycast.com/raycast/google-workspace
Description
Whenever I open a Google Drive file through this extension, it opens with the wrong Google account.
I am logged in the extension with my professional account, and this same account is the default one in my browser (Arc).
However when I open a file, it opens with my personal account selected.
Steps To Reproduce

Log in the extension with a google account
Set this same account as default in google drive in the browser (Arc)
Open google file through the extension
in the little Arc window that opens, check the account used in the top right. It's the wrong one.

Current Behaviour
No response
Expected Behaviour
The professional account is the one selected.

On which command does this happen?

Could you test it out on other browsers such as Safari, Firefox, or Google Chrome? I'm not able to reproduce it.

I get the same problems on safari. I do not use the other two, so cannot test, apologies.
￼￼

On 12 Jun 2023, at 09:59, Thomas Lombart @.***> wrote:
Could you test it out on other browsers such as Safari, Firefox, or Google Chrome? I'm not able to reproduce it.
—
Reply to this email directly, view it on GitHub https://github.com/raycast/extensions/issues/7003#issuecomment-1586787222, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADETNB2ZOLSXCHI53EKF44LXK3D6BANCNFSM6AAAAAAZAM4WFU.
You are receiving this because you authored the thread.

I see now that my screenshots sent by mail do not come up here. Apologies. Here they are: