instruction stringlengths 0 30k ⌀ |
|---|
I am curious how really lambda function in set algorithms works or the algorithm behaves for the given lambda function in C++ . In below example I am using std::set_difference algorithm for two map.
```
std::map<std::string, int> map1{ {"test1",1}, {"test2",2}, {"test3",3}, {"test4",4},{"wxyz5",10}};
std::map... |
Thank you GSerg, this got me thinking. After testing all controls for focus it turned up that when the form is initializing the focus is being set to the image control in the third frame. Printing the list of controls to the immediate window, looking at the creation sequence, tab index, and tab stop nothing shows why V... |
I'm currently working on an Express.js application where I'm trying to handle file uploads using Multer. However, I'm encountering an issue with the error message "MulterError: Unexpected field" when I attempt to upload files.
Interestingly, when I tested file uploads using Postman, I successfully received image da... |
MulterError: Unexpected field in Express.js with multer |
|express|next.js|multer|react-hook-form|shadcnui| |
null |
I use Apache2 to intervene between my site and the User with an Authentication Login dialogue. I've added a hashed password to the Apache2 .htaccess file. The Site has a registered subdomain, and the web server has a set of SSL certs and keys. However, when a User tries to access the site and they are presented with th... |
EDIT:
On a side note, I personally would not modify the array while iterating over it, some data structures implementations are not prepared for that.
Other have said correctly the your are removing the item first, which is wrong.
---
---
But for the solutions, I would give you 2.
For one, you could sort ... |
For me, I was serving up drupal via PHP CLI and had to be running it in the web folder, not send web/index.php as a param |
Here is a full working solution that I think is neat.
I used the idea (thanks @matswecja) of using a custom `replace` function.
```python3
def myreplace(self,kwargs_= {}, **kwargs):
kwargs = kwargs_ | kwargs
current_data = self.__dict__
updated_data = {}
sig = self.__annotations__
for var,... |
I'm working on two projects simultaneously: one in Laravel 8 and the other in Express.js. In the Laravel project, I generate a token and want to use it to retrieve an element in my Express.js application. How can I pass this token securely from Laravel to Express.js and then use it to fetch the corresponding element?
... |
How to Retrieve an Element in Express.js by Passing a Token Generated by Laravel 8? |
|javascript|php|node.js|laravel|express| |
null |
Running a shell script file marked as executable results in creating a system process executing it.
It appears to me that it is not possible to determine from within the script if the executable of the interpreter used to run the script is the executable ASSUMED to be used as interpreter.
There are ways to quer... |
I have multiple pipelines running on Airflow and these pipelines dump data to Snowflake.
When I used basic authentication(username and password), I didn't get any error. However, when I switched to using Key-Pair authentication, the pipelines failed
WARNING - Retrying (Retry(total=0, connect=None, read=None, ... |
You can delete a endpoint using the python azure ml sdk
service = Webservice(workspace=ws, name='your-service-name')
service.delete()
Then if you want to re create you can re deploy the model
from azureml.core.model import InferenceConfig
from azureml.core.webservice import AciWebservic... |
I have a Redis cluster v7.x with 3 masters each having 1 slave.
A function `myFunc` written in Lua is loaded in all the 3 master nodes. I am calling this function from my node.js code (caller.js) using ioredis client library as:
let redis = require('ioredis');
const cluster = new redis.Cluster(
... |
To use sealed classes with Freezed in Dart, you don't need to create separate classes for each variant. Instead, you can define all variants within the same sealed class and handle them using pattern matching. Here's how you can modify your code:
import 'package:freezed_annotation/freezed_annotation.dart';
... |
I am trying to hide every product in my shop that is in the "Testing" category. I have tried the following 3 sets of code that I have found on these forums, to no avail.
```add_filter( 'get_terms', 'ts_get_subcategory_terms', 10, 3 );
function ts_get_subcategory_terms( $terms, $taxonomies, $args ) {
$new_terms = ... |
Hiding a specific category in WooCommerce shop |
|php|wordpress|woocommerce| |
I have created a workflow which captures the data sent by a request in a variable, lets call it `data`.
I am using Python to hit the endpoint.
The JSON structure is as follows:
```
slack_data = {
"userEmail": f"{email}",
"blocks": [
{
"type": "section",
... |
Adding Slack Blocks into a workflow using the UI |
|slack|slack-block-kit| |
```
import React from "react";
import ReactLogo from "./image/react.svg";
import TypeScript from "./image/typescript.svg";
import MongoDB from "./image/logo_mongodb_icon.svg";
import JavaScript from "./image/logo-javascript.svg";
import NodeJS from "./image/logo_nodejs_icon.svg";
import Express from "./image/exp... |
svg image is not displaying |
|reactjs|vite| |
null |
I am facing this when i go to localhost
> Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
>
>Please check that the mysqli PHP extension is installed and enabled.
>
>If you are unsure what these terms mean you should probably contact your host. If you still need hel... |
I am suddenly getting a CS1002 error on an aspx page when it was working fine. The code:
<ItemTemplate>
<div class="swatchBox" >
<%#Eval("SwatchName") %><br />
<%#Eval("RGB") %>
</div>
</ItemTemplate>
The compiler expects a semicolon on the Eval("RGB") ... |
How can I change the arrange of correlation, it is setting ordinal alpha for me
How can I change the arrange of correlation, it is setting ordinal alpha for me
How can I change the arrange of correlation, it is setting ordinal alpha for me
|
How can I change the sort of corelation, it is setting auto for me |
|pandas-profiling| |
null |
I have an energy counter (kWh) recorded in a MySQL database every 15 minutes.
Sometimes the recording fails for several reasons (power outage, computer reboot for updates...) and values are missing.
The table looks as followed:
```
id Time Energy
27800 13.02.2024 23:30:01 651720048
27801 13.02.2024 23:45:00... |
`mov eax, num`
eax = address of num, my debugger shows value 00402000.
`mov ebx, [array+8]`
ebx = 00050004.
`cmp eax,ebx`
eax >= ebx so code jumps to `skip` label.
Write function prints `0x0A` which is `new line` code. If You change to `0x35` You will see `5`.
`printdigit` code is never executed.... |
i ran brew reinstall libvmaf to reinstall libvmaf, as my own error was
Library not loaded: /usr/local/opt/libvmaf/lib/libvmaf.1.dylib
and also i got this error too
'/usr/local/opt/libvmaf/lib/libvmaf.1.dylib' (no such file),
but after running
brew reinstall libvmaf
it fixed my issue
if th... |
I need to extract info from a professional experience section like the following and store the result in a dataframe.
https://www.linkedin.com/in/maxlvsq/details/experience/
[example][1]
I have been reading about how to do it, including this stack overflow thread: https://stackoverflow.com/questions/75539164/get-t... |
I am making a UI with Swing, and I made a `JPopupMenu` to add to a `JMenu` for my top bar, but the `paintComponent()` function never get called. I saw online i couldn't have a size of `0,0` this was default and when I changed it still didn't call paintComponent. I am using `java 17`.
```java
public class PopUpMenu ... |
I need to extract info from a professional experience section like the following and store the result in a dataframe.
https://www.linkedin.com/in/maxlvsq/details/experience/
[example][1]
I have been reading about how to do it, including this stack overflow thread: https://stackoverflow.com/questions/75539164/get... |
I have a project idea in mind and I don't know how to achieve it. Let me explain. My idea is to create a web app that suggests travel destination ideas depending on dates and a budget.
But as far as I know all flight or hotel APIs available need a destination as a query parameter, so I'm stuck here. A workaround cou... |
{"Voters":[{"Id":724039,"DisplayName":"Luuk"},{"Id":9214357,"DisplayName":"Zephyr"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[18]} |
I need help with the Livewire component update based on the select dropdown.
```
class FutureTreeMapChart extends Component
{
public $segment = 'N50';
public $expiry = '2024-02-25';
public $data;
public function fetchTreeMap()
{
if (!empty($this->segment) && !empty($this->expir... |
Livewire component update with new data |
|laravel|laravel-livewire| |
is there anyone know hoy to access to the BIOS in a thomson SP-HERO91.1BK32, because i want to reset windows and make it a new pc so i tried all the posible keys but I haven't made it
how to acces to the bios in a thomson SP-HERO91.1BK32 |
how to access to the bios in a thomson SP-HERO91.1BK32 |
|bios| |
null |
Is this what you’re trying to do? `cond` provides the N different conditions (i.e., a loop-variable-dependent bool function) and `foo` introduces recursion:
```cpp
#include <iostream>
bool cond(int cond_which, int current_loop_variable) {
switch (cond_which) {
case 0:
return current_loop_varia... |
VS error on aspx file Eval(), expecting semi-colon |
|c#|asp.net|itemtemplate| |
I have DateTime string in following format:
> 3/15/24 4:25:51.000 PM EST
And I need to parse it. I was able to work out template as below:
> M/d/yy h:mm:ss.fff tt K
And it's almost OK, but iit doesn't recognize "EST" code and it shows TimeZone as below:
> 3/15/24 4:25:51.000 PM -05.00
How could I cope... |
TimeZone Codes in DateTime Formatter |
|c#|.net| |
|java|spring-boot|redis|spring-data-redis|jedis| |
# You have not included the script in your HTML
In order to execute the script, you need to add a `<script>` element into your HTML document.
```html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="code.js" defer></script>
</head>
... |
Is it a good practice to use `Inertia.reload()` in your laravel project when you want to reload your component after a post request? If you think there is another way that would be better don't hesitate to suggest me.
**Front React**
```
const addToFavorite = async (videogameId: number) => {
await ... |
In base R you could do something like:
```r
combo <- combn(names(emot)[-1], 2)
t(combn(names(emot)[-1], 2)) |>
as.data.frame() |>
setNames(c("target", "source")) |>
transform(count = sapply(asplit(combo, 2), \(x) sum(rowSums(emot[,x]) == length(x))))
```
Basically, get all the combinations of your ... |
It prevents of registering users over admin area, REST and xml rpc
function execute_on_register_post_event($sanitized_user_login, $user_email, $errors){
wp_die('Forbidden, is manualy disabled by pwa');
}
add_action( "register_post", "execute_on_register_post_event" , 10, 3);
add_filter... |
I need to determine the generic type(s) applied to a Java `Object` at runtime. For a situation like `Map<String, String>`, that is rather easy. I have code that looks like this:
protected Class<?>[] getGenericParameterTypes(Field field) {
ParameterizedType pt = (ParameterizedType) field.getGenericType();... |
Java Reflection - Get generic type, with possible generic of generic? |
|java|generics|reflection| |
I have Stable Diffusion running in a VM in GCP.
I want to generate a picture based on text but also have a specific word in the background. For example: "City skyline" as the picture and "New York" as a text in the background.
I have only found solutions where you either add a picture with the background text or us... |
Stable Diffusion, how to set a background text using the /sdapi/v1/txt2img |
|stable-diffusion| |
i have a zsh [plugin](https://github.com/babarot/enhancd), thru [zplug](https://github.com/zplug/zplug) installed to `$HOME/.zplug/repos/babarot/enhancd`, and it exposes a function: `__enhancd::cd`.
now, what i would like to be able to do is to spawn a terminal running this zsh function.
i tried running e.g.: `wezter... |
{"OriginalQuestionIds":[37984906],"Voters":[{"Id":14853083,"DisplayName":"Tangentially Perpendicular"},{"Id":1509264,"DisplayName":"MT0","BindingReason":{"GoldTagBadge":"sql"}}]} |
I regularly work with Python files that are provided to me as templates, which use an indentation of 2. However, I personally prefer working with an indentation width of 4, which is what I've set in my `.vimrc`. However, because of the indentation-sensitivity of Python, the typical `gg=G` way to fix indentation to my p... |
Today I upgraded Symfony-cli to version 5.8.13 with brew. In my project, I start a new web server: `Symfony-cli server:start`
After that I open my browser to 127.0.0.1:8000, but my web server Symfony crashes
```none
2024/03/23 10:19:36 http: panic serving 127.0.0.1:49889: runtime error: index out of range [0] wi... |
I have an esp32 and i wish to use it to drive a HC-SR04 sonar module. I use interrupts to get information from sensors,then I use a queue to pass the data to a freertos task to output it. At first, it work and output the correct data, but after few second, it report an error and reboot.
Here is the error:
Guru ... |
`valueFormatter` does work with sunburst. For `valueFormatter` to work properly,
1. It shouldn't be used along with `formatter`
2. EChart version should be at least 5.3.0
To separate thousands, this part:
```
tooltip: {
trigger: 'item',
formatter: '{b}:<br/><b>{c}</b>',
},
```
Has to be repl... |
Here is what worked for me:
Delete **package-lock.json**
Then try to redeploy your project `firebase deploy`
NB: this solution is not ideal but that's the only thing that's working for me at the moment
|
Recently added an experimental implementation of server contexts to the [next-impl-getters][1] package. The implementation API mirrors client contexts, so there should be no difficulties in using them.
The alternative is to use the [unstable_cache][2] function.
[1]: https://github.com/vordgi/next-impl-getters... |
Try this:
<p-tree [value]="files">
<ng-template let-node pTemplate="default">
{{ node.label }}
</ng-template>
</p-tree>
https://www.primefaces.org/primeng-v16-lts/tree#template |
I would suggest to use Winulator or Box86 in Termux. I have found in personal experience that QEMU is very slow to load, slow after loading, and very memory hungry. |
{"Voters":[{"Id":87189,"DisplayName":"tadman"},{"Id":9223839,"DisplayName":"Joakim Danielson"},{"Id":3695849,"DisplayName":"Teja Nandamuri"}]} |
Given an linear system Ax=b, x = [x1; x2], where A,b are given and x1 is also given. A is symmetric. I want to compute the gradient of x1 in terms of A,b, i.e. dx1/dA, dx1/db. It seems that torch.autograd.backward() can only compute the gradient by solving the whole linear system. But I want to make it more efficient b... |
It is not necessary to notate these relationships in the model. The reason we write those relationships is that we can build queries easier.
For example: you have a User model which has a one-to-many relationship with a Post model, you can define the relationships in the models like this:
User.php
public ... |
Is there a way to make this request with UrlFetchApp in app script?
`curl -X GET http://test.com/api/demo -H 'Content-Type: application/json' -d '{"data": ["words"]}'`
I attempted it with this code:
```
const response = UrlFetchApp.fetch(API_URL, {
method: "GET",
headers: { "Content-Type": "applicatio... |
You could use subsetting in base R:
df$newd <- df[-1][cbind(seq_len(nrow(df)), match(df$time, names(df)[-1]))]
df
time M0 M12 newd
1 M0 1 8 1
2 M12 2 5 5
3 M0 4 9 4
4 M0 5 2 5
5 M12 1 1 1
---
Another way-though abit inefficient:
... |
I have powershell code where I am trying to fetch the releases using azure devops rest api and able to do it successfully I am using below rest Api. Only the issue which I am facing is when I check from azure portal it is having more releases of that particular deployments whereas rest api is giving me only top 6-7 rel... |
Azure devops rest api is giving me only few releases information.? |
|azure|azure-devops|azure-devops-rest-api| |
`page:finish` is triggered when the page has been rendered. It does not wait for any API call the page might have made, which would then trigger further updates to the page layout.
What should work is calling
```
nextTick(() => router.go())
```
after the page updated the data.
To my knowledge, it reloads ... |
This 'Microsoft.Bcl.AsyncInterfaces' have dependencies on .NETFramework v4.6.2, .NETStandard v2.0 and v2.1. This dll is used in .NETFramework v4.8 application while accessing this dll i throws exception '**Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' o... |
.Net 4.6 framework dll trying to load it's netstandard2.1 dependency |
I have a C# DLL which already uses `CsvHelper` to read CSV files. So I was wondering if `CsvHelper` has the capacity for me to simply pass it a `string` (*not* a file) and it return the list of tokens?
So much so, that:
> 2023/11/06,Name,PartType,"“Hey, This is the Theme!”",1
becomes a list:
1. 2023/11/06
... |
I am trying to use ```mutate``` + ```ifelse``` to create a new variable in the dataset.
My example dataset is below
```
df = structure(list(id = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), resp_gender = c("female",
"male", "female", "female", "male", "female", "male", "male",
"female", "female"), hoh_gender = c("male", "m... |
add `max-height: calc(100% - 1.4em);` to data class. |
Note: I simplified the code for testing.
I have an express.js route with the following code:
```
// /auth/register/confirm/:confirmationToken
const registerConfirm = asyncHandler(async (req, res, next) => {
console.log('registerConfirm');
res.status(httpStatus.OK).json({ msg: 'Registration confirmed' })... |
spawn terminal running zsh function from plugin |
|shell|terminal|zsh| |
{"OriginalQuestionIds":[70685602],"Voters":[{"Id":2886891,"DisplayName":"Honza Zidek"},{"Id":2696260,"DisplayName":"M. Deinum","BindingReason":{"GoldTagBadge":"java"}}]} |
Is there a firewall rule you need to allow for clamav on port 3310? That solved the issue for me on AWS. I had to include an inbound rule for ClamAV on port 3310 to create a socket file. |
In my case, I did not build "Authentication" in my Firebase project. After built it and configured providers, I could find the `CLIENT_ID` and `REVERSED_CLIENT_ID`. |
Why aren't my card box shadows showing in the browser? |
Using LEAD to get next distinct date |
I wish to use flags such as `i` (case insensitive) and `s` (dot matches new line) in BigQuery using REGEXP_REPLACE.
For the inputs,
`My name is X`, `my Name is Y`, `MY NAME is Z`, i wish to replace X,Y,Z with some constant C, such that the output is for ex. `My name is C`
I know that you can use these flags in t... |