I'm trying to get an ESP32-S3 TinyUSB device to show up as an XInput compatible device on Windows. There appears to be three ways to do this: XUSB, XInputHID & GIP, with a recommendation to use XInputHID, which also seems the easiest. The XInputHID Documentation.docx gives a listing of HID descriptors to use, but those by themselves will not cause Windows to load xinputhid.sys. The document also mentioned a compatibility ID “HID_DEVICE_SYSTEM_GAME” that should be given through a Microsoft OS Descriptor, but I cannot seem to get that to work. Firstly, I cannot find any reference, other than a v
I planned to write a custom eslint rule for eslint 9, focusing on performance optimizations and suggestions. The custom I've already built: no-sequential-await Can anyone suggest me some legit ideas, I'm looking for idea that is not a predefined rule in eslint.
Snowflake supports higher order functions like FILTER or TRANSFORM. A lambda expression that defines the filter condition on each array element. The lambda expression must have only one argument specified in the following syntax: <arg> [ <datatype> ] -> <expr> This type of functions may be also known as array_filter/list_filter, array_map, array_transform, apply, etc. Example: SELECT FILTER([10,20,30,40], x -> x > 20); -- [30, 40] My scenario requires to operate on element's index of the array, like choosing every second element. Pseudocode below: SELECT FILTER([10,20,30,40], (x, i) -> i % 2 =
I'm moving from C to C++ and I'm trying to avoid using C practices in C++. It is said that raw pointers are a C feature, and that in C++ I should use smart pointers instead, yet every example I have seen online for implementing a doubly-linked list starts something like this: class DoublyLinkedList { struct Node { int data; Node* prev; Node* next; }; Node* head; Node* tail; ... }; I struggle to find an elegant way to implement this with smart pointers. I could implement it using shared pointers, but I heard that these should be seldom used and that I should attempt implementing using unique_pt
I know you can set the Info.plist to match files by extension, MIME type, or UTI. Is there a way to add custom matching, like adding a filter function that looks at the entire name? Edit: This query was flagged as a duplicate. I can't reword the question because these queries aren't the same at all. The other query is about how to select a folder/directory; this one is about filtering by criteria not already given by Apple. For me, the criterion is exact filename, which applies to both regular files and directories. (As examples: "maildir" for a directory, and "mbox" for a regular file.)
I've been trying to run a function three times that plots 2 subplots (6 plots total) onto one single figure. So I've got a function that reads in a dataset and a manipulator, then manipulates it in 2 different ways, then plots in 2 subplots - the function works as it should, I just can't seem to merge the plots when I'm running it in a separate script. Simplified function below: function function_plot(dataset,manipulator) %Manipulates Data figure; subplot(1,2,2); imagesc(data_manipulated1); subplot(1,2,1); imagesc(data_manipulated2); end Simplified script below: function_plot('data.mat',manipu
It seems Visual Studio 2026 Build Tools (MSBuild 18) are currently not available on GitHub-hosted Windows runners. How to install them during a GitHub Actions job?
I have this zod schema with a discriminatedUnion: const mySchema = baseTypeSchema.extend({ id: z.string(), name: z.string(), specificData: z.discriminatedUnion("type", [specificDataA, specificDataB] as const) }); In addition, I have specific zodObject, such as the one below: const specificDataA = z.object({ type: z.literal("typeA"), isSomeDataRequired: z.boolean(), someData: z.string().optional() }); The issue is that I want to refine specificDataA, like this: const specificDataA = z .object({ type: z.literal("typeA"), isSomeDataRequired: z.boolean(), someData: z.string().optional() }) .refine
I am trying to take text entered by the user in a Flutter UI and display it in a ListView.builder on a different screen. Most online examples only show how to work with hardcoded items.
I am having trouble with the delete function for my table items. It keeps returning a modal with a value of 1. I have tried many possible solutions found online, but the issue persists. Controller: public function destroy($id) { $articleCategories = ArticleCategory::findOrFail($id); $articleCategories->delete(); return redirect()->route('article_categories')->with('message', 'Article category deleted successfully.'); } Vue: <script> import Title from "../Layouts/Components/Title.vue"; import PaginationLinks from "../../components/PaginationLinks.vue"; import TableEditButton from "../../compone
I am planning to build a project using an Express JS REST API with React native. I am wondering how email verification is usually handled with this kind of stack. A flow is: User registers with credentials Create a user in the database with an active field set to false The user is sent an email to verify their account (Maybe a code to enter in the app?) If verified set active field to true I am wondering if they are any external libraries to use or whether to create a custom email server to send these emails.
I want to make a function starting with a function prototype as usual in the LLVM C++ API and I want one of the accepted arguments of the function to be a char*. Can someone guide me on how I can do that? Thanks! Note: I just want to know if there is a Type::char* or something like that but if not, whats the equivalent.
I'm customizing a Sales Invoice in Frappe/ERPNext to calculate a discounted grand total (15% off qty * rate per item). The total updates correctly on add/edit but doesn't decrease when deleting rows from the 'items' child table. What I've tried: Client-side JS: Triggers on qty, rate, items_add, items_remove, refresh, onload, after_save. Recalculates and refreshes fields. Added a custom "Recalculate & Save" button. Server-side Python: Hook on before_save/before_submit to recalc and persist via frappe.db.set_value. Added debug frappe.msgprint. Custom fields: custom_g_total (Currency, in Sales In
I am using the mobile_scanner package in my Flutter project for barcode/QR code scanning. Here is how and where I use it in the code: 1. pubspec.yaml dependencies: flutter: sdk: flutter mobile_scanner: ^3.5.1 # (example version) 2. Usage in my Dart code I import the package normally: import 'package:mobile_scanner/mobile_scanner.dart'; I use it inside a widget, for example: class ScanPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: MobileScanner( onDetect: (capture) { final List<Barcode> barcodes = capture.barcodes; for (final barcode in barc
I am using a spectral method to solve an ordinary differential equation. The following R code and MATLAB code are completely equivalent, but the R code blows up (the values of u that it computes become very large), while the MATLAB code solves for u stably. I suspect this is because numerical computation in R is less stable than in MATLAB. I would appreciate it if someone could analyze the situation in more detail. # R (The result would explode) library(pracma) f<- function(x){ return(exp(x)*(x^2+ 4*x+1)+ exp(5*x)*(x^2-1)^5) } Cheb<- function(N){ #D_cheb of size N+1, corresponding to N sub-int
I am using ElevenLabs for transcribing audio (speech to text), and want to create a webhook which will be triggered once audio transcription is complete. I found that you must specify the webhook type into Edit Endpoint into the dashboard in order to make it work. Webhooks My question is that I couldn't do it using the JavaScript SDK and I didn't find the option on the API reference. import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js"; const { webhookId, webhookSecret } = await elevenlabs.webhooks.create({ settings: { authType: "hmac", name: "test-webhook", webhookUrl: "https://www.ex
In WordPress 6.9 version and WooCommerce version 10.3.6, I want to display the Stripe based on the shipping zone. Shipping zone 1 consists of Post code 3000 Shipping zone 2 consists of Post code 4000. ex: Post Code 3000 should display Stripe. Post Code 4000 or any other postcodes should hide Stripe. Currently, I am using woocommerce_available_payment_gateways webhook to display. add_filter('woocommerce_available_payment_gateways', 'payment_gateways_based_on_chosen_shipping_method'); function payment_gateways_based_on_chosen_shipping_method($available_gateways) { $shouldReturnAll = true; if( is
I am applying Pyright to my project. I want to fix issues however, on specific imports I want to ignore some rules. File or line level rule exceptions are problematic for me. Line level: from mockito import ANY, mock, unstub, when ... when(bob).get_fruit("Apple").thenReturn("Apple") # pyright: ignore[reportUnknownMemberType] I can keep the rule exception on specific situations but I need to repeat that for each line. File level: # pyright: reportUnknownMemberType=false from mockito import ANY, mock, unstub, when ... when(bob).get_fruit("Apple").thenReturn("Apple") Now I don't need to repeat bu
I am currently doing some efforts on applying Pyright throughout my project. Most of the time I want to fix the issues instead of ignoring them, however, in some situations (mainly on specific imports) I always want to ignore some rules. I know that you can have file level or line level rules exceptions but both are problematic for me. For line level, like: from mockito import ANY, mock, unstub, when ... when(bob).get_fruit("Apple").thenReturn("Apple") # pyright: ignore[reportUnknownMemberType] I like that since I can keep the rule exception on specific situations but the issue is that I will
My goal is to use Keras to visualise the architecture of the model. No training, no inference. For example if I just want to visualise the graph of the network of the classic VGG16-model with model = create_vgg_like_model() then Keras starts to pre-allocate the memory needed and the program crash (see image). PC specs: CPU with 4 cores, 8GB RAM. Due to the "huge" amount of parameters of the model it uses even the swap partition. I tried to play around with cpu_devices = tf.config.list_physical_devices('CPU') if cpu_devices: try: # avoid allocating all memory on the device tf.config.set_visible
I am building a multi-lingual website and want to localise the captions shown on buttons in a form. document.querySelector('form').addEventListener('submit', ev => { ev.preventDefault(); console.log('submitted: %o', Object.fromEntries(new FormData(ev.target, ev.submitter).entries())); }); <form action="check.php" method="post"> <input type="submit" name="action" value="Enter"/> <input type="submit" name="action" value="Cancel"/> </form> When I change the @value, that value is also received on the server. I would like to keep processing of the form simpler by handling only the default language
So this thing has been breaking my head for almost a day. How do I connect my n8n WhatsApp on message trigger node to the Meta developer panel? Because when I copy the webhook URL and paste it in meta, it says call back URL error when setting a random verify token: Meta dev panel error image How do I make this connection work? I asked ChatGPT, and it never helped. I would appreciate if someone can throw light in this situation. I would be extremely grateful as I have to submit the project by this week. Here are my WhatsApp node settings: WhatsApp node image
Disclaimer: So i'm writing a parody setting of DnD/ASOIF/LOTR so just accept that things might be a bit farcical Background: we have a formation of heavily armoured dismounted knights with cleaver falchions holding a position in a very narrow mountain pass. This pass is maybe 20 metres wide at most. Their opponents are the stereotypical rawhide axe-wielding barbarians. The barbarians are charging down the pass and face first into the knights. No outflanking is possible. For the purposes of this story, i want the knights to be in a quasi-wedge formation ie, formation leader up front, and then b
I am trying to generate an ARIMA process with statsmodels. I tried already different combinations but nothing works. There is also nothing in the documentation that could solve my problem. The parameters of the ARIMA model should be AR coefficient [0.4], MA coefficient [-0.2] and no differencing. So, the order must be (1, 0, 1). Here is the code from my latest trial: ar_params = np.r_[0.4] ma_params = np.r_[-0.2] order = (len(ar_params), 0, len(ma_params)) model = ARIMA([0], order=order) simdata = model.simulate(nsimulations=2000, params=np.r_[ar_params, ma_params]) I couldn find anything even
My Delphi application uses SQLite for its database. My understanding is that the database connection control TFDConnection has a default row count of 50 records. If true, there should only be 50 records displayed in the TDBGrid control on screen at any one time. The next set of 50 (or less) would be shown once you pass the 50th record in the dataset by proceeding to the next or last record. The problem is my application is apparently loading all the database records (currently 148) at one time which exceeds the default record count using select * from tablename. I have tried to setup a "paging
Is there a simple way (i.e., not involoving writing a print() method) to show the timezone when printing a data frame with a POSIXct column ? as.data.frame(Sys.time()) # Sys.time() # 1 2025-11-26 17:18:45 ## <- show timezone (GMT) here as.data.frame(Sys.time())[[1]] # [1] "2025-11-26 17:18:48 GMT"
To retrieve stock data, I always used: Contract contract = new Contract(); //contract instance contract.Symbol = "LRCX”; //ticker here contract.SecType = "STK"; //contract type stock That will point to the LRCX stock. However, IBKR manages the stock data using its unique contract IDs and it assigned a new contract ID to LRCX after its stock split on Oct 3 2024. So that contract instance will only point to LRCX after Oct 3 2024 and shows no such contract exists prior to the date. The current LRCX Conid is 732440574, but pre-split Conid is unknown. When I pull up the chart on IBKR, it shows LRCX
I am adding new worksheets to a workbook whose name will be the value of rows in a column. In the column, there are or can be duplicate values. I want to skip the creation of a new worksheet for any duplicate values in that column in my VBA loop. How can I do this?
git rebase --committer-date-is-author-date --interactive remote/branch preserves (or adjusts) the CommitDate: value. Both CommitDate: and AuthorDate: could also be adjusted with the GIT_COMMITTER_DATE and GIT_AUTHOR_DATE environment variable during git commit-like operations. Is there a way to achieve the same for already signed or to-be-signed commits? git log --show-signature --pretty=fuller shows the time of the git rebase --gpg-sign --committer-date-is-author-date --interactive remote/branch command is used, instead of the "author date".