Rendering JSON responses

Description
From @XiNiHa

Would it be difficult to make VPS support rendering JSON responses? I'm currently thinking about experimenting with a SolidJS-based metaframework that is focused on Islands architecture with partial navigation. SolidStart implements this by accepting a POST request on the same URL with the concrete route, and I want to try the same approach.

How would such an example POST request look like and what would the JSON contain?

I was originally thinking about letting users to return any kind of JSON responses (like what API routes do) and letting the users implement the actual rendering part. Actually, this will enable users to implement API routes in somewhat easy way.

Currently, with Client Routing, the initial HTML request is (and needs to be) HTML, while subsequent requests are actually JSON. So I'm not sure how this feature request differs with the current satus quo.
I'm wondering how this connects to island archtiecture. The bottom line and goal of island archtiecture is to ship less JavaScript to the client-side. What kind of JSON response do you want to make that would enable you to achieve island architecture?

Actually it's not required that the response should be in JSON. All I need is just a part(not a whole page) of HTML that can be fetched through JS.

In onBeforeRender() you can check whether the request is for the initial HTML or a subsequent client-side routing with pageContext.urlOriginal.endsWiths('.json').
You can then add your HTML parts to pageContext and use passToClient as usual.

Hi, I am facing the same need.
I have SSR app with backend (fastify) integration. In the VPS app I have some modules that are used in onBeforeRender to create initial pageProps. I would also want to use those modules (that are build and bundled by vite + VSP) for serving plain JS data as API response.
ATM I found a wokraround how to do it in VPS, but it is not standard/documented way and I am aware it may break one day. I will try explain my sollution:
Goal: I want to serve some data in endpoint /api/data

Create page File pages/api/data.page.server.ts that exports only onBeforeRender (export { Page } is not needed)

// pages/api/data.page.server.ts
import { getData } from 'some-data-module';

export const onBeforeRender = async (pageContext) => {

    const data = await getData();

    return {
        pageContext: {
            pageProps: { // pageProps is required by VPS
                data,
            },
        },
    };
};

Create renderer File pages/api/_default.page.server.ts that does nothing.

export async function render() {
    return {}; // return empty object as no other props are needed
}

in your server set up /api route

app.get('/api/*', async (req, res) => {
    const pageContextInit = {
        urlOriginal: req.raw.url
    };

    const pageContext = await renderPage(pageContextInit);

    res.status(200)
        .type('application/json')
        .send(pageContext.pageProps); // return pageProps that were generated in onBeforeRender

    return res;
})

The same way you can also implement POST API endpoint and passing some request data to pageContextInit
But as I mentined before, it is just a hacky workaround. I am thinking of different sollution. @brillout Would it be possible to define some file that will hold additional modules exports that will be accessible alongside import { renderPage } from 'vite-plugin-ssr';?
Example:

define some /exports.ts file

// /exports.ts

import { getData } from 'some-data-module';
import { someFunction } from './utils';

export { getData, someFunction }

use exported modules in server.ts

import { renderPage, exports } from 'vite-plugin-ssr';
...
app.get('/api/data', async (req, res) => {
    const data =  await exports.getData();

    res.status(200)
        .type('application/json')
        .send(data);

    return res;
})

Thanks!

@bagr001 What's your motivation for not completely bypassing VPS and creating a normal Fastify route instead?

@bagr001 Either use globalThis.cache instead of let cache or make Vite transpile your server code with vavite or HatTip, see https://github.com/brillout/vite-plugin-ssr/issues/562. (FYI in case your company is up for it: https://github.com/sponsors/brillout.)

Maybe take a look at telefunc?

Maybe take a look at telefunc?

👍 Telefunc is an option as well, since .telefunc.js files are processed by Vite.
(In general, I strongly recommend to look into that globalThis technique, it's quite useful.)

I have a similar use-case where I just want a fragment, instead of the entire html/head.
Did it like this, but relies heavy on the _pageAssets:
import { renderPage } from 'vite-plugin-ssr';

async function renderFragment(requestContext) {
  const vpsRenderResult = await renderPage(requestContext);

  return {
    fragment: {
      body: vpsRenderResult.markup.body,
      assets: vpsRenderResult._pageAssets,
    }
  };
}

app.get('*', async (req, res, next) => {
  const { fragment } = await renderFragment({/* context */});
  if (!fragment) {
    return next();
  } else {
    res.send(JSON.stringify(fragment));
  }
});

Might be a nice addition to have a way to retrieve the generated manifest.

@leonmondria I think your use case is quite different though, feel free to create a GitHub Discussion explaing your use case in further details.

Well actually @leonmondria 's usecase matches almost exactly with mine.

@leonmondria @XiNiHa Would the following work for you?
// /renderer/_default.page.server.js

export { onBeforeRender }
export const passToClient = 'htmlFragments'

async function onBeforeRender(pageContext) {
  if (pageContext.isClientSideRouting) {
    return {
      pageContext: {
        htmlFragments: [/*...*/]
      }
    }
  }
}

The new feature here being pageContext.isClientSideRouting which is false for the very first request (the first page the user goes to, i.e. when the browser does its very first request: HTTP GET /some-page) and true for subsequent client-side routing (when the user navigates to a new page).
Note that VPS already returns JSON for subsequent client-side routing requests, so AFAICT there isn't any need to modify the usually renderPage() middleware integration.
Also note that onBeforeRender() is always called (first request + subsequent routing), whereas render() is called only for the first request (it's skipped for subsequent routing since there isn't any HTML to render). Btw., for added clarity, render() has been renamed to onRenderHtml() in the V1 design, example: /examples/react-full-v1/renderer/+onRenderHtml.tsx.
As for pageContext._pageAssets, it's getting fairly stable, so we can make it an official pageContext property. (For improved DX pageContext.pageAssets will be slightly different.)
Let me know if that doesn't work for you or if you have any questions.

Looks great for me!

Released in 0.4.98. Note that it's called pageContext.isClientSideNavigation, see https://vite-plugin-ssr.com/pageContext.

@bagr001 What's your motivation for not completely bypassing VPS and creating a normal Fastify route instead?

@brillout What would be the standard way to bypass VPS on selected routes? I have a very similar situation as bagr001 in that I want to use VPS client routing for most routes as well as some API GET routes handled (exclusively) by the server.
My current solution is to create a dummy route in pages/ but I feel there has to be a nicer way:
// pages/rest/rest.page.route.js
export default "/rest/*"

// pages/rest/_default.page.server.js
export async function render() {
  return {}
}

// server/index.js
app.get('/rest/*', (req) => {
  ...
})


Adding Accessibility topic.

Q
A

content fix?
no - yes?

New article?
no - yes?

Related issues?
fixes #X, partially #Y, mentioned in #Z

What's in this Pull Request?
Please describe the changes in this PR. Sample description or details around bugs which are being fixed.
Guidance
You can delete this section when you are submitting the pull request.

Please update this PR information accordingly. We'll use this as part of our release notes in monthly communications.
Please target your PR to 'master' branch. Released documents are in live branch.

:x: Validation status: errors

File
Status
Preview URL
Details

:x:Error

Details

[Error] Cannot sync git repo to specified state. Please make sure the pull request is mergeable. Details: Git merge results in conflict, repository remote url: https://github.com/SharePoint/sp-dev-docs, working directory: W:\vfri-s, target branch: master, target branch commit: 07fbc37901391567161094178c80891bf32f0656, source branch: 75f7f6630b6d10654d80f3ef2c76ecbe/master, source branch commit: .

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

:x: Validation status: errors

File
Status
Preview URL
Details

:x:Error

Details

[Error] Cannot sync git repo to specified state. Please make sure the pull request is mergeable. Details: Git merge results in conflict, repository remote url: https://github.com/SharePoint/sp-dev-docs, working directory: W:\outk-s, target branch: master, target branch commit: 07fbc37901391567161094178c80891bf32f0656, source branch: 75f7f6630b6d10654d80f3ef2c76ecbe/master, source branch commit: .

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

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/design/accessibility.md
:white_check_mark:Succeeded

docs/toc.yml
:white_check_mark:Succeeded

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

:x: Validation status: errors

File
Status
Preview URL
Details

:x:Error

Details

[Error] Cannot sync git repo to specified state. Please make sure the pull request is mergeable. Details: Git merge results in conflict, repository remote url: https://github.com/SharePoint/sp-dev-docs, working directory: W:\t2at-s, target branch: master, target branch commit: 07fbc37901391567161094178c80891bf32f0656, source branch: 75f7f6630b6d10654d80f3ef2c76ecbe/master, source branch commit: .

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

:x: Validation status: errors

File
Status
Preview URL
Details

:x:Error

Details

[Error] Cannot merge commit 16bb47901b5126c234ed68d02110597c35bfb497 in branch master of repository https://github.com/Lauragra/sp-dev-docs into branch master (commit 07fbc37901391567161094178c80891bf32f0656)

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

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/design/accessibility.md
:white_check_mark:Succeeded

docs/toc.yml
:white_check_mark:Succeeded

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

Looks good!


bbox misaligned, rotated object are hidden depending on how they are viewed

It seems like the bbox is not rotated, this means that often the object will not be rendered when it should depending on the viewing angle.
In the 3d object addon this problem is mostly (depends on where the origin is) fixed, I hope a similar technique could be used here.

Took a look at it, I can't use the same technique as 3DObject, because 3DObject render is decoupled from the boundingQuad, so it can be set to arbitrary values compared to 3DObject.
In the case of 3D Shape, the render size is tied to the boundingQuad, as the boundingQuad is changed or updated, the size of the bounding box seems to change.
That being said, when 3D Shape rotates using the original ACE, it does seem to decouple bounding box vs the rotated 3DShape size, so there seems to be some internal way to at least handle the z angle rotation. If anyone else has ideas, open to PR.

What about using mesh instead of applying a rotation matrix for object types that support mesh?
I think I might write my own addon since I only need this for text and sprite and both can just use a 2x2 mesh


Crash in TextLayout using -Dnext in flixel.

Steps to reproduce:

Open any flixel demo (MODE will do)
Compile using -Dnext flag (but not -debug)
Flixel will crash during the preloader splash

Symptoms:

An EOFerror is thrown in a bytearray
Call stack:

Called from ? line 1
Called from ApplicationMain.hx line 131
Called from ApplicationMain.hx line 63
Called from lime/app/Application.hx line 163
Called from lime/_backend/native/NativeApplication.hx line 107
Called from lime/app/Event.hx line 59
Called from lime/app/Application.hx line 568
Called from openfl/display/Stage.hx line 945
Called from openfl/_internal/renderer/opengl/GLRenderer.hx line 303
Called from openfl/_internal/renderer/opengl/GLRenderer.hx line 317
Called from openfl/display/DisplayObjectContainer.hx line 967
Called from openfl/text/TextField.hx line 1633
Called from openfl/_internal/renderer/opengl/GLTextField.hx line 18
Called from openfl/_internal/renderer/TextFieldGraphics.hx line 33
Called from openfl/_internal/renderer/TextFieldGraphics.hx line 312
Called from openfl/text/TextField.hx line 1465
Called from openfl/text/TextField.hx line 1487
Called from openfl/text/TextField.hx line 1510
Called from lime/text/TextLayout.hx line 216
Called from lime/text/TextLayout.hx line 77
Called from lime/utils/ByteArray.hx line 482
Called from lime/utils/ByteArray.hx line 639
Uncaught exception - new EOFError();

I've narrowed it down to this line:
https://github.com/openfl/lime/blob/a44a109cdadd3694afd70f6fccea531206bc2779/lime/text/TextLayout.hx#L74
The ultimate cause of the thrown error is this line:
https://github.com/openfl/lime/blob/master/lime/utils/ByteArray.hx#L468
I modified readUnsignedInt () to do this:
public function readUnsignedInt ():Int {

		#if js
		var uInt = data.getUint32 (this.position, littleEndian);
		this.position += 4;
		return uInt;
		#else
		trace("position = " + position + " length = " + length);
		var ch1 = readUnsignedByte ();
		var ch2 = readUnsignedByte ();
		var ch3 = readUnsignedByte ();
		var ch4 = readUnsignedByte ();
		return littleEndian ? (ch4 << 24) | (ch3 << 16) | (ch2 << 8) | ch1 : (ch1 << 24) | (ch2 << 16) | (ch3 << 8) | ch4;
		#end

	}

Which gives this output right before the crash:
ByteArray.hx:481: position = 4 length = 204
TextLayout.hx:76: i = 1
ByteArray.hx:481: position = 24 length = 204
TextLayout.hx:76: i = 2
ByteArray.hx:481: position = 44 length = 204
TextLayout.hx:76: i = 3
ByteArray.hx:481: position = 64 length = 204
TextLayout.hx:76: i = 4
ByteArray.hx:481: position = 84 length = 204
TextLayout.hx:76: i = 5
ByteArray.hx:481: position = 104 length = 204
TextLayout.hx:76: i = 6
ByteArray.hx:481: position = 124 length = 204
TextLayout.hx:76: i = 7
ByteArray.hx:481: position = 144 length = 204
TextLayout.hx:76: i = 8
ByteArray.hx:481: position = 164 length = 204
TextLayout.hx:76: i = 9
ByteArray.hx:481: position = 184 length = 204
TextLayout.hx:76: i = 10
ByteArray.hx:481: position = 204 length = 204

(crash)

I also found that the count variable that TextLayout is getting by reading the unsigned int from the buffer is somehow set to 167772160, and in this case the length of the __buffer  variable is 204.
So I'm not sure what the intent of looping for (i in 0...167772160) is on a buffer that's only 204 units long, but it seems there's a bug there :)

All of a sudden this isn't happening anymore. I think I might have had an out of date library or submodule. False alarm!


Add npx link

You might add an npx (included in npm 5.2+) example ;)
npx rawkit example.js

