instruction
stringlengths
0
30k
As the title says, I use next-sanity for my Next.js blog. I recently wanted to update all npm packages. Now I can´t run `npm run build` as the one of the dependncies itself throws a type error as follows: ```console ./node_modules/@sanity/types/lib/dts/src/index.d.ts:756:3 Type error: Type parameter declaration ...
Sanity npm package throws type error on build
|typescript|next.js|sanity|
null
I have my own little graph class and I want to create a graph by reading in a file, containing the necessary information like number of vertices, edges, etc. The files are in the STP format. The code works fine, if I just read in the file word by word. Now I need to identify certain keywords like "Nodes", followed...
segmentation fault while reading in text file ( c++ )
|c++|file|segmentation-fault|
null
<!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> function palendrom(str){ let data = str.split(" ") let res = []; for(let a=0; a<data.length; a++){ let rev = ''; let subStr = data[a]; for(let i = subStr.length-1; i...
I have to click on "choose File" button and it opens the fileopen dialog. I need to check if file exists or not. Here is the code ```cs public static void UploadFile(IWebDriver driver, string photoLocation, string photoName) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); ...
I don't understand why My http PUT requests can't send data back to the database even though I checked in the console and made sure the data has changed. ``` import React, { useEffect, useState } from 'react' import './Win_Put_Data.css' import axios from 'axios' const Win_Put_Data = ({databaseRow}) => { ...
I have a domain model of user where I store `original` user state and `current`. If property from current state doesn't match original - it needs to be updated in database and included in sql query. Creating similar compare methods for each property becomes repetitive and I wanted to know, is there a way to replace ...
I started gVim lately in offline window pc. Specification is below... gVim - 9.1.0211 -64bit python - windows embedded 3.11.8 (pandas 2.2.1) - 64bit vimrc - filetype plugin indent on &_ set omnifunc=syntaxcomplete#Complete After typing "import pandas as pd pd.", I pressed <C-x><C-o> then it shows "p...
vim python omnifunc not working some modules
|pandas|vim|
null
I used this code snippet inside one of my useEffect hooks. But it mutates the object and shows me the message to be appeared twice. setConversations((prev) => { const oldConversation = room in prev ? prev[room] : []; const newConversation = [ ...oldConversation, { sende...
Recently, I've been trying to learn ARM assembly (ARM because my Mac can run it), but all the tutorials and recources that I can find all have slightly different variations, and the version that I have working is different again! Some of the versions I've seen have `.section .text` and `.section .data`, and other we...
Which version of ARM does the M1 chip run on?
|assembly|arm|
null
|google-apps-script|libraries|external|luxon|
|google-apps-script|momentjs|libraries|external|
1. How can I run a bat file in tablet? 2. if not, have any file can instead bat file to run in tablet? I want to run a website by **bat** file in tablet. because don't want customer using tablet to run other application. It allow a web pop-up window.
Is there BAT file can run in TABLET?
|tablet|
null
Here the pg_available_extensions word is selected: ![enter image description here](https://i.stack.imgur.com/nWtnd.png) The selection is not visible I tried to find a configuration parameter that would address this issue and could not find one. I lost hours trying to fix this as there are behavior associated t...
I have a dataset with 3 variables: `test_date`, `unique_ID`, and `location`, which provides location of testing and can be either `"department"` or `"practice"`. I want to exclude data from my dataset if the unique ID is present for more than one occasion within a 30 day period. Also the location must be `"practice...
{"Voters":[{"Id":874188,"DisplayName":"tripleee"},{"Id":286934,"DisplayName":"Progman"},{"Id":354577,"DisplayName":"Chris"}],"SiteSpecificCloseReasonIds":[18]}
How to have multiple rules file on Loki (Kubernetes)?
|prometheus|grafana-loki|observability|
React Native developers are frequently confronted with the decision between utilizing Expo CLI or opting for a bare React Native app. Expo CLI offers a streamlined development experience, bundling essential tools and components to expedite the development process. It simplifies tasks such as project setup, deployment, ...
Which is better for developers to develop? React Native with expo CLI or Bare React Native app.
|android|expo|hybrid-mobile-app|ios|react-native|
I need to set the value of a boolean to True if the value of any order_line is 11, however it does not work if I set the line using "l.route_id == 11", if I set the line to "lambda l: l.route_id" it works but it could have other number different than 11. route_id will be Null usually. The database format of route_id...
Comparing value from a foreign key in Odoo
|python|mysql|odoo|
null
I'm trying to set up a conversation ender for my botpress bot. So anytime the user would type end, a workflow should be triggered that will end the conversation. I've tried to add intents, triggers... but nothing seems to work.
Updating objects of key array pairs without mutation
|reactjs|react-hooks|
After going through the replies and reading the official documentation extensively, I found that the @annotation value requires the custom annotation's object rather than class. Ref - https://docs.spring.io/spring-framework/docs/2.5.x/reference/aop.html#aop-ataspectj-around-advice (Heading 6.2.4) so my Aspect cl...
{"OriginalQuestionIds":[73754664],"Voters":[{"Id":17865804,"DisplayName":"Chris","BindingReason":{"GoldTagBadge":"fastapi"}}]}
`props<{ value: number }>()` it's generics, not an embedded DSL. You get that error because `{ value = 0 }` is not a valid type. `{ value: 0 }` is, but it means that `value` is always `0`. If you want to signify that there's a default value, use `props<{ value?: number }>()` or `props<{ value?: number|0 }>()`. ...
Add a Box element inside of the Card element and use the minHeight property: https://polaris.shopify.com/components/layout-and-structure/box Your layout section should look something like this. If you have three of these Layout.Sections next to each other, they would all have the same height unless one extends pass ...
Why I Cann't use PUT requests?
|reactjs|react-native|http|frontend|put|
null
Within the function `sumAtBis` int sumAtBis(tree a, int n, int i){ if(i==n){ if(isEmpty(a)) return 0; else return root(a); } return sumAtBis(left(a),n,i+1)+sumAtBis(right(a),n,i+1); } there is no check whethe...
Here is what I implemented form last time and this code is working for most of my test cases but it is not working for these cases. ``` #include <climits> #include <cmath> #include <iostream> #include <limits> #include <stdexcept> #include <string> #include <vector> long long ConvertStringToNumber(std::s...
Bitbaking recipe doesn't install DEPENDS
|yocto|bitbake|yocto-recipe|yocto-kirkstone|
null
I do not have a lot of experience with AWS Cognito. In Javascript, I can authenticate with other user's pool using below code: import dotenv from 'dotenv'; dotenv.config(); import { CognitoUserPool, CognitoUser, AuthenticationDetails } from 'amazon-cognito-identity-js'; export async function...
Python AWS Cognito authenticate to other user pool as in Javascript
|python|amazon-web-services|amazon-cognito|
I'm attempting to retrieve user data, but the method is returning an empty object. bot.py ``` menuId = "id" server = "http://127.0.0.1:3000/" webapp = "https://localhost" + "/" + menuId bot = telebot.TeleBot(API_TOKEN) def webAppKeyboardInline(): keyboard = types.InlineKeyboardMarkup(row_width=1) ...
When I try to call the Telegram.WebApp.initDataUnsafe method in inline mode, the Telegram web app API returns an empty object - python
|python|telegram|python-telegram-bot|py-telegram-bot-api|telebot|
null
if [ "$req" = 1 ] or even better if [ "$req" -eq 1 ] See the syntax and operators in [man test](https://linux.die.net/man/1/test).
I have a set of functions which all accept a `value` named parameter, plus arbitrary other named parameters. I have a decorator: `lazy`. Normally the decorated functions return as normal, but return a partial function if `value` is None. How do I type-hint the decorator, whose output depends on the value input? ...
ultralytics_crop_objects is a list with like 20 numpy.ndarray, which are representing pictures (59, 381, 3) e.g.:[ultralytics_crop_objects[5]](https://i.stack.imgur.com/x6QvJ.png). I started passing a single picture out of the list to recognize. pipeline.recognize([ultralytics_crop_objects[5]]) --> ji85...
I would like to do ldap authentication in spring boot security but take roles and other information ( like user region ) from a db. I came up to a UserDetaisContextMapper impl like: @Component public class UserDetailsContextMapperImpl implements UserDetailsContextMapper { @Autowired ...
The documentation shows you how it works in one file, but in a real-life project you will need to separate the models in different files and their logic will be in separate files as well. You need to connect to sequelize and then register the models in your entry point file like that ```js // app.js setupSeq...
If you're writing something that does "the same thing, with just one thing changing at each step", that's a loop. You don't use separate `if` statements. Not even "when you're lazy": being lazy is an _excellent_ property to have when you're a programmer, because it means you want to do as little work as possible. Of c...
PROGRAM 4: Rolling Table Using the ROL and ROR instructions, write a program to produce a rolling table. This table should be built from a single int8 value provided by the user and print 3 rows from the starting value, each offset by one from the starting value. In each individual row, the entered number should be R...
How can I fix the middle row to be printed out correctly?
|hla|
null
You need a single SELECT joining the two tables: INSERT INTO ROLE_AUTHORITY_MAPPING (authority_id, role_id) (SELECT security_authorities.id, security_roles.id FROM SECURITY_AUTHORITIES cross join SECURITY_ROLES WHERE authority = 'READ_SELF' and name = 'USER');
I have a problem with integrating Firebase into my Flutter project. As soon as I add the firebase_core in my project in the pubspec.yaml file, I get two errors. One of them is multidex support which can be fixed and it's okay. But the other one is a compilation error. Here is the error: ``` e: C:/Users/DELL/...
I'm dealing with a little problem that I need to solve. I have an application in Django and I need a websocket, but I don't like Django channels, so I created a socket server in Flask and I'm trying to connect Django to it, by creating middleware that when called starts a process that sends messages through the process...
In trying to understand how to work with classes, objects, and methods, Please explain why print(list.sort()) does not work like list.sort() followed by print(list). list = \[5, 1, 2\] print(list.sort()) #output is None VS. list.sort() print(list) #output is \[1, 2, 5\] Explained above: I expect...
Why does print(list.sort()) result in None?
|list|methods|printing|
null
When I checked the responses I saw that I get the same page over and over. If we use BurpSuite to inspect the requests and compare them we can see this part: [![BurpSuite comparer][1]][1] You can see on the RHS the the value "Next", but if we inspect the form data in the response we can see that the value is mis...
|r|data-analysis|
`forumsite.com##li:has(a.username[title*="NaughtySpammer"])` did the trick for my needs, but I wouldn't hate to see other solutions, especially if they are more expedient or would allow multiple spammer names included on one line.
{"Voters":[{"Id":2123530,"DisplayName":"β.εηοιτ.βε"},{"Id":9214357,"DisplayName":"Zephyr"},{"Id":354577,"DisplayName":"Chris"}],"SiteSpecificCloseReasonIds":[13]}
The sigmas and pis aren't random. They're from SQL nomenclature. See [here](https://cs.nyu.edu/~jcf/classes/CSCI-GA.2433-001_sp15/slides/session5/RelationalAlgebra-RelationalCalculus-SQL.pdf) The sigma is a selection criteria and the pi is an attribute list. As to the sizing, [the docs](https://pola-rs.github.io/...
{"OriginalQuestionIds":[46270274],"Voters":[{"Id":28128,"DisplayName":"David Grayson"},{"Id":633440,"DisplayName":"Karl Hill"},{"Id":354577,"DisplayName":"Chris"}]}
When i write "." in IntelliJ no text comes. Heres what it looks like for me: [enter image description here](https://i.stack.imgur.com/7wlKd.png) And here is what im trying to get: [enter image description here](https://i.stack.imgur.com/uC98f.png) I have searched all over the place, but i just cant seem to fin...
Why is there no help text when i write "." in IntelliJ?
|java|intellij-idea|
null
Hello I wrote a program that creates 6 customized widgets which I called `Cell` and I want them to swap locations if one of them overlaps another. So I wrote a function called `swap_locations` and it works properly at first but when I try to swap the Cell (which I first selected) again it takes the target Cell's place ...
Botpress conversation ender
|bots|robot|botpress|
null
Just found out that the GC is not all that great at handling cyclic references in some cases... Use a ```WeakReference<RefType>``` and this creates a dead end anyway. Coming from C++ its been a bumpy road with the GC. In c++ unique and shared pointer are just more powerful. GC is ok but then... meh... :)
I'm using roproxy instead of roblox to get around cord measures, requestbody is username,ctype ,password and useridand for the headers I'm just doing xcrs token:xcrs. It's just returning 403(). Is this an xcrs token thing? Couldn't find anything about it online. Ideally, it would print the incorect password error, o...
The `results` Mongo collection contains the following documents: ```json [ { "id": 1, "failures": [ { "level": "BASIC", "message": "failure", }, { "level": "BASIC", "message": "failure", }, { "level": "WARNING", "mes...
Kotlin Version Error in Integration of Firebase
|flutter|firebase|kotlin|google-cloud-firestore|
null
If this error occurs from the start of the script run and before any video frames have been successfully processed, the problem may be in the incorrect video path. You can try to specify the full path instead of the relative one, and even test different videos to check if the error still exists. If the error occurs ...
I am trying to develop a plugin to export markdown file to PDF. Here is a sample markdown content: ``` # What is Obsidian ? Obsidian is a **markdown** editor. ``` I am using `marked` library to convert `markdown => html string` after which using `html` function of `JSPDF` library to convert to PDF and save ...