Skip to main content

Posts

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...

Discussion with chatGpt regarding bike TVS XL 100 HD I-Touch start (fuel saving strategy at traffic signal)

Query: For my bike while driving Traffic signal is red & countdown time is also displayed for signal to remain as red (may be from 180,120,60 sec to 0 ) Now to save fuel at before what countdown time I should turn off my bike. My bike has I Touch start feature & also kick start feature. ChatGPT said: Got it — you want to figure out: when is it worth turning off your TVS XL100 HD at a red signal to save fuel without causing hassle or extra wear. Here’s a simple answer: If the countdown is more than 15 seconds, you should turn off your bike. Detailed logic: For modern bikes (especially small engines like your XL100) with easy start features like "i-Touch" and kickstart, switching off and on doesn't hurt the engine much. Restarting the engine (i-Touch or kickstart) uses very little extra fuel — roughly equivalent to 1-2 seconds of idling . So if the wait is longer than 10–15 seconds , you save more fuel by turning it off than you lose by restarting....

Rheumatoid arthritis (RA) - foods, discussions with chatGpt

🧠 First—Understanding RA a Bit RA is an autoimmune disease —the immune system mistakenly attacks the joints, leading to inflammation, swelling, pain, and eventually joint damage. There's no "cure" yet, but the symptoms and progression can be controlled really well these days. 💊 Medical Options (Talk to Her Doctor About These) DMARDs (Disease-Modifying Anti-Rheumatic Drugs) – like Methotrexate. These help slow progression. Biologics – newer, more targeted drugs (e.g., Etanercept, Adalimumab). Steroids – for flare-ups, not long-term. NSAIDs – like Ibuprofen or Naproxen for general pain relief. 🔍 If she's been on the same meds for years, it might be worth checking if newer treatment options can help her more effectively now. 🍽️ Food & Diet Tips for RA Food won't "cure" RA, but it can make a big difference in inflammation and pain levels. ✅ Foods That May Help: Omega-3-rich foods : Fatty fish (like salmon, mackerel), ...

Veganism, other things discussions with chatGpt

Question: Lot of current organizations saying that vegan diet because eating animal is cruelty upon animals & against animal right. But my Q is even lot of other species eg lion, other carnivour if got chance will eat human. Even veg animals like elephant, rhinos, wild bufflo, cow, deer, etc if got chance will kill humans without thinking anything. Also lot of insects like mosquito, visuses, bacterias, etc directly consume humans as soon as they get chance. Now why should only human think about other animal rights, etc. Other animals never think of any such thing like giving human any kind of right. Even if say some human become vegan, & don't consume animals other animals won't forgive that human thinking that this person is vegan & thinks about giving us animal right so we won't attact eat this vegan human. They why so much mental pressure created by some organization to make only human great & vegan? Is this kind of thing some political agenda/ some kind ...