Categories
Mastering Development

How do I preprocess a header file with macros to a non macro header file

C newbie here. My use case is to give a header file posted here to the python library cffi so that I can bind to a C library. The header file in the previous link has macros. cffi only accepts a header file without macros, I think. Is there a way to give a header […]

Categories
Mastering Development

My GUI works but the data entry button doesn’t work saying error object doesn’t have an attribute

I have recently learned about OOP and I feel I haven’t made any mistake but while running the programme there’s an error that says ### ERROR MESSAGE #### Traceback (most recent call last): File “C:/Users/ADMIN/PycharmProjects/Ishan v.1/venv/inventory management.py”, line 203, in <module> ob = dealers(root) File “C:/Users/ADMIN/PycharmProjects/Ishan v.1/venv/inventory management.py”, line 126, in __init__ command=self.add_dealers).grid(row=0, column=0, padx=0, […]

Categories
Mastering Development

Python: SqlAlchemy map existing view to ORM Object

I currently try to map an existing view within my postgreSQL DB to an SqlAlchemy ORM object in python. My view has the following name path_number_view and joins some tables together. It is wokring fine. But I am not able to map the view to an ORM object, when starting the application I get an […]

Categories
Mastering Development System & Network

gunicorn failed to start on 18.04

i am running django on python3, gunicorn, nginx, wsgi while gunicorn is serving the app on domain:8000 but NOT on domain (iitiansenv) jagtar@wms:~/iitians/iitians$ systemctl status gunicorn ● gunicorn.service – gunicorn daemon Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2020-03-20 02:33:55 IST; 9min ago Main PID: 10782 (code=exited, status=3) Mar […]

Categories
Development

AWS download file from S3 bucket to windows local directory using lambda

I want to download file from S3 bucket to my windows pc/laptop local directory using lambda function. I have searched all over the internet but couldn’t find a solution. I wonder if that even possiable by invoking a lambda function. Here is my lambda function code named “myLambdaFunction”: import boto3 import os def lambda_handler(event, context): […]

Categories
Development

django with celery raise No module named ‘kombu’ when runserver

I made a website with django and I use celery for asynchronous task, when I run: ./manage.py runserver I got the error: Traceback (most recent call last): File “./manage.py”, line 22, in <module> execute_from_command_line(sys.argv) File “/home/rouizi/OC_project13/venv/lib/python3.6/site-packages/django/core/management/__init__.py”, line 401, in execute_from_command_line utility.execute() File “/home/rouizi/OC_project13/venv/lib/python3.6/site-packages/django/core/management/__init__.py”, line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File “/home/rouizi/OC_project13/venv/lib/python3.6/site-packages/django/core/management/base.py”, line 341, in run_from_argv connections.close_all() […]

Categories
Development

tensorflow federated : TypeError when using customized dataset and model

I am following the tutorial ‘Federated Learning for Image Classification’, but using my own dataset and resnet50. I got this error, when running iterative_process.next. I believe it was caused by tf.data.Dataset.from_generator here is my code: par1_train_data_dir = ‘./par1/train’ par2_train_data_dir = ‘./par2/train’ input_shape = (img_height, img_width, 3) img_gen = ImageDataGenerator(preprocessing_function=preprocess_input) ds_par1 = tf.data.Dataset.from_generator( img_gen.flow_from_directory, args=[par1_train_data_dir,(img_height,img_width)], output_types=(tf.float32, […]

Categories
Development

I’m having trouble installing CUDA in my Windows 10

I have a GTX 1650. I downloaded CUDA 10.1 along with cuDNN v7.6.4. After following a tutorial I did what I was told on the tutorial. After I was done I ran a script to check: from tensorflow.python.client import device_lib print(device_lib.list_local_devices()) and I got the following error: Traceback (most recent call last): File “C:\Users\prono\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py”, line […]

Categories
Development

ImportError: DLL load failed: Uvedená procedura nebyla nalezena. -propably ?The specified procedure could not be found.?

I wanted to see some total basics of python image recognition. As I am tottaly newbie in this one I have found this guide: https://medium.com/@guymodscientist/image-prediction-with-10-lines-of-code-3266f4039c7a Installed everthing described. My thoughts are that the guide is a little bit outdated, but I have to take it… Ending with Second.py from imageai.Prediction.Custom import CustomImagePrediction import os execution_path […]

Categories
Development

Local Azure Python: Function No module named ‘pyodbc’

I am trying to use Azure Functions (HttpTrigger) to Read my emails and put them into my Azure Database. To achieve this I developed a python script(readEmail.py and raFunctions.py) which works local under Visual Studio Code in Ubuntu. The next step I tried is to convert this script to an Azure Function. When I try […]