:+1: I like this a lot. I actually used npx while finalizing this the last week or so

https://github.com/darcyclarke/rawkit/commit/15b90af46f552e8380c81140c640154b87ca8ec0


HTTP/2: support trailers

Do we really want to perpetuate the existing trailers problem? Can we discard these trailers for now until we design a proper feature for them across protocol versions?

They are part of the spec. We need to at least read the HEADERS frame containing trailers to look at the END_STREAM flag and do something about it (error if it's not there, or complete the stream to which it was sent so any pending ReadAsync/CopyToAsync is unblocked).
The way I implemented it here, the behavior is pretty much the same as what we have for HTTP/1.x.

Yes we need to read them, but we can discard them rather than continuing the 1.1 bug of adding them to the request headers.

I wouldn't call the 1.1 behavior a bug. We just don't separate headers and trailers in two separate collections, which would be better.

shrug we already know it's undesirable behavior that we plan to change, so why continue it here?

I can leave out the part where it's added to the header dictionary - but the rest should be done (process frames, decode HPACK and throw on errors, etc.).

I don't think we should remove the part where it's added to the header dictionary. I'd rather this PR get HTTP/2 up to parity with how HTTP/1 trailers are handled and then handle the trailer problem across the board with a new feature. Leaving HTTP/2 with a half-way implementation where trailers are discarded seems like a recipe for something getting punted and users having no way to actually read trailers.

Rebased.


More reliable way to get author and autorurl

Fixes #520
Proposed changes:

Change the way how to get the author and the authorurl of a post. See #520 for details

Other information:

[ ] Have you written new tests for your changes, if applicable?

Testing instructions:

Go to '..'

Thanks for the contribution! I have no idea why the previous code wouldn't have worked, as get_post_field( 'post_author', $item->ID ) and $item->post_author should be effectively identical. Very odd, but I'm also used to that in WP. :)

Funny thing, the previous code worked sometimes. Mostly the original version did not work on the initial posting, but cured itself on an update.
In our blog the Author and the one who hits publish are 2 different users - maybe its related to that.
or it is some kind of type mixup - the author-id is a string as far as I understood.
or a race-contition somewhere (since $item->post_author returned 0 in this cases
I did not dig into too much detail so the above are my best guesses 🤷♀😉


Remove the Component trait implementation from Handle

Objective

Closes #15716
Closes #15718

Solution

Replace Handle<MeshletMesh> with a new MeshletMesh3d component
As expected there were some random things that needed fixing:

A couple tests were storing handles just to prevent them from being dropped I believe, which seems to have been unnecessary in some.
The SpriteBundle still had a Handle<Image> field. I've removed this.
Tests in bevy_sprite incorrectly added a Handle<Image> field outside of the Sprite component.
A few examples were still inserting Handles, switched those to their corresponding wrappers.
2 examples that were still querying for Handle<Image> were changed to query Sprite

Testing

I've verified that the changed example work now

Migration Guide
Handle can no longer be used as a Component. All existing Bevy types using this pattern have been wrapped in their own semantically meaningful type. You should do the same for any custom Handle components your project needs.
The Handle<MeshletMesh> component is now MeshletMesh3d.

I've extended the migration guide for you :)

Thanks for doing this! Small nit, can we remove the WithMeshletMesh type alias? I never liked it to begin with, and it's not even that complex now that handle is gone. Feels uneeded.


iodbc: SELECT 1;: free(): invalid pointer

Using the weird HFSQL database with iodbc.
The query seems to work when I'm using HFSQL's UI thing.
backtrace
#0  0x00007ffff7dc6bc7 in __pthread_kill_implementation () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#1  0x00007ffff7d79b46 in raise () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#2  0x00007ffff7d644b5 in abort () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#3  0x00007ffff7dbaa60 in __libc_message () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#4  0x00007ffff7dd0b9a in malloc_printerr () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#5  0x00007ffff7dd26ec in _int_free () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#6  0x00007ffff7dd5273 in free () from /nix/store/fz54faknl123dimzz6jsppw193lx2mip-glibc-2.35-163/lib/libc.so.6
No symbol table info available.
#7  0x00007ffff7f7f55a in SQLGetDiagRec_Internal () from /nix/store/1larqcdmwr5lyk38l7fvrakqa3lz14gr-libiodbc-3.52.15/lib/libiodbc.so.2
No symbol table info available.
#8  0x00007ffff7f7ff1e in SQLGetDiagRec () from /nix/store/1larqcdmwr5lyk38l7fvrakqa3lz14gr-libiodbc-3.52.15/lib/libiodbc.so.2
No symbol table info available.
#9  0x0000555555586e63 in odbc_api::handles::diagnostics::{impl#1}::diagnostic_record<odbc_api::handles::statement::StatementRef> (self=0x7fffffff3448, rec_number=1, message_text=&mut [u8](size=0))
    at src/handles/diagnostics.rs:186
        native_error = 0
        state = [0, 0, 0, 0, 0, 0]
        text_length = 1376
#10 0x0000555555586cdb in odbc_api::handles::diagnostics::Diagnostics::diagnostic_record_vec<odbc_api::handles::statement::StatementRef> (self=0x7fffffff3448, rec_number=1, message_text=0x7fffffff3280)
    at src/handles/diagnostics.rs:138
        cap = 0
#11 0x00005555555857bc in odbc_api::handles::diagnostics::Record::fill_from<odbc_api::handles::statement::StatementRef> (self=0x7fffffff3280, handle=0x7fffffff3448, record_number=1)
    at src/handles/diagnostics.rs:235
No locals.
#12 0x00005555555883d7 in odbc_api::handles::sql_result::SqlResult<bool>::into_result_with_trunaction_check<bool, odbc_api::handles::statement::StatementRef> (self=..., handle=0x7fffffff3448,
    error_for_truncation=false) at src/error.rs:201
        record = odbc_api::handles::diagnostics::Record {state: odbc_api::handles::diagnostics::State ([0, 0, 0, 0, 0]), native_error: 0, message: Vec(size=0)}
        function = "SQLExecDirect"
#13 0x0000555555574a0d in odbc_api::handles::sql_result::SqlResult<bool>::into_result<bool, odbc_api::handles::statement::StatementRef> (self=..., handle=0x7fffffff3448)
    at /home/bbigras/.cargo/registry/src/github.com-1ecc6299db9ec823/odbc-api-0.49.0/src/error.rs:172
        error_for_truncation = false
#14 0x000055555556bd2b in odbc_api::execute::execute<odbc_api::handles::statement::StatementImpl> (statement=..., query=...)
    at /home/bbigras/.cargo/registry/src/github.com-1ecc6299db9ec823/odbc-api-0.49.0/src/execute.rs:97
        sql = 0x7fffffff3e20
        stmt = odbc_api::handles::statement::StatementRef {parent: core::marker::PhantomData<&*mut odbc_sys::Dbc>, handle: 0x5555556201e0}
#15 0x000055555556baa7 in odbc_api::execute::execute_with_parameters<odbc_api::handles::statement::StatementImpl, odbc_api::connection::{impl#1}::execute::{closure_env#0}<()>, ()> (lazy_statement=..., query=...,
    params=()) at /home/bbigras/.cargo/registry/src/github.com-1ecc6299db9ec823/odbc-api-0.49.0/src/execute.rs:31
        statement = odbc_api::handles::statement::StatementImpl {parent: core::marker::PhantomData<&*mut odbc_sys::Dbc>, handle: 0x5555556201e0}
