instruction stringlengths 0 30k ⌀ |
|---|
You're not distinguishing between `NULL` and the empty string (`''`) - this first query shows you where the problem is, the second shows a solution (all of the code below is available on the fiddle [here][1]):
SELECT
post_id,
COALESCE
(
array_to_string(array_agg(DISTINCT t... |
Vector by Scalar Division with -ffast-math |
|arm|sse|division|fast-math| |
I'm trying to use OpensearchVectorClient() function in llama-index but I've run into a problem while calling OpenSearch: "object tuple can't be used in 'await' expression".
Here my code:
import boto3
from opensearchpy import RequestsHttpConnection, AWSV4SignerAuth
from llama_index.vector_stores.opense... |
I have a numpy array that contains both sub-arrays and an **integer**:
```
mixed_array = np.array([np.array([1, 2]), np.array([1, 2]), 0])
```
I want to mask the array so that I am left with only the sub-arrays and not the **integer**.
```
mixed_array = np.array([np.array([1, 2]), np.array([1, 2]))
```
I am... |
|python|paypal| |
You should specify the table where your list of languages is:
```go
var languages []Language
err := db.Table("TableOfLanguages").Find(&languages).Error
``` |
|javascript|roblox| |
|python|curl|python-requests| |
|php|laravel-10| |
I cannot figure out how to install [_Gym Retro_](https://github.com/openai/retro?tab=readme-ov-file#gym-retro). I follow the official [documentation](https://retro.readthedocs.io/en/latest/developing.html#development) but without success. I have tried to check further online sources but again no useful.
These are th... |
How to install openai-retro on Linux? |
In my file, I list the championship days by group: [https://docs.google.com/spreadsheets/d/1zYplMk2HOs-AC84sgRH1hDMH5-Yq2DuZ-XzXW3R0kBI/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1zYplMk2HOs-AC84sgRH1hDMH5-Yq2DuZ-XzXW3R0kBI/edit?usp=sharing)
As the days do not correspond to the same dates for the diffe... |
django allauth settings.SOCIALACCOUNT_ENABLED overwritten? |
|django|django-templates|django-allauth|django-settings| |
This is not caused by `subplot_mosaic` but because a `layout` was specified. If you use constrained or tight layout, the layout manager will supersede the custom adjustments.
Remove the layout manager and either method will work:
<a href="https://i.stack.imgur.com/jLUdY.png"><img src="https://i.stack.imgur.com/jL... |
I have a C#/Blazor project where i use tailwindcss for the user interface. Visual Studio highlights the @apply directives from tailwind as unkown @-blocks. Are there any ways to teach Visual Studio about them, disable this warning or replace @apply by some known directives?
Example:
```
table {
@apply table-... |
Is there a way to support Tailwind @apply in Visual Studio? |
|visual-studio|tailwind-css| |
# Hello! I'm developing a project on Raspberry Pi Pico W and I'm trying to setup a custom Wi-Fi Manager using [AsyncWebServer_RP2040W library](https://github.com/khoih-prog/AsyncWebServer_RP2040W) and [AsyncTCP_RP2040W](https://github.com/khoih-prog/AsyncTCP_RP2040W) on [Arduino Pico](https://arduino-pico.readthedocs.i... |
Async Web Server RP2040 returning ERR_CONNECTION_REFUSED? |
|http|arduino|http-get|arduino-c++|raspberry-pi-pico| |
null |
Is there a way in vscode to after I type Ctrl + . and accept a correction wewith quick fix, to automatically run the key combo Alt+F8 to move to the next problem without having to?
I use a spelling extension and it to correct a word by selecting Ctrl+ . then selecting the correct suggestion. However after this selec... |
In vscode how do I automatically go to next problem in my problem list after correcting an error with quick fix |
|visual-studio-code| |
I been trying to fix my code for it to give me the right number of nodes within the netlist and it keeps getting one less node than what it actually is, this is the part of my code that reads and analyze the info from the file. I am going insane at this point ); ( I already asked ai to help me fix this issue and nothin... |
I'm having trouble accessing a custom header named X-Subject-Token in the response of an AJAX request using jQuery. Here's my code:
async function submitHandler(e) {
e.preventDefault();
let BASE_URL = "http://{my-ip}:3005"
if (usernameInput.value && passwordInput.value) {
... |
I don't know why, and I don't know how, but this works for me.
I get camera intrinsic and extrinsic matrix from pybullet camera parameters by these 2 functions.
def get_intrinsics(fov, aspect, width, height):
fx = width / (2 * aspect * np.tan(np.radians(fov / 2)))
fy = height / (2 * np.tan(np.... |
null |
In MudBlazor you can use theme Colors or `Palette colors` Like:
`Color.Primary`, `Color.Secondary` ...ets
for more see [this link][1]
```razor
<MudText Typo="Typo.h6" Color="@(ShouldBeError ? Color.Primary : Color.Secondary)" > Some text </MudText>
@code {
private bool ShouldBeError = true;
}
```
... |
Since I have finally fixed it, it took me a little bit, and i am not sure if i fixed it fully but here's what i did:
1. deleted the older AVD i have and made a new one.
2. in my project directory, i deleted the /.gradle and the /.idea (kept a back up of this one just in case).
3. navigated to /.gradle directory... |
Emmm my bad. It turns out I need to open ICMP type 8 in security list. BY Default other icmp types are allowed:
https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/compute-cloud-at-customer/topics/network/security-rules.htm#:~:text=There%20is%20no%20default%20rule,0.0%2F0%20for%20the%20source. |
Since I have finally fixed it, it took me a little bit, and i am not sure if i fixed it fully but here's what i did:
1. deleted the older AVD i have and made a new one.
2. in my project directory, i deleted the /.gradle and the /.idea (kept a back up of this one just in case).
3. navigated to /.gradle directory... |
fixed it i accidentally had the wrong java version installed and i didnt have jdk 8 set to java home i fixed it all now tho |
I am experiencing a BeanCreationException when trying to deploy my Spring Boot application. I am able to build and run the app on my local computer but when I try to run it on an EC2 ubuntu or in a docker container on my local machine I get the following error.
```
Running com.horvath.ballparkpalapi.BallParkPalA... |
BeanCreationException when deploying Spring Boot app |
|java|spring-boot|maven| |
null |
Probably, when `onUpdate` in your `useEffect` changes the state of `ProjectFeatureListing`, the rerender recreates the `['title', 'description']` object and the `FilterInput` gets a new reference to another object with the same properties, which is why the callback in useMemo is called and the `fuse` variable changes, ... |
I have a web graph with six nodes (P1, P2, P3, P4, P5, and P6) and 10 edges connecting them. I am trying to calculate the personalized PageRank for each node for the first two iterations in the graph. The personalized PageRank is computed based on a specific source node, in this case, P3.
In personalized PageRank:
... |
|typescript|nestjs| |
null |
I want to make a simple html page with 4 images displayed at a time and a next button.
Basically I have list of image urls. At the start, the first 4 images from the lists will be shown in the page. Then, when next button is clicked, the next 4 will be chosen and replace the first 4 images displayed. When it reach t... |
How to update Images from list of image urls when Next button is clicked |
|javascript|html| |
null |
So i have 2 sql queries.
Query 1:
SELECT SUM(PrincipalBalance)
FROM
(
SELECT lt.AccountId
,SUM(CASE
WHEN TransactionTypeId IN (1)
THEN PrincipalPortionAmount
ELSE 0
END)
- SUM(CASE
WHEN TransactionTypeId NOT IN (
1
,2
)
THEN ... |
Group By Sum and without Group by sum Amount is different |
|sql-server| |
when i click on link it is taking me to '/product/api/product/2' URL but I have defined /api/product/<str:pk>/
for backend I'm using django.
```
import React from 'react'
import { Card } from 'react-bootstrap'
import Rating from './Rating'
import { Link } from 'react-router-dom' // we are using this to ... |
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<html>
<title>
test
</title>
<head>
<style>
.header {
position: absolute;
font-family: 'Lucida San... |
I was learning to do classification with the MNIST dataset. And I got an error which I am not able to figure out, I have done a lot of google searches and I am not able to do anything, maybe you are an expert and can help me. Here is the code--
>>> from sklearn.datasets import fetch_openml
>>> mnist = fetch... |
three parameter log normal distribution |
|logging| |
null |
IIUC, you can use [tag:numpy] broadcasting to form a mask per "main" and use this to find the first num1>num2 while considering only the next groups:
```
def find(g):
# get sub as 0,1,2…
sub = pd.factorize(g['sub'])[0]
# convert inputs to numpy
n1 = g['num_1'].to_numpy()
n2 = g.loc[~g['sub'].... |
[![enter image description here][1]][1]
In git lens I can see the commit details gets added to the right of the code line. Does anyone knows which feature of VS code extension us used to display such message in the right side of the code line. When I searched, I could see that Code lens extensions only support the act... |
Trying to fix my c++ code for it to read the right amount of nodes from a file |
|c++|parsing|ifstream|ss| |
null |
Trying to do the following on hackerrank question, what am I doing wrong.
select
a.company_code, a.founder, a.lead_mang, a.sen_mang, a.mang, a.emp
from
(select
distinct company_code,
founder,
(count(distinct lead_manager_code) over (partition by company_code)) lead_mang,... |
Join statement with nested select |
|mysql|window|nested-select| |
null |
If I understand correctly, you have two repositories: a main repository and a submodule repository containing a YAML config file.
Currently, your pipeline is configured to use the main repository as the source, which means you can't map the YAML file from the submodule repo for your pipeline definition.
If this... |
1. Remove all installed `ffmpeg`:
```shell
sudo apt-get remove ffmpeg
sudo apt-get purge ffmpeg
```
2. Delete the the Anaconda `ffmpeg` module from your environment:
```shell
conda remove ffmpeg
```
3. Reinstall `ffmpeg`:
```shell
sudo apt-get install ffmpeg
``` |
I made a new subdomain for example
```
server {
server_name wss.yourdomain.net www.wss.yourdomain.net;
access_log /var/log/nginx/wss_access.log;
error_log /var/log/nginx/wss_error.log;
root /var/www/yourdomain.net/public;
index index.php;
charset utf-8;
location / {
... |
You can just set your columns by `ColumnPanel` option in `slotProps`.
https://v6.mui.com/x/react-data-grid/column-visibility/#customize-the-list-of-columns-in-panel
```ts
// stop `id`, `__row_group_by_columns_group__`, and `status` columns to be togglable
const hiddenFields = ['id', '__row_group_by_columns_grou... |
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<html>
<title>
test
</title>
<head>
<style>
.header {
position: absolute;
font-family: 'Lucida San... |
You'd have to edit file `gradle/libs.versions.toml` and add in TOML format:
[versions]
androidx_media3 = '1.3.0'
androidx_compose_bom = '2024.03.00'
androidx_compose_uitest = '1.6.4'
# ...
[libraries]
androidx_media3_exoplayer = { module = "androidx.media3:media3-e... |
How to create code lens action next to code line in vs code, something similar to GitLens |
|visual-studio-code|vscode-extensions|gitlens| |
I'm trying create a docker-compose file to connect a backend created in nodejs using typeorm to manipulate and connect with a postgresql database, but always is getting error. It's working in separeted containers but when I try to connect the typeorm using service name in docker-compose always returns connect ECONNREFU... |
This worked for me:
```
import { Amplify } from "aws-amplify";
import amplifyconfig from "./amplifyconfiguration.json";
Amplify.configure(amplifyconfig);
```
|
I am using a storybook version 8. I have a select component that takes in two arguments: number and function. Function is being called on select change event and should change number argument to a new selected value. How can I do this?
This is storybook story:
```
const meta = {
title: 'SelectInput',
compone... |
Here is a function and a sample json file to test it on. This function is applicable to any type of json, with or without nested fields.
```
data = [
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"location": {
"city": "New York",
"co... |
again me.
I use the following code to open a new flaps on the navigator:
**function openNewWindowWithPost(url, params)
{
const form = document.createElement('form');
form.method = 'POST';
form.action = url;
form.target = '_blank';
for (const key in params)
{
... |
Close flap of navigator using javascript |
|javascript|php|html| |
null |
null |
null |
null |
I send a http request then I accept result data, and router a new page.
but APP crashes! I don't know why……
I use iOS simulator ,iOS version is 17.4
code:
`verificationCode(params.phoneNum as string,text).then(
(resultJson) => {
router.replace('/main/Main');})`
I try to router.push... |
expo-router replace to new page then crashes |
|react-native|expo|expo-router| |
null |
I'm currently deploying an application using `Django Channels` in Production environment.
The target application is based on the sample app from the official `django channel` documentation.
https://channels.readthedocs.io/en/latest/tutorial/index.html
I've confirmed that it works well in a production environment... |
I am traying to create a tree chart showing all departments under different companies.
I tried following code.
```
SELECT
c.company_name AS cmp,
d.department AS dept
FROM
_companies c
LEFT JOIN
_departments d ON c.id = d.company_id
where c.company_name is not null and c.company_name <> ... |
How to create Tree chart in Apache Superset |
|apache|visualization|apache-superset|preset|treechart| |
null |
I'm unable to ping any website from an instance which has only ipv6 address assigned whereas I'm able to access internet if I create a windows instance with same settings (Ubuntu or Amazon Linux instances are not working), some of the details are as follows
[ip -6 addr][1]
[1]: https://i.stack.imgur.com/HqzJ0.p... |
How to get argument from Command line for my python package |
|python|command-line|package| |
null |
I am designing my first green field enterprise software. Users submit requests in `initial state`. Then, the system should check some required fields and might call some regulatory external APIs `asynchronously` and update the state of the request and inform the user. There are several `states` and `events` like this f... |
How to design a request processing system calling external APIs with spring boot? |
|spring-boot|system-design|event-driven-design| |