Quantcast
Browsing all 14097 articles
Browse latest View live

How to make sure the input length is a multiple of 16, and if not add padding...

basically i want to have an inputted message, and if it is not a value of 16 add random letters to it to make its length a multiple of 16this is my current code:import maths =...

View Article


After creating a Custom Tokenizer using HF Tokenizers library, how to create...

I followed this tutorial to create a custom Tokenizer based on SentencePieceBPE class, with a custom pre-tokenizer class. The newly trained Tokenizer was successfully trained with a dataset and saved...

View Article


PySimpleGUI and matplotlib demo program not working on my Pi4

This question relates to a previous query about a program that used to run on a Pi3 but not an upgraded Pi4.The demo...

View Article

Failed building wheel for ltfatpy

i traied to instal ltfatpy but this problem occurserror: subprocess-exited-with-error× python setup.py bdist_wheel did not run successfully.│ exit code: 255╰─> See above for output.note: This error...

View Article

Telethon joining private channels

I tried using ImportChatInviteRequest like it says in the docs, but couldn't join public or private channels. With JoinChannelRequest I can only join public channels. Is there a way I'm missing?CHANNEL...

View Article


Using PyQt6 and QtSql Model-view widget Form displays but no record data is...

I am trying to create a simple form to add and edit records from a table, one at a time in an SQLite database using model_view widgets and QSqlTableModel. There are two records in the table. When I run...

View Article

How can I get my current mouse position in pyautogui?

So I was making an autotyper but I got stuck i want to find the current location of my mouse (on the search box) so that my program can click on the text box, but i cannot figure out how to get my...

View Article

Python Coding: Why are some implementations are Functions and some are Methods

For example, when using the "print" Function it works like this:print (string)However, when using the "lower" Method it works like this:string.lower()Why isn't lower a normal function that works like...

View Article


How can I add custom requirement to buildozer.spec file

My buildozer.spec file looks like this.requirements = python3, mysql-connector-python, plyer, android, futures, datetime,kivy, kivymdI want to use development version of kivymd so I changed that to...

View Article


ModuleNotFoundError: No module named 'psycopg2._psycopg' in AWS GLUE - Python...

I am trying to use the library psycopg2 in AWS Glue.I followed this question:"What I did was install psycopg2-binary into a directory and zip up the contents of that directory:mkdir psycopg2-binarycd...

View Article

Image may be NSFW.
Clik here to view.

Two stacked 100 percent bar charts

Hoping to get a pair of 100% stacked bar charts that looks like this:What I have so far:import pandas as pdimport numpy as npimport seaborn as snsimport matplotlib.pyplot as pltdfInd =...

View Article

Typing of the `__get_item__` method of numpy array subclasses

Let's consider a subclass of numpy's ndarray class:import numpy as npclass ArraySubClass(np.ndarray): def __new__(cls, input_array: np.ndarray): obj = np.asarray(input_array).view(cls) return objThen,...

View Article

How to find the size of a deep learning model?

I am working with different quantized implementations of the same model, the main difference being the precision of the weights, biases, and activations. So I'd like to know how I can find the...

View Article


Image may be NSFW.
Clik here to view.

Fastest way to extract moving dynamic crop from video using ffmpeg

I'm working on an AI project that involves object detection and action recognition on roughly 30 minute videos.My pipeline is the following:determine crops using object detection modelextract crops...

View Article

python code to parse a site table content

Help with python code to parse htmli have a site - https://www.rate.am/en/armenian-dram-exchange-rates/banksi need to store bank data with rates in dictionary with this format{bank1 name:[{update time:...

View Article


How to debug (500) Internal Server Error on Python Waitress server?

I'm using Python and Flask, served by Waitress, to host a POST API. I'm calling the API from a C# program that posts data and gets a string response. At least 95% of the time, it works fine, but...

View Article

FileNotFoundError: [Errno 2] No such file or directory: 'Test.csv' in VS Code

I was trying to read from a .csv file and wrote a very basic code.import csvwith open('Test.csv', 'r') as csv_file: csv_reader = csv.reader(csv_file) for line in csv_reader: print(line)Both the...

View Article


How to uninstall Keras?

I have installed Keras using this command:sudo pip install kerasIt installed properly and worked fine until I tried to import application modules:from keras.applications.vgg16 import VGG16Using Theano...

View Article

Apache Kafka Server Configuration (Consumers and Producers are in different...

I'm testing Apache Kafka between 2 vps. (First vps IP: x.x.x.x and Second vps IP: y.y.y.y) Os course I've installed zookeeper and kafka server on both of them and are same producer and consumer file...

View Article

how to add multiple domains into DJANGO_ALLOWED_HOSTS as an environment variable

in django 4.1 application I'm trying to add several allowed hosts in my .env file as an environment variable like this -> DJANGO_ALLOWED_HOST=synapse-developmentcenter.am...

View Article
Browsing all 14097 articles
Browse latest View live