#16 0x0000555555567f4e in odbc_api::connection::Connection::execute<()> (self=0x7fffffff4788, query="SELECT 1;", params=())
    at /home/bbigras/.cargo/registry/src/github.com-1ecc6299db9ec823/odbc-api-0.49.0/src/connection.rs:115
        lazy_statement = odbc_api::connection::{impl#1}::execute::{closure_env#0}<()> {self: 0x7fffffff4788}
        query = odbc_api::handles::sql_char::SqlText {text: "SELECT 1;"}

odbc-api = { version = "0.49.0", features = [ "iodbc" ] }
Note that will the old odbc crate I get:
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: FromBytesWithNulError { kind: InteriorNul(4) }', /home/bbigras/.cargo/registry/src/github.com-1ecc6299db9ec823/odbc-0.16.1/src/diagnostics.rs:55:60

It seems to get an error executing the statement and getting an invalid free than trying to fetch the error message.
I actually would be suprised if iodbc would be thread safe. The pthread in the stack worries me a bit. If you use odbc-api directly you'll find that you have to write unsafe code in order to make Connections Send. That means you have to use connections on the same thread you create them.
I know from the other thread that you use a connection pool library which hides that unsafe code behind a safe function call, but it doesn't actually do anything to make it safe (nor can it, if the underlying C-Lirbrary is not thread safe).
As you might be able to imagine I would have a hard time reproducing your error. Best I can do is provide a couple of guesses.
First thing I would try is to have a really simple program outside of any server implementation just executing this one query. No multithreading, no fancy connection pooling and see if that works.
Best, Markus

Oh for this case I didn't use r2d2.
My code is this:
[dependencies]
anyhow = "1.0.65"
dotenv = "0.15.0"
odbc-api = { version = "0.49.0", features = [ "iodbc" ] }

use anyhow::{Context, Error};
use dotenv::dotenv;
use odbc_api::{buffers::TextRowSet, Cursor, Environment, ResultSetMetadata};
use std::{
    env,
    ffi::CStr,
    io::{stdout, Write},
    path::PathBuf,
};

const BATCH_SIZE: usize = 5000;

fn main() -> Result<(), Error> {
    dotenv().ok();

    let conn_str = env::var("SQL_STR").unwrap();

    let environment = Environment::new()?;
    let mut connection = environment.connect_with_connection_string(&conn_str)?;

    match connection.execute("SELECT 1;", ())? {
        Some(mut cursor) => {
            println!("ok!");
        }
        None => {
            eprintln!("Query came back empty. No output has been created.");
        }
    }

    Ok(())
}

I also tested other queries:

SELECT CURRENT_DATE FROM DUAL; OK
SELECT TO_CHAR(12,'RN') free(): invalid pointer

@genusistimelord suggested that it "it must not like selects without From".

Okay interessting. Yeah, there might be something it doesn't like about these SELECTs. The issue from my point of view is not that these fail, but that you get an error when diagnostics are fetched.

To clarify, in case an error occurrs odbc-api goes on and uses ODBC C-API to get an error message from the datasource. E.g. a message explaining a syntax error, or similar stuff. This seems to be the call causing the invalid free.
Stuff that is currently beyond my understanding:

Why do we get an invalid free? The ODBC function SQLGetDiagRec (get diagnostic record) should just fill a buffer. Not delete anything. The implementation may do whatever it wants to (obviously).

I feel the first point may hold more relevance though.

yeah in this case connection is only on a single thread to begin with so multi threading should not cause any issues here. I wounder if the error from hfsql is different from those in other SQL so it doesn't know how to parse it. which it fails and then tries to call Free on memory that doesn't exist due to the failure.

Could this happen if my database's charset is latin1?
If I run SELECT 1; with the old odbc-rs, I get a FromBytesWithNulError but with gdb I can see this error message:
"Erreur dans le code SQL de la requ"
Which means that there's an error in the SQL query. The next character should be "ê" so maybe there's an encoding problem there.
I wonder if it could be similar with odbc-api.

ahh yeah it might be having a hard time since the string doesn't have a nul terminator?

ahh yeah it might be having a hard time since the string doesn't have a nul terminator?

not sure.
but with odbc-api, I just found something.
If I add message_text.resize(1024, 0); at the start of diagnostic_record_vec(), I don't get the free error anymore, I get:
Error: ODBC emitted an error calling 'SQLExecDirect':
State: 0100, Native error: 0, Message: Erreur dans le code SQL de la requ?te <Requete_HyperFile2074370896>. Initialisation de la requ?te impossible.
Fichier ###DUAL0### inconnu
Erreur d?tect?e :
FROM >>>>"###DUAL0###"<<<<

Informations de d?bogage :
IEWD230SQL=1.12
Module=<WD230SQL>
Ve

I tried this because I was wondering if it could be related to null_mut. maybe my driver doesn't like it.
https://github.com/pacman82/odbc-api/blob/c37869fa2c4a9007dd21fa4c479bc58d05a24e06/odbc-api/src/handles/buffer.rs#L13-L19

Hello together,
sorry for the delayed response. I am a bit swamped this week, and I did not have internet on my train rides recently.
@bbigras Thanks for taking a closer look at it. It might be helpful to know, that at least for the first diagnostic message associated with an error, odbc-api tends to call the underlying SQLGetDiagRec twice. The first time it is with an empty buffer, just to retrieve the minimal buffer length, which might be able to hold the entire text message. On the second call it would try to receive the same message with an adequatly sized buffer. This leads me to hypothesize that the ODBC driver in question may remove that message after the first fetch, and in the second fetch might try to remove it again (retrieving diagnostic messages actually should not change state, so this is likely a bug). To verify, what would happen if you only call it with a buffer of size 10 instead of 1024?
@genusistimelord You are not wrong either. You identified the reason why the replacement character shows instead of the é in requests. Usually odbc-api does avoid this kind of problems by specifying to using wide characters by default. According to the standard these must always be UTF-16 encoded. The narrow encoding is according the spec decided by the system locale, yet many impelementation just always return UTF-8. So the idea is to enable the narrow feature only on modern platforms there the character encoding is set as UTF-8. However, either the iodbc driver manager seems to be unable to handle the wide encoding (it allocates the state buffer of the wrong size among other things). So the iodbc feature implies using narrow encoding. I would advice switching the system locale to an UTF-8 character encoding, to solve this part of the problem.
I won't be able to do much this week, please do not mistake my inactivity for me being unsympathetic to your problem.
Cheers, Markus

odbc-api 0.50.0 is released. Then first fetching diagnostics it uses a buffer of size 512. It seems that fetching with a buffer of size 0 is what causes the HFSQL driver to remove the message (guessing here). So this may workaround the issue. However any true fix must be happening within HFSQL.
The other issue that came up, is the confusion of encodings. Any encoding other than UTF-8 or UTF-16 is not supported by the higher level of abstractions of this crate. If you care about decoding the diagonstics correctly and can not change the system locale you must fall back the functionality provided by the handles submodule.
Best, Markus

thank you Markus.

You are welcome


Refact class components to function components and hooks

Fix #66
As the title says, this Pull Request adds functional components and hooks to all class components used in this project, and changes deprecated lifecycles for hooks like useEffect.
Important: I removed all typings while refactoring, as I talked to @JoseRenan and @JRobsonJr.

@JoseRenan I made some changes you've requested and commented on others, please take a look when you can :smile:


Add more manual default implementations

Adds Default implementations for the widgets that weren't covered by this previous PR https://github.com/gtk-rs/gtk4-rs/pull/582 because they had a manual new function.
The widgets affected by this PR are:

Application
DropDown
EntryBuffer
FileChooserDialog
MessageDialog

@bilelmoussaoui ?

Btw. a point release for this would be great. Without Default implementation for MessageDialog Relm4 CI will constantly fail because I don't want to implement a temporary workaround only for MessageDialog.


Add the values table function and use it in values statements.

Summary of the changes / Why this improves CrateDB
The behaviour of the unnest table function has been
changed to unnest nested arrays as well. The implementation
of the VALUES statement uses the unnest table function
which leads to the behaviour change of the statement. Therefore,
we introduce the values table function that can be used for the
values statement's implementation.
VALUES([[1, 2], [3]], [‘a’, ‘b’])
will return the following rows:
    [1, 2] | a
    [3] | b

instead of
    1 | a
    2 | b
    3 | NULL

Checklist

[ ] User relevant changes are recorded in CHANGES.txt
[x] Touched code is covered by tests
[ ] Documentation has been updated if necessary
[x] CLA is signed
[x] This does not contain breaking changes, or if it does:

It is released within a major release
It is recorded in CHANGES.txt
It was marked as deprecated in an earlier release if possible
You've thought about the consequences and other components are adapted
(E.g. AdminUI)

yep, _values would be a nice way to go

@mfussenegger can you please look at it again? I had to replace the list of iterators with a supplier.


The role of CU_TCP_FRIENDLY in cubic_update?

The cubic algorithm is :
W(cubic) = c(t-K)(t-K)(t-K) + W(max)
K = cbrt(W(max)*q/C)
But what's the function of CU_TCP_FRIENDLY?

Not exactly sure. from commit history, it was added to fix things up. :-)


Add sequence diagram to README

Hi, I created a little diagram. Hope this clarifies things, and hope that my understanding is correct.

Alright, "NAT" changed into "network" and fixed the overlapping texts that I accidentally introduced

Thanks!


kctrl: Better errors for malformed package-resources.yml

Describe the problem/challenge you have
[A description of the current challenge that you are experiencing.]
Today, if resources are missing from package-resources.yml we get an error somewhat like this,
$ kctrl package release --version 1.0.0
kctrl: Error: Parsing resource config 'package-resources.yml':
  Unknown apiVersion '' or kind '' for resource

Describe the solution you'd like
[A clear and concise description of what you want to happen. If applicable a visual representation of the UX.]
We should have a better error message or even ignore the cases in which a resource is not necessary.

Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.

Branched out of #632


Update dangerfile to use scoped syntax

This has been in a few builds, but support for unscoped vars is going away soon.

  Generated by :no_entry_sign: danger


Installation Docs?

Would you mind writing a few steps on how to use this driver?  How to build and install it?
I'm happy to see you attempting to make Rokid work on linux, but I really don't know where to start yet.
Thanks

This is more of an SDK to develop custom apps with. If you are planning to use it to run existing apps, then this is not for you. If you only want to use the glasses as a second screen, they should work out of the box though.
Hopefully one day we'll make an actual OpenXR driver with monado (like the wonderfully done Nreal Air driver), and it should then work out of box with all OpenXR compatible apps, but this isn't really planned right now.

Ah okay.
My device is on the way.  Is it possible, out of the box, to enable/disable 3D mode, i.e. where the screen is either fixed in space or always in your FoV?

