createTranscription File type does not exist in node

Describe the bug
createTranscription's interface is defined as: createTranscription(file: File, ....)
However, File does not exist in node.js. This is a browser only class.
What is expected here? A return value from fs.readFileSync?
To Reproduce
const file = fs.readFileSync(audioOutputFilePath)

const transcript = await openai.createTranscription(new File([file]), ...) // File does not exist

Code snippets
No response
OS
macOS
Node version
Node v14.19.0
Library version
openai 3.2.1

have same problem

have same problem

I believe this is mostly a typing issue in api.ts with the file param. The code doesn't actually use any File properties. Also, the docs show a different usage using :
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const resp = await openai.createTranscription(
  fs.createReadStream("audio.mp3"),
  "whisper-1"
);

You can use //@ts-ignore for the time being and use @ajsharp's example above and it will work for the time being
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);

//@ts-ignore
const resp = await openai.createTranscription(fs.createReadStream("audio.mp3"), "whisper-1");

It's not working for me, and if you look at the source code on line 2541:
if (file !== undefined) {
    localVarFormParams.append('file', file as any);
}

It's appending the file to the FormData object. All of those are native DOM objects. It must be a File instance to work.

@demian85 I don't think that's correct. This library uses axios as it's HTTP lib, which will take a Buffer or any sort of buffer-like object. File basically just adds a few mostly information properties to Buffer.
That code you referenced is just coercing the object for typescript's sake, it's not really doing anything File-specific.
Here's some code I'm using, which doesn't use the openai library, but essentially does the same thing:
import axios, { AxiosError } from "axios";
import * as FormData from "form-data";

const apiKey = "YOURKEY";
const apiUrl = "https://api.openai.com/v1/audio/transcriptions";

export async function createTranscription(file: Buffer, fileName: string) {
    const formData = new FormData();

    formData.append("file", file, {
      filename: fileName,
      contentType: "audio/aac",
    });
    formData.append("model", "whisper-1");
    formData.append("response_format", "json");
    formData.append("language", "en");

    // Send a POST request to the OpenAI API
    const response = await axios.post(apiUrl, formData, {
      headers: {
        ...formData.getHeaders(),
        Authorization: `Bearer ${apiKey}`,
      },
    });
    return response;
}

It's not working for me, and if you look at the source code on line 2541:
if (file !== undefined) {
    localVarFormParams.append('file', file as any);
}

It's appending the file to the FormData object. All of those are native DOM objects. It must be a File instance to work.

