How to get multi-part form file from the http request?

Hi, guys,
I want to use the workflow to build a RESTful server which can receiver image file from client and do some AI works. As the title says, how to get multi-part form file from the http request? Can you share a code example?
Thanks!

You means splitting query of URI? Like http://.../?a=1&b=2c=3...
Maybe URIParser will help you.

@Barenboim , URI Like http://.../?a=1&b=2c=3 is the query parameter in URL for GET method. What I mean is the file attachment in the http request.

You means Http message body?
Example:
void process(WFHttpTask *task)
{
const void *body;
size_t size;
task->get_req()->get_parsed_body(&body, size);
...
}
get_parsed_body() is an method of protocol::HttpMessage。BTW, this interface does decode chunk encoding, it returns orginal http message body.

Sorry, we don't parse multi-part form of http message automatically. So you may get the message body, and parse it by yourself.
Example:
void process(WFHttpTask *task)
{
const void *body;
size_t size;
task->get_req()->get_parsed_body(&body, size);
// parse body here
...
}
get_parsed_body() is an method of protocol::HttpMessage。BTW, this interface does decode chunk encoding, it returns orginal http message body.

To decode chunked body, you may use HttpUtil::decode_chunked_body in HttpUtil. Or use HttpChunkCursor to decode chunks with zero-copy.

https://github.com/BDZNH/workflow-HttpFormdataParser

@tjliupeng
Restful web framework based on workflow: https://github.com/wfrest/wfrest

Nice.

int state = task->get_state();
    if (state == WFT_STATE_SUCCESS)
    {
        protocol::HttpResponse* response = task->get_resp();

        const void* body;
        size_t len;

        response->get_parsed_body(&body, &len);

        char* resp_body = new char[len + 1];
        memset(resp_body, 0, len + 1);
}

I use the snap code above to the http Post response,  response data is to much,  but the maxmium len is always 380696, I use the tool Postman it return the all data, how can I get the rest data or there is a bug on the reponse data buffer .


tests: fix a small race in the rescan_and_recover test

self-ACK<PHONE_NUMBER>b6f8340aeec5493b07e55ae9628398 -- trivial, tested locally by running many instances of the test in parallel


Are we able to use Nuxtlabs UI outside of Nuxt, in a generic Vue SPA?

Would love to use this library outside of a Nuxt context.

https://github.com/nuxtlabs/ui/issues/187


Update security endpoint

Proposed Changes
Supervisor 129 and up usesa different API endpoint.
Related Issues
Closes #1.
Remarks
Only tested with supervisor 129.

@frenck Should $(hass.api.supervisor.info.version) be put in double quotation marks? Seems to work like this anyway.

Didn't think of that, cleaned it up.


Neevor/exclude

@batson I fixed the targets ordering and added a test.
The guides generated with these changes produce 525, which is less than the original set. The main difference is that MexS__HQ433550__ARO_3000813 is no longer solved. The earlier guide had a guide that overlaps one of the SNPs and this no longer solves and so the guides for that gene now fail.

@batson I updated this to use data from a gene so it all matches real targets.


The Database file has not been in the data directory for a while.

I have had issues with this docker container maxing out the CPU, and the container stopping itself.
The only way I get it going again is to start with a new log file and force a re-install of the docker container, this may be overkill.
Today I was looking in the docker var directory (now that my container is up and running) for the database file you have mentioned on another "issuse" that can be deleted to re-read the logfile from scratch and noticed the database file is named as if it should be in the data folder.

Maybe simply recreating the database file may fix my problem in the future by deleting the file from the volume. Can you possibly fix the above and get it back in the data directory.
It may be an UNRAID config issue on my end though I haven't changed anything in a while, hopefully, you can assist.

I recently re-installed the docker container in Unraid and I can only assume this line has been corrected from what I had before as my issue is now resolved.


Improve default success message of step

When a developer creates a new step named «step-name» this will immediately trigger the following log output on loglevel STEP:
Start: «step-name»

The developer can now end the step explicitly with a custom success message but if he just invokes step.success() then a default success message is logged on loglevel STEP.
This is currently just:
«step-name»

Depending on what the developer has chosen as step name this can be rather confusing.
Instead we should get something like this:
Successfully ended step '«step-name»'.

Example log before change when running ide update:
Start: Install or update software
Start: Install eclipse
Version 2024-09 of tool eclipse is already installed
Install eclipse
Start: Install intellij
Version 2023.3.7 of tool intellij is already installed
Install intellij
Start: Install gradle
Version 8.10.2 of tool gradle is already installed
Install gradle
Start: Install jmc
Version 9.0.0 of tool jmc is already installed
Install jmc
Start: Install npm
Version 10.8.3 of tool npm is already installed
Install npm
Start: Install tomcat
Necessary version of the dependency java is already installed in repository
Version 10.1.30 of tool tomcat is already installed
Install tomcat
Start: Install aws
Trying to download aws-2.17.57-windows-x64.msi from https://awscli.amazonaws.com/AWSCLIV2-2.17.57.msi
Downloading 100% [===============================================] 39/39MiB (0:00:12 / 0:00:00) 3.3MiB/s
Checksum 558afec17ffc15cc2572912b927de4e5420e546d44fbc5f97deb58fd7a711836 is correct.
Successfully installed aws in version 2.17.57 replacing previous version 2.17.56
Start: Install java
Version 21.0.4_7 of tool java is already installed
Install java
Start: Install node
Version v18.20.4 of tool node is already installed
Install node
Start: Install mvn
Version 3.9.9 of tool mvn is already installed
Install mvn
Install or update software

It is not very obvious for the user that Install java means that java is successfully installed.


Gradle 6.4.1

Gradle 6.4.1 is available.
This is sent by @gradleupdate. See https://gradleupdate.appspot.com/Knotx/knotx-gradle-plugins/status for more.

Already updated to Gradle 6.5.


Added browserify directive to make sure that JSX->JS transform happens w...

Currently we are getting errors about illegal characters when we use reactify transform on the local module which imports react-autocomplete. This is because reactify works only on local modules and not the imported ones unless we explicitly specify reactify transform in package.json. This patch adds reactify directive and also css directive to package.json

The "reactify" module also needs to be added to dependencies in order for this to work.


Move from Node 14.x to 18.x with NPM 9.5.0+

Request details
What NPM version do you use for reposilite frontend, because the AUR package needs to reflect this version, as currently it doesnt and npm shouts at you every time you build the package that the npm lock is out of date and updates it.
Would it be better to update to the latest npm version, and thus update the upstream version of the lockfile?

The minimal required version for reposilite-frontend module is Node 14.x+,  there were some issues with newer versions in the past, so we're using this to build app in Docker:

https://github.com/dzikoysk/reposilite/blob/main/Dockerfile#L6

I guess we could revisit this requirement and see if we can move to the latest LTS.

Oh damn, we are using 8.19 to build the packages, I dont know which one you are using... but its outdated when I build reposilite

Idk which NPM version comes with Node 14.x on CI, but locally I use Node 14.x + NPM 9.5.0 and it works properly.

the issue is mainly because Arch Linux is rolling release, so we use latest upstream and not LTS (we could use LTS but node and NPM is split).


fixes https://github.com/Microsoft/monaco-editor/issues/1353

This PR fixes https://github.com/Microsoft/monaco-editor/issues/1353 based on the suggestion from  @cgillis-aras here: https://github.com/Microsoft/monaco-editor/issues/1353#issuecomment-476683672
Unfortunately, the follow-up comment from @yishn did not work out -- just changing from 'mousewheel' to 'wheel' did not work on Firefox.
This PR follows the pattern used in several other vscode files of using browser.isFirefox rather than registering multiple listeners (from the original suggestion).
Tested and working in vscode and Monaco. Feedback welcome and appreciated! :-)

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

bump on this @rebornix and @alexandrudima -- anything i can do to aid in review here? Many thanks!

Thought I'd check in on this again. This PR is very small and hopefully not controversial (I tried to follow other examples from the code base as closely as I could).
It's my hope that it will be a very quick (3-ish minute) review. Please let me know if there is anything I can do to make it easy for you all!
Thanks @jrieken, @rebornix and @alexandrudima! :-)

Thought I'd check in on this again. This PR is very small and hopefully not controversial (I tried to follow other examples from the code base as closely as I could).
It's my hope that it will be a very quick (3-ish minute) review. Please let me know if there is anything I can do to make it easy for you all!
Thanks @jrieken, @rebornix and @alexandrudima! :-)

@bcolloran thanks for your help and sorry for missing your ping. The code works as expected. The only problem is DOMMouseScroll  will be deprecated in the future as well so we don't want to replace one deprecated api with another.
I think the right fix should be adopting wheel event incrementally, like https://github.com/microsoft/vscode/pull/70515 . But again, we should be careful, as the semantics of wheel event is different from mouseWheel.
IMO we should

Adopt wheel for Firefox to unblock Monaco users
Adopt wheel for every browser which supported it and use event. wheelDelta
Introduce an option, say useSystemWheelSensitivity, and use event.delta when it's turned on.

thank you for getting back to me @rebornix :-) Sounds like you have a plan. Is there anything I can do to support #70515? It looks like a thoroughly thought-out solution. I'd love to see it get over the line! :+1:

@bcolloran it would be awesome that you can help with this issue, having more contribution is always incredible to me. I can do a mitigation for FF and for adopting wheel event, we can probably do that together
Firstly, we need to know what's the expected result of mouseWheel event on different platforms, and different browsers. Take them as input and see what's the output of current VS Code/Monaco. Write tests for them.
Secondly, we change mouseWheel to wheel, and make sure all test cases pass. This way we can ganguratee that users won't be affected by the change.

These event aren't standard according to :

https://developer.mozilla.org/en-US/docs/Web/API/Element/mousewheel_event
https://developer.mozilla.org/en-US/docs/Web/API/Element/DOMMouseScroll_event

it's recommended to use : https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event

It's already fixed in master. We can look into how to adopt deltaY/deltaX in the future, for now we still use wheelDeltaY/wheelDeltaX when possible.


🚨 | Review/Refactor Required

Review/Refactor Required
I'd like to refactor the project in order to be more standardised and compatible.

Undeniably, the current readme.md does demand significant enhancements;
Somewhat confusing version tracker;
Universal Unix-like project structure.
etc.

Partially fixed here #20.
Though, the README.md needs an update with the respect to the newly designed src.

Track: 91325ae6735b2fd61c700fc1470796c671ddfc43


Incompatibility with other libraries

I am currently using BeerCSS in one project but I came across an issue when I wanted to use another library for rendering maps.
The labels when hovering over the maps were not showing. I end up tracking the issue to the BeerCSS CSS file. Specifically in the following block:
* {
  -webkit-tap-highlight-color: transparent;
  position: relative;
  vertical-align: middle;
  color: inherit;
  margin: 0;
  padding: 0;
  border-radius: inherit;
  box-sizing: border-box;
}