Unfortunately that post is about a different feature.
I think what you're talking about, positioning windows in true 3D space has to have proper software support on the operating system side. It's more of an application. I'm not sure about Rokid, but Xreal (formerly Nreal) has Nebula for example. For linux there is Simula, but that needs OpenXR integration.
Without a specific app like that, the screen is just a screen right in front of you and moves with your head.
The post you linked is about switching the glasses themselves between mirrored mode (where both eyes see the same thing) and SBS (side by side stereo mode, where the small display for each eye displays something different). It's still just a screen, without any 3D features, even in SBS mode. But I think there are some games or some software that can make use of this.
If your plan is to just use it as a fancy VR display for windowing, I think your best shot is to just switch to an XReal Air.
Or of course you can also donate some money to help us push Rokid support into monado :)

Just getting started with this, would monado support replace a window manager, or run along side it? Would apps on my desktop automatically be available for the glasses display?  Would multi virtualize monitor support be available?
How much money would you estimate that would require?

Monado itself is just an OpenXR provider library. I think Simula is a complete window manager, but you should ask them in their discord or something to know for sure, I haven't tried it yet.  Looking at the demos, you can place individual windows in 3D space with it.

How much money would you estimate that would require and what would be possible?

I guess about $0 if you have a compatible AR glasses.

If there was good reason to implement that for Rokid, can you estimate the cost of that?

Well, calculating with standard contractor rates, it would be around 2000 EUR for a good quality port, so I'm preeeetty sure it's not worth it, unless some 10 people throw that money together. I just started asking around in the discord channels if someone's doing it for free right now or not :D
As for the glasses themselves, I only tried the Rokid Air and the Nreal Light. The Nreal had way better build quality and better image. FOV doesn't really matter if the edges are blurry.
Then again, the Rokid Max is a much newer design, and it also has 120Hz update rate, which is pretty huge. I'll try to get my hands on them someday.

@ddurham2 : You might be interested in the new Rokid module in monado, and a step-by-step Simula install guide:
https://www.reddit.com/r/rokid_official/comments/15vapgp/guide_3d_desktop_on_linux_with_simulamonado_and_a/
(It wasn't 2000 EUR in the end :P, see https://github.com/badicsalex/ar-drivers-rs/issues/3#issuecomment-1668449367 )

Closing due to lack of activity, and since it is not really that applicable.


Adding kwargs to OpenAI get_embedding calls

Sorry, I'm new to open source and I accidentally closed my last PR
Why is this needed?

OpenAI now supports another parameter (user) while generating embeddings and might support more in the future.
Passing headers to the Embeddings API endpoints is also limited in the current implementation

What is included in this commit?

Added kwargs to the BaseEmbedding and OpenAIEmbedding classes and functions to support extra parameters to be passed as needed.

I've reverted the changes discussed in the last PR. We still need to add kwargs to the base embeddings class as well, I felt removing everything from kwargs in the OpenAI class might be more messy.

@jerryjliu please review. Have made the changes. A little new to contributing to OSS, but excited to be starting with Llamaindex :)
I’m waiting on this to take an app to production  so please let me know. Thanks!

@Disiok thanks for being patient! I've made the changes and ran the linter & tests.

Great, looks like nice and cleaned up now!


Add psmisc to base image

For compatibility reasons (GLIBC), Veracruz must be deployed in a Docker container provided by us.
The issue is that my deployment scripts depend on killall, which is part of psmisc, which isn't part of the base image.

Per our discussion this morning, the consensus is that we don't need to push CI images and update the github/workflows/main.yaml file unless it's anticipated to be a breaking change.


How to disable Bluetooth Audio and play System audio from output when needed/desired

This Scripts works great!
Just one thing...
How to go back to play System Audio from Speakers when needed.

Seems Audio works if we change output source for vlc to digital in vlc prefrence but chromium sound still not working!
Seems like Chromium doesnt work well with bluealsa...
Help plz

I think I did not quite understand what you are trying to do. Would you like to play system audio (like notification sounds) from your local speakers, but VLC sound via Bluetooth on the Raspberry Pi? (This would require some configuration on the client and depends on your setup...)

Never Mind I got it working, thanks for this project


fixing enterprise ldap issue with execution view

Closes #4758
The error caused in #4758 is because the ldap rbac is expecting the document returned from the ActionExecutionDB to contain action.pack and action.uid, but they are currently not being returned.
Here is the traceback I got from the rbac
Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2rbac_enterprise_backend/utils.py", line 120, in assert_user_has_resource_db_permission
    permission_type=permission_type)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2rbac_enterprise_backend/utils.py", line 287, in user_has_resource_db_permission
    permission_type=permission_type)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2rbac_enterprise_backend/resolvers.py", line 673, in user_has_resource_db_permission
    pack_db = PackDB(ref=action['pack'])
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/mongoengine/base/datastructures.py", line 54, in __getitem__
    value = super(BaseDict, self).__getitem__(key)
KeyError: 'pack'

and here is the action object that is returned when it gets the key error
<ActionExecutionDB: ActionExecutionDB(action={u'parameters': {u'pack': {u'required': True, u'type': u'string', u'description': u'Name of pack to lookup'}}}, children=[], context={}, delay=None, end_timestamp=None, id=5d49d6ddf55f7d00f89a00e7, liveaction={}, log=[], parameters={u'log_level': u'DEBUG', u'pack': u'packs'}, parent=None, result={u'result': {u'git_status': None, u'pack': {u'description': u'Pack management functionality.', u'author': u'StackStorm, Inc.', u'python_versions': [u'2', u'3'], u'version': u'3.1.0', u'email'<EMAIL_ADDRESS>u'name': u'packs'}}, u'exit_code': 0, u'stderr': u'', u'stdout': u''}, rule={}, runner={u'runner_parameters': {u'debug': {u'default': False, u'required': False, u'type': u'boolean', u'description': u'Enable runner debug mode.'}, u'content_version': {u'required': False, u'type': u'string', u'description': u'Git revision of the pack content to use for this action execution (git commit sha / tag / branch). Only applies to packs which are git repositories.'}, u'log_level': {u'default': u'DEBUG', u'enum': [u'AUDIT', u'CRITICAL', u'ERROR', u'WARNING', u'INFO', u'DEBUG'], u'type': u'string', u'description': u'Default log level for Python runner actions.'}, u'env': {u'type': u'object', u'description': u'Environment variables which will be available to the script.'}, u'timeout': {u'default': 600, u'type': u'integer', u'description': u"Action timeout in seconds. Action will get killed if it doesn't finish in timeout seconds."}}}, start_timestamp="2019-08-06 19:58:10.371616+00:00", status=None, task_execution=None, trigger={}, trigger_instance={}, trigger_type={}, web_url=None, workflow_execution=None)>

By having mongo return the action.pack, and the action.uid, it should satisfy the st2rbac requirements

 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.jmeyer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

Thanks for your contribution @jdmeyer3 , we will review it and merge.

Thanks for contributing this bug fix.
I will go ahead and add a corresponding test case to our proprietary RBAC code base.

While working on the tests, I noticed there is another bug hiding in there.
When, rbac.permission_isolation config option is enabled, context attribute is mandatory as well - 9a712d9939c00b24d6b0f35bae8f3427c46b6da9.

And to clarify / add some context - I believe this issue would only affect WebUI by default, but not CLI, since WebUI tries to retrieve less fields (only the ones it needs) to speed things up.


Use supported_instructions not basis_gates for control flow

Summary
Control-flow already isn't really a basis gate, but due to deployment issues in the short term, it may be more convenient to get if_else into supported_instructions and not basis_gates.  This swaps the check in the Target construction over, so it will be respected if so.
For transpiling on Terra, it doesn't matter that if_else isn't in basis gates, because the Target takes priority.

Details and comments
cc: @taalexander.
This is just in draft because it may not be necessary, but if it is, then it's ready to go.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

-1 of 1 (0.0%)  changed or added relevant line in 1 file are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage remained the same at 41.307%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

qiskit_ibm_provider/utils/backend_converter.py
0
1
0.0%

Files with Coverage Reduction
New Missed Lines
%

qiskit_ibm_provider/utils/backend_converter.py
1
14.15%

Totals

Change from base Build<PHONE_NUMBER>:
0%

Covered Lines:
2832

Relevant Lines:
6856

💛  - Coveralls


Notify user

On the mattermost integration page it says you can notify a channel/group/user,
How does group/user actually work since looking at the source (I don't have a strong grasp of PHP so forgive me), it doesn't actually seem possible.

This plugin doesn't send notifications to a single user or a group, only to a channel.
Incoming Mattermost webhooks don't even seems to support direct message to a user, only mentions.

This issue has been closed automatically for inactivity after more than 1 year. Unfortunately, this project doesn't have enough resources to manage all these requests. Read the FAQ.


Fix jax support

the .tolist method triggers a ConcretizationTypeError when using jax traced objects. In discopy 1.~. these two lines are removed as well.

See https://github.com/discopy/discopy/blob/d40573048d95f60a37d15843055ce38dd0bc9fc8/discopy/cat.py#L473

ok, fake news, we need to check whether it's a numpy array.

Cool, can we release a new 0.5.~ version after merging?

Cool, can we release a new 0.5.~ version after merging?

Sure! I just sent you an invite to become maintainer of the PyPI repo.


Update CODEOWNERS

This will suppress automatic review requests to @aspnet/build for bot-generated PRs

I would rather we not do this until the bot can notify us when checks fail. Can use Outlook to ignore 90% of the bot's updates:

I personally find GitHub emails useless altogether and use octobox to manage notifications...so outlook rules don't help me. @dougbu if you still want to receive emails, I can add you as a co-owner with dotnet-maestro-bot so you still get email notifications for review requests.

How will we monitor invalid manual changes to the files the bot changes w/o these notifications? And, I understand you're willing to hand a lot of info and power over to Octobox but I am not.
So, yes, if you don't want email notifications and pare them down on receipt, add me as a code owner.
Separately, should we let the bot own /global.json in our Arcade repos?

How will we monitor invalid manual changes to the files the bot changes w/o these notifications?

Sounds like a good question for a separate conversation about how much we trust the bot. Pinging @aspnet/build for every PR is sufficient to answer this question, though, as human review of Versions.Details.xml is often error prone anyways.

Separately, should we let the bot own /global.json in our Arcade repos?

Actually, that one I want our team to still review. Changes to global.json are more likely to lead to build errors and problems than other version files since global.json controls the version of the .NET Core SDK and Arcade SDK.

Pinging @aspnet/build for every PR is sufficient to answer this question

With this change to CODEOWNERS, who or what will ping @aspnet/build ?

I'm assuming no one is monitoring the dotnet-maestro-bot inbox for notifications.
As always, if you want to adjust this file, send a PR. :)


"expected T to occur only covariantly" and (x: {t: T}) => void

Not sure if I misunderstand something or there is a bug.
/* @flow */

