Skip to main content

Posts

Receiving an error when requesting an exchange?

Good afternoon, I have a very intriguing question: When trying to send a request through requests python gives out a 403 error, although I have fully copied all the cookies and headers from the request that sends the site exchange - bitget import requests cookies = { deleted cookies, but they are in the code } headers = { 'authority': 'www.bitget.com', 'accept': 'application/json, text/plain, */*', 'accept-language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7', 'content-type': 'application/json;charset=UTF-8', 'language': 'ru_RU', 'locale': 'ru_RU', 'origin': 'https://www.bitget.com', 'referer': 'https://www.bitget.com/ru/spot/ETHUSDT?type=spot', 'sec-ch-ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"', 'sec-ch-ua-mobile...

Can't call a value from inside an object dynamically based on a variable. ( Reference error: Not defined )

I have multiple objects set up within other objects and would like to call specific values inside of them based on the user input ( a preset value in this example for simplicity ) but I get an error whenever I try to call those values/numbers I want. let creekchub = { islandWarrior: { iw2: { sb: 850, tgttos: 1670, hitw: 2300, bb: 1985 }, iw1: { sb: 600, tgttos: 1850, hitw: 2100, bb: 1650 } } } let player = "creekchub"; let server = "islandWarrior"; let event = "iw1"; console.log(player.server.event.bb); Is my first attempt. My expected output would have been 1650 however I get a error: "Reference Error: islandWarrior not defined" I tried something similar but with a function typefunction printStats(player,server,event){ console.log(player.server.event.bb); } printStats(creekchub,islandWarrior,iw1); here but it has a similar issue, simply outputting the same error. Is ...

Django Collect Static says 0 static files copied

I want to get run python manage.py collectstatic To collectstatic files but it not working But it says 0 static files copied to.... Here in my setting.py looks like that. I have static folder in my root folder and still not working evertime it says 0 static files copied to ... and I think because of it now my admin page looks like with out CSS enter image description here Settings.py code from django.contrib.messages import constants as messages import os from pathlib import Path import cloudinary import cloudinary.uploader import cloudinary.api from dotenv import load_dotenv load_dotenv() # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY') # SE...

How to enable and disable button using summernote?

Is it possible to disable/enable the buttons of the editor without removing the buttons from the toolbar? Summernote toolbar looks like this: toolbar: [ ['style', ['bold', 'italic', 'underline']], ['fontsize', ['fontsize']], ['color', ['color']] ] I want to disable the "color" button while at the same time keeping it visible on the toolbar Im using Summernote library. Via Active questions tagged javascript - Stack Overflow https://ift.tt/UVk9zZ7

nodejs convert raw image file (.NEF) to jpg

I'm trying to build a tool to convert raw images in the .NEF format into .jpg files. Is there an NPM library that can do this for me? Or an example where someone has parsed the actual image data off of a .NEF and saved it as a .jpg using javascript/nodejs? Via Active questions tagged javascript - Stack Overflow https://ift.tt/UVk9zZ7

Indesign Script - Keep reference of nested pageItem in group while duplicating it

I am on InDesign 2023. VisualStudioCode. I have a group of nested textFrames. I track the textFrames by their id. Now i need to duplicate these groups but still keep track of the textFrame duplicates. Example: Let's say i have a group of pageItems (can be deeply nested and/or anchored): Rectangle with id 1 TextFrame with id 2 TextFrame with id 3 (and many more) I need to insert text in TextFrame with id 2. No problem by getting it by id. Now i need to duplicate the wrapping group to a new location. No Problem too. On duplicating, the id of the textFrame inside the group changes and i obviously loose my reference of it. So what i do is to use the label of the textFrame to store the id as string and recursively look for that in the duplicated group. This way i can identify the duplicated textFrame and continue using it, but is very slow for large groups and tons of duplicates. So i was wondering if there's a more efficient way of accomplishing this task to keep a ref...

Node.js exposing information from python script to ngrok for a get request

So im trying to get info i get from my python script exposed on a tunnel i made using ngrok but for some reason i cant seem to make it appear on the set route anyone who knows why ? it writes to the output file but i tried consol logging it nothing works and i try to understand why the text from the output is not being stored and updated on the tunnel const express = require('express'); const { spawn } = require('child_process'); const fs = require('fs'); const app = express(); const port = 4000; let lastDeliveryMessage = ''; app.use(express.json()); app.post('/execute-script', async (req, res) => { try { const { naam } = req.body; // Ensure naam is provided if (!naam) { return res.status(400).json({ success: false, message: 'No naam provided' }); } // Execute the Python script await executeScript(naam); // Wait a bit before reading the file to ensure that ...