on code
Is there any other option than to apply this styling to all elements? This makes it difficult to work with BeerCSS and other libraries because it causes incompatibilities that are difficult to override especially if the HTML is created dynamically with JS
What workaround would be the best to enable this styling for BeerCSS-styled HTML elements?

Hi @WilliamSoler,
The project of Beer CSS doesn't delivery any guarantee that using another UI lib will work, because it styles directly HTML semantic tags. I would to suggest to use the map on different context like iframe or try to style as all: revert:

Using all: revert will revert to default styles from browser. In theory, all child element must work as expected. Maybe we can create a helper called "revert" or "revert-all" to do that.


Arguments with spaces in the value?

Is there a way to create an argument that allows spaces in it?
I am trying to use Moderator for a swift script to post a message to the Slack API.  How can i pass in a "message" argument that may have spaces in it?  Wrapping my message argument value in quotes does not seem to work.
I imagine I could write my messages to a file, and pass in the filename, but I was curious if there is any other way with the current Moderator implementation.
import Foundation
import Moderator
import SwiftShell

let arguments = Moderator(description: "Post a message to Slack.")

let messageArg = arguments.add(Argument<String?>.optionWithValue("m", name: "message", description: "The message to post."))
let botNameArg = arguments.add(Argument<String?>.optionWithValue("n", name: "name", description: "The name of the bot."))
let urlSlugArg = arguments.add(Argument<String>.optionWithValue("p", name: "path", description: "The url path (the part after https://hooks.slack.com/services/)."))

do {
    try arguments.parse()

    guard let message = messageArg.value else {
        throw ArgumentError(errormessage: "Slack message not found.", usagetext: "use -m Message")
    }

    guard let urlSlug = urlSlugArg.value else {
        throw ArgumentError(errormessage: "Slack URL path not found.", usagetext: "use -p T000000/B000000/XXXXXXX")
    }

    guard let botName = botNameArg.value else {
        throw ArgumentError(errormessage: "Bot name not found.", usagetext: "use -n BotName")
    }

    } catch {
        print("*** FAILURE!")
        print(error)
        exit(Int32(error._code))
    }

Here is what happens with my current script.  I am trying to get the "m" argument to contain spaces:
$ marathon run post-to-slack.swift -m Message! -p T00000000/B00000000/XXXXXXXXXXXX -n Bot

$ marathon run post-to-slack.swift -m Longer Message! -p T0000000/B0000000/XXXXXXXXXXXX -n Bot
*** FAILURE!
Unknown arguments: Message!
Post a message to Slack.