class A<+T> {
  foo(cb: (x: T) => void): void {} // this works
  bar(cb: (x: {t: T}) => void): void {} // this doesn't work
}

bar(cb: (x: {t: T}) => void): void {}
                ^ T. invariant position (expected `T` to occur only covariantly)

Example in "Try Flow"

Well, x.t is both readable and writable in the seconds case, so it's invariant

So the problem is that someone can do the following?
a.bar(x => {
  x.t = ...
})

I'm still struggling with variance so I don't understand well what I'm doing to be honest.

Hm, it seems to work with a little hack:
/* @flow */

type Obj<+T> = {t: T}

class A<+T> {
  foo(cb: (x: T) => void): void {}
  bar(cb: (x: Obj<T>) => void): void {}
}

I think that variance with type aliases is broken, this is obviously unsafe.

A you sure it's unsafe? Flow seems to disallow the unsafe mutations.

This definition is unsafe on it's own:
type Obj<+T> = {t: T}

And, as you can see, it doesn't really work

Yeah, I get it. Thanks!
So if your example worked, then this would also have to work, and this is more clearly unsafe:
/* @flow */

declare class Foo {}
declare class Bar extends Foo {}
declare class Baz extends Foo {}

type Obj<+T> = {t: T}

const x: Obj<Bar> = { t: new Bar };
const y: Obj<Foo> = x

y.t = new Baz

This is sad though. I'll have to choose between less convenient API on one hand and unsafe poorly typed API on the other.

Is it ok to use interface for this?
/* @flow */

interface Obj<+T> {t: T}

class A<+T> {
  foo(cb: (x: T) => void): void {}
  bar(cb: (x: Obj<T>) => void): void {}
}

I think it is the same. The only that would make it possible is immutable properties

The only difference is Flow won't complain. Though it's still unsafe. But I'm going to use interfaces in my case, seems to be the best option, even though a bit unsafe.

Interfaces a pretty broken in some cases, for example, properties of optional types don't work


[Module Proposal]: AVD Firewall Policy (tf)

Check for previous/existing GitHub issues/module proposals

[X] I have checked for previous/existing GitHub issues/module proposals

Check this module doesn't already exist in another project that is being evolved into AVM

[X] I have checked for that this module doesn't already exist in CARML or TFVM

Terraform or Bicep?
Terraform
Module Classification?
Resource Module
Module Name
avm-res-network-firewallpolicy
Module Details
creating an azure firewall policy that is specific for AVD network rules outbound from the required URL list.
Do you want to be the owner of this module?
Yes
Module Owner's GitHub Username
cshea15

Hey @cshea15
This would be a pattern module, if anything in my opinion as it's providing specificity to a single architecture pattern.
Would it also just be a policy? Could this be wrapped together with other resource modules to help accelerate more than just the firewall policy?
Otherwise this would be a duplicate of #153 and the AVD rules could just be an example in the tests/e2e folder.
Let us know your thoughts on direction here.
Thanks
Jack

Awesome thanks @cshea15
Let's close this one and add as an example for #153 and to the pattern in the future


Mention scheduling profiles in Configure Multiple Schedulers

This is a Feature Request

What would you like to be added
https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/ should signpost readers to
https://kubernetes.io/docs/reference/scheduling/config/#multiple-profiles as they
Why is this needed
Readers might want to use an additional scheduling profile rather than implement a fully custom scheduler.
Comments
You can also use a custom scheduler configuration, or custom container image, for the cluster's main scheduler by modifying its static pod manifest on the relevant control plane host.
/language en
/kind feature
/help
/sig scheduling

/assign

/triage accepted

/remove-lifecycle rotten

Fixed in PR #27027

/close


Bug: cant import ModellT

Description
for my application
cant import ModelT
I wrote B
from .typing import ModelT
in
advanced_alchemy/repository/__init__.py
and it started working for now.
URL to code causing the issue
No response
MCVE
# Your MCVE code here

Steps to reproduce
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots
"In the format of: ![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
Logs
File "/api/src/domain/__init__.py", line 1, in <module>
    from .app_version import AppVersion
  File "/api/src/domain/app_version.py", line 8, in <module>
    from litestar.contrib.sqlalchemy.repository import SQLAlchemyAsyncRepository
  File "/api/.venv/lib/python3.11/site-packages/litestar/contrib/sqlalchemy/repository/__init__.py", line 21, in __getattr__
    from advanced_alchemy.repository import (  # type: ignore[import-not-found] # pyright: ignore[reportMissingImport]
ImportError: cannot import name 'ModelT' from 'advanced_alchemy.repository' (/api/.venv/lib/python3.11/site-packages/advanced_alchemy/repository/__init__.py)

Package Version
[[package]]
name = "advanced-alchemy"
version = "0.11.1"
description = "Ready-to-go SQLAlchemy concoctions."
optional = false
python-versions = ">=3.8"
files = [
{file = "advanced_alchemy-0.11.1-py3-none-any.whl", hash = "sha256:a04db7f2aa798be98273fa35df27e86b3a4525cafe7b1395140b95bf85e2a4d1"},
{file = "advanced_alchemy-0.11.1.tar.gz", hash = "sha256:8814be5ac3bcccf07f1d01ba73fea12777097368e971d3d95cfb7010c1494d94"},
]
Platform

[X] Linux
[ ] Mac
[ ] Windows
[ ] Other (Please specify in the description above)

@sion908 Can you please update your Advanced Alchemy version?  It looks to be quite an old release.

If updating doesn't resolve, you can please open a new issue with the traceback of the new version and a way to reproduce?

sorry
I've solved
thank you


Can fabric and tee be used together?

Can fabric and tee be used together? If so, how should they be used?

Yes, take a look at https://github.com/hyperledger/fabric-private-chaincode

Thanks


Parametrized dhcp_domain option

This caused nova to add .novalocal to the FQDN of an instance. Now a value can be set in reclass model.

This has already been implemented in #38


fula mobile android not work on WIFI

https://github.com/golang/go/issues/52702

It's not this network problem it's a DNS problem.
For some reason on Android and on WIFI can not resolve bootsrap.libp2p.io.
So for now I deploy 2 nodes on AWS as bootstrap.

bootsrap.libp2p.io is the public libp2p node for bootstrapping instances?

@ehsan6sha
default bootstrap nodes are :
"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
I think /dnsaddr is made by libp2p guys because:
bootstrap.libp2p.io does not have A or AAA record it has TXT record of another list of addresses.


chemkin.py added

Coverage remained the same at 100.0% when pulling f85254a7c241042b6009316bb3b5a7780b2f2629 on Gedichter:master into cde459bc06c3a3ec0a49308385556798916d73fd on cs207-group11:master.

Coverage decreased (-80.07%) to 19.928% when pulling a2c7c76bfec04c1b92c0b009595c5dc38df8b0a3 on Gedichter:master into cde459bc06c3a3ec0a49308385556798916d73fd on cs207-group11:master.

Coverage decreased (-2.6%) to 97.351% when pulling 205dc94a40bf038459f667b336d75a7047cf284d on Gedichter:master into cde459bc06c3a3ec0a49308385556798916d73fd on cs207-group11:master.


Add quick-lint-js version <IP_ADDRESS>

[x] Have you signed the Contributor License Agreement?
[x] Have you checked that there aren't other open pull requests for the same manifest update/change?
[x] This PR only modifies one (1) manifest
[x] Have you validated your manifest locally with winget validate --manifest <path>?
[ ] Have you tested your manifest locally with winget install --manifest <path>?
[ ] Does your manifest conform to the 1.5 schema?

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

Microsoft Reviewers: Open in CodeFlow

There was a problem with the web server hosting the .msix file. I fixed the problem. The CI bot should re-test.

/AzurePipelines run


Feature Request: add an airline theme?

Love the theme, only thing I would like is for an airline theme to be available as well.
https://github.com/vim-airline/vim-airline-themes

Thanks for the pull, sorry for making you waiting, i've been busy these few days. Will merge it and close this after trying it myself

done! check the latest push


pod reaper health checks

If a pod-reaper is being managed with a deployment, how can we implement health checks against it?

As it stands: the pod-reaper is a go binary running in a scratch container. It doesn't listen for http requests, and isn't touching files. Right now: the "health" check is whether or not the container exists with a non-zero status code.
If the reaper encounters an error that it does not expect (there are cases such as pod deletion race conditions) it simply panics: logging a stacktrace and exiting with a non-zero status code.

I spent some more time thinking about this and think that, for the moment at least, if the pod is running: it is healthy. If the pod crashes/exits with non-zero: it is unhealthy. Kubernetes happily handles those by default with no need to specify additional health checks.


AHK Image maker from YT

Could you share that lil utility thingie that makes your Scan class THAT Much More comfortable to use ?
Honestly i kinda dont wanna install 1 thing i would only use for this and nothing much else, i DID have Gimp few years ago but i didnt use it soo when i got new PC i just kinda didnt bother XD
We are probably fine with some kind of early access pre-Alpha sloppy version of it too, just rly anything soo we can start enjoying it and give you some feedback (probably here on GitHub in a new Repo ?).
Thanks,
your faithfull user(s) :-)

It's in the plans but kind of low priority, I don't have much free time anymore sadly, I do want to get around to it and when I do I will make a new repo for it, the problem is it was half programmed in c++ and compiled as a DLL and I don't really want to have people download a bunch of random DLLs required to run my scripts.

