Posts

Create a autorun for a PyQt5 raspberry pi Application

Create a autorun for a PyQt5 raspberry pi Application :  To create an autorun for a PyQt5 Python application on a Raspberry Pi, you can follow these steps: Create a script that will run your PyQt5 application. Let's call it "DemoApp.py". Make sure that the script is executable by running the command chmod +x App_Script.sh . Open the rc.local file by running the command sudo nano /etc/rc.local . Add the following line to the file, just before the "exit 0" line: ' sudo python3 /path/to/ App_Script.sh  &'. S ave the file and exit. The next time your Raspberry Pi boots up, the script " App_Script.sh " will automatically run and your PyQt5 application will start. Note: If your PyQt5 application requires any specific environment variables or other dependencies to run properly, you may need to modify the script or add additional commands to the rc.local file to ensure that these requirements are met before running the application.

Pointers in C++

  Pointers: Pointer is a variable which store the address of another variable. It is declared using '*' with data type of the variable whose address will be store in the pointer variable. For Example -                                     int  n=10;  / / An integer variable n                                    int* ptr = &n; // ptr is a pointer to the variable n.                                                      // ptr store the address of variable n.                               int*ptr means "ptr is a pointer to the integer variable". Dereferenci...

Difference between Structure and Class in C++

  Difference between Structure and Class in C++  Members of Structure are public by default and members of Class are private by default. Structures are value types and Classes are reference types (A variable of structure type contains the Structure's data but a class variable contains the reference of the data). Structures use stack allocation; Classes use heap allocation.  When deriving a struct from a class/struct, default access specifiers for base class/struct are public.

pragma in c++

Why to use #pragma once  in program?   '#pragma' is a Preprocessor directive, which specifies how a compiler should process its input. The use of #pragma once can  reduce build times. Compiler will not open and read the file again after the first #include of the file in the translation unit. It's called the multiple-include optimization. The  intrinsic  pragma tells the compiler that a function has known behavior. The compiler may call the function and not replace the function call with inline instructions, if it will result in better performance .

Number System

 Important   Number System for computer are :- Decimal Number System (0-9) Binary Number System (0-1) Hexadecimal Number System (0-9, A-F) Octal Number System (0-7) 1.) Decimal Number System :        Base : 10       Values : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 2.) Binary Number System :        Base : 2       Values : 0, 1 3.) Hexadecimal Number System :        Base : 16       Values : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A(10), B(11), C(12), D(13), E(14), F(15)       4.) Octal Number System :        Base : 8       Values : 0, 1, 2, 3, 4, 5, 6, 7 Binary to Decimal Conversion: Binary (base-2) numbers use only two digits: 0 and 1. Decimal (base-10) numbers use ten digits: 0 through 9. The conversion process relies on the idea of place value , just like in decimal numbers. In decimal, each digit's position represents a power of 10 (e.g., in 1...

C Programming

C Programming  Introduction C is often called the “mother of all programming languages” because of its influence on modern languages like C++, Java, and Python. Developed by Dennis Ritchie in the early 1970s at Bell Labs, C remains a cornerstone for system programming, embedded systems, and performance-critical applications.  Why Learn C? Foundation for other languages: Many popular languages borrow syntax and concepts from C. Efficiency: C gives direct access to memory and hardware, making it ideal for embedded systems. Portability: Programs written in C can run on different machines with minimal changes. Control: Unlike high-level languages, C allows fine-grained control over system resources.  Key Features of C Procedural language: Focuses on functions and structured programming. Low-level access: Through pointers and direct memory manipulation. Rich library: Standard functions for input/output, string handling, and math. Fast compilation & execution: Suitable for ...