Skip to main content

Posts

Showing posts from February, 2025

How to use gdb in Ubuntu Terminal

Here's a practical, minimal guide for using GDB in Ubuntu terminal — from launching to setting breakpoints and navigating your code. 🧰 Step 1: Compile with Debug Symbols Use -g and disable optimizations ( -O0 preferred for debugging): bash Copy Edit g++ -g -O0 -o myprog myprog.cpp 🚀 Step 2: Launch GDB bash Copy Edit gdb ./myprog You'll see a (gdb) prompt. 🎯 Step 3: Set Breakpoints You can set breakpoints in three main ways : ✅ a. At a function gdb Copy Edit (gdb) break main ✅ b. At a specific file and line gdb Copy Edit (gdb) break myprog.cpp:42 ✅ c. At a method in a class gdb Copy Edit (gdb) break MyClass::doSomething If the symbol is mangled (C++), GDB usually demangles automatically, especially if compiled with -g . ▶️ Step 4: Run the Program gdb Copy Edit (gdb) run 🧭 Step 5: Navigate Command Meaning next or n Step over current line step or s Step into function call finish Run until current function returns continue or c Continue until...

Postgres / Pgadmin - ForeignKey discussions

Query: In pgadmin foreign key defn wht is deferable, defered, validated, auto FK index, match (full/simple)? ----- ChatGpt response: When defining a foreign key (FK) in pgAdmin (or directly in PostgreSQL), the following options are available: 1. DEFERABLE & DEFERRED These options control when the foreign key constraint is checked during a transaction. DEFERRABLE: Allows the foreign key check to be deferred until the transaction ends . Useful for complex transactions where you might insert/update related rows before enforcing constraints. If not specified, the foreign key is NOT DEFERRABLE (checked immediately). DEFERRED: Applies only if the foreign key is DEFERRABLE . If set, the constraint is checked at the end of the transaction instead of immediately . 🔹 Example: sql Copy Edit ALTER TABLE orders ADD CONSTRAINT orders_customer_fk FOREIGN KEY (customer_id) REFERENCES customers (id) DEFERRABLE INITIALLY DEFERRED; This allows inserting an order referencing a customer_id ...

Public api to get any medicine details

Query: Public api to get any medicine details like Uses and Benefits composotion Mechanism of Action of Drugs side effects precautions how to use.. alternate medicines generic medicines, ... etc? Chatgpt response: Yes, there are several public APIs that provide comprehensive information about medicines, including their uses, composition, mechanisms of action, side effects, precautions, usage instructions, and alternatives. Here are some notable options: openFDA API : Offered by the U.S. Food and Drug Administration, the openFDA API provides access to a wealth of publicly available data on drugs, including product labeling and adverse events. You can retrieve structured information such as indications, usage instructions, and side effects. However, details like composition and mechanism of action might be limited. OpenFDA DrugBank API : DrugBank offers a comprehensive API that includes detailed drug data such as chemical composition, mechanisms of action, pharmacology, interactions, and...

Reduct image size Ubuntu terminal

To reduce the size of a JPG image on Ubuntu (from MB to KB), you can use the convert command from the ImageMagick package. Here's how to do it: Install ImageMagick If it's not already installed, you can install it using: bash Copy Edit sudo apt update sudo apt install imagemagick Reduce Image Size Use the following command to compress the image: bash Copy Edit convert input.jpg -quality 75 output.jpg Explanation: input.jpg : The original image file. -quality 75 : Sets the compression level (1–100). Lower values reduce file size but can decrease image quality. output.jpg : The compressed image. Additional Options for Further Size Reduction: Resize the image to smaller dimensions: bash Copy Edit convert input.jpg -resize 50% output.jpg This reduces the width and height by half. Specify exact dimensions: bash Copy Edit convert input.jpg -resize 800x600 output.jpg Replace 800x600 with your desired resolution. Strip metadata to save space: bash Copy Edit convert input.jpg -strip ...

AI Dropshipping discussion

Query: top dropshipping webistes with good reputation in india I dont want global supplier, from where I will import product n sale in india. But only top indian dropshipping suppliers with good reputation for selling in india ChatGpt Response: Certainly! Here are some reputable Indian dropshipping suppliers you might consider: vFulfill : An all-in-one solution offering product research, fast delivery (3-5 business days), and competitive pricing. dodropshipping.com BaapStore : Tailored for the Indian market, BaapStore provides a variety of products, including women's apparel, jewelry, and traditional wear. dropship.io IndiaMART : A leading B2B platform connecting buyers with suppliers across various categories, making it suitable for diverse dropshipping needs. moneymint.com TradeIndia : Established in 1996, TradeIndia connects buyers with manufacturers, suppliers, and exporters, offering a wide range of products. moneymint.com Printrove : Specializing in print-on-demand services, ...