i get that, but if i get sth else (like gimp) i will end up with RNG libraries anyways (also takes waaay more space on my already overfilled disk)
welp, if i end up needing image search i will figure sth out i guess ;-(
(probably MS paint XD)


Can't make it work, am I missing something?

HI, thank you so much for taking the time to build this super useful extension. I still couldn't get it to work though.
I created a .fttemplates folder in my project root and added the folder structure but when I select "Create New Templated Folder" in the context menu or via Ctrl + Shift + p I always get a "No configured Folder Templates found!" error.
What am I missing? Here's the repo in case you want do check it: https://github.com/onepercentio/IATE-nodejs-boilerplate
Thanks again for your time!

Moin @afmeirelles ,
thanks for reaching out.
When I cloned your repo and tried to use the template it seemed to work fine for me.
Could it be that you had multiple workspaces open? I don't know if the extension can handle this yet. I might have to take another look into this. Or maybe you opened the project a level up too high so that the .fttemplates folder wasn't at the root of the vscode project?
However I noticed a few other things.

The first level of children in the .fttemplates Folder is supposed to be the name of the template and inside this folder you place the actual template structure. This is so you can choose the template you want to use based on its name (if you have more than one template in a project).
You seem to not want to use the [FTName] but instead want to use a [ResourceName] placeholder instead. For this you have to specify the "omitFTName" and "omitParentDirectory" properties in the .ftsettings.json file.

Given this feedback I would suggest the following structure in .fttemplates
.fttemplates
- Default
  - .ftsettings.json
  - [ResourceName]
     - ....all the files in the ResourceNameFolder

.ftsettings.json content
{
  "customVariables": ["ResourceName"],
  "omitParentDirectory": true,
  "omitFTName": true
}

I adapted these changes into this fork of your repo, feel free to take a look: https://github.com/Huuums/IATE-nodejs-boilerplate
If you have any further questions I'm happy to answer them.

Hey, @Huuums, thanks for replying so fast.
Your guess was right, my workspace has several projects and when I opened up another window with only one project (the boilerplate) everything worked as expected. It seem the extension doesn't cope well with multiple projects then.
I replicated some of the changes you suggested, no need for custom placeholders.
If you could make it work with a multi-project workspece that would be awesome. As you should have noticed, I'm building a reference project and it'd be really nice to allow people creating resources with just one click.
Thanks!

I will definitely take a look into supporting multiproject workspaces. I will probably take a look over the weekend but can't, make any promises regarding the timeline for a fix.


copier: 9.1.0 -> 9.2.0

Diff: https://github.com/copier-org/copier/compare/refs/tags/v9.1.0...v9.2.0
Changelog: https://github.com/copier-org/copier/blob/v9.2.0/CHANGELOG.md
Description of changes

Things done

Built on platform(s)

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

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

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

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

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[ ] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

Result of nixpkgs-review pr 322852 run on x86_64-linux 1

2 packages built:

copier
copier.dist


Allow arbitrary image ratios in plugin images

will provide compatibility for openplanet-nl/website#35 once that drops, in the meantime this of course renders perfectly fine with the existing image ratios

Does it make sense to still have some of this code for the main image after recently reverting the change on the site?

Does it make sense to still have some of this code for the main image after recently reverting the change on the site?

it doesn't! i went ahead and cut that bit out so it's just the screenshots being adjusted :)

What happens when screenshots are wider than the thumbnail box, instead of just taller?
Is the Dummy call necessary if the ratio is 16:9?
Should the height value of Dummy be scaled, or is it ok?

What happens when screenshots are wider than the thumbnail box, instead of just taller?

I thought i'd accounted for this, but in testing it seems not :pensive:

will do a quick fix :spop:

Is the Dummy call necessary if the ratio is 16:9?

I'll include a check to exclude it if no space is being added, but as-is I'm not seeing any issues with 0-width dummy space render-wise.

Should the height value of Dummy be scaled, or is it ok?

It doesn't need to be scaled, any arbitrary value should be fine.


For example, Python's 3.7.15-alpine3.17 image is 17.35MiB compressed while the 3.7.15-slim Ubuntu based one is 44.89MiB
As a side note, a Dockerfile as simple as this seems to work:
FROM python:3.10.8-alpine3.17 as build

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PYTHONFAULTHANDLER=1 \
    POETRY_VERSION=1.2.2 \
    POETRY_VIRTUALENVS_IN_PROJECT=true \
    POETRY_NO_INTERACTION=1 \
    POETRY_HOME=/usr/bin/poetry \
    PATH=/usr/bin/poetry/bin:$PATH

RUN wget -O- https://install.python-poetry.org | python

ENTRYPOINT ["poetry"]

Thanks for the issue, Angelo!
I did not added Alpine suppprt because Python's performance are worse in them (some source).
But I see no problem on adding it to the image! I am a little busy until the end of the year, so I do not know when I can implement this feature. But if you want to do it yourself, it would be awesome!
Unfortunately I still have not written a contribution guide lines for the project, but the idea seems to be

add Dockerfile-alpine.template file to the templates folder (very similar to the Dockerfile of your example).
add -alpine to config.py
assure the quality of code, from the project's CI (you can use Poetry, with poetry install && poetry shell, or pure pip, with pip install -r requirements/dev.txt && pip install -e ., to install the quality tools and run them locally).

Any question, you can ask me!


Return unwrapping error when executing Do func

Changed returned error retryableError to unwrapping error in retry.Do().
In my case, i use retry.Do() func like below to get origin error.
err := retry.Do(context.Background(), b, func(ctx context.Context) error {
  // my logic
})
if err != nil {
  if err2 := errors.Unwrap(err); err2 != nil {
    err = err2
  }
}

I think it is also helpful if u provide unwrapping errors in retry packages :)

I think the proper use here would be:
var targetError *MyCustomError
err := retry.Do(...)
if err != nil {
  if errors.As(err, &targetError) {
    // use custom error
  }
  return fmt.Errorf("unknown error: %w", err)
}

@sethvargo thx for reply :)
I think that is proper use if i know target error.
But what is proper use if i don't know target error?

If you don't know the error target, what's the point in unwrapping?

I just want to return origin error :)
For example, define http client's wrapping function for retry like below.
In this case, i just want to return a fasthttp's error, and hide retry package.
func (c *HttpClient) Get(ctx context.Context, url string, result interface{}) error {
	var (
		statusCode int
		body       []byte
	)
	backoff := c.NewBackoff()
	if err := retry.Do(ctx, backoff, func(ctx context.Context) error {
		var err error
		statusCode, body, err = fasthttp.Get(nil, url)
		if err != nil {
			// we don't know target error
			return retry.RetryableError(err)
		}
		return nil
	}); err != nil {
		if err2 := errors.Unwrap(err); err2 != nil {
			return err2
		}
		return err
	}
	// extract result
}

You have no guarantee that the error you're unwrapping is a fasthttp error though.

Hi @sethvargo & @zacscoding
As @zacscoding I dislike to return to my caller an error that may or not be a retryable error. I mean that this caller should not know about my internal implementation details.
So what about adding a IsRetryableError(err error) bool function that check if the error returned by Do is retryable or not and let me decide if I want to unwrap it?

If you have a particular type of error you want to return to the caller, you should use errors.Is and errors.As to unwrap it.
I think you may be mis-using Go errors. Sentinel errors are almost always a bad idea, also this.

Well I agree that sentinel errors are to be avoided. I would prefer @zacscoding solution.
Anyway, to clarify my point is not about returning a particular error but masking the retry.retryableError.
In your example:
// This example demonstrates selectively retrying specific errors. Only errors
// wrapped with RetryableError are eligible to be retried.
if err := retry.Do(ctx, retry.WithMaxRetries(3, b), func(ctx context.Context) error {
	resp, err := http.Get("https://google.com/")
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	switch resp.StatusCode / 100 {
	case 4:
		return fmt.Errorf("bad response: %v", resp.StatusCode)
	case 5:
		return retry.RetryableError(fmt.Errorf("bad response: %v", resp.StatusCode))
	default:
		return nil
	}
}); err != nil {
	// handle error
}

In this example Do() may returns an error from http.Get(), an error created with fmt.Errorf() or a retry.retryableError.
If in // handle error I simply return it, my caller will sometime see errors retryable: bad response: xxx I think knowing that an error is retryable or not is not interesting and may even be confusing. I don't get the added value of returning an retry.retryableError.
But maybe I indeed do not understand properly how I should handle errors returned by this package.

IFF you want to use sentinel errors, you need to use them throughout. Here's an example of how I would do the HTTP example above if I was required to use sentinel errors:
type StatusError struct {
  code int
  msg string
}

func (e *StatusError) Error() string {
  return fmt.Sprintf("%d - %s", e.code, e.msg)
}

func() TODO() {
  // This example demonstrates selectively retrying specific errors. Only errors
  // wrapped with RetryableError are eligible to be retried.
  if err := retry.Do(ctx, retry.WithMaxRetries(3, b), func(ctx context.Context) error {
    resp, err := http.Get("https://google.com/")
    if err != nil {
      return err
    }
    defer resp.Body.Close()

    switch resp.StatusCode / 100 {
    case 4:
      return &StatusError{resp.StatusCode, "user error"}
    case 5:
      return &StatusError{resp.StatusCode, "server error"}
    default:
      return nil
    }
  }); err != nil {
    var e *StatusError
    if errors.As(err, &e) {
      return e // e is *StatusError
    }
    return err
  }
}

Thanks for your reply I do not particularly want to use sentinel errors (It was just another proposal as you seems to disagree  with @zacscoding PR).
If we get back to your original example.
// This example demonstrates selectively retrying specific errors. Only errors
// wrapped with RetryableError are eligible to be retried.
if err := retry.Do(ctx, retry.WithMaxRetries(3, b), func(ctx context.Context) error {
	resp, err := http.Get("https://google.com/")
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	switch resp.StatusCode / 100 {
	case 4:
		return fmt.Errorf("bad response: %v", resp.StatusCode)
	case 5:
		return retry.RetryableError(fmt.Errorf("bad response: %v", resp.StatusCode))
	default:
		return nil
	}
}); err != nil {
	// handle error
}

How should a handle error to not exposing to my callers that an error is or is not retryable?

If you or your callers care about the specific error that's returned (sentinel errors), you have to call all-in. That means you wrap all the errors that you return and then unwrap them before passing them onto the caller.

OK thanks, and just to understand how to properly use this lib, what is the benefit of returning a retry.retryableError?

It tells the function that the error is retryable. In the example above, only the 500-level errors are retried. The others are immediately returned and execution stops.

@loicalbertin thx for additional opinion :)
@sethvargo thx for proper usage of errors :) I learned many things from reference and comments!
please close this pr :)


fix: add ignore-date when rebasing

The Node.js commit history does not have chronological dates, so a more recent commit can have an older timestamp. This is causing solutions like Codecov to have unreliable coverage reports.
059f2f43b8      Afanasii Kurakin        Wed Jul 10 20:41:34 2024 +1000  doc: add OpenSSL security level to TLS docs
661ae62ab8      Cloyd Lau       Wed Jul 10 17:24:43 2024 +0800  doc: update `scroll-padding-top` to 4rem
eaffed65f0      Igor Sheludko   Mon Jun 24 10:42:18 2024 +0200  src: fix implementation of `PropertySetterCallback`
e849dd6632      Node.js GitHub Bot      Wed Jul 10 07:13:36 2024 +0300  meta: move one or more collaborators to emeritus
b4e8f1b6bb      Colin Ihrig     Tue Jul 9 16:33:38 2024 -0400   lib,src,test,doc: add node:sqlite module
1a1639de3e      Chengzhong Wu   Sun Jun 23 23:31:33 2024 +0100  deps: V8: cherry-pick 9ebca66a5740
d15f514077      Joyee Cheung    Sun Jul 7 20:22:17 2024 +0200   deps: V8: cherry-pick e061cf9970d9
307430e490      Yagiz Nizipli   Tue Jul 9 10:38:01 2024 -0400   fs: improve error performance of `fs.dir`
c0962dc3bf      Chengzhong Wu   Thu Jun 20 10:14:57 2024 +0100  vm,src: add property query interceptors
213fea0c55      Chengzhong Wu   Thu Jun 20 00:01:54 2024 +0100  src: remove unused ContextifyContext::WeakCallback

