Stack Overflow Questions
2,910 FOLLOWERS
Stack Overflow is the largest, most trusted online community for developers to learn, share their programming & technical knowledge, ask questions and build their careers. It is empowering the world to develop technology through collective knowledge.
Stack Overflow Questions
4h ago
I need your help.
I'm building a new service and, for now, I am using the free plan of Vercel (but I will upgrade to Pro within July). I am using Atlas MongoDB as the database service, but I want to switch to MongoDB provided by OVH (to meet the requirements of my biggest prospect who wants to use my service as soon as it is released). OVH requires a list of IPs to allow connections, so I need to know how Vercel manages the IPs of deployed services (do they change with every deploy? Where can I see the IP's value for a specific deploy?).
Thanks to everyone ..read more
Stack Overflow Questions
4h ago
I'm trying to attach a payment method to a customer using the Stripe API in my Node.js application. However, I keep encountering the error StripeInvalidRequestError: No such customer: 'pm_1xxx'. According to the Stripe documentation, the function should work this way, but I still receive the error.
Here is the function I am using:
import Stripe from 'stripe';
const stripeClient = new Stripe('your-secret-key');
async function attachPaymentMethod(
paymentMethodId: string,
customerId: string,
): Promise<Stripe.PaymentMethod | null> {
try {
const pm = await stripeClient.paymentMe ..read more
Stack Overflow Questions
4h ago
Firstly it was showing error for big query now suddenly appearing even to * from table I was doing a project it was almost done for some query it started showing error because data set was huge after changing timeout interval and other stuff it started to work and suddenly stopped working even for Queries like select * from table Anyone help none of the query is working in the table #MySQL
I'm expecting code to run without error which was working before ..read more
Stack Overflow Questions
4h ago
I'm building a Dropdown Menu and I've got stuck with the CSS when trying to align the Sub-Menu-1 so that its centred on the main menu heading. See this image enter image description here
Ive gone round in circles and the only way I can see to align it is to add a negative Margin to my .ul-sub-menu-1 enter image description here
This change dosnt feel like its the best way to achieve what i want and that i may hit problems down the line, So I thought it best to ask for some help here :-)
HTML
<!DOCTYPE html>
<html>
<head>
<title>World-War-2.org | World War 2 Timelin ..read more
Stack Overflow Questions
4h ago
I wanted to solve Erect The Fence from LeetCode. That's my code:
const double PI = 3.141592653589793;
double get_angle(const vector<int>& p1, const vector<int>& p2) {
vector<int> p{ p2[0] - p1[0], p2[1] - p1[1] };
double angle = atan2(p[1], p[0]);
angle = angle * 180 / PI;
if (angle < 0)
angle = 180 + (180 + angle);
return angle;
}
static bool comp(const tuple<double, int, int>& k1, const tuple<double, int, int>& k2) {
if (get<0>(k1) == get<0>(k2)) {
if (get<2>(k1) == get<2>(k ..read more
Stack Overflow Questions
4h ago
I have written a distributed spider using scrapy-redis. At first, everything seemed fine.
The distributed-workers file:
# distributed-workers.py
import scrapy
from scrapy_redis.spiders import RedisSpider
from vendor_scraper.items import ProductItem
from scrapy.loader import ItemLoader
class VendorSpider(RedisSpider):
name = 'distributed-workers'
allowed_domains = ['proxy.scrapeops.io']
redis_key = 'url_pools:start_urls'
redis_batch_size = 1 # Number of URLs to fetch from Redis at once
max_idle_time = 7 # Number of seconds the worker can be idle before stopping ..read more
Stack Overflow Questions
4h ago
while executing the Django project it displays the below error message
py .\manage.py runserver
Traceback (most recent call last):
File ".\manage.py", line 22, in <module>
main()
File ".\manage.py", line 14, in main
"Couldn't import Django. Are you sure it's installed and "
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
python version is 3.12 Django version is 5
the path of python is configured in the environment variables
i tried uninstalling and reins ..read more
Stack Overflow Questions
4h ago
I have a table called tblMain with the column col_a, col_b, col_c
col_a
col_b
col_c
Mr A
01/01/1950
12345
Mr B
02/02/1950
99999
Mrs C
03/03//1950
111111
I then have a view where I set the names to be more meaningful:
select col_a AS [Customer Name], col_b AS [Customer dob], col_c AS [Customer Order ID] from tblMain
Customer Name
Customer dob
Customer Order
Mr A
01/01/1950
12345
Mr B
02/02/1950
99999
Mrs C
03/03//1950
111111
However, I'd like to hold a mapping table where I can control the name of the outputted fields in the view dynamically.
So a new table cal ..read more
Stack Overflow Questions
4h ago
I am writing chisel for the following FIR circut (specifically to understand ShiftRegister in chisel as this can be done easily using NextReg in chisel).View Image here
I have written this code for this
class My4ElementFir(b0: Int, b1: Int, b2: Int, b3: Int) extends Module {
val io = IO(new Bundle {
val in = Input(UInt(8.W))
val out = Output(UInt(8.W))
})
val inDelayOne = ShiftRegister(io.in, 1)
val inDelayTwo = ShiftRegister(io.in, 2)
val inDelayThree = ShiftRegister(io.in, 3)
io.out := (b0.U * io.in) + (b1.U * inDelayOne) + (b2.U * inDelayTwo) + (b3.U * inDelayThree ..read more
Stack Overflow Questions
4h ago
From a UWP application I start this background task:
namespace Background.UWP
{
public sealed class BackgroundTask : IBackgroundTask
{
private WatchLoop _watchLoop;
public void Run(IBackgroundTaskInstance taskInstance)
{
ApplicationTriggerDetails details = taskInstance.TriggerDetails as ApplicationTriggerDetails;
var arg = details.Arguments["MyArg"].ToString();
// Start a loop that periodically does some checks
// and, if necessary, displays a toast with button "Show Details".
_watchLoop = new Watch ..read more