Quantcast
Browsing all 13921 articles
Browse latest View live

Using flask inside class

I have an application with many threads. One of them is flask, which is used to implement (auxiliary) API. It's used with low load and never exposed to the Internet, so build-in flask web server is...

View Article


How to zero pad an f-string? [duplicate]

Like this is how you can 0 pad a format stringfor i in range(10): zeropad = "Value is{:03}.".format(i) print(zeropad)and you get result asValue is 000Value is 001and so on...So, how can i do the same...

View Article


Why do I get different embeddings when I perform batch encoding in...

I am trying to encode some text using HuggingFace's mt5-base model. I am using the model as shown belowfrom transformers import MT5EncoderModel, AutoTokenizermodel =...

View Article

Problem filling up a list in the correct order while also avoiding duplicates...

I'm working on implementing the adaptive Simpson's rule for numerical integration in Python via a recursive function that iterates itself on the left and right side of an interval. In the algorithm, I...

View Article

I entered the code, I need to recognize and remove a certain word from the...

need to be deleted en masse, let's say in my case the word©pomogalka.me from the screenshot, I tried everything, no, it doesn’t delete.uploaded a photo screenshot with an example, please help me, good...

View Article


Python grpc server not working properly in docker container

I am having an issue running a python grpc server in a docker container, where my server is up and running but there are no logs showing up.This is what my proto file looks likesyntax = "proto3";// The...

View Article

migrated from pyglet 1.5 to 2.0 and now can't use colors. I looked at the...

import pyglet as pyprint(py.version)# Create a windowwindow = py.window.Window(width=500, height=500)circle = py.shapes.Circle(250, 250, 30, (255,255,0))@window.eventdef on_draw(): window.clear()...

View Article

task of validating that all elements in the input array are strictly positive...

Your assistance is required to verify that every single element in the input array exudes positivity. Your task is to scrutinize the code with precision and guarantee that this requirement is met...

View Article


I'm dealing with an infinite loop. What do I need to do to fix it?

I'm dealing with an infinite loop here. It keeps on printing: " You are over your budget!". I don't know what's causing it or how to fix it. `def main(): monthly_budget = int(input("Enter the amount...

View Article


Is there a way to integrate vector embeddings in a Langhcain Agent

I'm trying to use the Langchain ReAct Agents and I want to give them my pinecone index for context. I couldn't find any interface that let me provide the LLM that uses the ReAct chain my vector...

View Article

How to use UTF-8

Screenshot of a code about Valid CharactersSo I downloaded a Programm from Github and wanted to make a change since it wouldnt want to name Files with japanese characters.So i tried adding UTF-8 to...

View Article

Image may be NSFW.
Clik here to view.

Transpose a table using python

I have this table that I need to transpose it in a very specific way using Python:But I need to transpose it this following way:Meaning to transpose the headers except for the first column and then the...

View Article

How to add sprite clicked on collision without rects?

I am new to pygame, not python and I am trying to make a alien shooter game, and i want collision between the crosshairs and the sprite. I want to collide a circle with a alien image and a shape? I...

View Article


Inconsistent results when using Scipy Minimum Spanning tree with sparse and...

I have the adjacency matrix of a graph stored as sparse scipy scr matrix. When I call the scipy.sparse.csgraph.minimum_spanning_tree function, my generated sparse array have too few non zero values (...

View Article

Get the value of a read-only field in Serializer validation

Error:TypeError at /api/answer/'>' not supported between instances of 'NoneType' and 'datetime.datetime'serializer.pyclass AnswerSerializer(serializers.ModelSerializer): class Meta: fields =...

View Article


Validation Error : Unable to instantiate GPT4AllEmbeddings Model

I am encountering an issue while trying to create an instance of GPT4AllEmbeddings. However i keep receiving the following errorCell In[15], line 1----> 1 vectorstore =...

View Article

Standard convention when a property has to be accessed through its accessor...

Im asking this because I didn't find any answers that suffice my doubts about Uniform Access Principles in Python, and what is a good practice.Inside a class, I have the methodology to call or set a...

View Article


How do I extend to convert an integer to a character by using the 'chr()'...

I'm having trouble in the 3rd part of my Scripting homework.1.23 LAB: Warm up: Variables, input, and type conversion(1) Prompt the user to input an integer between 32 and 126, a float, a character, and...

View Article

Customtkinter and pyinstaller issue

I am trying to use pyinstaller to convert my code to an .exe but when I run the commandpyinstaller --noconfirm --name Pendu --onedir --icon=icon.ico --add-data...

View Article

How to pull a list from Excel and use said list to search a dynamic website?

Long story, short. I work for my local hardware store, and I'm trying to streamline and automate as much stuff as possible. As such, this is part of a larger project I'm trying to complete.Like the...

View Article
Browsing all 13921 articles
Browse latest View live