cc @bcoe
Unblocks https://github.com/nodejs/node/pull/53891

cc @targos @aduh95 appreciate if you could take a look at this

Couldn't codecov use the committer date instead of the author date?

Couldn't codecov use the committer date instead of the author date?

We should verify that this isn't already the case, the bug I was running into was four years ago.


Standalone or Hosted App?

So the tutorial seems to produce a working Blazor application. Very cool! I'm just not sure if it is producing a standalone or a hosted Blazor application. I'm a newbie to Blazor so it's possible I'm misunderstanding something. Here's my case...
1. In .vscode/launch.json, the 'name' entry contains the word 'Standalone':
{
   "version": "0.2.0",
   "configurations": [
		{
			"name": "Launch and Debug Standalone Blazor WebAssembly App",
			"type": "blazorwasm",
			"request": "launch",
			"cwd": "${workspaceFolder}/Server"
		}
	]
}

Should the "name" entry be corrected to reflect the purpose of the tutorial, which is to build "a hosted Blazor WebAssembly app" instead of a "Standalone" app?
2. The second clue that led me to think the app is standalone, and not hosted, is the size of the client download... approximately 8 MB of content.
3. Going back to vscode/launch.json, I located this documentation which provides a sample config for a hosted application:
{
  "name": "Launch and Debug Hosted Blazor WebAssembly App",
  "type": "blazorwasm",
  "request": "launch",
  "hosted": true,
  "program": "${workspaceFolder}/Server/bin/Debug/netcoreapp3.1/MyHostedApp.Server.dll",
  "cwd": "${workspaceFolder}/Server",
  "browser": "edge"
}

I would've thought the 'hosted' entry would also appear in the tutorial version (located in step 1 above). So I replaced the tutorial version with the version above and the app still works but A LOT more debug messages show up.
Anyway, hope that helps. Please enlighten me if I am misunderstanding something.
Thanks for the great tutorials.

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

ID: 08de9daf-79aa-ee76-431e-f2432f8d691e
Version Independent ID: 1a1ee728-1741-c82a-75e1-06159709935b
Content: Use ASP.NET Core SignalR with a hosted Blazor WebAssembly app
Content Source: aspnetcore/tutorials/signalr-blazor-webassembly.md
Product: aspnet-core
Technology: aspnetcore-tutorials
GitHub Login: @guardrex
Microsoft Alias: riande

OOF for the :gift: holidays :snowman:
This issue has been marked for triage on the Blazor.Docs project, and I'll respond as soon as I return in 2021.
We only work on documentation on this repo. If you need product support, close this issue and seek assistance through one or more of the following support channels:

Stack Overflow (tagged: blazor)
General ASP.NET Core Slack Team
Blazor Gitter

If you think that you found a potential bug in the framework or have product feedback, close this issue and open a new issue for the ASP.NET Core product unit at aspnet/AspNetCore issues.
For problems or feedback on Visual Studio or Visual Studio for Mac, close this issue and use the Report a Problem or Suggest a Feature processes from within VS, which open internal issues for the VS team. For more information, see Visual Studio feedback options or How to report a problem in Visual Studio for Mac.
For problems with Visual Studio Code, close this issue and ask for support on community support forums. For bug reports and product feedback, open an issue on the microsoft/vscode GitHub repo.
⛄🎁 Happy Holidays! :dancer::man_dancing::partying_face: Happy New Year! :balloon::champagne::tada:

OOF for the :gift: holidays :snowman:
This issue has been marked for triage on the Blazor.Docs project, and I'll respond as soon as I return in 2021.
We only work on documentation on this repo. If you need product support, close this issue and seek assistance through one or more of the following support channels:

Stack Overflow (tagged: blazor)
General ASP.NET Core Slack Team
Blazor Gitter

If you think that you found a potential bug in the framework or have product feedback, close this issue and open a new issue for the ASP.NET Core product unit at aspnet/AspNetCore issues.
For problems or feedback on Visual Studio or Visual Studio for Mac, close this issue and use the Report a Problem or Suggest a Feature processes from within VS, which open internal issues for the VS team. For more information, see Visual Studio feedback options or How to report a problem in Visual Studio for Mac.
For problems with Visual Studio Code, close this issue and ask for support on community support forums. For bug reports and product feedback, open an issue on the microsoft/vscode GitHub repo.
⛄🎁 Happy Holidays! :dancer::man_dancing::partying_face: Happy New Year! :balloon::champagne::tada:

@firewater ... I'm back from vacation.

Standalone or Hosted App?

The second clue that led me to think the app is standalone, and not hosted, is the size of the client download... approximately 8 MB of content.

Hosted ... you can read about the hosting models at ...
https://docs.microsoft.com/aspnet/core/blazor/hosting-models
... and the size of the app isn't particularly relevant. However if you feel that there's a problem with the product output is too large ... perhaps you've found a problem where trimming isn't working as expected, that would need to go to the product unit at ...
https://github.com/dotnet/aspnetcore/issues

Should the "name" entry be corrected to reflect the purpose of the tutorial

You'd need to open that with the product unit at ...
https://github.com/dotnet/aspnetcore/issues
... because it's produced by the tooling/template ...

I located this documentation which provides a sample config for a hosted application

That's a fine cross-link for the tutorial, so I'll use this issue to add that. Thanks for the suggestion. Leave this issue open ... it will close automatically when the PR merges.

@firewater ... I'm back from vacation.

Standalone or Hosted App?

The second clue that led me to think the app is standalone, and not hosted, is the size of the client download... approximately 8 MB of content.

Hosted ... you can read about the hosting models at ...
https://docs.microsoft.com/aspnet/core/blazor/hosting-models
... and the size of the app isn't particularly relevant. However if you feel that there's a problem with the product output is too large ... perhaps you've found a problem where trimming isn't working as expected, that would need to go to the product unit at ...
https://github.com/dotnet/aspnetcore/issues

Should the "name" entry be corrected to reflect the purpose of the tutorial

You'd need to open that with the product unit at ...
https://github.com/dotnet/aspnetcore/issues
... because it's produced by the tooling/template ...

I located this documentation which provides a sample config for a hosted application

That's a fine cross-link for the tutorial, so I'll use this issue to add that. Thanks for the suggestion. Leave this issue open ... it will close automatically when the PR merges.


Add EdDSA signatures support.

This adds support EdDSA signatures, when using OpenSSL.
Due to the way EdDSA works, an auxiliary buffer is need to serialize the Sig_Structure.
A pair of new functions, t_cose_sign1_verify_set_sigstruct_buffer, are used to provide
this buffer from the application to t_cose.
A "known good" signature, generated by pycose, is added to the test
suite. Additionally, the usual sign/verify roundtrip test is added.

@laurencelundblade I've finished adding the signing side of it. Please let me know what you think.

Paul, thanks for that!  I glad for all the algorithms support as it is helping me think about the t_cose 2.0 design. I will be merging all this stuff to the dev branch at some point.
It's going to take me a while to look at this because of other stuff I have going on.

Haven't looked through it all yet. I can compile it and run the tests.
There should be a DISABLE_EDDSA because lots of people won't want it and small code size is important.
As far as I know eddsa is the only signing algorithm that needs the auxiliary buffer so I think DISABLE_EDDSA should disable it too.  If it turns out that there is another algorithm that needs it, then we can make it so that it disables only if both those algorithms are disabled.
Still working on reviewing the whole PR in detail...
Thanks for your work here!

I didn't want the public API to change depending on whether EdDSA is available or not, which is why I didn't put the set_auxiliary_buffer behind an ifndef.
I did consider making the set_auxiliary_buffer function a no-op if EdDSA is not available and remove the pointer field from the signing and verification contexts. The function would get removed at link-time if it isn't used. This issue with this is that it breaks applications that do call the function, and expect the buffer size to be adjusted:
q_useful_buf buffer = { NULL, INT32_MAX };
t_cose_sign_set_auxiliary_buffer(ctx, &buffer);
t_cose_sign1_sign(....); // Just measure the size
buffer.ptr = malloc(buffer.size);
t_cose_sign1_sign(....); // Do the actual signing

If set_auxiliary_buffer is a no-op, the application will try to allocate an INT32_MAX sized buffer. Another option would be, instead of a no-op, the set_auxiliary_buffer immediately sets the length to 0. But then when that length gets set depends on whether DISABLE_EDDSA is set, in pretty subtle ways.

Honestly I'm not that happy with the set_auxiliary_buffer API, especially the way the signing operation has a non-obvious side effect. I'll try to think of something better.

I've made the mentioned API change, and I think it is a lot nicer to use than the previous one was. It also allows signing / verifying two different messages with the same context and auxiliary buffer, which the previous API did not (you'd have had to re-configure the auxiliary buffer between each operation).

There are some compiler errors still with the max warnings that tdv/b.sh uses.
I haven't found a way to use Q_USEFUL_BUF_FROM_BYTE_ARRAY_LITERAL()/sizeof() in static const data initializations. I haven't researched this thoroughly as to whether it is allowed by C99 or not, but I suspect it is not allowed. In the implementation of test cases it's OK if it is done at run time and thus has slightly larger object code.

sizeof seems to be fine in this context, it's the cast to q_usebul_buf_c that isn't. Except in other contexts you do need the cast :/
Anyway I've initialized the static data explicitly, doesn't seem worth making a new macro just for this reason.


speedup numpy array collation, and remove upcasting

🚀 🚀 Pull Request
Impact

[ ] Bug fix (non-breaking change which fixes expected existing functionality)
[ ] Enhancement/New feature (adds functionality without impacting existing logic)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Description

before dataloader creation check the participant tensors list and see if upcasting is needed or not
added special case for collation it the batch is numpy array

Things to be aware of

Things to worry about

Additional Context

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


Request support for HUMHOLD Smart Low Profle Ceiling Fans with RGB Lights

Log message
Device matches humhold_rgb_ceilingfan with quality of 81%. DPS: {"updated_at":<PHONE_NUMBER>.715725, "20": true, "21": "colour", "22": 605, "23": 322, "24": "000003e803e8", "34": false, "60": true, "61": "fresh", "62": 30, "63": "reverse", "64": 0, "107": true, "108": true, "110": 0, "111": 77, "119": true}

DPS information
name: Light and fan
products:
  - id: eb9dfc9cd
    name: HUMHOLD Smart Low Profle Ceiling Fans with RGB Lights