I'm trying this, but I'm getting a 400 error, at least when trying to pass a Buffer object. I think the 400 is happening because openai relies on the file name and content type coming from axios in the multipart form data headers, but Blob and ReadStream doesn't contain any of that info.
Node's buffer package provides a node-native File class as of node 18 (I think), but it's still experimental (see https://github.com/nodejs/node/pull/47153), and I still get errors with it trying to use it with axios.
It seems like what's needed is a File-like utility class provided by this library to add the filename and content type metadata axios needs to the request body. Ideally this class would implement whatever interface axios expects.
Another option would be to have some utility code to manually add the content type and filename when appending the file to the axios payload. For example changing https://github.com/openai/openai-node/blob/51b1340e3182c4cb5d43a5b771606ecdd93a60f4/api.ts#L2475
to do something like this:
localVarFormParams.append("file", file, {
  filename: fileName,
  contentType: "audio/aac",
});

The form-data package accepts that interface, which i think is what this package uses to build multipart request bodies.

Hi, we have an upcoming version v4.0.0 that overauls File support; please give it a try and let us know in the thread whether it suits your needs!

Hi, we have an upcoming version v4.0.0 that overauls File support; please give it a try and let us know in the thread whether it suits your needs!

Just tried the new version out this morning
isFileLike from openai/uploads + OpenAI.toFile are game changers, much easier to integrate now 🥳

Thank you so much for the feedback @EddyVinck ! I encourage others here to give the v4 a try and share your experiences as well.


Publish to AWS failed to load, shows error: Unable to start a deployment session: A task was canceled

I have been trying to publish to our staging site. The other 2 developers in my team are able to use the same set of credentials and deploy successfully. Could you advise me on how to resolve this issue?

I am one of the other developers @ratemo86 is referring to. We've been unable to set up his account properly. We use SSO authentication, but as you can see in the screen shot, he's got access to the resources in the AWS Explorer... but when he goes to Publish there are problems.
We've spent many hours trying to figure this out and some assistance would be most appreciated.
Thanks so much!

Hi @ratemo86 , can you please share your toolkit log from the session where you saw this issue? You can get to your logs by navigating to the Extensions / AWS Toolkit / View Toolkit Logs menu.
Also, we can try to rule out whether or not the underlying deploy tool is successfully downloaded:

check that %localappdata%\AWSToolkit\aws.deploy.tools \ (2019 or 2022 depending on your VS version) \ contains files. You might want to even delete that folder and re-launch Visual Studio in order to have the Toolkit attempt to re-download the tool
can you please check your NuGet sources, both in Visual Studio and on the command line with dotnet nuget list source ? You'll want to confirm that nuget.org (https://api.nuget.org/v3/index.json) is enabled and in your list.

@dtechfish Did you ever figure anything out for this? We are running into this exact same error, exact same exception in the logs.

No.  Still struggling.
From: Nick Miller @.>
Sent: Friday, November 22, 2024 1:09 PM
To: aws/aws-toolkit-visual-studio @.>
Cc: David Garcia @.>; Mention @.>
Subject: Re: [aws/aws-toolkit-visual-studio] Publish to AWS failed to load publish details using the current credentials: Error (Issue #427)
@dtechfishhttps://github.com/dtechfish Did you ever figure anything out for this? We are running into this exact same error, exact same exception in the logs.
—
Reply to this email directly, view it on GitHubhttps://github.com/aws/aws-toolkit-visual-studio/issues/427#issuecomment-2494599079, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEFQYMYFMBJ5GRT6QCR2LZD2B56LNAVCNFSM6AAAAABJFHCTLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJUGU4TSMBXHE.
You are receiving this because you were mentioned.Message ID<EMAIL_ADDRESS>

Ugh! Thanks for responding.

@dtechfish @nicklmiller we are interested in understanding more about this failure.
What is interesting in the logs is there seems to be a gap of about two minutes between the "Starting a deployment session" entry and the "Unable to start a deployment session: A task was canceled" entry. If this isn't consistent in your logs, please let us know.
Can you share some details about your development environment:

what region is selected in your AWS Explorer before you try to launch Publish to AWS? (for example, is it a region on the other side of the world, is the region a newer opt-in region, is the region in a different partition like Govcloud or China)
what type of credentials do you have set up? (is it a typical access key-secret key pair? is it SSO based? some other type?)

The Publish to AWS experience is powered by the AWS Deploy Tool for .NET, which is a CLI tool. If you can try to deploy the same project with that tool, it would be helpful for us to know if that deployment succeeds for you, and if it doesn't, what failure output it displays.

I am also seeing the same problem. The legacy tool works fine.

@awschristou
This occurred with US West (Oregon) selected, and the computer was in Florida.
It was with an access key/secret pair.
We are actually able to open AWS Explorer and interact with the Elastic Beanstalk environment there, doing commands like rebuild and restart, but just get this error when trying to publish. You are right that it hangs for a while before the error happens.
I'll see if I can get it published via CLI.

@nicklmiller thank you for the details, looking forward to hearing about your results with the CLI.
@cceccles99 , please see https://github.com/aws/aws-toolkit-visual-studio/issues/427#issuecomment-2504558048 to share useful details that can help us diagnose the problem.

@nicklmiller how many Beanstalk environments (and applications) do you currently have in the Oregon region? Were all of those deployed through the Toolkit, or were some of them created through other means, for example using CDK, Terraform, or directly in the web console?

@awschristou We have 2 applications, with 2 environments per application, all in Oregon. They were all created initially through the web console.
Additionally, I'm not sure if I mentioned this already, but publishing used to work, it just stopped one day. One thing that did change on our end was that we previously had 2 applications with only 1 environment each. I spun up an additional environment on each application, and shortly after was when the error started occurring. It could just be a coincidence, but thought I should share.

@nicklmiller Any chance you have the toolkit configured to use a proxy? Toolkit proxies are configured in the Tools -> Options - AWS Toolkit menu. Or are there any proxies setup in your network environment?

@nicklmiller thank you for the details, looking forward to hearing about your results with the CLI.
@cceccles99 , please see #427 (comment) to share useful details that can help us diagnose the problem.

I was using London region with access from the UK (about 250 miles from London).
I'm using SSO with EntraId.
There are 6 beanstalk environments.
Also I noticed that it seems to be some kind of timeout as there is a delay of about 1 minute 40 seconds with nothing happening before the error message appears.
If I use the legacy tool with the same credentials it works with no problems.


Fix download for when proxy is not passed for backward compatibility

#32 breaks existing codes using gdown:
  File "/home/pazeshun/apc_test_ws/src/jsk_apc/demos/grasp_fusion/ros/grasp_fusion/python/grasp_fusion_lib/data/utils.py", line 95, in download
    gdown.download(url, temp_path, quiet=quiet)
TypeError: download() takes exactly 4 arguments (3 given)

This is because existing codes pass 3 arguments to download function while #32 adds new required argument proxy.
This PR fixes that by adding default value to proxy.

I'll add test. Wait a minute.

CI correctly failed in #34 and passed in this PR.
@wkentaro Could you review this?

Released v3.9.1


Add first interaction action to better inform newcomers

Creates a first interaction action.
https://github.com/actions/first-interaction

[x] Add the first issue message.
[x] Add the first PR message.
[ ] Ask the comms team input for the messages

I think this is a great idea and will like this to be implemented. Github knows when a contributor is new and we can use this information to give more detailed instructions.

The "Be patient." at the end sounds very aggressive. I would go for something like "thank you for your patience" instead 😅

Thanks!


S3 Express One AZ Support

/feature
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
Not sure if current S3 mountpoint CSI driver can support S3 express or not. I tried with existing static provision example, but it failed. If it is already supported transparently, would suggest to have either an example or doc for it. I am also would like to contribute for the example if it's already supported.
Describe the solution you'd like in detail
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

Thank you for the feature request! We are currently actively working on this feature and our ETA is to have a new release that supports Mountpoint version 1.3.1 (which supports S3 Express One Zone) by the end of this week! Will update you when this release is cut.

We've released v1.1.0 of the driver which includes support for S3 Express One Zone! Here's an example which includes how to set the availability zone of the pod as well.

Hi @dlakhaws , thanks for your update. I noticed the v1.1.0 has not been released as EKS managed addons, as of today Dec 7. So I just mannually updated my s3-csi-driver image from the daemonset.
However, it is still not able to mount the the s3 express volume, and got below errors.
Error: Failed to create mount process
  Warning  FailedMount  114s  kubelet  MountVolume.SetUp failed for volume "s3-express-pv" : rpc error: code = Internal desc = Could not mount "s3-express-us-east-1a--use1-az4--x-s3" at "/var/lib/kubelet/pods/7d0b8db4-0707-4529-96ce-3ebdc4e5925c/volumes/kubernetes.io~csi/s3-express-pv/mount": Mount failed: Failed to launch systemd service mount-s3-1.3.1-84ca2a50-ac1d-44db-9c77-a9a2fb7f930a.service output: Error: Failed to create S3 client\r
\r
Caused by:\r
    0: initial ListObjectsV2 failed for bucket s3-express-us-east-1a--use1-az4--x-s3 in region us-east-1\r
    1: Client error\r
    2: Unknown CRT error\r
    3: CRT error 14343: aws-c-s3: AWS_ERROR_S3_INVALID_RESPONSE_STATUS, Invalid response status from request\r
Error: Failed to create mount process
  Warning  FailedMount  73s (x4 over 8m5s)  kubelet  Unable to attach or mount volumes: unmounted volumes=[persistent-storage], unattached volumes=[], failed to process volumes=[]: timed out waiting for the condition

I did have the bucket created, and specified correct region and AZ; also for the IAM role I already gave s3 full access to simplify the testing. So do you have any hints?

You are right @dlakhaws . It's working now with the policy you suggested. I was not aware it is a separate permission group for S3 Express. Thank you so much


bugfix: return visualized svg for SmilesVisualizer

Codecov Report

Merging #286 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master     #286   +/-   ##
=======================================
  Coverage   83.24%   83.24%
=======================================
  Files         147      147
  Lines        7092     7092
=======================================
  Hits         5904     5904
  Misses       1188     1188


MediaElementAudioSource outputs zeroes due to CORS access restrictions for http://<IP_ADDRESS>:5000/talk.wav

I use this
 const audio_link = "http://<IP_ADDRESS>:5000/talk.wav"
 model.motion('test', 0, 3, audio_link)

but my browser show me an info about cors restriction like:
MediaElementAudioSource outputs zeroes due to CORS access restrictions for http://<IP_ADDRESS>:5000/talk.wav
Then. there was nothing voice on my Live2D page.
How can I deal with it?

I think I have dealed with it by adding a line audio.crossOrigin = "anonymous"; in cubism4.es.js.
It worked !


Request for Data Access

Hello, thank you for your excellent work. I'm very interested in the scVAEIT method. I've encountered the same issue of not being able to find the DOGMA_pbmc.h5 file. If possible, could you please share this data with me? I would greatly appreciate it. My email is<EMAIL_ADDRESS>Thank you!

Hi, thanks for your interest. Please find the dataset through the link here to Google Drive.

Data received, much appreciated for your sharing!


bundles.py doesn't be imported from app.py in sample code

Dear colleague,
I am  trying to do invenio-previewer's example/app.py tutorial.
https://github.com/inveniosoftware/invenio-previewer/blob/master/examples/app.py
But 'flusk npm' command make just only  'package.json' with angular.
There aren't any bundle.py's npm settings in the package.json.
So, I added code like this to import the npm assets according to invenio-assets usage .
examples/app.py
import invenio_previewer from bundles
assets = InvenioAssets(app)
assets.env.register( 'csv_previewer_js', bundles.csv_previewer_js )

If there is any good alternative methods for reflecting the settings, could anyone advice me?

@yohei-ocean Normally asset bundles are registered via the invenio_assets.bundles entrypoint, and this is how flask npm knows which packages to include in the produced package.json. If you are building a new previewer in your own repository/module that introduces new bundles, you'll have to add the appropriate entry in your setup.py (don't forget to run pip install -e ., since setup.py entrypoint changes aren't automatically picked up)

@slint I forgot to do 'pip install -e .'. Every npm were imported. Thanks your advices.


60kb IDL Limit

In some cases, my IDL's are much larger relative to program size so I have run into cases where my program is a valid size but the Anchor CLI won't let me upload the IDL onchain. Would like to make this configurable and upload larger IDL if the user is will to pay for it.

I can put up a PR but not sure if there are other constraints via the program build that would prevent this. Assuming you would need to know this when building the program.

What is the size of your IDL? We're also compressing it before writing it on-chain, so the compressed size information would also be helpful.
I don't see why we wouldn't be able to increase it further. However, it's likely the default way of storing the IDL will be inside the program binary itself (rather than a PDA) in the not-so-distant future (https://github.com/coral-xyz/anchor/issues/3225).


docs: describe mise behavior when mise version is lower than min_version

Thanks for fixing my previous PR. This PR addresses @glasser's comment.

Thanks. Also it's not clear to me what section this key goes in — the other ### headings are section names?

Oh, I see, it's actually not in a section — that might be worth stating explicitly!

Actually experimenting with this for once, it looks like the impact of this (similar to, say, a TOML parse error) is that mise does not update PATH (etc) but also doesn't actively clear PATH entries from previous mise runs.

it's actually not in a section — that might be worth stating explicitly!

I would keep this out of this PR because other sections follow similar style.

Actually experimenting with this for once, it looks like the impact of this (similar to, say, a TOML parse error) is that mise does not update PATH (etc) but also doesn't actively clear PATH entries from previous mise runs.

Good find. This looks like a problem but a trivial one. It's easy to reload the interactive shell for mise users. If there are more complains, we could look into it. What do you think?


Fix missing / outdated deps for some OSes in LNBits guide

What
Fixes missing / outdated deps for some OSes (tested on Ubuntu Server 20.04.4 LTS) in LNBits guide.
Scope

[ ] significant change to core configuration
[X] independent bonus guide
[ ] simple bug fix

Fixes #985.

Moved apt install deps to "Preparations" section.


Fix express typings compatibility bug

Is there anything specific needed for this to be merged?

That's an excellent question. As you can see, the PR is over a year old so I don't recollect the context around it. If the code here works for you then I can merge it.


Getting error on iOS

Getting the following error on iOS and datepicker is not working
CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:1486:24: ERROR TypeError: _co.pickDate is not a function. (In '_co.pickDate()', '_co.pickDate' is undefined)

Added ModalDatetimepicker to provider, now i'm not getting this error


fix: improve token selection behavior in swap form

Remove redundant non-selectable dependencies
Update form interface
Move token selection out of form responsibility

:tada: This PR is included in version 1.1.6 :tada:
The release is available on:

GitHub release
npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:


Disable Cache?

Feature motivation
I have a mono project that contains multiple workspace bundles like library-a, library-b, library-c, app-a, app-b. Each bundle is written in TypeScript and they may depend on each other. For easier understanding, suppose that library-c depends on library-b, and library-b depends on library-a, and app-X depends on all libraries (library-a, library-b and library-c), as below:
library-a  <-- library-b <-- library-c <-- appX
            \             \
             \             app-X
              \
               app-X

I'm using esbuild / babel-loader in development process, so that .d.ts is not available. During building process, library-a will build a development js bundle first, which is then used by library-b and app-X. Since the dependency of library-b is changed, it is rebuilt as well, result in a new library-b bundle, which then cause library-c to rebuild, etc. Each library is marked as an external, and they are not bundled together.
To make type checks work, I added tsconfig alias, like:
{
  "compilerOptions": {
    "paths": {
      "@foo/library-a": ["packages/library-a/index.ts"],
      "@foo/library-b": ["packages/library-b/index.ts"],
      ...
    }
  }
}

However, for the ForkTs plugin, when library-a is changed, type checks in library-b and appX is outdated and becomes incorrect, since for library-b no .ts file is changed, only .js is changed.
This can be migrated by adding ts file from library-a to the file watch list of library-b. However, it means whenever there is a change in library-a, library-b will be rebuilt twice (1 for unneeded .ts, 1 for updated js bundle file). Similarly, each rebuild in library-b will then cause library-c to rebuild twice. Eventually each appX will be rebuilt number of times for each change in library-a.

Feature description

I would like to disable ForkTs plugin cache, so that even if no source .ts file is changed, type checks are performed correctly based on latest disk contents.
Feature implementation

Hi! Could you provide a reproduction repository that represents the issue that you would like to solve? There is no cache like you described in the plugin itself so it can be some bug or misconfiguration of the TypeScript

Hi, I bypassed this issue by running another TypeScript check process independently. I would re-open this issue if I move back to this plugin and can produce a reproduction. Thanks!


Proposal: Extension point for TCP implementations

Problem
Endpoints are the lowest-level networking layer in the gRPC core. The most commonly used endpoint is the TCP implementation. We have seen increasing demand for different endpoint implementations, including alternate TCP stacks and TCP-like protocols. Some of these would be too special-case to support within the gRPC core itself.
Solution
Our solution to this is to add add public APIs (with respect to the C core) that allow the existing endpoint implementations to be modified or replaced.
Proposed Implementation
We will make the header files src/core/lib/iomgr/tcp_client.h and src/core/lib/iomgr/tcp_server.h public, with vtable definitions in place of function definitions to allow for extensibility. They would look something like this:
tcp_client.h
typedef struct grpc_tcp_client grpc_tcp_client;
typedef struct grpc_tcp_client_vtable {
  void (*connect)(grpc_exec_ctx *exec_ctx, grpc_closure *on_connect,
                  grpc_endpoint **endpoint,
                  grpc_pollset_set *interested_parties,
                  const grpc_channel_args *channel_args,
                  const grpc_resolved_address *addr,
                  gpr_timespec deadline);
  void (*ref)(grpc_tcp_client *client);
  void (*unref)(grpc_exec_ctx *exec_ctx, grpc_tcp_client *client);
} grpc_tcp_client_vtable;

struct grpc_tcp_client {
  const grpc_tcp_client_vtable *vtable;
};

tcp_server.h
typedef struct grpc_tcp_server_acceptor // as currently defined;
typedef void (*grpc_tcp_server_cb) // as currently defined;
typedef struct grpc_tcp_server grpc_tcp_server;

typedef struct grpc_tcp_server_vtable {
  void (*start)(grpc_exec_ctx *exec_ctx, grpc_tcp_server *server,
                grpc_pollset **pollsets, size_t pollset_count,
                grpc_tcp_server_cb on_accept_cb, void *cb_arg);
  void (*add_port)(grpc_tcp_server *s,
                   const grpc_resolved_address *addr,
                   int *out_port);
  void (*ref)(grpc_tcp_server *s);
  void (*unref)(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s);
  void (*shutdown_starting_add)(grpc_tcp_server *s,
                                grpc_closure *shutdown_starting);
} grpc_tcp_server_vtable;

struct grpc_tcp_server {
  const grpc_tcp_server_vtable *vtable;
};

typedef struct grpc_tcp_server_factory grpc_tcp_server_factory;

typedef struct grpc_tcp_server_factory_vtable {
  void (*create_server)(grpc_exec_ctx *exec_ctx,
                        grpc_closure *shutdown_complete,
                        const grpc_channel_args *args,
                        grpc_tcp_server **server);
  void (*ref)(grpc_tcp_server_factory *f);
  void (*unref)(grpc_exec_ctx *exec_ctx, grpc_tcp_server_factory *f);
} grpc_tcp_server_factory_vtable;

struct grpc_tcp_server_factory {
  const grpc_tcp_server_factory_vtable *vtable;
};

The existing headers with function declarations will stay internal, and src/core/lib/iomgr/endpoint.h will be split, with the vtable and struct definitions moved to an external header, and the function declarations staying in an internal header. Like with the endpoint code, the only explicit implementations of the client and server interfaces will be vtable calls, and the existing implementations will change to define vtables.
We will also add two channel arg keys to allow API users to use their TCP implementations with their channel or server. I propose "grpc.tcp.client", which will have a pointer value of type grpc_tcp_client* and "grpc.tcp.server_factory", which will have a pointer value of type grpc_tcp_server_factory*.
These interfaces use types from other iomgr headers, so the following headers from src/core/iomgr/ will also need to become public:

closure.h
error.h
exec_ctx.h
pollset.h
pollset_set.h
resolve_address.h
resource_quota.h

plus src/core/lib/support/mpscq.h

@murgatroid99
It looks promising but may I ask you for a usage model for this?
As I understand, the channel will have additional keys to expose the endpoint type to other side. What endpoint is planned to use to transmit this information?
The gRPC server have to support different clients at the same time. How it should switch endpoint from default (tcp) to user requested?
I thought the workflow looks like:

client: creates alternative endpoint and a channel based on it.
client: send handshake request with special endpoint information to the server using default, tcp based gRPC endpoint, connection.
server: if server doesn't support alternative endpoint, it reject this connection.
server: if server supports this type of endpoint, it send server side alternative endpoint information to the client.
server: creates alternative endpoint, change current endpoint (tcp based) to alternative communication way and wait for an events on new file descriptor.
client: receive handshake information from the server via default channel (tcp). Change current connection method to alternative.
client and server: Do RPC via alternative endpoints
Shutdown procedure should destroy alternative endpoints and fallback into default gRPC tcp based endpoints. gRPC finishes the channel shutdown using default procedures.

One more question if you don't mind.
What is deadline/time shedule for implementation of the proposed changes?
@miked-mellanox FYI

Using this API would be a lot simpler than all that. The client and server would each be initialized with compatible endpoints using the channel arguments, then they would communicate using those endpoints. The "grpc.tcp.client" argument would only be used on the client side, and the "grpc.tcp.server_factory" argument would only be used on the server side.
We plan to get this done this quarter, assuming there are no major issues.

@murgatroid99 If there has been any work done in this regard, can you please share the branch. I was looking to do some work with regards to moving to a different low level transport system for our embedded systems.

I haven't started implementation work on this yet. But I have created a more formal proposal at grpc/proposal#8 to solidify the design.

It looks like the referenced proposal has been dropped. Is there any progress on this feature? Thanks.

There has been no progress, and it is likely that if something like this ever happens, it won't be in this form.


Added syntax highlighting to the README

Thank you very much!
Your changes have been merged in https://github.com/delight-im/Android-AdvancedWebView/commit/da9c379ec85d744e6bb72947be535b6a7790ef76


Zypper install stays hanging "Reading installed packages" inside system container - sysbox 0.6.1

Hello,
It's my first time writing an issue, so if I miss any important information in here just let me know, I'll be glad to provide it.
I have a system container that I'm running using the new sysbox version 0.6.1.
It's a opensuse leap based container, version 15.2. In this container I'm trying to install some packages using zypper, however when I perform any install commands it hangs while "Reading installed packages". On the previous version I had no problem doing this.
I have searched on opensuse forums for a solution to this , however what I found does not fit my scenario:

One of the solution was to delete the lock file from zypper and perform the command again, but I have no lock file.
Other solutions were based on restarts and some problems related with the usage of the GUI installer which I don't have as well.

Also thought it could be related with some network issues but inside this container I'm able to retrive data from website like google or perform wget commands on resources available on repositories.
Given this I'm a little bit lost on what else to try since I'm not sure where to look more to try and find the issue.
Thanks for your help in advance.

Hi @pedromorais11, thanks for giving Sysbox a try, hope you find it useful.

It's a opensuse leap based container, version 15.2. In this container I'm trying to install some packages using zypper, however when I perform any install commands it hangs while "Reading installed packages". On the previous version I had no problem doing this.

Did you mean it worked with the previous version of Zypper or the previous version of Sysbox (v0.5.2)?

Given this I'm a little bit lost on what else to try since I'm not sure where to look more to try and find the issue.

The best way to debug this is to trace the system calls for Zypper inside the Sysbox container so we can understand why it fails.
To do this, try the following:

Create the sysbox container (e.g., docker run --runtime=sysbox-runc -it --rm <YOUR_IMAGE> bash)

On a different terminal, do a pstree -SlpgT and find out the process ID (PID) of the container's init process. It will look like this:

─containerd-shim(45674,45674)───bash(45696,45696)    <<< THIS IS THE CONTAINER'S INIT PROCESS

Strace that process and all it's children:

strace -f -p <PID> -o ~/strace.txt

Run Zypper inside the Sysbox container and let if fail.

Exit/stop the Sysbox container.

Upload the strace.txt output and I can help you take a look. Typically you'll see syscalls that error out with "EPERM" and such, those are the ones to look at.

Hope that helps!

Hi @ctalledo, for sure very usefull. :100:
Thank you very much for your support, I'm in the middle of some other topics right now but I'll be sure to try that as soon as I can. I'll come back with the output after. Thanks again!

First answering your question: it worked with the previous version of Sysbox (v0.5.2). Sorry, missed that one.
So I did what you proposed. Here is the output:
strace.txt
Part of the logs are showing that it's trying to get information on files that do not exist and are under /sys/kernel folder.
I've seen this folder was hidden on this last 0.6.1 release and if I perform a ls -la I can confirm this:
dr-xr-xr-x  13 nobody  nobody    0 May 19 10:10 sys
I also took the chance to look at the logs from zypper and noticed that he gets stuck at this point:
2023-05-19 10:42:36 <1> b07ba8fa4953(3217) [MODALIAS++] Modalias.cc(Impl):146 Using /sys directory.
I had a friend who had the opportunity to check this file Modalias.cc referenced in the previous log line in the libzypp source code and they provide a command for debugging in case of errors:
find /sys/ -type f -name modalias -print0 | xargs -0 cat >/tmp/modaliases
When I do this it begins to drop logs in an endless loop and it is getting on a loop. One example of the logs lines that can be seen is this one:
find: File system loop detected; ‘/sys/devices/virtual/block/dm-0/holders/dm-1/subsystem/nvme0n1/device/device/firmware_node/device:03/power_resources_D0/LNXPOWER:00/subsystem/devices/ACPI0003:00/physical_node/subsystem/devices/ACPI000E:00/firmware_node/wakeup/wakeup62/subsystem/wakeup0/device/physical_node/iommu/devices/0000:00:01.0/0000:01:00.0/consumer:pci:0000:01:00.1/consumer/sound/card0/controlC0/subsystem/card1/input35/event20/subsystem/event10/device/device/hidraw/hidraw5/subsystem/hidraw0/device/subsystem/devices/0003:1050:0407.0009/input/input43/input43::capslock/subsystem/phy0-led/device/net/wlp0s20f3/phy80211/rfkill2/subsystem/rfkill0/device/input/input23/event4/subsystem’ is part of the same file system loop as ‘/sys/devices/virtual/block/dm-0/holders/dm-1/subsystem/nvme0n1/device/device/firmware_node/device:03/power_resources_D0/LNXPOWER:00/subsystem/devices/ACPI0003:00/physical_node/subsystem/devices/ACPI000E:00/firmware_node/wakeup/wakeup62/subsystem/wakeup0/device/physical_node/iommu/devices/0000:00:01.0/0000:01:00.0/consumer:pci:0000:01:00.1/consumer/sound/card0/controlC0/subsystem/card1/input35/event20/subsystem’.
So we are assuming that this has something to do with the process of making this /sys folder hidden inside the container. If we change the environment variable inside the container ZYPP_MODALIAS_SYSFS, that is a variable that hosts a location where zypper is reading this installed packages (as far as I've understand), to a different location the zypper install command works just fine.
I wonder why they have these lines to debug in this part of the code :smile: maybe they have run into similar issues in the past.


Wireless functionality?

Is there a possibility to configure this with a microcontroller that has a wireless module?

It's possible to port this to other MCUs with a bit of refactoring. The Arduino Nano RP2040 Connect does have an integrated Bluetooth module, so it would techinically be possible there. Having said that, Bluetooth HID is different than the current USB HID and it's not an easy addon.
While this would be awesome, it would require someone with knowledge of Bluetooth protocols to make it happen, which is unfortunately not me at the time.


[WIP] Enabling Solaris testing in JDK8 build pipeline

We should be able to run these tests now. Adding them into the
automated pipeline.
Signed-off-by: Adam Farley<EMAIL_ADDRESS>

It seems like only these two single-line changes are required to enable testing for this, as the test jobs should be automatically generated at the end of the build job.
Second opinions welcome. Could I be missing something?

Looks correct.  To note that 'default' means that nightly default is run nightly and nightly + weekly is run on weekend & releases, as defined in the defaults.json file.
So, the only other thing to watch out for would be do we have enough machine resource to cover that amount of testing.

Looks correct. To note that 'default' means that nightly default is run nightly and nightly + weekly is run on weekend & releases, as defined in the defaults.json file.
So, the only other thing to watch out for would be do we have enough machine resource to cover that amount of testing.

My theory was that, since we're only testing Hotspot JDK8 on these platforms, there's nothing else competing for the available machines (except for the JDK11 sparcv9Solaris builds, which don't run tests).
48 hours feels like more than enough time, given the run time of the default test sets on other platforms.
e.g. jdk8 on linux builds in 30 mins and takes 461 minutes to test (nightly). That's 7 hrs, 11 mins.
Solaris x64 builds in 20 mins, so assuming proportional run time for tests, just one machine should chew through all the tests in around 5 hrs.
Solaris sparcv9, however, takes 1 hr and 30 mins (ish) to build. Proportional testing times gives us an assumption of around 21 hrs for testing. Running once every 2 days still gives us 48hrs of runtime though, so we should be safe.
So we're probably fine, but I should still check on test runtime come Monday morning.

Based on a quick look at: https://ci.adoptopenjdk.net/label/sw.os.sunos/
there appears to be 1 sparcv9_solaris machine for test and 0 x86_64_solaris machines for test.  Will suggest holding off on merging this until we actually have machines available for testing, alternately, the PR can be adjusted to reducing the amount of testing for sparcv9_solaris and not enabling for x86-64_solaris until more resource is available.

Thanks @sxa for adding an x86_solaris machine to the pool, given that, we can try this out and see if amount of testing needs adjustment/reduction, or if given its only for jdk8 we get through the set before the next nightly is triggered.


404 error

Hi,
I am still getting 404 error. Can you please help to resolve this?

i have the same error ..

Hi, how did you solve this issue? I cloned the project locally and I just did an install but I get 404


[stable/prometheus] Prometheus server globals parameterization

Externalize global timing-related parameters to allow their easier modification, i.e. without the need to pass the whole configuration file. See #1550 for details. P.S. Sorry for being stupid for the first two unsuccessful attempts — this is my first personal contribution to the open-source project — being confused by an issue with invalid "user.email" which (for whatever reason) differs for GUI and command line tools, even if I set it up manually from the second one.

/remove-lifecycle stale

/reopen

/close


Feature request: Allow the user to change feed icons

The icons that NetNewsWire retrives for each feed is sometimes inaccurate, and I would like to have the ability to fix them.
For example, the bottom 3 feeds in the attached screenshot have incorrect icons. The Channel NewsAsia feed has an incorrect aspect ratio, and I would like to replace it with the channel's proper logo. Also, the Reuters and AP feeds are taken from a 3rd-party service that scrapes the respective Twitter accounts, and they consequently have the favicon of that service.

Could be cool to allow an emoji or an SF Symbol.

People would also like to change folder icons.

Coming here to upvote.
Now that Reddit has gone to RSS feeds, the icons for the RSS feeds are all the same, I'd love to be able to override the icon with my own custom icon

I'd also like this. I use a tool called kill-the-newsletter (source code) and when importing feeds created by it the icon is set to KTN's:

In this case I'd like to change the "Elixir Streams" icon. 😄


Refactor transaction tracking to allow for separate address per invoice and more sane event handling

Closes https://github.com/bitpal/bitpal/issues/9, https://github.com/bitpal/bitpal/issues/26, https://github.com/bitpal/bitpal/issues/27

@fstromback I'm having trouble retrieving txid from Flowee, could you help me out a bit here?
I get this from Connection:
%BitPal.Backend.Flowee.Connection.RawMsg{
  data: [
    {9,
     %BitPal.Backend.Flowee.Connection.Binary{
       data: <<31, 130, 166, 200, 190, 225, 71, 52, 156, 43, 185, 148, 193, 163,
         224, 115, 49, 237, 124, 63, 100, 112, 219, 171, 149, 241, 84, 140, 30,
         130, 77, 146>>
     }},
    {6, 1000},
    {8, 1518375},
    {7, 687955}
  ],

But txid that should be tagged 4 is missing.
I tried to record the binary data we got from Flowee and added it as fixtures for unit tests here. I hope that all the data we want is there, which it should if the docs is correct.
You can just do mix test test/backends/flowee/flowee_test.exs to run these specific tests. You can do it on master too, but I've made some minor refactors to the flowee handling in this branch that makes the test fail here (because txid is missing).

Sure, I'll have a look!

I just noticed that we do get txid, but only for one of the fixtures...
When a tx is seen it's ok:
on transaction: %{
  address: %BitPal.Backend.Flowee.Connection.Binary{
    data: <<31, 130, 166, 200, 190, 225, 71, 52, 156, 43, 185, 148, 193, 163,
      224, 115, 49, 237, 124, 63, 100, 112, 219, 171, 149, 241, 84, 140, 30,
      130, 77, 146>>
  },
  amount: 1000,
  txid: %BitPal.Backend.Flowee.Connection.Binary{
    data: <<2, 137, 190, 235, 119, 87, 16, 155, 89, 178, 155, 249, 78, 54, 122,
      66, 181, 163, 76, 208, 110, 171, 237, 219, 51, 59, 176, 83, 99, 164, 208,
      229>>
  }
}

But when it's confirmed, no txid:
on transaction: %{
  address: %BitPal.Backend.Flowee.Connection.Binary{
    data: <<31, 130, 166, 200, 190, 225, 71, 52, 156, 43, 185, 148, 193, 163,
      224, 115, 49, 237, 124, 63, 100, 112, 219, 171, 149, 241, 84, 140, 30,
      130, 77, 146>>
  },
  amount: 1000,
  height: 687955,
  offset: 1518375
}

Weird. And when I look at it, the txid isn't in the fixture... But surely we should get that data from flowee?
And another thing: I want to convert txid to strings, something like this: ff416d296da15607ba733ddd80362a1744920658111714913900c8e10a84942d, which we can view in an explorer.

I think I remember seeing this when implementing the interface, now that you mention it. I need to go and have a closer look at what Flowee does to see if this is the intended behavior, or if we need to tell it that we want txids somehow.
Converting them to hex is quite easy, it is just to convert the binary to hex (but reverse the bytes first, I don't know why they differ). I think I have a function for that in the module for bitcoincash addresses.

Converting them to hex is quite easy, it is just to convert the binary to hex (but reverse the bytes first, I don't know why they differ). I think I have a function for that in the module for bitcoincash addresses.

Sweet. Now I think the only thing holding this back is the missing txid for the confirmed notification.

I looked at the source code for Flowee to find out what is happening here. Indeed, in the file libs/api/AddressMonitorService.cpp it seems like Flowee does not send the TxId when the transaction has been accepted into a block.
Reading the code I also got a bit confused. It seems like it can return multiple "scripthashed" and "amount" tags at the same time. It seems like a single message might contain multiple transactions (contrary to the documentation), but I need to dig deeper to understand this properly.
If you have time, try (and capture) the following:

Subscribe to two addresses.
Send three transactions to these: two to the first, and one to the second. This all has to happen before a block has been mined, and all transactions have to end up in the same block.
We should get three "accepted into mempool" messages
The interesting part is if we get one or three "accepted into block" messages.

I will try to ask about this.

Reported to Flowee, see here

I got an answer from Tom. It seems Flowee is now sending TxId:s. I have not yet tested, but seems good.
Also: I need to re-do some part of that interface, since a transaction may have multiple outputs and we might get multiple outputs from Flowee there. In our case, I think it is just to look for the destination address we are interested in and see if the amount for that one is right.
I will look into this.

I saw that. Sounds good.


Error when creating a new file - Not Found

Bug Report
Current Behavior
The Action is returning an error when creating a new file.
Environment

version(s): v1.2.2

Possible Solution
N/A
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.

Not a bug with the Action code. This was a bug with the configuration within the Repository. The GH PAT was being used but the account had not been granted permissions to the repository (whoops!)


toast.js : Cannot read properties of null (reading 'classList')

Prerequisites

[X] I have searched for duplicate or closed issues
[X] I have validated any HTML to avoid common problems
[X] I have read the contributing guidelines

Describe the issue
I'm having the following issue in production on one website
Cannot read properties of null (reading 'classList')
At the lines
https://github.com/twbs/bootstrap/blob/bf6240dad9a466e9d3bc682abf416e9e5b4c66df/js/src/toast.js#L114-L116
My guess is that the element is already removed when that callback is called (i'm calling .dispose in the bs.hidden callback event I don't know if that's related or not. it should work without issues either way in my opinion).
Reduced test cases
My proposal is to simply add a null check before and return early if this._element is null
Demo
https://codepen.io/lekoalabe/pen/oNdPNXJ
click create modal
click create toast
accept sweet alert modal
try to click close icon on toast => it triggers the error
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
v5.2.2

ok so it's kind of hard to replicate but here it goes
https://codepen.io/lekoalabe/pen/oNdPNXJ
it can trigger a variety of errors I've listed in the codepen
i have to admit it's a bit extreme to have sweetalert, modals and toasts all over the place, but it shouldn't create js error anyway
you have to click around a fair bit to trigger the various error. the toast error is caused like this:

click create modal
click create toast
accept sweet alert modal
try to click close icon on toast => it triggers the error

This issue is related to #37245

@debadutta98 seems more complex than what I thought!

i'm not sure adding null checks will fix the root cause, but at least it would prevent js errors. these errors don't seem to prevent expected behaviour, so I think it should be pretty safe to add them.

I had a "quick" look to the given codepen.

You have imported the bootstrap.bundle.js twice, that was causing  modal.js:357 Uncaught TypeError: Cannot read properties of null (reading 'hide')

plus, I couldn't spot any referral to bootstrap.Toast 😖

Is a bit strange to find an error on bootstrap toast, without using it. 😵💫

@GeoSot sorry about that indeed i tried a couple of variations and indeed i left a duplicate import. without it i dont have the issue anymore (it still happens (without duplicates) in prod in another app but it's hard to replicate the exact setup).
not sure why importing twice would break everything though?
I'm using a "toaster" helper method that calls new bootstrap.Toast under the hood, i can extract this helper if that makes anything clearer but in any case, without the duplicate import i didn't find a way to replicate my issue

For sure, I can try to help only if you use the Bs components explicitly, and not inside another library. It is not possible to guess any side effects

@GeoSot so i managed to replicate it finally!
basically it's very tricky to get it by hand, which is why it happens rarely
if you click or double click on the close icon right when it's supposed to close, it will fail
I've simulated this with a setTimeout

I tried it a lot in comparison with a 'native' toast.  On your codepen example, for some reason (not able to debug all these lines 😞), the second click of the double-click, seems, it is finding the event listener still registered, so it tries to execute the hide process twice. In contradiction, this cannot be replicated on a native toast https://getbootstrap.com//docs/5.2/components/toasts/#live-example
So maybe the better scenario is to try to decouple the code a bit, or try to be based on the given events

Soooo I found some time to try your code
Using your script with some minor changes (you will find below), seems, it works ok
const html = `

      Bootstrap
      11 mins ago
      <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>

      Hello, world! This is a toast message.

`;

document.getElementById("toast-me").addEventListener("click", ev => {
  const container = document.getElementById("toast-container");
  container.innerHTML = container.innerHTML + html;

  const toastElList = document.querySelectorAll(".toast");
  console.log(toastElList.length);
   toastElList.forEach(toastEl => {

    const inst = bootstrap.Toast.getOrCreateInstance(toastEl, {
      autohide: true
    });
    inst.show();

    toastEl.addEventListener(
      "hidden.bs.toast",
      () => {
        // can cause issue with bs5
        // @link https://github.com/twbs/bootstrap/issues/37265
        inst.dispose();
        //toastEl.remove();
        console.log(inst, toastEl);
      },
      {
        once: true
      }
    );
  });

  setTimeout(() => {
    document.querySelectorAll(".btn-close").forEach((btn) => {
      btn.dispatchEvent(new Event("click"));
      console.log("click");
    });
  }, 5000);
});

@GeoSot i updated the pen with your code, it's still happening. you do have to click a crazy person to get the issue. I suspect there is some kind of race condition happening in rare cases when you click on the close icon (which is what i can gather from the error reporting in my production app)

@GeoSot Got the issue again on another project so i decided to have a look again
good thing is: i know what is the precise, reproducible error and updated the codepen accordingly
it happens if you double click fast on the close icon and if the instance was disposed on hidden callback.

removing animations fixes the issue => there is no delay in queue callback and therefore, double clicking has no impact
delaying the dispose with a timeout works also => this is what i will be doing for now :-)

therefore, i don't think there is anything really wrong with bootstrap itself if you don't dispose of toast instances on hidden. This is still a (minor) issue as soon as you try to create dynamic instances like I do and need to dispose of them afterwards and remove the actual html element from the dom.

in the same line of thinking, you can get similar issue with dynamic models where you get
undefined is not an object (evaluating 'this._config.backdrop')
some kind of issue: dispose&removing on hidden can lead to this


Auxiliary index

I wonder if it could be possible, even in theory, to build a sidecar index file that fundamentally contains only feature ID and offset/range of that feature in the fgb file. Use case that I have in my mind is to find a cadastral parcel by ID, or a building by a building ID from a large collection.  The index file would be small and fast to download and clients could keep it in the cache.
I have been reading some articles where people do not seem to miss external dBase indexes at all, or they hate the bunch of files needed for a complete shapefile. However, in cloud environment where every request has a price tag it could be a benefit to download the whole index into a cache and after that send http range requests only for fetching the data.

Don't mention the sidecar.. :P
Seriously though, unless I misunderstand you want this because the built in index is "too large" too fetch into cache because your case only needs feature id/offset index not the spatial index? That's pretty domain specific in my opinion and I would need more convincing arguments to introduce an official sidecar concept. In hindsight I did have some regret that I did not make room for other index types that would be ignored for reader implementations that do not understand them - perhaps there is some tricks to introduce that in a non-breaking fashion but I'm not really into increasing complexity/adding more index types at this time. But I would rather invest in that than introducing sidecars. Of course you could have unofficial sidecars if you like.. :P

Right, the spatial index works fine but that's the only supported index type and find by attribute is a rather common use case as well. I guess that writing indexes into a place where they are reasonable easy to find with range requests makes it somehow heavy to finalize the optimized file. At least that's the case with Cloud Optimized GeoTIFFs but why not with fgb as well.
I was wondering that it could  be faster/simpler to write a fgb file first with spatial index only and create another index (or indexes) as a sidecar with no hurry if it feels useful. So I was just thinking, I have not played much with fgb yet even it seems that I have still the Finnish buildings as fgb remaining from some old experiments https://latuviitta.kapsi.fi/data/mtk/rakennus.fgb. Feel free to use if you need such data. Source is National Land Survey of Finland and license is CC-BY 4.0.

I can agree that there are pro and cons with externalizing indexes but that is equally true for the built in spatial index. It can also be argued that it could be useful to externalise attributes and store them in columnar fashion if that is the main access pattern. I did think about this when designing flatgeobuf and my main argument for not going down that road is that I saw simplicity as much more important than flexibility.
Attribute indexes are also complex because the type of index is dependent on the data. There is a reason there are multiple index types in PostgreSQL and there is a reason a full blown database is needed for attribute indexes. My rationale is that in most use cases for static spatial data the spatial index is the primary filter and if you need more flexibility you should probably use a real database. I don't want to implement a database, that's what file geodatabases and GeoPackage does and I don't like the cons that come with that. Even adding a b-tree type index is adding complexity to the spec and implementations that I don't want.

Another reason I didn't want to externalize the spatial index in the first place is that I wanted to constrain it to be optimal and coupled to guaranteed spatially ordered data.

That said, having "exotic" things like a specialized btree index for an identifier type attribute for fast id lookup could make sense to externalize and specified in a way so it's clear it is for specific use cases. But still, I'm hesistant to work/accept it. Perhaps I will reconsider when flatgeobuf is the most popular spatial format. :P

Databases do not work in a cloud with just http range requests. SQLite/GeoPackage does work to some extent but still too many bytes must be read. Somehow I feel that somebody, some day, will advance the queryable serverless cloud-pay-model-optimized read only vector storage to support attribute queries.

As I told, I was just pondering without any exact use case or need for the feature.


Allow account id to be in settings.yml

Use case for users who may not have IAM permissions.
See: https://github.com/jorgebastida/gordon/issues/114#issuecomment-285392944

@jorgebastida All green :)

Nice one! Thanks!


Add Roku Ultra Set Top box browser User Agent to detection

User agent:
Roku4640X/DVP-7.70 (297.70E04154A)

Is Roku Ultra Set Top box browser User Agent
See list found here: https://deviceatlas.com/blog/list-of-user-agent-strings#settop

Roku is a device and not a browser. You can install Chrome and Firefox Android apps on it.

Link: https://www.roku.com/

I leave the admins to fix this issue.

Improved Roku detection. Fixed in 2.1.1

Improved Roku detection. Fixed in 2.1.1


Applying join and group by on list query results in duplicate column error

Bug report
What I did
Applying join and group by clauses on list action
What I expected to happen
I expected the list counts to work normally
What happened
An error ocurrend  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'id'
What I've already tried to fix it
Disabling list counts fixes the issue.
Enabling it will trigger the issue, the root cause is from the file
vendor/backpack/crud/src/app/Library/CrudPanel/Traits/Query.php at line 261, as in case of group by all the results are selected "*"
 $minimumColumns = ($crudQuery->groups || $crudQuery->havings) ? '*' : $modelTable.'.'.$this->model->getKeyName();

I checked Backpack 6 and this line was updated and is working in this case.
Is it a bug in the latest version of Backpack?
After I run composer update backpack/crud the bug... is it still there?
Yes
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version the output is:
backpack/crud: 5.6.1
backpack/generators: v3.3.17
backpack/logmanager: v4.0.11
backpack/pro: 1.6.6
backpack/settings: 3.1.0
PHP 8.1.18 (cli)
Mysql 8

Hello @YosraHamza, we no longer provide support for Backpack 5, if you have already verified that this situation is resolved in version 6, our recommendation is that you update it.
Thanks.
P.D.: i will close this issue because we will not update Backpack v5, but you are free to re-open or create new is needed.


[BUG] When using HTTP get requests, the params configuration parameters cannot interface properly

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior
1.When using HTTP get requests, the params configuration parameters cannot interface properly
2.The data obtained by the interface is the same as without passing parameters
3.After investigation, I found that I was using the time format yyyy mm dd hh: mm: ss, which contains spaces. The parameter was already escaped when saving the incoming interface, resulting in the parameter being used in the hertzbeat backend to dock with the escaped data in the interface. Therefore, the parameter is incorrect

Expected Behavior
When using parameter docking, the desired interface data can be obtained normally
Steps To Reproduce
No response
Environment
HertzBeat version(s):1.3.1

Debug logs
No response
Anything else?
No response

ok


Players cannot be edited unless there is an active season

If there is no active season, the SQL to get the course for the season doesn't work - this apparently causes the edit player page to not show up.

Fixed.


[Single Disk Eject] Fails to eject SD Card

Extension
https://www.raycast.com/johndturn/single-disk-eject
Description
Whenever I try to eject an SD card, it fails to do so, but says it did. It works fine with external ssds.
https://github.com/raycast/extensions/assets/85531625/6edf4626-525c-4e4f-b4f9-13eaa6ab06b2
Steps To Reproduce
Try to eject an SD card.
Current Behaviour
Doesn't eject, says it did.
Expected Behaviour
Eject and confirm or not eject and report error.

@brunocbreis Thanks for surfacing this! I'm doing a bit of travel over the next 2 weeks, but I'll dive in and take a look at it once I'm back and things are settled.

Have you managed to get around to this yet?

@brunocbreis thank you for your patience. Im back from traveling now and I'll have time this week to review this and give you an update.

@brunocbreis Looking into this a bit more, I have a qq for you: What sort of SD card is this that you're trying to eject (specific hardware)? Also, how is the SD card formatted (FAT32, exFAT, NTFS, or something else)?

I've just tried to reproduce it now and it successfully ejected all of my SD cards. 🙃 I was on another computer, with another SD card when the error happened though. Which I don't have access to anymore 😅

It was named Untitled, yes. If I'm not mistaken, it seemed like the card wasn't ejected for a reason (might've been being used by another app), and the problem wasn't that the extension failed to eject it, it was that it failed to warn about the error

@brunocbreis Great call on that. I'll dig into the code a bit more tonight and see if I can replicate the issue / layer in some additional error handling.

@brunocbreis FYI: https://github.com/raycast/extensions/pull/9189


using ssml_mark is not returning the timepoints information

As mentioned in the docs, the timepoints were supposed to return. But I got no luck getting the info.
The Text-to-Speech API supports the use of timepoints in your created audio data. A timepoint is a timestamp (in seconds, measured from the beginning of the generated audio) that corresponds to a designated point in the script. You can set a timepoint in your script using the  tag. When the audio is generated, the API then returns the time offset between the beginning of the audio and the timepoint.
There are two steps to setting a timepoint:
Add a  SSML tag to the point in the script that you want a timestamp for.
Set TimepointType to SSML_MARK. If this field is not set, timepoints are not returned by default.
I have done all the steps but the timepoints info is not returned in the result.
  const request = {
    input: {text: fs.readFileSync(textFile)},
    voice: {languageCode: 'en-US', ssmlGender: 'FEMALE'},
    audioConfig: {audioEncoding: 'MP3'},
    enableTimePointing: ['SSML_MARK']
  };

  const [response] = await client.synthesizeSpeech(request);

A similar issue has been reported before.
https://github.com/googleapis/nodejs-text-to-speech/issues/410

Hi @alexyoux — thank you for filing this issue. To be able to get timepoint information, you need to add the <mark> to your input, like so. You also need to use the v1beta1 version of the API: const textToSpeech = require('@google-cloud/text-to-speech').v1beta1;.

Hi @b-loved-dreamer
It works. I should use v1beta1. Thanks for your help.


Old implementations

I've clicked around in the implementations in the documentation and it seems there is quite a lot of project that haven't been updated in ages. For the PHP side i see quite a few that one could argue are abandoned.
Would you mind if i went through and a least do some sorting so active projects are on top? This way when users click through the list of implementations they see relatively active projects first. I'm not sure if assuming a project dead is really feasable since that sometimes is rather hard to know for sure.

I'd like to do some sorting too, as the list is much less useful than it could be because it doesn't highlight the most-developed implementations. The trick is finding some general criteria to apply to sort things in a way that people feel is fair.
I can think of one thing off the top of my head that should be uncontroversial: if an implementation is still based on RC3 of the spec, it should definitely be removed. That criterion is easy to check -- does the implementation have separate attributes and relationships keys in its resource objects? --  and would mean that the implementation hasn't been updated in years.
Maybe you can post a list here of all the implementations that are still based on RC3 and we'll start by killing those? Then, if there's still too much cruft in the list, we can explore other means of sorting what's left?
cc @dgeb
ref #733 #1151

Oh interesting, first time I hear about RC3 and attributes <> relationships not yet being a thing there!
Sounds like a great criterion for at least a first round of clean-up!

Yup. @wimleers, if you have some time to help, maybe one of you could take the PHP server implementations and the other the client implementations and we'll start there?

I'll keep this issue in mind/this browser tab open for when I do have some down time :)

Yeah, same, please mention here should you start and if you are starting on the client or server list.
Personally i think we should (at least for php) also look at how well supported it is, i mean, when i see Laravel 5.2 support as the max, that is like a few years old, and no longer maintained, which would mean the package is kind of worthless right now.

The PHP clients seem fine actually, i just made a small PR to order them by name.

I've been looking at many implementations today, and many of them are pretty simplistic and incomplete. Implementing the absolute basics of the JSON:API spec is easy, but also including support for collection filtering, sorting, pagination for example is usually lacking.
I'm not sure how we can surface this in easy-to-scan format though. Thoughts?

Perhaps something like a feature table would work. But I fear that will be outdated pretty fast.

A lot of the features you mentioned aren't compulsory though. So perhaps that might be a separation. Hmm.

I feel like that would make sense. Then we could use a bit of JS on the frontend to enable people to sort/filter by supported features.

👍


Include indian currency

May I please get Language for Indian Currency?

if i defined a language myself will it works without any other codes from your end??
I have just tried editing an already defined language by changing its symbol to Indian currency.
Its working fine but when i changed the language tag to INR and called function setLanguage(INR) its not working.


integration test for DocAI parser

Description: added an integration test
Issue: #11407

@baskaryan

thanks @lkuligin!


feat: Add EclipseChain Testnet V1.3.0 contracts

Relevant issue: https://github.com/safe-global/safe-deployments/issues/485

LGTM, I'm getting 502 server errors from the RPC endpoint when trying to verify the deployments. I will try again later.

LGTM, I'm getting 502 server errors from the RPC endpoint when trying to verify the deployments. I will try again later.

@nlordell Thanks for your response, I just checked that our RPC endpoint is working without any issues.(I deployed a new contract using the RPC endpoint)
I would like you to share more details about the RPC Endpoint issue so we can look into it together.
Yes, I hope you can try again.

RPC is working now.


Generator: Refactor out the folding code into a separate js file

Should make generator.js cleaner and easier to understand.

Solved here https://github.com/fossasia/open-event-webapp/pull/271 :)


guide pls

pls help how to use this there are error comming unknown mmr etc etc

Hello and thank you for your interest!
The work is still in progress for this project, as there have been some bugs in evaluating the model that need fixing. When these issues are fixed, I will post a release with a README of how to train and query the model. If you want to be informed when the release is made (hopefully very soon), you can star the project to see its updates.
Have a nice day,
Apo


[benchmark] Adopt the new Clock APIs from SE-0329

This experimental PR builds on #41485 and adopts the Clock APIs from SE-0329 in the Swift Benchmark Suite.

@swift-ci benchmark

Note that we may need to polyfill the new types/methods in the benchmarking tool before landing this -- we may want to continue being able to run benchmarks on releases that don't have SE-0329.


Startup time

So, I've switched from zgen to zplug and the cached startup times are noticeably slower.
I profiled my ~/.zshrc with the zprof module, and the results are here (best out of 5).
This seems mostly due to calling zplug load over and over (yes, I have ~50 zsh plugins):
num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)   52        2076.13    39.93   59.38%   2076.13    39.93   59.38%  __zplug::validator
 8)   54        3193.69    59.14   91.35%     16.00     0.30    0.46%  zplug

My goal is to short-circuit this by loading ~/.zplug/.cache if it exists, but these lines are a problem:
# ~/.zplug/.cache
if [[ $_zplug_repos != $_zplug_saved ]]; then
  ZPLUG_USE_CACHE=false zplug load --verbose
  return $status
fi

If I remove them and source the file, all plugins are loaded perfectly.

In short, I would like to mimic the following zgen functionality:
if ! zgen saved; then
    # ^ this line loads all the plugins from cache

    # otherwise, 50 invocations of `zgen load` happen here.
fi

I am more than happy to zplug clear --force (analogous to zgen reset) each time I change ~/.zshrc if it saves me 2-3 seconds on each shell.
As I understand it, this is what you are trying to avoid (typing zplug clear), so two questions:

Can it be possible to opt-in to the behavior I'm looking (where you have to manually zplug clear)?
Perhaps a faster way to perform this "diff" (e.g. postponing __zplug::validator calls until later)?

Hopefully I'm not missing something and this is already possible. Thoughts?

Thank you for your report :+1:
I would like to ask you some questions before I answer your questions because I want to correctly understand what you want to say.
In addition, if you can't understand what I mean, please let me know because I'm not good at English.

Firstly, do you think the bottleneck in zplug is __zplug::validator?
Secondly, do you want to make zplug resemble to zgen in terms of caching?

No worries - we seem to be understanding each other fine.

Firstly, do you think the bottleneck in zplug is __zplug::validator?

Not entirely, it's actually __zplug::load + __zplug::validator together that take 90% of the time. Skipping this completely would make new shells open 10x faster for me.

Secondly, do you want to make zplug resemble to zgen in terms of caching?

Yes, I would like this option since I rarely change the zsh plugins I use. Maybe a new command could be introduced, such as zplug freeze that would remove these lines from .cache file?

Thank you @deizel

Firstly, do you think the bottleneck in zplug is __zplug::validator?

Not entirely, it's actually __zplug::load + __zplug::validator together that take 90% of the time. Skipping this completely would make new shells open 10x faster for me.

Well, I understand. Certainly I have noticed it. In particular, __zplug::validator is called each time zplug is called.

Secondly, do you want to make zplug resemble to zgen in terms of caching?

Yes, I would like this option since I rarely change the zsh plugins I use. Maybe a new command could be introduced, such as zplug freeze that would remove these lines from .cache file?

That makes sense! I understand very well.

Compare plugins with cached plugins (nice to have but slower - could be made optional)

Exactly. I have to design new cache system that does not check the change of plugins additions/deletions.
I agree in principle but I don't want adopt 'saved' command just like zgen because it is difficult to understand what it is doing. Any ideas?

Or, for example, should I introduce a new environment variable so that zplug users can decide whether they use mechanism of checking whether the plugins are added or deleted? such as ZPLUG_CACHE_CHECK_CHANGE

I would like something like this:
By default, zplug checks .zshrc for changes, to keep all your plugins up to date. For faster startup times, you can tell zplug to skip this check with unset ZPLUG_CACHE_CHECK_FOR_CHANGES.  Make sure to run zplug clear --force anytime .zshrc changes.

Sounds good. That may be within the allowable range.

Could another option be to stat .zshrc and store the last modified time somewhere, like a file in the config directory?
The nice thing is that .zshrc will be automatically sourced when changes are made, so the user may not even notice the change.
The downside is that you may reload even when no plugins were changed, if some unrelated thing in .zshrc changed.
Thoughts?

Er, looks like __zplug::load() already does that? I'm confused now...

Looks like this is actually what zgen does (or at least has an option to)

Started tinkering around in a fork. So far here's what I've found:

The __zplug::validator() calls can be skipped entirely when loading from the cache
After __zplug::validator() is removed, most of the time is spent in __zplug::load(). That time is basically just sourcing lines in the cache file.

So at least at this point looks to me that at this point the bottleneck might be the filesystem? I'll have to see how zgen does it...

Just as @deizel tried to migrate from zgen to zplug, but startup time unfortunately is worse by an order of magnitude. But if there is anything I can help with making caching work I'll be more than happy to do it.
I have tried @aw1621107 fork, but I had to set $XDG_CONFIG_HOME manually and remove %m in https://github.com/aw1621107/zplug/commit/724dddd0d4d44fb9cceee14577ea599185494748#diff-1e9953403c9324b84bf46210c66dd796R1125 .
Even then loading time was about 2s versus 0.2s I experienced with zgen.
Maybe I am doing something wrong as according to zprof the main culprits are still __zplug::validator and __zplug::load.

My timings for similar configs from zgen and zplug: https://gist.github.com/anonymous/118355ecca23de61a86f

@DoomHammer Oops, forgot about that var...
I think I forgot to mention that you need to put your zplug calls in something like this:
if ! $ZPLUG_CACHE_CLEAN; then
    zplug ...
    zplug ...
fi

zplug load

From my tests if things go right you shouldn't see any __zplug::validator calls

@aw1621107 when I tried your branch I used the guardian. Profiling times are from master. If you want, I can do another round of profiling with your branch, although I am optimising other parts of my .zshrc as well, so would have to first configure a fair environment for tests.

Nah, you don't have to run more tests. I just found it curious that __zplug::validator showed up in the profiling logs

On Mar 18, 2016, at 3:15 PM, Piotr Gaczkowski<EMAIL_ADDRESS>wrote:
@aw1621107 when I tried your branch I used the guardian. Profiling times are from master. If you want, I can do another round of profiling with your branch, although I am optimising other parts of my .zshrc as well, so would have to first configure a fair environment for tests.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

My load times with time zsh -i -c exit went from ~0.2s to ~0.1s with @aw1621107 's patch applied, that is awesome!

@jedahan, would you share the exact setup?

@DoomHammer I actually switched to zplug2, but here it is:
https://github.com/jedahan/dotfiles/blob/osx/home/.zshrc

Not much luck here or doing something wrong: https://gist.github.com/anonymous/382d0c5bf5d7575d4345

@DoomHammer Don't have a check against $ZPLUG_CACHE_CLEAN?

Tried to replicate what @jedahan has. Modified as attached and it improves zplug startup but fails for zplug2 somehow.
my_zplug() {
  if [ "$1" = "2" ]; then
    zplug_repo=b4b4r07/zplug2
    zplug_dir=~/.zplug2
    zplug_init=init.zsh
    zplug_cmd=use
  else
    zplug_repo=b4b4r07/zplug
    zplug_dir=~/.zplug
    zplug_init=zplug
    zplug_cmd=of
  fi
  if [ ! -d "$zplug_dir" ]; then
    printf "Install zplug? [y/N]: "
    if read -q; then
      echo;
      git clone "https://github.com/$zplug_repo" "$zplug_dir"
      source "$zplug_dir"/"$zplug_init"
      # manage zplug by itself
      zplug update --self
    fi
  fi

  if [ -f "$zplug_dir"/"$zplug_init" ]; then
    source "$zplug_dir"/"$zplug_init"

    if ! $ZPLUG_CACHE_CLEAN; then
      # Make sure you use double quotes
      zplug "$zplug_repo"

      zplug "plugins/command-not-found", from:oh-my-zsh, ignore:oh-my-zsh.sh
      zplug "plugins/extract", from:oh-my-zsh, ignore:oh-my-zsh.sh
      zplug "plugins/pip", from:oh-my-zsh, ignore:oh-my-zsh.sh
      zplug "plugins/python", from:oh-my-zsh, ignore:oh-my-zsh.sh
      zplug "plugins/ssh-agent", from:oh-my-zsh, ignore:oh-my-zsh.sh
      zplug "plugins/sudo", from:oh-my-zsh, ignore:oh-my-zsh.sh
      zplug "plugins/vagrant", from:oh-my-zsh, ignore:oh-my-zsh.sh
      zplug "plugins/virtualenv", from:oh-my-zsh, ignore:oh-my-zsh.sh

      zplug "b4b4r07/enhancd"
      zplug "caarlos0/zsh-mkc"
      zplug "joel-porquet/zsh-dircolors-solarized"
      zplug "marzocchi/zsh-notify"
      zplug "mrowa44/emojify", as:command
      zplug "oconnor663/zsh-sensible"
      zplug "rimraf/k"
      zplug "sharat87/autoenv"
      zplug "zlsun/solarized-man"
      zplug "zsh-users/zsh-completions"
      zplug "zsh-users/zsh-history-substring-search"
      zplug "zsh-users/zsh-syntax-highlighting", nice:19

      zplug "DoomHammer/gogh", $zplug_cmd:"themes/solarized.dark.sh", at:"overall"

      #if [[ `brew ls --versions fzf|wc -l` -gt 0 ]]; then
      #  zplug "$(brew --prefix fzf)/shell", from:local
      #fi

      zplug "miekg/lean"
    fi

    # Install plugins if there are plugins that have not been installed
    if ! zplug check --verbose; then
      printf "Install zsh plugins? [y/N]: "
      if read -q; then
        echo; zplug install
      fi
    fi

    # Then, source plugins and add commands to $PATH
    zplug load # --verbose
  fi
}

Timings
% time zsh -ic exit
zsh -ic exit  1.09s user 0.37s system 99% cpu 1.460 total
% time zsh -ic exit
zsh -ic exit  1.03s user 0.37s system 99% cpu 1.413 total
% time zsh -ic exit
zsh -ic exit  1.13s user 0.37s system 99% cpu 1.515 total
% time zsh -ic exit
zsh -ic exit  1.00s user 0.35s system 99% cpu 1.355 total
% time zsh -ic exit
zsh -ic exit  1.11s user 0.37s system 99% cpu 1.482 total

I will close this issue since there hasn't been a reply in a while, thus I assumed the problem went away :balloon: Feel free to reopen if the issue persists!

Good day,
My inquiry is more of a question, but I think that this is an appropriate place to ask it.
There is a graph on the github page that shows zplug as a faster manager, yet in my experience it is noticeably slower than zgen. I prefer the customization of zplug and wanted to ask whether there is some mistake in the way I use it.
zgen time:
 ❯ repeat 5 time zsh -i -c exit
zsh -i -c exit  0.02s user 0.01s system 102% cpu 0.038 total
zsh -i -c exit  0.03s user 0.01s system 103% cpu 0.038 total
zsh -i -c exit  0.03s user 0.01s system 102% cpu 0.038 total
zsh -i -c exit  0.03s user 0.01s system 103% cpu 0.038 total
zsh -i -c exit  0.03s user 0.01s system 102% cpu 0.038 total

zplug time:
 ❯ repeat 5 time zsh -i -c exit
zsh -i -c exit  0.22s user 0.04s system 103% cpu 0.256 total
zsh -i -c exit  0.07s user 0.03s system 109% cpu 0.091 total
zsh -i -c exit  0.08s user 0.02s system 109% cpu 0.091 total
zsh -i -c exit  0.08s user 0.02s system 109% cpu 0.091 total
zsh -i -c exit  0.08s user 0.02s system 109% cpu 0.091 total

I tried setting frozen flag to all the plugins, but the timings didn't improve. And there is nothing where the @aw1621107 patch was.
There's the way I call zplug:
# zplug
source ~/.zplug/init.zsh
zplug "yardnsm/blox-zsh-theme", frozen:1
zplug "zsh-users/zsh-syntax-highlighting", frozen:1
zplug "zsh-users/zsh-completions", frozen:1
zplug "zsh-users/zsh-history-substring-search", frozen:1
zplug "zsh-users/zsh-autosuggestions", frozen:1
zplug load


Check to see whether the cache driver(redis/memcache(d)) is supported when it is initialized

When setting a cache driver(redis/memcache(d)) but it isn't supported on the web server, the server will return "fatal error". So we need check whether the cache driver is supported when it is initialized.

Your previous PR (#4376) had problems with its presentation, not the patch. Why did you turn a one-liner into a whole bulk of changes that are mostly unnecessary?
Also, please reference issues from the PR title/description, not from commits in your fork.
Relevant: #4277


API: removal of drf_yasg (OpenAPI 2.0 Swagger)

@kiblik Mind looking at those 2 minor Flake 8 issues? Otherwise, this looks ready to me.

@kiblik Just started looking at this - will look deeper later.
But, given how much this touches, I'm thinking its best to merge this after the 2.31.0 release so it has a decent time to 'soak' in the dev branch,
@Maffooch Thoughts on :point_up: ?

Can we approve and merge this now?


Typo pg 48

Describe the erratum
A clear and concise description of the erratum.
On page 47-48 "were" instead of "where".
"Then we can marginalize the unknown constant mean exactly to derive
the marginal Gaussian process were the uncertainty in the mean has been absorbed into the prior
covariance function"
Version and Location
Please provide:
8th Dec 2021, pg 48

Thank you! This correction will appear in the next draft.


how can i train my model with mask picture/video ?

how can i train my model with mask picture/video ?

Hi, what do you mean by "mask picture/video"?

The issue is no longer active, as such I'm closing this. Feel free to ask if you have further questions.


added static camera position config option

Added a config option to common.yaml to enable static camera position for position tracking.

I use a fixed ZED camera in an indoor environment with an industrial robot arm and human workers. ROS2 is used to communicate between the robot and also other sytems. I need to have a fixed coordinate system to track humans in the scene relative to the robot.
Maybe this is a niche case but I tought this feature might be useful to have.

This seems indeed a possible application that we should make available for everyone.
Thank you for your PR


Generate new Google access token at request time

instead of HeliosClient creation time. This will prevent users
who create a HeliosClient once and reuse it from accidentally
using expired tokens.

This fetches a new token for every request. Did you look into how difficult it might be to grab a refresh token?

I just looked a bit. Would using a refresh token be better in some way? You still need to make a request that goes over the network. I just didn't see any advantages to doing that.

Codecov Report

Merging #1207 into master will increase coverage by 0.03%.
The diff coverage is 27.27%.

@@             Coverage Diff              @@
##             master    #1207      +/-   ##
============================================
+ Coverage     52.53%   52.56%   +0.03%
  Complexity     1610     1610
============================================
  Files           268      268
  Lines         13015    13017       +2
  Branches       1503     1503
============================================
+ Hits           6838     6843       +5
+ Misses         5657     5654       -3
  Partials        520      520

Any other thoughts on this?

Looking at the source code I appear to be wrong about the GoogleCredentials class - I don't see a method that you can call which internally do the "check if expires soon, if so refresh, else return already present token" dance for you. This seems to only be in methods like Map<String, List<String>> getRequestMetadata(URI uri). It would be nice if we could use one of the methods already in that library to avoid reimplementing that.

@mattnworb See new commit. Is this what you meant?

I thought our approach was to generate a new token right before each request was made so we would never need to check and refresh?

GoogleCredentials.getAccessToken() looks like it will return null if you haven't called refresh at least once. I don't think we should fetch a token from Google on every single HTTP request in HeliosClient as that adds overhead, and typically many methods in HeliosClient are called at the same time to fulfill some higher-level operation.
Also now that most of the work is being done in the Supplier<Optional<AccessToken>> being injected into the AuthenticatingHttpConnector I think it would be good to add a test of that code as it seems like we can't verify the behavior just from looking at the code.

Opened issue here asking if the oauth2 lib can expose a method to check expiration and refresh token if expired.
In the meantime, I think we can use getRequestMetadata(URI uri) with a dummy URI. The implementation that's relevant doesn't seem to use uri for anything.

See new commit. bin/helios -d guc3 hosts heliosagent -vvv shows the same access token is used for both HTTP requests.


add parent stream order

Adding parent order makes it easy to prioritize 1st/2nd order streams that drain into major channels above 1st/2nd order streams higher up in the network. This column would be valuable in both streams and crossings.
Consider adding the column directly to whse_basemapping.fwa_stream_networks_sp in fwapg

This is also valuable for lateral habitat model. I'll create an issue upstream in fwapg but I think adding this to bcfishpass is fine for now - it is a simple query.

Update - use new fwapg value added table whse_basemapping.fwa_stream_order_parent rather than adding parent order directly to bcfishpass.streams. This is more versatile and easier to manage. Report on parent order where required.


different cpu time usage on different machine

'push same trx to different node cost different CPU resource'
then how to apply_block with this transaction in different node ? maybe it will lead to hard branching?
the cpu usag of my EOS account updated by which node cpu calculation?

Your final cpu usage will be determined by the producer who produces the block where your transaction is included in.

Hard forking is prevented by producing nodes being comparable in CPU capacities and by allowing a small amount of overrun when verifying blocks vs initially creating blocks.


Text Going haywire - Reported by a user on Twitter

https://twitter.com/HexaWallet/status/1474027693897252866
Tagging @summikhan11 to observe.

the currency switch is missing the symbol too.

@cakesoft-swati unable to reproduce the bug on iPhone 12. ios version, 14.5

what is needed from me?

Verified this issue on dev app v2.0.68(421)


Tutorial for own model implementation

Hello,
I am trying to use DiCE for truly model-independent counterfactual generation. But I am unable to create my own model interface.
Could you add a tutorial or give a short description how to do this?
Or help me with my implementation?
I tried writing a model-interface which acts a wrapper for pytorch since I already know this model theoretically works. The code is mostly copied from the pytorch interface.
If desired I can upload my entire code.
class CustomModel(BaseModel):
    def __init__(self, model=None, model_path='', backend='', func=None, kw_args=None):
            super().__init__(model, model_path, backend)
            self.model_type = ModelTypes.Classifier
    def get_output(self, input_tensor, transform_data=False):
        #convert pd dataframe to numpy (strings included) and then to float torch tensor
        input = torch.tensor(input_tensor.to_numpy().astype(np.float)).float()
        return self.model(input).float()

    def set_eval_mode(self):
        self.model.eval()

    def get_gradient(self, input):
        raise NotImplementedError("Future Support")

    def get_num_output_nodes(self, inp_size):
        temp_input = torch.rand(1, inp_size).float()
        return self.get_output(temp_input).data

But executing my code with this model gives
      1 d = dice_ml.Data(dataframe=dataset, continuous_features=["city_development_index",
      2              "experience","company_size","last_new_job","training_hours"], outcome_name='target')
----> 3 exp_genetic = dice_ml.Dice(d, m, method='genetic')
      4 dice_exp_genetic = exp_genetic.generate_counterfactuals(query_instances, total_CFs=100, desired_class=1)
      5 dice_exp_genetic.visualize_as_dataframe(show_only_changes=True)

.....
~/.local/lib/python3.9/site-packages/dice_ml/explainer_interfaces/explainer_base.py in check_query_instance_validity(self, features_to_vary, permitted_range, query_instance, feature_ranges_orig)
    163         for feature in query_instance:
    164             if feature == self.data_interface.outcome_name:
--> 165                 raise ValueError("Target", self.data_interface.outcome_name, "present in query instance")
    166
    167             if feature not in self.data_interface.feature_names:

ValueError: ('Target', 'target', 'present in query instance')

@finnschwall From the error description, looks like the error might be related to your dataset.
Have you tried the dataset with a standard sklearn model (e.g., LinearRegression) and check if the code works. That will help debug whether it is due to the custom model or due to the data.
Also in your code, how is m defined? I don't see it defined after line 2.
From a quick glance, the structure of CustomModel' looks okay, but there might be a typo in get_num_output_nodes: why does it return .data`, just needs to return the number of nodes.

@finnschwall, the model that you are wrapping is still a pytorch model. So the genetic method may not apply to it. As Amit mentioned could you paste the line of code on how you instantiate the model?
Regards,

@amit-sharma Thanks for the quick reply. Testing with a random forest classifier indeed revealed an error with my data.
But I still don't have any success. Now the prediction works with the rfc but still not with my model. It says it is missing a "prediction function". Is there a way to do it without having a prediction function in the underlying model just with the get_output function?
Here the relevant code
import ModelClass
m = ModelClass.CustomModel(model, backend={"model": "ModelClass.CustomModel", "explainer": "dice_genetic.DiceGenetic" })
d = dice_ml.Data(dataframe=dataset, continuous_features=["city_development_index",
             "experience","company_size","last_new_job","training_hours"], outcome_name='target')
exp_genetic = dice_ml.Dice(d, m, method='genetic')
dice_exp_genetic = exp_genetic.generate_counterfactuals(query_instances, total_CFs=1, desired_class="opposite")

and the error
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_4480/419216923.py in <module>
      2              "experience","company_size","last_new_job","training_hours"], outcome_name='target')
      3 exp_genetic = dice_ml.Dice(d, m, method='genetic')
----> 4 dice_exp_genetic = exp_genetic.generate_counterfactuals(query_instances, total_CFs=1, desired_class="opposite")
      5 dice_exp_genetic.visualize_as_dataframe(show_only_changes=True)

....

~/.local/lib/python3.9/site-packages/torch/nn/modules/module.py in __getattr__(self, name)
   1128             if name in modules:
   1129                 return modules[name]
-> 1130         raise AttributeError("'{}' object has no attribute '{}'".format(
   1131             type(self).__name__, name))
   1132

AttributeError: 'NeuralNetwork' object has no attribute 'predict'

Additionally I found something which I find weird behavior. If I use the provided pytorch-interface with
m = dice_ml.Model(model=model, backend="PYT")
it does not throw any errors but also doesn't find any cfs. But for the same dataset and same configuration there are cfs with the rf classifier.

@finnschwall  you are almost there! If I understand correctly, you just need to replace the below line,
m = dice_ml.Model(model=model, backend="sklearn")

with a custom Model that extends BaseModel.
m = dice_ml.MyModel(model=pytorchmodel, backend="sklearn")

and then replace the get_output method. I see that you had already done that in your first post.  That should have worked.
Can you share the full stack trace of the error?
On your second question: Using backend="PYT" does two things. First, it uses the in-built pytorch model interface, and second, it defaults to a gradient-based algorithm for CFs, since that is more suited for models with gradients. So if you specify backend as PYT, then DICE defaults to the gradient-based method and ignores the genetic method. In general, genetic tries to approximate the gradient so it is best to use the gradients if they are available.  But then perhaps it makes sense to allow genetic algorithm too for full flexibility. In any case, since CFs depend on both the trained model and data, it is possible that the algorithm provided CFs for RFC but not for pytorch model. That usually means that you may need to change hyperparameters for the algorithm, as in this notebook.

Thanks for the clarification on the backend parameter.
Here the full error stacktrace:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_3114/1246876773.py in <module>
      8 exp_genetic = dice_ml.Dice(d, m_own, method='genetic')
      9
---> 10 dice_exp_genetic = exp_genetic.generate_counterfactuals(query_instances, total_CFs=5, desired_class="opposite")
     11 dice_exp_genetic.visualize_as_dataframe(show_only_changes=True)

~/.local/lib/python3.9/site-packages/dice_ml/explainer_interfaces/explainer_base.py in generate_counterfactuals(self, query_instances, total_CFs, desired_class, desired_range, permitted_range, features_to_vary, stopping_threshold, posthoc_sparsity_param, posthoc_sparsity_algorithm, verbose, **kwargs)
     90         for query_instance in tqdm(query_instances_list):
     91             self.data_interface.set_continuous_feature_indexes(query_instance)
---> 92             res = self._generate_counterfactuals(
     93                 query_instance, total_CFs,
     94                 desired_class=desired_class,

~/.local/lib/python3.9/site-packages/dice_ml/explainer_interfaces/dice_genetic.py in _generate_counterfactuals(self, query_instance, total_CFs, initialization, desired_range, desired_class, proximity_weight, sparsity_weight, diversity_weight, categorical_penalty, algorithm, features_to_vary, permitted_range, yloss_type, diversity_loss_type, feature_weights, stopping_threshold, posthoc_sparsity_param, posthoc_sparsity_algorithm, maxiterations, thresh, verbose)
    284                 query_instance_df_dummies[col] = 0
    285
--> 286         self.do_param_initializations(total_CFs, initialization, desired_range, desired_class, query_instance,
    287                                       query_instance_df_dummies, algorithm, features_to_vary, permitted_range,
    288                                       yloss_type, diversity_loss_type, feature_weights, proximity_weight,

~/.local/lib/python3.9/site-packages/dice_ml/explainer_interfaces/dice_genetic.py in do_param_initializations(self, total_CFs, initialization, desired_range, desired_class, query_instance, query_instance_df_dummies, algorithm, features_to_vary, permitted_range, yloss_type, diversity_loss_type, feature_weights, proximity_weight, sparsity_weight, diversity_weight, categorical_penalty, verbose)
    204         self.feature_range = self.get_valid_feature_range(normalized=False)
    205         if len(self.cfs) != total_CFs:
--> 206             self.do_cf_initializations(
    207                 total_CFs, initialization, algorithm, features_to_vary, desired_range, desired_class,
    208                 query_instance, query_instance_df_dummies, verbose)

~/.local/lib/python3.9/site-packages/dice_ml/explainer_interfaces/dice_genetic.py in do_cf_initializations(self, total_CFs, initialization, algorithm, features_to_vary, desired_range, desired_class, query_instance, query_instance_df_dummies, verbose)
    180             # Partitioned dataset and KD Tree for each class (binary) of the dataset
    181             self.dataset_with_predictions, self.KD_tree, self.predictions = \
--> 182                 self.build_KD_tree(self.data_interface.data_df.copy(),
    183                                    desired_range, desired_class, self.predicted_outcome_name)
    184             if self.KD_tree is None:

~/.local/lib/python3.9/site-packages/dice_ml/explainer_interfaces/explainer_base.py in build_KD_tree(self, data_df_copy, desired_range, desired_class, predicted_outcome_name)
    657             query_instance=data_df_copy[self.data_interface.feature_names])
    658
--> 659         predictions = self.model.model.predict(dataset_instance)
    660         # TODO: Is it okay to insert a column in the original dataframe with the predicted outcome? This is memory-efficient
    661         data_df_copy[predicted_outcome_name] = predictions

~/.local/lib/python3.9/site-packages/torch/nn/modules/module.py in __getattr__(self, name)
   1128             if name in modules:
   1129                 return modules[name]
-> 1130         raise AttributeError("'{}' object has no attribute '{}'".format(
   1131             type(self).__name__, name))
   1132

AttributeError: 'NeuralNetwork' object has no attribute 'predict'