Usage: post-to-slack
  -m <message>:
      The message to post.
  -n <name>:
      The name of the bot.
  -p <path>:
      The url path (the part after https://hooks.slack.com/services/).

$ marathon run post-to-slack.swift -m "Longer Message!" -p T00000000/B00000000/XXXXXXXXXXXXXX -n Bot
-bash: !": event not found

Thanks you for any guidance you can help provide.  Loving your tools.

This seems to be an issue with marathon. If you go to the project directory of post-to-slack.swift (by default in ~/.marathon/Scripts/Cache/`) and run:
swift build
./.build/debug/post-to-slack -m "Longer Message" -p T0000000/B0000000/XXXXXXXXXXXX -n Bot

it should work. But only without the !, Otherwise bash will complain about "event not found". If you put a \  before the exclamation mark it works fine.

Apparently you can include ! if you use single quotes instead: https://unix.stackexchange.com/questions/33339/cant-use-exclamation-mark-in-bash

I'm seeing the exact behavior you are describing.  Seems like an issue with Marathon.  Thanks for the fast response.  👍

@jeffctown BTW your example above reminded me that the error message Moderator gives when a required argument is missing is pretty useless. I tried to improve on that in this release: https://github.com/kareman/Moderator/releases/tag/0.4.2 . Now you can do this:
let messageArg = arguments.add(Argument<String?>.optionWithValue("m", name: "message", description: "The message to post.").required())
let botNameArg = arguments.add(Argument<String?>.optionWithValue("n", name: "name", description: "The name of the bot.").required())
let urlSlugArg = arguments.add(Argument<String>.optionWithValue("p", name: "path", description: "The url path (the part after https://hooks.slack.com/services/).").required(errormessage: "Slack URL path not found. Use -p T000000/B000000/XXXXXXX"))

do {
	try arguments.parse()

	let message = messageArg.value
	let urlSlug = urlSlugArg.value
	let botName = botNameArg.value

and still (hopefully) get useful error messages. I'd love to hear any feedback you have, you can comment on the commit itself (https://github.com/kareman/Moderator/commit/19660ff89e5dd6ed17ab70505d9147ddca1ab482) or create a new issue if you want.

@kareman great man.  I will be picking this up again tonight, so I will update and let you know how the new error messages are looking.
FYI - the marathon team was able to provide a crazy fast turn around to get this fixed within 24 hours - https://github.com/JohnSundell/Marathon/issues/114.

@kareman love it man.  I think you've helped convince me to rewrite all of my automation scripts in swift.  👍

Glad to hear it :) . Automation feels much safer when you can catch many errors at compile time.


[Dependency] Bump Espresso to Version 3.5.1

Description
Bump espresso to version 3.5.1
Review checklist

[x] PR is split into meaningful commits for the ease of reviewing
[ ] Tests have been written
[ ] Screenshots added (where applicable)
[x] Appropriate labels have been applied

Codecov Report

Merging #90 (62d1615) into main (ba0d918) will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##            main     #90   +/-   ##
=====================================
  Coverage   74.9%   74.9%
=====================================
  Files         45      45
  Lines       1354    1354
  Branches     400     400
=====================================
  Hits        1015    1015
  Misses       125     125
  Partials     214     214


🪸 last check "Request new subscription" view [epic 347]

🗂 this is a sub-issue for our epic #347
#Todo
When all issues related to epic #347   are finished:

check, potential update and get ok for all copies with technical writer
check, potential update and get ok with design
check and potential update user flows in form for accessibility

keyboard usage
screenreader
automated tests like for color contrasts etc.

💡 If there are things that we can improve in design system or consoles form component, don't forget to make them aware and support!

@mathieu-anderson  should this be closed?


email not working

DO NOT REMOVE THIS
Please make sure your issue complies with these guidelines:

[ ] Be using PMMP

[ ] Make sure the issue hasn't already been reported

[ ] Make sure you are on the latest version of PMMP & PiggyAuth

[ ] Have a detailed title like "Players are being kicked randomly"

[ ] Provide any crash dumps or errors

General

Server Software:

Tesseract
Version of PiggyAuth:

PiggyAuth version <IP_ADDRESS>
Data Provider:

[ ] MySQL I believe
[ ] SQLite
[ ] YAML
[ ] JSON

Steps to Reproduce the Issue

I typed my email but nothing happened so I typed 'none' and it worked
the part where it asked for my email -> Now type in your email. Type 'none' to skip.

Extra Information

Latest version is <IP_ADDRESS>...

but we no longer support Tesseract as of <IP_ADDRESS>

Try this on pmmp.


Move dataplane/server package -> dataplane

server is too generic of a name.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

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 70.624%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
702

Relevant Lines:
994

💛  - Coveralls


build: fix building without external dependencies

Issue #, if available:
Configuration fails with -DBUILD_DEPS=OFF because the cmake file containing the AwsFindPackage() macro is located in one of the submodules.
Description of changes:
Pull the relevant file into the main git repo to fix it.
Check all that applies:

[ ] Did a review by yourself.
[ ] Added proper tests to cover this PR. (If tests are not applicable, explain.)
[x] Checked if this PR is a breaking (APIs have been changed) change.
[x] Checked if this PR will not introduce cross-platform inconsistent behavior.
[x] Checked if this PR would require a ReadMe/Wiki update.

Tests not applicable, patch affects the build system.
Check which platforms you have built SDK on to verify the correctness of this PR.

[x] Linux
[ ] Windows
[ ] Android
[ ] MacOS
[ ] IOS
[ ] Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

#1888


Loading config from a file (e.g. JSON or toml etc.)

Currently the Javalin API does not seem to have ability for directly loading the config settings from a file (e.g. in JSON format etc.). Most settings have to be hard coded during the initialization of Javalin instances.
Please pardon my ignorance, but somehow I wasn't able to find any examples or documentation that describes any Javalin APIs for loading configuration from a file. Also, I understand that one can load the settings from a resource or external file, and then manually setup the configuration entries. However, I think it would be useful if there is an API inbuilt for doing it. Something like: myJavalinObj.applyConfig(File configFile), which will apply the configuration setting loaded from the supplied file.
Thanks in advance!

Hi @bsodhi,
Javalin is just a library, and not a full framework. When you are setting up a web application in Javalin, it's likely you'll use something else for database connections/migrations, templating, json serialization, emails, rate-limiting, etc.
In most cases you'll want to use a library for config too, so that you can configure all of these components in the same way (so you don't have to deal with X different ways of writing configs).
Hopefully this answered your question!


Fix dataprocessing asm

Adding R char in second op data processing ASM
Fixing asm when shift amount is 0
Readded some tests deleted in the last PR

Codecov Report
Base: 59.52% // Head: 59.60% // Increases project coverage by +0.08% :tada:

Coverage data is based on head (02ae988) compared to base (f6c5086).
Patch coverage: 66.66% of modified lines in pull request are covered.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
+ Coverage   59.52%   59.60%   +0.08%
==========================================
  Files          32       32
  Lines        2241     2248       +7
==========================================
+ Hits         1334     1340       +6
- Misses        907      908       +1

Impacted Files
Coverage Δ

emu/src/cpu/instruction.rs
82.87% <ø> (ø)

emu/src/cpu/data_processing.rs
84.79% <66.66%> (-0.93%)
:arrow_down:

emu/src/cpu/alu_instruction.rs
62.92% <0.00%> (+2.24%)
:arrow_up:

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

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


Improved Documentation

Hi,
Please could you add examples of how to use pmtiles via docker to build or upload pmtiles
Beleive it something like docker run -v $(pwd)/data:/var/ ghcr.io/protomaps/go-pmtiles:main convert radon.pmtiles radon.mbtiles, however this doesn't work for me.
Please could you also provide more detailed instructions to install on linux - I can see the binary but don't know how to install
I'll happily add to the readme and submit a PR once I know how.
Kind regards,
Edd

The linux binary does not need installation, you simply run the binary with ./pmtiles. This should also obviate the need for Docker.

I'm also running the pmtiles binary through docker and can give some input here in case that helps:
docker run -v $(pwd)/data:/var/ ghcr.io/protomaps/go-pmtiles:main convert radon.pmtiles radon.mbtiles

In your command here you mount your ./data directory into the container at /var/ and because convert runs inside the container you have to prefix your input and output paths with /var/, too.
Below is an example of how I run it. I noticed I also had to change the TMPDIR env var because otherwise the creation of temporary files does not seem to work with the scratch image by default, resulting in

2024/05/09 10:39:36 main.go:177: Failed to create temp file, open /tmp/pmtiles2186268370: no such file or directory

This runs the latest go-pmtiles to convert a .mbtiles file to a .pmtiles file; pretty neat!
$ docker run -it --rm --pull always -e TMPDIR=/data -v $(pwd):/data ghcr.io/protomaps/go-pmtiles:main convert /data/monaco-latest.mbtiles /data/monaco-latest.pmtiles

main: Pulling from protomaps/go-pmtiles
Digest: sha256:9627edcd10eed2936c63602333f13270644d659d823d2478fa60c1dac99d60b1
Status: Image is up to date for ghcr.io/protomaps/go-pmtiles:main
2024/05/09 10:39:46 convert.go:260: Pass 1: Assembling TileID set
2024/05/09 10:39:46 convert.go:291: Pass 2: writing tiles
 100% |███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (22/22, 10100 it/s)
2024/05/09 10:39:46 convert.go:345: # of addressed tiles:  22
2024/05/09 10:39:46 convert.go:346: # of tile entries (after RLE):  22
2024/05/09 10:39:46 convert.go:347: # of tile contents:  22
2024/05/09 10:39:46 convert.go:369: Total dir bytes:  123
2024/05/09 10:39:46 convert.go:370: Average bytes per addressed tile: 5.59
2024/05/09 10:39:46 convert.go:340: Finished in  12.034584ms

New docs for CLI here: https://docs.protomaps.com/pmtiles/cli


Allow passing size hints for streaming request bodies

Currently when creating a reqwest::Body you get the choice between a static body with an known content length, or a streaming body with an unknown and unbounded content length. The first case will use content-length, the second transfer-encoding: chunked. There is actually a third possibility though: a streaming body with a known content length, for example a file on disk.
In the scenario where you want to post a large on disk file, you don't want to load the entire file into memory, but you can reasonably determine the full size with a stat call. The reason for using this over transfer-encoding: chunked, is that not all servers support transfer-encoding: chunked for HTTP1.1 incoming request bodies. Moreover, the web fetch spec (section <IP_ADDRESS>) even specifically mandates that the transfer-encoding: chunked header should only be set if the body size is not definitely known (reason is compat with badly behaving servers).
I propose a very simple addition to the reqwest::Body interface:
impl Body {
    pub fn wrap_stream_with_size_hint<S, O, E>(stream: S, size_hint: SizeHint) -> Body;
}

This would work identically to the existing system, except that the size of the stream is hinted at using the specified http_body::SizeHint.

Actually, you can just manually set content-length header, so probably unnecessary.


[Unnecessary Files Remove]

Dir vulnerable-application\.idea should be removed.

we added it because if someone wants to continue development on the application we have added the config files we used as a example web server config and all


feat: add slicing to vectors

I'm not sure why the MacOS tests are flaky. They are all passing on my local machine.


MB-15710 add and implement BuildProofOfServiceDoc

Jira ticket for this change
Summary
Add and implement BuildProofOfServiceDoc
Setup to Run Your Code

💻 You will need to use three separate terminals to test this locally.
Terminal 1
Run tests locally.
 make db_dev_e2e_populate server_test

Messages

:book:
:link: MB-15710

  Generated by :no_entry_sign: dangerJS against 49f88cbfee28483090230eb62f5cb87d607647e1


using orWhere on a soft delete model returns deleted items?

I'm having an issue using an eloquent query to search for my users.
$users = User::where('email', 'like', '%'.$search.'%')->orWhere('brid', 'like', '%'.$search.'%')->orderBy('brid', 'ASC')->paginate(5);

This is returning deleted and un-deleted users.
I am not using the withTrashed() function, so i should be just getting my un-deleted users in the result.
If i remove the orWhere() it then works correctly.
Is this something that can be fixed in Eloquent?

While this is a logical result of the way the queries are built, the documentation is seriously misleading:

When querying a model that uses soft deletes, the "deleted" models will not be included in query results.

With automagical features like this, you kind of expect them to work as described. If they don't, maybe it's better to just explain the technical details of what they do.

@taylorotwell Is it worth it to update the docs for this issue? if yes, I will do it.

Sure send it over.
On Mon, Nov 2, 2015 at 4:48 AM, Mustafa Ehsan Alokozay
<EMAIL_ADDRESS>wrote:

@taylorotwell Is it worth it to update the docs for this issue? if yes, I will do it.
Reply to this email directly or view it on GitHub:
https://github.com/laravel/framework/issues/1945#issuecomment-152985380

I think that this is a terrible bug (of course not an sql bug but an eloquent one), why in the above example should be retrieved deleted items? It doesn't make sense!!!
Eloquent in this case generate a not expected and very dangerous query!

I can get passed the issue using
$query->whereNull('deleted_at');
at the end of the query before calling
$query->paginate($perPage, $page);

I solved like that after each orWhere(...)->withoutTrashed(); The same things for onlyTrashed();
You can solve it like that :
$users = User::where('email', 'like', '%'.$search.'%')->orWhere('brid', 'like', '%'.$search.'%')->withoutTrashed()->orderBy('brid', 'ASC')->paginate(5);


Compute Accuracy

Is compute_accuracy method is general for all problems or that is specific just shortest_path example?

(Closing due to inactivity)


Fix chain info format for suggesting chain

The chain info objects were not being properly transformed to the format Keplr expects for experimentally suggesting chain. Let's fix that.

LGTM!


Add workflow for checking git-lfs files

Adds a check that prevents files that should have been tracked by git-lfs to be directly committed to the git repository.
Tested for failure: https://github.com/grafana/beyla/actions/runs/10999538512/job/30539903906
Tested for success: https://github.com/grafana/beyla/actions/runs/10999512344/job/30539820365

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

Project coverage is 53.34%. Comparing base (c3901b2) to head (46f49ca).

:exclamation:  There is a different number of reports uploaded between BASE (c3901b2) and HEAD (46f49ca). Click for more details.
HEAD has 2 uploads less than BASE

Flag
BASE (c3901b2)
HEAD (46f49ca)

oats-test
1
0

k8s-integration-test
1
0

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1194       +/-   ##
===========================================
- Coverage   78.35%   53.34%   -25.02%
===========================================
  Files         136      136
  Lines       11501    11501
===========================================
- Hits         9012     6135     -2877
- Misses       1930     4965     +3035
+ Partials      559      401      -158

Flag
Coverage Δ

k8s-integration-test
?

oats-test
?

unittests
53.34% <ø> (ø)

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

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


BatchUploader: use iterative --pretend

Originally on 2013-03-15
When the batchuploader interface uses bibupload --pretend to pre-check input it might happen the the HTTP request timesout. Infact this could be done in an iterative way.

Closing this as per the overall reimplementation.


Is it feasible to use Entitas in the backend?

Context
We currently have a singleplayer game. Diablo perspective but guns as weapons (for both player and enemy), goal is to clear each room out of X max and get loot at the end.
Old gameplay: https://youtu.be/ck-nqOgGjXo?t=79
Apart from guns & bullets, player characters have abilities, 3 active and 1 passive.
We have / want typical RPG spells and special attacks, distilled to just "abilities" that have a wide range of unique effects, such as: life drain, mind control, hp / damage / speed / etc. boosts, as well as the opposite effect to debuff enemies.
Problem
Since we are using Entitas for the client, but we want to introduce PvP and Coop, the need to move Entitas to a C# backend solution arises.
Option 1 (Ideal, clean):
I would assume that for each match, we would create a micro-instance with a separate Entitas running in order to isolate Entities and Systems from other matches, then either recycling or destroying / recreating them on demand.
Option 2 (Risky):
I don't think, at any point, did our entity count within a game level surpass or came close to 100 Entities, so if 1000 matches are running, and somehow we do have EVERYBODY AND EVERYTHING in the same 1 Entitas instance and we isolate them by matches, it might work but that means 100,000 Entities, a few dozen Systems operating on them. Don't know about thisone.
Option 3 (Unlikely):
Some sort of P2P but since there's a certain amount of Physics involved, I can literally feel my soul leaving my body having to deal with any of this. Plus, the game is mobile first, so any lag, disconnect will be / feel unfair. Also client authoritative is cumbersome to check for cheating.

To me Option 2  means rewriting everything, you need to think differently when you want to handle multiple matches. there's a risk of interference between matchs... scaling is a pain also.
Option 1 is probably your best bet
will offer a more stable gameplay experience, any issue or crash would technically affect a single game.
it's easier to predict ressource usage and easier to scale by just spawning more game servers.
but being server-authoritative you might need to implement lag compensation and client prediction... but with movement and bullet speed seems slow enough that you might not need it at first... coop can probably work fine without it, but PvP will prolly need it.

Entitas works fine in console application and don't need unity. Also, you can have as many copies of context in one instance as you want. In our project we have two copies of contexts in one game at same time for local and global data. You just need to manage that copies by hand or dependency container.
If I have to make a multiplayer game, I will choose 1 option.

You can use a UI-less Unity instance as a server, handling multiple games at once, tag each networked entity with an id what game it belongs to and only broadcast those that belong to the game the current player is in. You can load multiple maps, aslong as you offset them by a generous value so their physics objects do not collide

you can use Unity in headless-mode I think, my understanding is that it will simply work without rendering anything.
a very simple implementation would be to have clients only send input to the server, process physics on the server, and sync position and stuff back to the clients.
But lag will probably feel bad for players so you also run the physic on the client to control the 'local' player, but then you always take what the server say the position is so that clients can't cheat. on slow-ish movement it should work pretty well


Fix edit-time and infinte loop.

Hi, thanks a lot for the script.
I found some error while converting mine database so I figure I would submit a PR.
The first one is the location of 'edit-time'. In some of my page, it's inside the page['children'][0] dict, in some other page it is directly in the page dict. I add a small if else around that.
The second one is infinite loop  when reference not found. I haven't dig around the logic around that part yet but just add a break statement seems to work fine for me.
Hope this help.

Thanks for the break in the uid check. I also needed an empty dict return in the scan method to deal with no 'uid' found.


Fix sign error in ζ(Z)

@sandreza merge when you're happy

@BrodiePearson this could be relevant to you.

@glwagner Thanks Greg! Is this something that changes results? The code comparison makes it look like the two sign flips cancel out.

The test was incorrect (it used Z = 1000 meters, but Z is supposed to be the geopotential height, which is negative in the ocean).
We fixed the sign error in the code and the test. This fixes the results with Oceananigans.
That said, the differences are probably significant only for simulations in deep domains where thermobaricity may be important (ie density differences due to simultaneous changes in temperature and pressure).

@sandreza do you think you can report back here with some confirmation that changing this sign error leads to expected results in a complicated deep ocean simulation?

Mmm yes there are also terms associated with salinity+pressure variation ("halibaricity"? not sure what people call it).
If you do re-run LES to check effects it could be nice to post here whether or not you see differences (just in case there are others affected).

Will do! And I also have no idea what the term for that is...


Verify generated content with a linter or similar

Right now this is only our site.min.css files. We should (as part of our tests) verify that the contents are at least valid css.

Fixed by #731.

Something like npx csslinter %(AllOurCSSFiles) would do the trick.


Installation instructions via cocoapods do not work when submitting to the app store.

The instructions for linking against 3.5 for cocoapods are good for testing but this is not the case when trying to compile and submit your app to the app store.
pod 'AudioKit', '~> 3.5'
Causes this issue on iTunes:
Invalid signature. Code object is not signed at all. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level. Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a simulator target.
I have gone through closed issues and found issues relating to this where your recommendation is to use the develop branch to resolve this issue.
^^^ Should not be considered a fix.
It would be nice if you guys gave some proper instructions on how to include the framework in your app in such a way that satisfies itunes / application loader.
As of now - about 3 days no luck. Such a disaster.

All my certificates etc are kosher. So no need to suggest that is the mistake.

@adamdahan how did you solve it?

@oliviernicki

Download the master branch as a zip
In this repo under frameworks/INSTALL.md follow the compile from source instructions
Go to build settings and type in bitcode
Set enable bitcode to NO

Then archive and voila!
Let me know if you need further help - best.

@oliviernicki using cocoapods or simply embedding as framework will not work to submit to iTunes even if you add the run script build phase they suggest. So specifically dont follow step 1 or 2 in INSTALL.md.


Building broken on Mac OS 12

See for instance: https://github.com/rhaberkorn/sciteco/actions/runs/11414224313/job/31762843710#step:6:214
A_ITALIC is not available on the ancient ncurses shipping with Mac OS 12. In fact, A_ITALIC is a non-X/Open extension according to curs_attr(3X). You need to #ifdef any reference to it.
(I didn't know that either!)

While you're at it, there are warnings because sprintf() is deprecated. Probably not only on Mac OS. This can easily be avoided by using snprintf() instead.

Thanks, I noticed this a couple days ago and it's fixed in https://github.com/orbitalquark/scinterm/commit/60e32993f7d31674aa9b8db0766d9f6984fb4891.

Oops, didn't even see you committed it in the meantime.


docs: add metadata markup capability to docs template so docs can have unique SEO descriptions and metadata

What?
All docs pages currently use the same meta description and it's not possible to customize it for each doc. In the existing blog template, unique metadata is added by using markup at the top of each markdown file as follows:
title: August '20 Community Gems
description: |   A roundup of technical Q&A's from the DVC community...
I propose adding the same capability to the docs template so that docs can also have unique metadata.
Why?
SEO analyzers/site audits flag this as an issue because a unique (and well written) description often improves clickthrough rates on search results, which leads to better rankings.
There are currently ~90 /doc pages on the dvc.org domain with duplicate descriptions. Adding unique descriptions to all/most of the docs could have a material positive impact on overall rankings in the medium to long term.
Adding this feature would allow for a partial fix for two open general SEO issues: it's a best practice to have unique descriptions (#1118), which could then be updated on all docs and

[ ] the meta description tags considered "reviewed" (#1119).

If the docs template was updated to use custom metadata like blog posts, then

[ ] #857 re: content previews should also be addressed.

The content preview (e.g., og:description) is not unique for the same reason: different tags but generated from the same text. 😉

This should function as described in #982 ("easily replace default og-tags in header with the ones needed for current page"), but if no custom tags are added to a given doc, the default tags should remain.
How?
I investigated how this is working for blog posts and tried adding similar metadata to a doc on my local... just in case the renderer picked it up (it didn't 🙃). So it appears the docs template and page generation need to be updated.
To fix the duplicates issue, only the meta description would be required. There is no need or benefit to customizing the meta title for most of the docs as the title is simple and should only reference the command or feature. However, for tutorials, use cases, or other long-form docs it would be good to have the option to edit the meta title for SEO purposes.

Hey @jorgeorpinel, I think this would be a good complement to the GSoD work. With this I could update some/all of the docs descriptions as I make other updates.
I can probably figure out how to do this, but it would be great if someone who was more familiar with the site generator (or did the blog meta work) could help out. Let me know what you and the team think!

Agree. @shcheklein @rogermparent should we prioritize this for coming weeks? Thoughts on how to implement?
BTW this is sort of a duplicate of #982, can we merge them please? This one has more info so let's keep this one, just bring in any info that's not included (if any) from that older one into the description above.
Some follow-ups:
Can you try to summarize the requirements as bullets or check boxes in the description of this issue @jeremydesroches? E.g. which fields to support, etc. (or is it the exact same stuff as in the blog?)

then #857 re: content previews should also be addressed

OK, I closed that issue and added a check box to the description above instead.

To fix the duplicates issue

Which one are you referring to there? Didn't get that part (feel free to clarify in the description/requirements).
Thanks

Adding this would be quite easy, I think. We just need to decide which fields we want to add, what SEO tags they translate to, then map these two pieces of info to the docs page queries and react-helmet components in the template respectively.

Can we auto generate all needed meta fields (description, images, etc, etc). It would be great to avoid us having to update and maintain new fields for every single page in docs.

BTW this is sort of a duplicate of #982, can we merge them please @jeremydesroches?

#982 is very similar and I added the detail about defaults vs. custom tags. Ideally docs could continue to use the default tags until we update and add the front matter with custom tags. That's how it works for blog posts (I tested it out). If you leave a custom tag blank, it's replaced with a default "blog" tag.

Can you try to summarize the requirements as bullets or check boxes in the description of this issue Jeremy? E.g. which fields to support, etc. (or is it the exact same stuff as in the blog?)

The minimum to fix the "duplicate meta descriptions" issue is only the description. The title might be useful for tutorials and use cases. So it's a subset of what blog posts use. I was thinking that if the fallback to defaults works as with blog posts, then it would be simpler to follow the blog implementation exactly.

@jeremydesroches by "duplicate meta descriptions" you mean that every doc page has the same meta description right? Just checking

Can you try to summarize the requirements as bullets or check boxes

only the description. The title might be useful... if the fallback to defaults works as with blog posts

So again, can you clearly summarize the desired requirements? TBH I didn't fully understand the answer. Thanks

So again, can you clearly summarize the desired requirements please? TBH I didn't fully understand the answer. Thanks

OK @jorgeorpinel. Added to original description. Let me know if anything can be added or clarified.


Duplicate Post Titles

Repeated blog post titles allows only the most recent blog post be shown
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:

Create a post with any date and any title, e.g. "2019-01-01-new-year.md".
Create a post with any date and the same title, e.g. "2020-01-09-new-year.md".
Run "jekyll serve"
See error; i.e. only your newest blog post is accessible, e.g. "http://<IP_ADDRESS>:4000/posts/new-year/" shows the post dated Jan 09, 2020.

Expected behavior
I should be able to see both blog posts, regardless of title. If the setup of the blog posts' URLs were yyyy-mm-dd-title, this problem might be avoided.
Additional context
Not sure if I should have posted under Bug Report - sorry if this is a repost.

Well, it's the Jekyll setting stuff: permalinks. In this project  it was set to /posts/:title/, so as you do, the generated static file overrides will appear.
I don't think it's a good idea that give two(or more) different posts with a same title, because it will confuse your readers, and even yourself. But if you insist on doing so, there‘re two methods to avoid file overwriting:

Change the permalinks in config
A little trick that suffix your duplicate files, e.g. '2020-01-09-new-year-SUFFIX.md'

Great! Thank you for that information. Sorry for the bug ticket.


Proper handling of SQLAlchemy database sessions

I am convinced this is due to sqlalchemy sessions not being properly handled within conda-store server and workers. This also addresses issues seen in https://github.com/conda-incubator/conda-store/issues/459. There should be clear boundaries around sessions and they should never be passed between threads since they are not thread-safe https://docs.sqlalchemy.org/en/13/orm/session_basics.html#is-the-session-thread-safe.
Currently main is broken.  This was shown clearly by https://github.com/conda-incubator/conda-store/blob/5507732fbe4cbd2015e99dedcbe694851c0eb82e/conda-store-server/conda_store_server/server/app.py#L190 which essentially passes a sqlalchemy session to the Traitlets object conda_store_server.server.auth.Authentication and the value is used across threads (each fastapi route call potentially runs on a separate thread).
A simple fix is to pass the session_factory instead of session:

https://github.com/conda-incubator/conda-store/commit/74d37e2d28dd490582c90502ec50f254dbbca032#diff-8aca98d789e72a0f566677c4fd621c36710f5f7962296ae7ba9775a69bb3bebfR246
https://github.com/conda-incubator/conda-store/commit/74d37e2d28dd490582c90502ec50f254dbbca032#diff-6e917bb6802f2371734d67dc682bca330426e10a04625ef77f396d208f943a3eR190

But this "fix" leads to additional errors about closing sessions in other places. See the following errors message.
emy/orm/attributes.py", line 942, in get
    value = self._fire_loader_callables(state, key, passive)
  File "/home/costrouc/.conda/envs/conda-store-server-dev/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py", line 978, in _fire_loader_callables
    return self.callable_(state, passive)
  File "/home/costrouc/.conda/envs/conda-store-server-dev/lib/python3.10/site-packages/sqlalchemy/orm/strategies.py", line 863, in _load_for_state
    raise orm_exc.DetachedInstanceError(
sqlalchemy.orm.exc.DetachedInstanceError: Parent instance <Build at 0x7ff1c197e0e0> is not bound to a Session; lazy load operation of attribute 'specification' cannot proceed (Background on this error at: https://sqlalche.me/e/14/bhk3)

All this is to say that we need to have a clearer boundaries on when a session begins/ends.

For the web server it should start/end with each web requests since a single web request run in the same thread see https://github.com/conda-incubator/conda-store/commit/74d37e2d28dd490582c90502ec50f254dbbca032#diff-eb87ec4963d68bcf72a2229159a5369d892597d1c118ea43f37357e78bf19172R25 and https://github.com/conda-incubator/conda-store/commit/74d37e2d28dd490582c90502ec50f254dbbca032 on how this is done
For the celery tasks we need to start/end each session for a task

The major refactor here is that conda_store_server.app.CondaStore cannot handle the session instance and instead it needs to be passed along from the web request or celery task.

Figured out a sneaky bug in conda-store having to do with threads.
from fastapi import Depends

def f():
    return [1, 2, 3]

async def g():
    return [1, 2, 3]

@app.get('/')
def list_items(items: Depends(f))
    return items

The function f is not guaranteed to run in the same thread as list_items but g is. I think this also explains some of the subtle issues with celery being setup on the server.


copy is not following symlinks correctly, only creates empty directory

When copying a symlink, I've usually expected the contents of the link's target directory to be copied. Since updating to Grunt 1.0 an empty directory with the name of the symlink is created, with no contents.
Sample gruntfile.js:
module.exports = function(grunt) {
    require('jit-grunt')(grunt);
    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            dist: {
                files: [
                    {
                        expand: true,
                        src: 'test3',
                        dest: 'test1'
                    }
                ]
            }
        }
    });
    // Default task(s).
    grunt.registerTask('default', ['copy:dist']);

};

link created with ln -s test2 test3
test2 contains file1 and file2
Folder structure before running grunt (ls -lR test*):
lrwxrwxrwx  1 ubuntu ubuntu    5 Apr 21 15:50 test3 -> test2/
lrwxrwxrwx 1 ubuntu ubuntu    5 Apr 21 15:50 test3 -> test2/

test1:
total 0

test2:
total 0
-rw-r--r-- 1 ubuntu ubuntu 0 Apr 21 15:47 file1
-rw-r--r-- 1 ubuntu ubuntu 0 Apr 21 15:47 file2

Folder structure after running grunt (ls -lR test*):
lrwxrwxrwx 1 ubuntu ubuntu    5 Apr 21 15:50 test3 -> test2/

test1:
total 4
drwxr-xr-x 2 ubuntu ubuntu 4096 Apr 21 16:03 test3/

test1/test3:
total 0

test2:
total 0
-rw-r--r-- 1 ubuntu ubuntu 0 Apr 21 15:47 file1
-rw-r--r-- 1 ubuntu ubuntu 0 Apr 21 15:47 file2

test1/test3 should contain file1 and file2, but is empty. It's also not a symlink to test2, which would be kind of understandable.

In https://github.com/gruntjs/grunt/blob/master/lib/grunt/file.js file.copy runs file.isDir on line 297, but doesn't do antyhing special with symlinks

I am seeing the same behaviour after upgrading grunt to 1.0.1. However, should this be reported to grunt, instead of this package?

@hrj same here. Did you file an issue with the Grunt package? If not, I'll go ahead and do it. I don't know much about the inner workings of Grunt, but I'm happy to help with suggesting a fix.

@karllhughes I never reported it in the grunt package - that line I mentioned could be the culprit, but I didn't have time to do any proper testing on it.
I wasn't 100% sure it wasn't a quirk of the copy package, so thought it best to start here, although copy seems to mostly just call file.copy.

@tobyroworth I actually think it is a deficiency in this package (possibly based on changes in the primary grunt package).
The grunt package includes methods for isDir and isLink, so I'm thinking we could add a conditional in this project to check if the file is a symlink, and if so to copy it over anyway.
I'm working on a fix to propose. I've never worked with grunt internals before though, so it'll take me a little time to figure out how exactly everything works.

@karllhughes sound like a good start. You might need to recurse manually though, to get around the check in the grunt package.
I think there's a file.recurse, but I might be thinking of a Go library!
https://github.com/gruntjs/grunt/issues/371 is worth a look, as it covers the opposite of this issue (and explicitly states file.copy should follow symlinks)

@tobyroworth just out of curiosity, were you testing this on Mac or Linux?
I pulled the project down and wrote a symlink test on my Mac and it seems to be working. Then I tried it on my Linux box and it didn't work. Could be an issue with the way Linux handles symlinks? Also could be a Node thing (I'm using Node 6 on my Mac, but Node 4 on the Ubuntu server).

@karllhughes tested on Linux (on cloud9 - have a test workspace I used to verify the bug report if you're interested: (https://c9.io/tobyroworth/grunt-copy-test)
I updated grunt (to 1) and node (to 5, I think - whatever "stable" was at the time) at the same time, so not sure if it's a node thing or a grunt thing, but the problem happened in fresh container, with only what was necessary installed/updated, and an old one I was developing in.
cp, ls etc work as expected, but I guess that doesn't mean it doesn't upset grunt somehow.
I'll try updating node and see what happens

Nope, node 6.1.0 doesn't fix it on Linux

I'm also having the issue on my Mac with both node 5 and 6. It only breaks when updating grunt from 0.4.x to 1.0.1. Did anyone report in that project?

This is actually caused by a breaking change in node-glob which is the underlying module used by grunt, see isaacs/node-glob#139.
So to get back the old behavior of following symlinks simply specify follow:true as part of file matching option, for which grunt will pass along to node-glob according to http://gruntjs.com/configuring-tasks#files.

@mwsam just tried it, and it didn't seem to make a difference:
       copy: {
            dist: {
                files: [
                    {
                        follow: true,
                        expand: true,
                        src: 'test3',
                        dest: 'test1'
                    }
                ]
            }
        }

It seems follow:true is effective only for ** matching. I faced the same empty directory problem as you but my config is a bit different:
        files: [{
          expand: true,
          follow: true,
          cwd: 'client/',
          src: '**/*',
          dest: 'build/client/'
        }]

A symlinked directory under client/ will just be copied as empty directory if follow:true is not used.

Adding follow: truedid the trick for us, indeed with a **style matching rule.


Change the icon for guides on the landing page

The new icon has been updated here: https://projects.invisionapp.com/d/main#/console/11376491/241171900/preview

@dsandip this links seems to be outdated.

Fixed the issue


add LinearWarmupScheduler

Create a schedule with a learning rate that decreases linearly from the initial lr set in the optimizer to 0, after a warmup period during which it increases linearly from 0 to the initial lr set in the optimizer.

Huge thanks!

I notice the design is quite different from the one in PyTorch native schedulers that have a  step() function and have load_state_dict() and state_dict() functions.
We also ended up changing the interface a bit, as I wanted something where you could step on both minibatches and epochs.  [In our case it's not part of a unified interface, though; because as for now, for flexibility of early development, our model is to put most of the complexity in local scripts without putting most things in any central place.]

Agreed. Torch schedulers are a bit rigid. Although, you can use it natively with SB as well. As you may have seen, we follow the opposite direction for now: more central places and less complexity in local scripts. I guess it's a balance to do between how much maintenance you can put from a coordinated team (central) vs how much you wish to rely on the community to do that (local scripts). At least, this is a personal opinion, I find it hard to maintain properly recipes as they tend to grow way too rapidly in number :p

Hm yes, for now we are aiming to get the best possible WER with reasonable latency before we add lots of recipes; at a later time we might consider centralizing things a bit.  I figure if people really need recipes that work for a specific dataset, they can always get it from speechbrain or ESPNet.

The numbers you get with Transducers are really impressive, I really wish we soon obtain enough resources to put someone on this full-time. The last intern that tried did not succeed but he had other things to do as well (the PR where he tried your nice pruned transducer loss).


Message not displayed

Based on the how this method is documented, I would expect that the message passed to this method would be shown in the UI.  However, that's not the case.  For the following, this is what I see on <IP_ADDRESS>1.
Xrm.Navigation.openErrorDialog({message: "test"})

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

ID: fe8e17bb-a7c5-ccc3-4714-be09c9411e21
Version Independent ID: 901a00f0-c333-bb90-9556-6fc84b910842
Content: openErrorDialog (Client API reference) in Dynamics 365 Customer Engagement
Content Source: ce/developer/clientapi/reference/Xrm-Navigation/openErrorDialog.md
Service: crm-online
GitHub Login: @KumarVivek
Microsoft Alias: kvivek

From here: https://debajmecrm.com/2015/01/22/dynamics-crm-error-dialog-xrm-internal-client-script/  It looks like this was an internal API that's been exposed, but isn't performing as expected according to the docs.

As per docs above, if you provide the errorCode using an integer value (with minus sign) from an existing error message, you can benefit from their description. Hardly the flexibility that the feature promises, but as a workaround while they address this bug it may help someone. For what it's worth though, the descriptions in this list don't necessarily match what is displayed on screen: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/org-service/web-service-error-codes
I ended up appending my summary error message to the start of the serialised log in "errorOptions.details".


Rename bare

Based on #1554
Somehow I couldn't push @santino 's branch :/

Changes are fine.
I would personally prefer to have a single declarative syntax, but appreciate the effort to not introduce the braking change.
Maybe you can still avoid any and do something like
union RenameTransformConfig =  RenameTransform | [RenameTransformObject!]
?

Yes I tried it already but it is not supported by the parser to have an array and singular type in the same union :/ so I had to do this workaround.

Let's merge this now as-is. I don't want this to be blocking for you anymore :)

Thank you so much.
I will continue to refine documentation in following PRs.


DevTools: Custom colors palette

It's a feature request for DevTools.
Currently when clicking on color icon next to color definition and changing the palette is shows 3 basic palettes: Material, Custom and Page colors:

It would be nice to have a possibility to create more than one custom color palette. It is helpful when working with more than one product (common use case for a graphic/ux designers) and you have different color sets for them.
It would speed up a work instead of opening styleguide for the product to have color codes.
Also - maybe this should be new issue report - it would be nice to assign a variable name for those colors. So instead of searching of the color you could enter a variable name in a color value and this should be replaced with real color value. This is an example:

This could work like a CSS variable (without "var" function). With syntax autocomplete from page's variables and the ones defined in custom colors it would be nice to have but convenient tool.

hey @jarrodek thanks for the request! this repo is used for content of WebFundamentals site. Please file feature request at crbug.com thanks !

For future reference: https://bugs.chromium.org/p/chromium/issues/detail?id=739891


Update multiimagechooser_strings_es.xml

There are some english phrases missing

Hi there! I took the liberty of merging your changes to my fork at https://github.com/Spriz/cordova-imagePicker :-)


Change Weekend Edition Saturday title to correct day

Thanks for catching this! I'll hopefully deploy some time this weekend.

Deployed to npr.pyther.net

@pyther Thank you, and especially for making and hosting this in the first place! FYI, there's a small token of appreciation pending in PayPal to matthew@ your domain name.


[Rust] Implement more methods in Vector

Planus vectors are basically just slices with extra steps. They should support more operations like splitting, trimming or more iterators (windows/chunks). Basically just look at everything from the std slice and see if it makes sense to port it.
When implementing this, keep in mind that most of the rust standard library was made before const generics -- some of the functions would look a bit different if they were designed today.

We cannot really use const-generics for anything here, since most vector operations returns Results.


create named variable within Mojo::Template

This leaves much to be desired, but I wanted to run my technique by you and get any comments from you.  Please let me know what I can do to make this PR acceptable.  Thanks!!

Making it work in Mojo::Template is not the hard part, you have to make it work for Mojolicious::Plugin::EPRenderer too.

I'll look at that next if this is more or less acceptable?
On Mar 4, 2016 11:24 PM, "Sebastian Riedel"<EMAIL_ADDRESS>wrote:

Making it work in Mojo::Template is not the hard part, you have to make
it work for Mojolicious::Plugin::EPRenderer too.
—
Reply to this email directly or view it on GitHub
https://github.com/kraih/mojo/pull/927#issuecomment-192580652.

I don't think there should be a stash in Mojo::Template, an attribute accessor containing a hash does the job just as well.

We generally don't do work in progress pull requests, if you want to discuss working branches you can do so on IRC or the mailing-list.

OK no problem. How should I best share my code for discussion? Just link
you to my fork?
On Mar 4, 2016 11:41 PM, "Sebastian Riedel"<EMAIL_ADDRESS>wrote:

We generally don't do work in progress pull requests, if you want to
discuss working branches you can do so on IRC or the mailing-list.
—
Reply to this email directly or view it on GitHub
https://github.com/kraih/mojo/pull/927#issuecomment-192583874.

Yes.

I would expect something like this. https://gist.github.com/anonymous/f1066c1027e965dd4e5a


install_data() after configure_file()

conf_data = configuration_data()
tp_durka_exec = prefix + '/' + libexecdir + '/telepathy-durka'
conf_data.set('TELEPATHY_DURKA_EXEC', tp_durka_exec)
configure_file(input : 'org.freedesktop.Telepathy.ConnectionManager.durka.service.in',
               output : 'org.freedesktop.Telepathy.ConnectionManager.durka.service',
               configuration : conf_data)

install_data(sources : 'org.freedesktop.Telepathy.ConnectionManager.durka.service',
             install_dir : dbusservicesdir)

I have this meson.build in one of subdirs. I'm getting error on install step.
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tito/rpmbuild-telepathy-durkaIFCQz_/BUILD/telepathy-durka-git-0.15f464e/data/org.freedesktop.Telepathy.ConnectionManager.durka.service'

I've tried to do something like service = configure_file(...blah...) and use it to install, but looks like configure_file() doesn't return anything.

This is not in 0.22 as it was added just recently with this commit: 87ea869f0229af1448dce0a49718eebe47492018
In older versions the only solution is to have your custom install script, so something like this:
#/bin/sh
cp ${MESON_BUILD_ROOT}/foo/bar.dat ${DESTDIR}${MESON_INSTALL_PREFIX}/subdir

ah, it's again about documentation. update reference manual, please.

Updated. Thanks for noticing.


Could not download  .NET Framework 4.6.2

After Tried to download .NET Framework 4.6.2, below popup is showing.

Then Press 'Yes'. I below error is occured.

That posting was written by me!


Fixed rendering of base classes

Classes from base renderer taken from - htmlHelper.ViewContext.ViewData["childrencssclass"] were not rendered correctly.
e.g. rendering content area with:

                             @Html.PropertyFor(m => m.MainContent,
                                new
                                {
                                    ChildrenCssClass = "custom-children-css",
                                    HasItemContainer = true
                                })

Results in:
class="block myblock col-xxl-3 col-xl-3 col-lg-3 col-md-6 col-sm-12 col-xs-12 displaymode-one-quartercustom-children-css"

Totally missed this PR 😬


Loss of image detail

I have this:
http://imgh.us/bK.svg
But I get:
http://imgh.us/1bf27fed.bK.svg
What option can be used to keep the image detail?

Do you use the latest version—0.5.2? Looks like mergePaths bug, but it was reworked in the last 2 versions.

Thank you. That solves the problem.


Header response not available in YAML

https://github.com/Azure/autorest.modelerfour/issues/34

M4 has been fixed


Uncaught TypeError: Cannot read properties of null (reading 'useRef')

i have this error, when go to TvPlayer component.
react-dom.development.js:18572 The above error occurred in the  component and Uncaught TypeError: Cannot read properties of null (reading 'useRef')
my react version is 18.1.0.
can u help me ?

Hi,
Sorry to hear you're having problems with the component and react 18.1.
The component was built with React 18.2.
Until I'm able to resolve it to work with 18.1, are you able to bump up the version of react you are using? I've tested TvPlayer in a bare bones Create React App with latest React 18.2 and it works ok.
You can share your repo if you like and I can take a closer look.

p.s. I've just tried updating my CRA with React 18.1 and it works. Try the following:

delete your node_modules folder
run npm i to re-install everything
3 restart your app (npm start for create react apps)

in my case. not working in 18.1 version of react

ok, in that case please try suggestions in my first comment.


Python: FunctionCallingStepwisePlanner results in "Function Call arguments are not valid JSON.. "

Describe the bug
When running plug-ins w/ the FunctionCallingStepwisePlanner, many of the tool calls results in an invalid JSON error.
After repeated invalid JSON errors, it fails w/ Error 400
To Reproduce
Here's the plan "ask" (the {{$...}} are replaced by my code at runtime:
Complete the following tasks for each of the following SNR investigation data .csv files one by one: {{$INVESTIGATION_DATA_PATHS}}
1. Read and analyze the SNR investigation data in the .csv file.
2. Generate a suitable filename for the analsys based on the content.
3. Output the analysis to blob storage using the generated filename in the following directory: '{{$SNR_DIRECTORY_PATH}}/hermes'
After the summaries have all been saved to blob storage, respond with 'exit' or 'TERMINATE'.
Expected behavior
There are several plug-ins that do the steps requested. The plug-ins should be called w/ the appropriate parameters.
Screenshots
INFO:semantic_kernel.kernel:Received invalid arguments for function core_prompts-generate_filename_from_content: Function Call arguments are not valid JSON.. Trying tool call again.
INFO:semantic_kernel.kernel:Received invalid arguments for function multi_tool_use.parallel: Function Call arguments are not valid JSON.. Trying tool call again.
INFO:httpx:HTTP Request: POST https://stg-mc-ncus-openai-api.openai.azure.com/openai/deployments/gpt-4o-adhoc/chat/completions?api-version=2024-02-01 "HTTP/1.1 400 model_error"

---------------------------------------------------------------------------
BadRequestError                           Traceback (most recent call last)
File /usr/local/lib/python3.12/site-packages/semantic_kernel/connectors/ai/open_ai/services/open_ai_handler.py:40, in OpenAIHandler._send_request(self, request_settings)
     39 if self.ai_model_type == OpenAIModelTypes.CHAT:
---> 40     response = await self.client.chat.completions.create(**request_settings.prepare_settings_dict())
     41 else:

File /usr/local/lib/python3.12/site-packages/openai/resources/chat/completions.py:1295, in AsyncCompletions.create(self, messages, model, frequency_penalty, function_call, functions, logit_bias, logprobs, max_tokens, n, parallel_tool_calls, presence_penalty, response_format, seed, service_tier, stop, stream, stream_options, temperature, tool_choice, tools, top_logprobs, top_p, user, extra_headers, extra_query, extra_body, timeout)
   1261 @required_args(["messages", "model"], ["messages", "model", "stream"])
   1262 async def create(
   1263     self,
   (...)
   1293     timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
   1294 ) -> ChatCompletion | AsyncStream[ChatCompletionChunk]:
-> 1295     return await self._post(
   1296         "/chat/completions",
   1297         body=await async_maybe_transform(
   1298             {
   1299                 "messages": messages,
   1300                 "model": model,
   1301                 "frequency_penalty": frequency_penalty,
   1302                 "function_call": function_call,
   1303                 "functions": functions,
   1304                 "logit_bias": logit_bias,
   1305                 "logprobs": logprobs,
   1306                 "max_tokens": max_tokens,
   1307                 "n": n,
   1308                 "parallel_tool_calls": parallel_tool_calls,
   1309                 "presence_penalty": presence_penalty,
   1310                 "response_format": response_format,
   1311                 "seed": seed,
   1312                 "service_tier": service_tier,
   1313                 "stop": stop,
   1314                 "stream": stream,
   1315                 "stream_options": stream_options,
   1316                 "temperature": temperature,
   1317                 "tool_choice": tool_choice,
   1318                 "tools": tools,
   1319                 "top_logprobs": top_logprobs,
   1320                 "top_p": top_p,
   1321                 "user": user,
   1322             },
   1323             completion_create_params.CompletionCreateParams,
   1324         ),
   1325         options=make_request_options(
   1326             extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
   1327         ),
   1328         cast_to=ChatCompletion,
   1329         stream=stream or False,
   1330         stream_cls=AsyncStream[ChatCompletionChunk],
   1331     )

File /usr/local/lib/python3.12/site-packages/openai/_base_client.py:1836, in AsyncAPIClient.post(self, path, cast_to, body, files, options, stream, stream_cls)
   1833 opts = FinalRequestOptions.construct(
   1834     method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options
   1835 )
-> 1836 return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)

File /usr/local/lib/python3.12/site-packages/openai/_base_client.py:1524, in AsyncAPIClient.request(self, cast_to, options, stream, stream_cls, remaining_retries)
   1515 async def request(
   1516     self,
   1517     cast_to: Type[ResponseT],
   (...)
   1522     remaining_retries: Optional[int] = None,
   1523 ) -> ResponseT | _AsyncStreamT:
-> 1524     return await self._request(
   1525         cast_to=cast_to,
   1526         options=options,
   1527         stream=stream,
   1528         stream_cls=stream_cls,
   1529         remaining_retries=remaining_retries,
   1530     )

File /usr/local/lib/python3.12/site-packages/openai/_base_client.py:1625, in AsyncAPIClient._request(self, cast_to, options, stream, stream_cls, remaining_retries)
   1624     log.debug("Re-raising status error")
-> 1625     raise self._make_status_error_from_response(err.response) from None
   1627 return await self._process_response(
   1628     cast_to=cast_to,
   1629     options=options,
   (...)
   1633     retries_taken=options.get_max_retries(self.max_retries) - retries,
   1634 )

BadRequestError: Error code: 400 - {'error': {'message': "Invalid 'messages[47].tool_calls[0].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.", 'type': 'invalid_request_error', 'param': 'messages[47].tool_calls[0].function.name', 'code': 'invalid_value'}}

The above exception was the direct cause of the following exception:

ServiceResponseException                  Traceback (most recent call last)
Cell In[3], line 38
      7 playbook["plays"] = [
      8     {
      9     "kernel": "semantic-kernel",
   (...)
     33 }
     34 ]
     36 print(json.dumps(playbook, indent=2))
---> 38 result = await engine.execute_playbook(playbook)
     39 print(result)
     40 engine.evaluator.get_results()

File /project/engine/CognitionEngine.py:155, in CognitionEngine.execute_playbook(self, playbook)
    153 log.info(f"Executing PLAY #{i}...")
    154 # play execution
--> 155 result = await self.execute_play(play.copy(), play_input)
    157 # "feed forward" the result into the next play
    158 play_input = str(result)

File /project/engine/CognitionEngine.py:111, in CognitionEngine.execute_play(self, play, play_input)
    109 # execute the play through the kernel
    110 if asyncio.iscoroutinefunction(self._adapters["kernel"].execute_play):
--> 111     result = await self._adapters["kernel"].execute_play(ask, play, play_input)
    112 else:
    113     result = self._adapters["kernel"].execute_play(ask, play, play_input)

File /project/engine/kernel/SemanticKernel.py:150, in SemanticKernel.execute_play(self, ask, play, play_input)
    148 # NOTE: the 'result' is not a string, it is a KernelContext object --> this may have change in v0.9
    149 if planner == "stepwise":
--> 150     result = await plan.invoke(self.kernel, question=ask, arguments=kernel_args)
    151 else:
    152     result = await plan.invoke(self.kernel, arguments=kernel_args)

File /usr/local/lib/python3.12/site-packages/semantic_kernel/planners/function_calling_stepwise_planner/function_calling_stepwise_planner.py:166, in FunctionCallingStepwisePlanner.invoke(self, kernel, question, arguments, **kwargs)
    164 # For each step, request another completion to select a function for that step
    165 chat_history_for_steps.add_user_message(STEPWISE_USER_MESSAGE)
--> 166 chat_result = await chat_completion.get_chat_message_contents(
    167     chat_history=chat_history_for_steps,
    168     settings=prompt_execution_settings,
    169     kernel=cloned_kernel,
    170 )
    171 chat_result = chat_result[0]
    172 chat_history_for_steps.add_message(chat_result)

File /usr/local/lib/python3.12/site-packages/semantic_kernel/utils/telemetry/decorators.py:87, in trace_chat_completion.<locals>.inner_trace_chat_completion.<locals>.wrapper_decorator(*args, **kwargs)
     82 span = _start_completion_activity(
     83     CHAT_COMPLETION_OPERATION, model_name, model_provider, formatted_messages, settings
     84 )
     86 try:
---> 87     completions: list[ChatMessageContent] = await completion_func(*args, **kwargs)
     88 except Exception as exception:
     89     if span:

File /usr/local/lib/python3.12/site-packages/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py:105, in OpenAIChatCompletionBase.get_chat_message_contents(self, chat_history, settings, **kwargs)
    101 self._prepare_settings(settings, chat_history, stream_request=False, kernel=kernel)
    102 if settings.function_choice_behavior is None or (
    103     settings.function_choice_behavior and not settings.function_choice_behavior.auto_invoke_kernel_functions
    104 ):
--> 105     return await self._send_chat_request(settings)
    107 # loop for auto-invoke function calls
    108 for request_index in range(settings.function_choice_behavior.maximum_auto_invoke_attempts):

File /usr/local/lib/python3.12/site-packages/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py:247, in OpenAIChatCompletionBase._send_chat_request(self, settings)
    245 async def _send_chat_request(self, settings: OpenAIChatPromptExecutionSettings) -> list["ChatMessageContent"]:
    246     """Send the chat request."""
--> 247     response = await self._send_request(request_settings=settings)
    248     assert isinstance(response, ChatCompletion)  # nosec
    249     response_metadata = self._get_metadata_from_chat_response(response)

File /usr/local/lib/python3.12/site-packages/semantic_kernel/connectors/ai/open_ai/services/open_ai_handler.py:51, in OpenAIHandler._send_request(self, request_settings)
     46     if ex.code == "content_filter":
     47         raise ContentFilterAIException(
     48             f"{type(self)} service encountered a content error",
     49             ex,
     50         ) from ex
---> 51     raise ServiceResponseException(
     52         f"{type(self)} service failed to complete the prompt",
     53         ex,
     54     ) from ex
     55 except Exception as ex:
     56     raise ServiceResponseException(
     57         f"{type(self)} service failed to complete the prompt",
     58         ex,
     59     ) from ex

ServiceResponseException: ("<class 'semantic_kernel.connectors.ai.open_ai.services.azure_chat_completion.AzureChatCompletion'> service failed to complete the prompt", BadRequestError('Error code: 400 - {\'error\': {\'message\': "Invalid \'messages[47].tool_calls[0].function.name\': string does not match pattern. Expected a string that matches the pattern \'^[a-zA-Z0-9_-]+$\'.", \'type\': \'invalid_request_error\', \'param\': \'messages[47].tool_calls[0].function.name\', \'code\': \'invalid_value\'}}'))

Platform

OS: Linux
IDE: Jupyter running inside a Docker container
Language: Python
Source: v1.4.0

Additional context
Add any other context about the problem here.

The real issue here is that the model is potentially sending back a function name that doesn't fit our plugin/function name regex criteria:
Error code: 400 - {'error': {'message': "Invalid 'messages[47].tool_calls[0].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.", 'type': 'invalid_request_error', 'param': 'messages[47].tool_calls[0].function.name', 'code': 'invalid_value'}}'))
We should look at the function name we get and if we get one that fails the regex, we should tell the model how the function name should be formed (similar to how we tell the model the JSON args are invalid).

Per #8292, there is an occasional bug on the model side that throws this error during parallel function calling. If you continue to experience the issue, please toggle the prompt execution setting parallel_tool_calls = False.


feat: skip reading values immediately after it being written into an array

Description
Problem*
Resolves
Summary*
I noticed a couple of cases where we were writing into an array and then immediately reading the same index from it. This seems like something that we should be able to unwind.
Draft as I want to do more thinking on how EnableSideEffects can interact with this.
Additional Context
Documentation*
Check one:

[x] No documentation needed.
[ ] Documentation included in this PR.
[ ] [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

[x] I have tested the changes locally.
[x] I have formatted the changes with Prettier and/or cargo fmt on default settings.

I can't think of situations where the current predicate would change this either.
The main case of
let mut a = ...;
if foo {
    a[0] = 1;
}
.. use a ...

Shouldn't apply here since (after removing stores/loads) we should see the later uses of a referring to the result of an IfElse instruction rather than an array set.


3.3. "coordinateTransformations" metadata

"coordinateTransformations" describe a series of transformations that map between two coordinate spaces (defined by "axes").
For example, to map a discrete data space of an array to the corresponding physical space.
It is a list of dictionaries. Each entry describes a single transformation and MUST contain the field "type".
The value of "type" MUST be one of the elements of the type column in the table below.
Additional fields for the entry depend on "type" and are defined by the column fields.

identity

identity transformation, is the default transformation and is typically not explicitly defined

one of: "translation":List[float], "path":str
translation vector, stored either as a list of floats ("translation") or as binary data at a location in this container (path). The length of vector defines number of dimensions. |

one of: "scale":List[float], "path":str
scale vector, stored either as a list of floats (scale) or as binary data at a location in this container (path). The length of vector defines number of dimensions. |

https://ngff.openmicroscopy.org/0.4/index.html#trafo-md
The transformations in the list are applied sequentially and in order.

Pretty sure this is done 🎉


Is there an AxesHelper shape?

Currently I'm using:
def buildAxesHelper(pose: np.ndarray, *, scale: Union[float, Tuple[float, float, float]] = None):
    '''
    pose: 4x4 matrix, (pose@local_xyz.T).T -> global_xyz
        [ |  ,   | ,  |  ,  |     ]
        [xdir, ydir, zdir, center ]
        [ |  ,   | ,  |  ,  |     ]
        [ 0  ,   0 ,  0  ,  1     ]
    '''
    xdir = pose[:3, 0]
    ydir = pose[:3, 1]
    zdir = pose[:3, 2]
    center = pose[:3, 3]
    if scale is None:
        sx, sy, sz = 1.0, 1.0, 1.0
    elif isinstance(scale, (list, tuple)):
        sx, sy = scale[:2]
        sz = scale[2] if len(scale) > 2 else 1.0
    else:
        sx, sy, sz = scale, scale, scale
    ax = Arrow(center, center + sx*xdir, c='r')
    ay = Arrow(center, center + sy*ydir, c='g')
    az = Arrow(center, center + sz*zdir, c='b')
    return ax + ay + az

what you have looks ok to me :)
you may also create the Assembly of the 3 arrows and rotate it as a single object... if it's more convenient in your specific case.

Okay. Thank you. Just make sure I'm not missing something. I'll assembly three axes. or even skip using Arrow & using 3 line segments.
Closing for now.

Another version:
def __AxesHelper():
    ax = Arrow([0, 0, 0], [1, 0, 0], c="r")
    ay = Arrow([0, 0, 0], [0, 1, 0], c="g")
    az = Arrow([0, 0, 0], [0, 0, 1], c="b")
    return ax + ay + az

def buildAxesHelper(
    pose: np.ndarray, *, scale: Union[float, Tuple[float, float, float]] = None
):
    """
    pose: 4x4 matrix, (pose@local_xyz.T).T -> global_xyz
        [ |  ,   | ,  |  ,  |     ]
        [xdir, ydir, zdir, center ]
        [ |  ,   | ,  |  ,  |     ]
        [ 0  ,   0 ,  0  ,  1     ]
    """
    if scale is not None:
        if isinstance(scale, (list, tuple)):
            sx, sy = scale[:2]
            sz = scale[2] if len(scale) > 2 else 1.0
        else:
            sx, sy, sz = scale, scale, scale
        pose = np.copy(pose)
        pose[:, 0] *= sx
        pose[:, 1] *= sy
        pose[:, 2] *= sz
    arr = __AxesHelper()
    arr.apply_transform(pose)
    return arr

arr.apply_transform(pose) may not be correct, applied to child actors? I'd like to setup arr.transform but failed...

I have many camera/imu poses (4x4 matrix) and I'd like to draw some camera frames, IMU frames in vedo, something like https://peterfalkingham.com/2017/04/04/photogrammetry-testing-8-colmap. How cloud I setup transform? (tried to search .transform = , set_transform in this repo but no example found)
A close example is vedo -r glyphs.py (but I don't know how to integrate these 4x4 matrices)
I tried something like this:
from scipy.spatial.transform import Rotation as R
qx, qy, qz, qw = R.from_matrix(pose[:3, :3]).as_quat()
tx, ty, tz = pose[:3, 3]
import vtk
T = vtk.vtkTransform()
T.Identity()
T.Translate(tx, ty, tz)
T.RotateWXYZ(qw, qx, qy, qz)
arr.transform = T

But not working.
I should read these docs I guess.

https://www.programcreek.com/python/example/12960/vtk.vtkTransform
https://vtk.org/doc/nightly/html/classvtkHomogeneousTransform.html

Have you tried something like mymesh.apply_transform(T) as in
https://vedo.embl.es/autodocs/content/vedo/vedo/pointcloud.html#Points.apply_transform

Have you tried something like mymesh.apply_transform(T) as in
https://vedo.embl.es/autodocs/content/vedo/vedo/pointcloud.html#Points.apply_transform

I saw this example and tested it in my "Another version". It works, visually.
But is this the right way to do it. I'd like to use one geometry and place it at many position+orientations, apply_transform sounds like would change self.actors' geometry. Because I tested these:
from vedo import Cube, show
c1 = Cube()
print('---------init')
print(c1.get_transform())
T = c1.get_transform(invert=True)
c1.rotate_z(5).x(2).y(1)
print('---------rot trans')
print(c1.get_transform())
T = c1.get_transform(invert=True)
c1.apply_transform(T)
print('------------ get back')
print(c1.get_transform())

I think I should set transform to the Assembly, not to it's child actors.

😅 My mistake. I should use c2.apply_transform(T, concatenate=True) here. It works as expected now:
from vedo import Cube, show
c1 = Cube()
print('---------init')
print(c1.get_transform())
c1.rotate_z(5).x(2).y(1)
print('---------rot trans')
print(c1.get_transform())
T = c1.get_transform(invert=True)
c1.apply_transform(T, concatenate=True)
print('------------ get back')
print(c1.get_transform())

Doc: https://vedo.embl.es/docs/vedo/pointcloud.html#Points.apply_transform

cool, keep  in mind you can convert to numpy with
print(vtk2numpy(c1.get_transform()))

[[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]


Radio locale ww support

add possibility to use oref0-setup.sh with TI-stick and World Wide (WW) pumps

@PieterGit LMK if you think you'll be able to address the comments above, or if I should merge it and do so.

Since per @oskarpearson we don't want to merge this yet, I'm going to create a new branch for it in openaps/oref0 and merge it there so we can work on it collaboratively before merging to dev.  That will also let me delete the oref0-setup branch and re-branch it cleanly.

Opened https://github.com/openaps/oref0/pull/232 to track this.


Translate the introduction of the concept, PV

I translated the introduction of the concept Persistent Volume.
The rest of the documents stays the same with the English document.
Should I create a pull request after I finish translating the whole page?

Sorry.
I think I forked the wrong branch.
I'll close it and create pr again.
Before I close it,
it would be nice if you tell me I can create pr with partial translation.
Many thanks.
Jonghun.

@JonghunBok 감사합니다! 페이지 전체를 현지화하는 것을 원칙으로 하고 있습니다. 다만, PR Title에 WIP를 붙여주시면 중간 리뷰를 할 수 있겠습니다.

/check-cla

/check-cla

/retitle [WIP] Translate the introduction of the concept, PV
@gochist do you need assistance resolving the CLA issue?

@JonghunBok Please sign a CLA following the instruction at https://github.com/kubernetes/website/pull/19069#issuecomment-584524351

@JonghunBok I'm closing this PR as dev-1.17-ko.4 is outdated team milestone branch. Please reopen this PR after signing CLA and rebasing onto current Korean l10n team milestone branch.
/close


bug(changed_files): doesn't trigger correct workflows, when amount of files changes in PR is over 30

:tada: This issue has been resolved in version 1.20.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Metal Prompt Feeding

I'm trying to run llama on mac using metal, but I noticed on the accelerators doc it states metal cannot be used for feeding in a prompt with more than 1 token. Is this an underlying limitation with ggml, or llm?
I'd love to help enable this, but I'm not sure where to begin.

I haven't been tracking this, but https://github.com/ggerganov/llama.cpp/issues/2428 suggests that it's still an issue and it's because the Metal kernels don't support batching. You can probably find more on the repo if you look.
Not sure if there's anything we can do from our end, outside of implementing it and submitting it upstream 😅

I've gotten a change to look into this more, and I don't think it's an issue upstream. Here's my prompt:
def merge_sort(arr):
    if len(arr) <= 1:
        return arr

    mid = len(arr) // 2
    left = arr[:mid]
    right = arr[mid:]

    left = merge_sort(left)
    right = merge_sort(right)

    return merge(left, right)

def merge(left, right):
    if not left:
        return right
    if not right:
        return left

    result = []

    i = j = 0

    while len(left) > i and len(right) > j:
        if left[i] < right[j]:
            result.append(left[i])
            i += 1
        else:
            result.append(right[j])
            j += 1

    result.extend(left[i:])
    result.extend(right[j:])

    return result

print(merge_sort([56,32,5,2,43]))

And when I run the same prompt through each project:
llama.cpp
llama_print_timings:        load time =   298.62 ms
llama_print_timings:      sample time =    90.26 ms /   128 runs   (    0.71 ms per token,  1418.17 tokens per second)
llama_print_timings: prompt eval time =  1676.02 ms /   250 tokens (    6.70 ms per token,   149.16 tokens per second)
llama_print_timings:        eval time =  3909.66 ms /   127 runs   (   30.78 ms per token,    32.48 tokens per second)
llama_print_timings:       total time =  5686.13 ms

llm
feed_prompt_duration: 6956ms
prompt_tokens: 251
predict_duration: 7818ms
predict_tokens: 269
per_token_duration: 29.063ms

llm did attach another token to the prompt, but the main issue is the prompt processing time difference. Both were compiled and ran on an M1 Pro with metal enabled and all layers offloaded to GPU

For reference, here's the perf for llm without metal enabled:
feed_prompt_duration: 8508ms
prompt_tokens: 251
predict_duration: 8565ms
predict_tokens: 252
per_token_duration: 33.988ms

Also, this link was put in the code referencing the llama.cpp fallback to accelerate for matrix x matrix compute: https://github.com/ggerganov/llama.cpp/blob/e1886cf4fe0d0f31661dda52a4a9f34bd9b9009a/llama.cpp#L1692
However that branch is not in the newest llama.cpp, so I'm guessing it was worked out.

@philpax
For reference, this commit (https://github.com/ggerganov/llama.cpp/commit/bf83bff6742c0f1795b4c18695a13a34ac7adf62) fixed the matrix matrix mul, which is about 2 weeks newer than the currently used llama.cpp, so we'd need to upgrade to a llama cpp version past it. I'm sure you already are doing an upgrade with the gguf stuff which should be to a sufficiently new version as to support the mul.


Can i use dnc with speech signals?

I don't know of any published work where a dnc has been trained on speech signals. Sounds worth trying!

Time series analasys using time domain statistics could be neat for this lstm is before DNC and used time series pythonprogramming.net has a tutorial on time series I think 15.


General Issue: change needed due to testthat3e: derive_param_wbc_abs

Background Information
Once we introduce testthat3e (see #1538), a message is thrown during testing of derive_param_wbc_abs. We need changes made to derive_param_wbc_abs BEFORE testthat3e is introduced so that the messsage will not be thrown.
Original test output before testthat3e:

Test output would look like this after testthat3e is introduced:

After looking at the test, my understanding is the test is not testing for a message which is thrown by the function and testthat3e is a bit more strict on what needs to be tested; it is informing us that there is a message thrown which is not being tested! I will modify the test to also check for the function's message.
Definition of Done
No response

Closing this. All testthat3e changes done in Issue #1754.


Compiler doesn't understand Partial function argument without explicit cast

TypeScript Version:  2.7.1 up to latest 2.8.0-dev.20180228
Search Terms: generics,type,inference
Code
interface IEntity {
  id: number;
}

class Student implements IEntity {
  id: number;
  name: string;
}

class Repository<T extends IEntity> {
  public filter(criteria: Partial<T>): T[] {
    return [];
  }

  public first(criteria: Partial<T>): T {
    return this.filter(criteria)[0];
    // Works fine
  }

  public find1(id: number): T {
    return this.first({ id });
    // Argument of type { id: number } is not assignable to parameter of type 'Partial<T>'.
  }

  public find2(id: number): T {
    return this.first({ id } as Partial<T>);
    // Works fine
  }
}

// Sample code
const repository = new Repository<Student>();
const p1 = repository.filter({ id: 10 });
const p2 = repository.find1(10);
const p3 = repository.find2(10);

Expected behavior:
The compiler should be able to figure out that an argument of { id: 10 } is a valid argument to provide to a Partial<T> where T extends IEntity.
Actual behavior:
The compiler doesn't understand that { id: 10 } is a valid argument without an explicit cast.
Playground Link:
Playground Code
Related Issues:

Note that the following is not sound:
function f<T extends { x: number }>(): Partial<T> {
    return { x: 0 };
}
interface I { x: 1 | 2 | 3; }
const i: Partial<I> = f<I>();

However, the following should work:
function f<T extends { x: number }>(x: T["x"]): Partial<T> {
    return { x }; // Does not work even with `x: x as any`
}
interface I { x: 1 | 2 | 3; }
const i: Partial<I> = f<I>(1);

Intellisense in VS Code also indicates something's wrong:
public first(criteria: Partial<T>): T {
    // criteria.id seems to be a T["id"] instead of number

    let typedCriteria = criteria as Partial<IEntity>;
    // typedCriteria.id is a number as expected

@andy-ms what's the behavior changed implied by the "bug" label? I think this is WAI, for the same reason as the one shown by your example

Misread the intent of "should" up there

WAI = work as intended? I don't believe this is working as intended.
In my example the { id } as Partial<T> explicit cast shouldn't be necessary IMO.

It's marked as a bug -- we should make the second example in my comment work, but it doesn't work right now.

@andy-ms you do not need Partial in your example above. I would argue that the correct signature here is
function f<T extends { x: number }>(t: T): { x: T["x"] } {
    return { x: t.x };
}

The current behavior is really how it is intended to behave. we have two affordances for T being assignable to Partial<T>, and {} being assignable to Partial<T>. I assuming the proposal here is to add a new rule where { x: Y } is assignable to Partial<T> if for all x, Y is assignable to T["x"].

I assuming the proposal here is to add a new rule where { x: Y } is assignable to Partial if for all x, Y is assignable to T["x"].

:+1:
In the original example we can't just make the type be { id: T["id"] } because we want to support other criteria too.

This is a correct error; if allowed, the code would be unsound
interface IEntity {
  id: number;
}

class Student implements IEntity {
  id!: 42;
  name!: string;
}

class Repository<T extends IEntity> {
  public filter(criteria: Partial<T>): T[] {
    return [];
  }

  public first(criteria: Partial<T>): T {
    return this.filter(criteria)[0];
    // Works fine
  }

  public find1(id: number): T {
    return this.first({ id });
    // Argument of type { id: number } is not assignable to parameter of type 'Partial<T>'.
  }

  public find2(id: number): T {
    return this.first({ id } as Partial<T>);
    // Works fine
  }
}

// Sample code
const repository = new Repository<Student>();
const p2 = repository.find1(10);
const n: 42 = p2.id; // 10 inhabits 42

@RyanCavanaugh Thank you, that example really helps!
I'm still trying to wrap my head around why this then wouldn't work:
interface IEntity {
  id: number;
}

class Student implements IEntity {
  id!: 42;
  name!: string;
}

class Repository<T extends IEntity> {
  public filter(criteria: Partial<T>): T[] {
    return [];
  }

  public first(criteria: Partial<T>): T {
    return this.filter(criteria)[0];
    // Works fine
  }

  public find1(id: T["id"]): T {
    return this.first({ id });
    // Argument of type { id: T["id"] } is not assignable to parameter of type 'Partial<T>'.
  }

  public find2(id: T["id"]): T {
    return this.first({ id } as Partial<T>);
    // Works fine
  }
}

// Sample code
const repository = new Repository<Student>();
const p2 = repository.find1(42);

Doesn't { id: T["id"] } satisfy Partial<T>?

Shortened (discussing this offline)
function fn<T extends { id: number }>(id: T["id"]): Partial<T> {
    return { id };
}