primary_entity:
  entity: light
  dps:
  - id: 20
    type: boolean
    name: switch
  - id: 21
    type: string
    name: color_mode
    mapping:
      - dps_val: white
        value: color_temp
      - dps_val: colour
        value: hs
      - dps_val: scene
        value: Scene
      - dps_val: music
        value: Music
  - id: 22
    type: integer
    name: brightness
    range:
      min: 10
      max: 1000
  - id: 23
    type: integer
    name: color_temp
    range:
      min: 0
      max: 1000
    optional: true
    mapping:
      - step: 500
        target_range:
          min: 2700
          max: 6500
  - id: 24
    name: rgbhsv
    type: hex
    format:
      - name: h
        bytes: 2
        range:
          min: 0
          max: 360
      - name: s
        bytes: 2
        range:
          min: 0
          max: 1000
      - name: v
        bytes: 2
        range:
          min: 0
          max: 1000
secondary_entities:
  - entity: fan
    dps:
    - id: 60
      type: boolean
      name: switch
    - id: 61
      name: preset_mode
      type: string
      mapping:
        - dps_val: fresh
          value: fresh
        - dps_val: nature
          value: nature
    - id: 62
      type: integer
      name: speed
      optional: true
      range:
        min: 0
        max: 100
      mapping:
        - step: 15
          target_range:
            min: 0
            max: 100
    - id: 63
      type: string
      name: direction
  - entity: number
    name: Fan timer
    translation_key: timer
    category: config
    dps:
      - id: 64
        type: integer
        name: value
        range:
          min: 0
          max: 540
        unit: min
  - entity: light
    name: White
    category: config
    dps:
      - id: 107
        type: boolean
        name: switch
  - entity: light
    name: Color
    category: config
    dps:
      - id: 108
        type: boolean
        name: switch
  - entity: switch
    name: Main switch
    category: config
    dps:
      - id: 119
        type: boolean
        name: switch

Product ID
No response
Product Name
Smart Low Profle Ceiling Fans with RGB Lights
Information about how the device functions
I have created a Yaml that works for me without issues. Although I still don't know what dps 34, 110 and 111 does.
This is the link to the product on Amazon: https://www.amazon.com/dp/B0CFXX2BL7
Just wanted to ask you to add this for others so they can use it without going through the hassle of figuring things out themselves.

I wonder whether some of the light controls would be better moved into the White and Color lights. That way the RGB color and the color temperature would be able to be controlled all the time.
Does the color_mode dp actually do anything with this light, given that there are separate switches for the White and Color?

Unfortunately it doesn’t work like that.
There is one main switch for light that controls the light based on the color_mode.
Also, there is a single brightness that also controls the light that is specified by color_mode.
I also checked and even in official Tuya integration, there is a single light object.

So what do the "White" and "Color" light switches do then, if the color_mode setting of the main light is what defines the mode?

Those will separately turn off/on the color or white light, but will mess
up with the main light on/off.
Also, there is no separate attribute to set color_temp for that light as
well and all the previous issues are there as well.
On Wed, Oct 30, 2024 at 7:04 AM Jason Rumney @.***>
wrote:

So what do the "White" and "Color" light switches do then, if the
color_mode setting of the main light is what defines the mode?
—
Reply to this email directly, view it on GitHub
https://github.com/make-all/tuya-local/issues/2361#issuecomment-2447279613,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACNWQLSLSOAQPDR44STCI2LZ6DRPTAVCNFSM6AAAAABPD4K4JOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBXGI3TSNRRGM
.
You are receiving this because you authored the thread.Message ID:
@.***>

To understand the best way to implement this, I need some answers to the true/false questions below.

When the color switch is off, changing the RGB setting of the main light does nothing.
When the color switch is off, changing the RGB setting of the main light automatically turns it on.
The light controlled by the color switch is a separate light from the main light.
The white switch and the color switch can be on at the same time
When the white switch is turned on, the color switch is automatically turned off and the color mode of the main light automatically changes.

Analysis on the provided config shows:
  Missing 110: 0
  Missing 34: False
  Missing 111: 77

34 is maybe a "Do not disturb" switch or "Initial state" setting, based on other lights with this feature.
The others are into the custom dp range (>100), so could be anything, but possibly independant brightness and/or color_temperature to go with the 107 and 108 switches.


Running any command in 2.0 causes trackpad to switch to 'scroll history'

I am - albeit experimentally - using Cloud9 IDE. I have just installed the latest version of .Net Core, and pulled down a repository I know works locally.
When I run any dotnet command, the terminal settings change. The trackpad begins scrolling through the command history instead of normal scrolling.
Not sure if this is a problem with .Net Core or Cloud9 so I'll be posting over on their forum as well.
Appreciate any help. If anyone else is facing this issue, use this command to repair the issue:
tput reset
Cloud9 Community Topic

@nguerrera , can you have a look?

Issue moved to dotnet/cli #7781 via ZenHub


feat: Added support for hidden inputs

Hidden Input support
Hiding input in TUI when hide_input=True for an option
@click.option("--foo", hide_input=True)
def exec(foo):
     ...

Closes #29
(awesome!)

Thanks for this!
Does it make sense to have hide_input on options that don't have prompt? My gut feeling is that hide_input is not something that Trogon should handle at all, since it's Click that will accept the input for it.
I think if the option has prompt=True or hidden=True, then we should just not render any widget for it in the form.

Makes sense how about having something that gives info on hide_input flag for a command even if it isn't rendered then?

I think hide_input doesn't make sense, since hide_input is something Click uses when prompt=True to hide the characters the user types. All of the prompt stuff is handled inside Click.

I think hide_input doesn't make sense, since hide_input is something Click uses when prompt=True to hide the characters the user types. All of the prompt stuff is handled inside Click.

makes sense I'll change it ⚡

Based on @darrenburns remarks, it would make the most sense that Trogon presented textboxes for these arguments that redacted user input; a textbox for secrets. Does Textual provide such a widget?

Based on click docs, the proper way to handle these options is self-evident, IMO.
https://click.palletsprojects.com/en/8.1.x/api/#click.Option

hide_input (bool) – If this is True then the input on the prompt will be hidden from the user. This is useful for password input.

hidden (bool) – hide this option from help outputs.

Will the hidden option also be tackled in this pr? My organisation can't wait to use trogon, but is blocked by #29

I have a (hopefully temporary) fork of Trogon to make click an optional dependency.
https://github.com/Textualize/trogon/pull/38
In this fork, I just implemented the ability for Trogon to:

omit hidden parameters and subcommands (hidden=True)
show read-only input for required prompts (prompt=True, prompt_required=True)
redact sensitive values (hide_input=True)  <-- This was tricky!

https://asciinema.org/a/0aa5accX2QcN2D8oFwyCYty69
:crossed_fingers:


Jest related error when running gridsome develop

Here is a link to a bug issue opened i gridsome github but apparently related to Jest:
https://github.com/gridsome/gridsome/issues/252#issue-418312824

This example doesn't work in the latest version<EMAIL_ADDRESS>because stderr is null when setting silent: false or stdio as anything other than 'pipe'.
const worker = new Worker('/path/to/worker.js', {
  forkOptions: {
    silent: false
  }
})

I've reproduced this same issue.

Thanks @hjvedvik! That makes perfect sense. We made the change since we got a type error - turns out our internal types were wrong (not really surprising)! Will have a PR with a fix up shortly


https option?

can you add to config https option?

Works fine with e.g. Sitemap::Generator.instance.load(:host => "mywebsite.com", :protocol => "https") do


404 at /Machine/%EF%BC%89%E3%80%82

I found a broken link : https://docs.docker.com/Machine/）。
I arrived on this page through: https://ask.csdn.net/questions/384324

Hey @suihan10
Thanks for reporting the broken link. Please report this issue on the source page where the link is located.


Add Experiment and Phase objects for orphan Blocks

Cf. #1211.

Closed as this is incorporated into #1227


Wrong middleware name in docs

Change "caffeinate" to "caffeinated".

Thanks for submitting this!

Thanks for the package! Appears to be just what I needed.


Teams Toolkit not loading

All the tabs are not loading at all.
I've deleted the cache of VS Code and reinstalled it for about 5 times already. I've reinstalled the Teams Toolkit and restarted my PC, logged off and in again in VS Code with my Azure Account, yet the Teams Toolkit Tabs will remain empty:

Thanks in advance.

/causedByExtension


How can merge cells in xlsx populate

Please read the docs. Usage questions can be asked on StackOverflow. Issues are for bugs/feature requests.


Methods on an PeriodIndex that return an empty set don't return a PeriodIndex object

In [27]: period_index=pd.PeriodIndex(start='2015-01-01',end='2015-03',freq='B')
period_index
Out[27]: <class 'pandas.tseries.period.PeriodIndex'>
[2015-01-01, ..., 2015-03-02]
Length: 43, Freq: B

In [28]: period_index.difference(period_index)
Out[28]: Index([], dtype='object')

I think this should return an empty PeriodIndex object, not an empty Index object.
This happens because if there is an empty set as a result of difference, the object doesn't check its type before creating an empty version of itself: https://github.com/pydata/pandas/blob/v0.16.0/pandas/core/index.py#L1360. Generally I've seen a better construction for that line be type(self)([]).
I'm happy to make this PR, although I'm not sure whether I'm missing something on the intention. If I'm not, should this be executed by adding something in Index's difference method, or overriding that method in PeriodIndex?
A method that removed items from the index would avoid any subclass-specific code, but the drop method also has some odd behavior:
In [25]:
period_index.drop(period_index)
Out[25]:
Int64Index([], dtype='int64')

So if you're creating a new object, you'd need to check the freq of the PeriodIndex too, given an empty PeriodIndex constructor needs a freq. Something like type(self)([], freq=self.freq, name=self.name). Are there cases for other subclasses of Index?

PeriodIndex for sure has some of these types of issues (people have been slowly working there way thru).
The constructors should almost always be
self._shallow_copy(....) (you can pass a new values as the first arg, the meta data will be propogated

sym_diff is also affected.
period_index.sym_diff(period_index)
Index([], dtype='object')

union and intersection should work for empty PeriodIndex, but nice to have explicit tests.
pidx
# PeriodIndex([], dtype='int64', freq='M')

pidx.union(pidx)
# PeriodIndex([], dtype='int64', freq='M')
pidx.intersection(pidx)
# PeriodIndex([], dtype='int64', freq='M')

closed by #10599


Cannot change dropdown item text color

Is it possible without making an adapter?

@Abhaya-Sood sorry for the late response.
You can achieve this with the Custom Spinner Adapter.


Add files via upload

Howdy @abdo098ub, can you clarify the purpose of this PR?

Howdy @abdo098ub, feel free to re-open with more context, but I can't really understand why we'd want this in our repo.


docs still mention default.toml

which no longer exists

Closed by https://github.com/nrc/rustfmt/pull/315.