The "Quick Fix" That Wasn't: A Lesson in Humility (and Python) 🤦♂️💻 You might have seen my recent post about the automation and data project I’ve been building. I’m incredibly proud of it, but let’s be real—the road to "fully automated" is rarely a straight line! 📈 Funnily enough, everything passed testing. It even worked perfectly on Day 1 of deployment. 🚀 But then? I decided to give the code a "quick once-over." I spotted a potential minor issue and implemented a "fix." Plot twist: That fix actually broke the system. 😅 The database was fine and I still delivered the report on time, but it was a classic reminder: sometimes we are our own biggest bugs. 🐞 The culprit? Reusing global variable names as local variables. A total rookie mistake! 🤦♂️ The Silver Lining: ✅ Issue identified and resolved. ✅ This morning, the report was exactly where it should be. ✅ Fully automated and packed with the insights leadership needs. In tech, you never stop learning. Whether it’s a massive architecture shift or a simple variable name, there’s always a lesson in the code. 🛠️ Has a "quick fix" ever come back to haunt you? Let's swap horror stories in the comments! 👇 #SoftwareEngineering #DataAutomation #Python #LearningEveryday #TechLife #GrowthMindset #CleanCode
William Young’s Post
More Relevant Posts
-
🚀 Efficient Duplicate Detection with Hash Sets | LeetCode Today, I tackled the Contains Duplicate problem. While the brute force approach is often the first instinct, optimizing for time complexity is where the real fun begins! 💡 The Problem: Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. ⚡ My Approach: I utilized a Hash Set to track elements as I traversed the array. This allows for near-instantaneous lookups compared to nested loops. 👉 The Logic: Initialize an empty set seen. Iterate through the array once. For each number, check: "Have I seen this before?" (Is it in the set?) If Yes → Return True immediately. If No → Add the number to the set and keep moving. 🔥 Complexity Analysis: ⏱ Time Complexity: $O(n)$ – We only pass through the list once. 📦 Space Complexity: $O(n)$ – In the worst case (all unique elements), we store all $n$ elements in the set. 🏆 The Result: ✔️ Accepted: All 77 test cases passed. ✔️ Performance: 9 ms runtime, beating 73.44% of Python3 submissions! 📌 Key Takeaway: Using a Set turns a potential $O(n^2)$ search into a sleek $O(n)$ operation. Choosing the right data structure isn't just about passing tests; it's about writing scalable, "production-ready" code. 💻 Tech Stack: #Python | #DataStructures | #Algorithms #leetcode #dsa #coding #programming #softwareengineering #100DaysOfCode #pythonprogramming #tech #growthmindset
To view or add a comment, sign in
-
-
Day 116 🚀 Today was all about going deeper into my trading bot project using Python — and honestly, it was one of those “messy but meaningful” days. I focused heavily on improving how my bot handles market data. Earlier, my candle-fetching logic was inconsistent and sometimes broke due to API issues. So I reworked the entire flow: • Built a cleaner function to fetch OHLC candle data • Handled API errors like timeouts and incomplete responses • Added retry logic to make the bot more reliable • Structured the data properly for further analysis A big chunk of time went into debugging. At one point, I was getting unexpected errors from the data provider, which forced me to rethink how I validate incoming data before using it. This made me realize — a trading bot is not just about strategy, it's about robust systems. I also started refining the internal structure: • Separating data fetching, processing, and execution logic • Making the code more modular and easier to scale • Preparing the base for plugging in different strategies Key learning today: A bot that fails silently is more dangerous than one that crashes loudly. Logging, validation, and error handling are not optional — they are core features. Next steps: • Implement strategy logic (entry/exit conditions) • Add backtesting to evaluate performance • Start tracking trades and metrics Still early, still learning — but moving forward every day 📈 #BuildInPublic #Python #TradingBot #LearningJourney #Consistency
To view or add a comment, sign in
-
-
🚀✨ 𝗗𝗮𝘆 𝟰 𝗼𝗳 𝗠𝘆 𝗣𝘆𝘁𝗵𝗼𝗻 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝗝𝗼𝘂𝗿𝗻𝗲𝘆 🐍💻 Took a short break, but now I’m back on track 💪 Consistency isn’t about being perfect, it’s about not giving up 🔥 ━━━━━━━━━━━━━━━━━━━━━━━ 🔹 📚 𝗪𝗵𝗮𝘁 𝗜 𝗥𝗲𝘃𝗶𝘀𝗲𝗱 & 𝗟𝗲𝗮𝗿𝗻𝗲𝗱: ✔️ Revised loops (for & while) ✔️ Practiced conditional statements ✔️ Strengthened strings & data structures (list, tuple, set, dictionary) ✔️ Worked more on logic building problems ━━━━━━━━━━━━━━━━━━━━━━━ 🔹 💻 𝗣𝗿𝗮𝗰𝘁𝗶𝗰𝗲: 🔥 Fibonacci series 🔥 Sum of digits of a number 🔥 Removed duplicates from list 🔥 Frequency count using dictionary 🔥 Solved pattern-based questions ━━━━━━━━━━━━━━━━━━━━━━━ 🔹 🧩 𝗠𝗶𝗻𝗶 𝗣𝗿𝗼𝗷𝗲𝗰𝘁: 🎯 Guess the Number Game (Improved Version) 💡 Added better logic using loops & conditions to make it more interactive ━━━━━━━━━━━━━━━━━━━━━━━ 🔹 ✨ 𝗞𝗲𝘆 𝗧𝗮𝗸𝗲𝗮𝘄𝗮𝘆𝘀: ✔️ Revision is as important as learning new topics ✔️ Logic improves only with practice ✔️ Taking a break is okay, but coming back is what matters 💯 ━━━━━━━━━━━━━━━━━━━━━━━ 🎯 𝗠𝘆 𝗚𝗼𝗮𝗹: Stay consistent and start solving more structured problems daily. 🔥 𝗗𝗮𝘆 𝟰 — 𝗕𝗮𝗰𝗸 𝗼𝗻 𝗧𝗿𝗮𝗰𝗸! #Python #LearningJourney #Day4 #Coding #Programming #Consistency #100DaysOf
To view or add a comment, sign in
-
-
Mistakes are part of the process Day 7 – #100DaysOfCode ⏰ Time Spent: 2 hours ⚒️ What I Did: * Yesterday I have learned one way to read scatter plots , today I Practiced that . * Modified my function to make it reusable * Plotted relationships between complaints and aggregated features I observed only these two trends: * log(x) vs y → logarithmic trend [ y = a · log(x) + b ] * log(x) vs log(y) → power law [ y = k · xᵃ ] But then I realized something important… I was plotting a sum on the x-axis, which naturally increases the values which created misleading patterns. So I switched to mean,but the trends disappeared. Which implies no relation but I'll experiment with few other transformations before I conclude that --- 🚪 Links: * Repo: [https://lnkd.in/g7zsMygp) --- 🧠 Learning: Bad feature choice can create fake patterns. 📌 Closing: Should try to work on these things when I am not tired ( Mornings / After a nap ) #DataScience #DataAnalytics #Python #CodingJourney
To view or add a comment, sign in
-
-
Leveling Up with Functions Focus: Functions, Scope, and Efficiency Day 8(04-04-2026): Today was the day I stopped repeating myself! I dove into Functions, and it’s a total game-changer for writing clean code. Instead of writing the same logic over and over, I can now "wrap" it into a function and call it whenever I need it. It’s all about working smarter, not harder. Key concepts I tackled: Parameters vs. Arguments: Understanding the difference between what a function expects and what I actually give it. The Return Statement: Learning how to get a result back from a function so I can use it elsewhere. Variable Scope: This one was tricky! Understanding why a variable created inside a function "disappears" once the function is done (Global vs. Local). In-built Libraries: Starting to explore the massive world of pre-written tools Python offers. It feels like I’m finally moving from writing "scripts" to building "systems." 🏗️ #PythonFunctions #CleanCode #Day8 #TechSkills #CodingLogic
To view or add a comment, sign in
-
-
🚀 Day 344 of solving 365 medium questions on LeetCode! 🔥 Today’s challenge: “89. Gray Code” ✅ Problem: You are given an integer n. Your goal is to generate an n-bit Gray code sequence, which is an array of 2^n integers where every adjacent pair of numbers (including the first and last numbers) differs by exactly one single bit in their binary representation. ✅ Approach (Bit Manipulation / The Formula) You could solve this using backtracking or mirroring, but there is a mathematical cheat code that solves it instantly! Find the Size: First, we need to know exactly how many numbers to generate. For an n-bit sequence, there are exactly 2^n numbers. I used a bitwise left shift (1 << n) to calculate this size instantly. The Magic Formula: The i-th number in a standard Gray code sequence can always be found using the exact formula: i ^ (i >> 1). This takes the number, shifts its bits to the right by one, and applies a bitwise XOR against the original number. List Comprehension: I packed this entire logic into a single Python list comprehension that loops from 0 up to our calculated size. It applies the magic formula to every index i, generating the perfect sequence in one go! ✅ Key Insight Bitwise operations are essentially black magic when you know the right formulas. Recognizing that Gray code has a direct integer-to-sequence mapping completely eliminates the need for messy recursive state-tracking. What looks like a complex combinatorial sequence problem is actually just a one-line math trick! ✅ Complexity Time: O(2^n) — We must iterate to generate exactly 2^n elements for the sequence. Space: O(1) — Excluding the space required for the output array, the mathematical generation uses strictly constant auxiliary memory. 🔍 Python solution attached! 🔥 Flexing my coding skills until recruiters notice! #LeetCode365 #BitManipulation #Math #Python #ProblemSolving #DSA #Coding #SoftwareEngineering
To view or add a comment, sign in
-
-
Day 7/30 🔹 Problem: Split expenses among friends (equal & custom split) 🔹 What I focused on today: Handling multiple scenarios based on user choice 🔹 My Thinking Process: Take total expense and number of people Ask user how they want to split (equal or custom) If equal → divide total by number of people If custom → take individual contributions 👉 Same problem, different approaches based on user need 🔹 Inputs I used: Total expense Number of people Choice (equal/custom) Individual amounts (for custom split) 🔹 Code: total = float(input("Enter total expense: ")) people = int(input("Enter number of people: ")) choice = input("Enter '1' for equal split or '2' for custom split: ") # Equal Split if choice == "1": share = total / people print("Each person should pay:", share) # Custom Split elif choice == "2": sum_amount = 0 for i in range(people): amount = float(input("Enter amount paid: ")) sum_amount = sum_amount + amount if sum_amount == total: print("Expenses match the total.") else: print("Amounts do not match total.") else: print("Invalid choice") 🔹 Example: Total = 1000, People = 4 Equal → Each pays 250 🔹 Key Takeaway: Real-world problems often need flexible logic to handle different scenarios, not just one fixed solution #Day7 #Python #30DaysOfCode #LearningInPublic #DataAnalytics #ProblemSolving
To view or add a comment, sign in
-
Recursion used to confuse me a lot… until I started thinking of it like a corporate manager delegating work. 😅 🌳 Maximum Depth of Binary Tree (LeetCode 104 — Easy | Blind 75) Whenever I saw a Binary Tree problem, I used to panic. Keeping track of depth while moving through the tree felt overwhelming. The question was always: 👉 How do I keep track of everything at once? I realized something simple but powerful: 👉 I don’t need to track everything myself — I can ask my subtrees Think of each node as a Manager. The manager asks the left subtree: “What’s your max depth?” Then asks the right subtree: “What’s your max depth?” Takes the maximum of both and adds 1 (for itself) That’s exactly what this does: 👉 1 + max(left_depth, right_depth) 🔑 Key Learnings: ✔️ Base Case is your foundation If there’s no node, return 0 → Like an employee saying: “No team under me.” ✔️ Trust Recursion Don’t try to track every path manually → Assume subproblems are solved correctly ✔️ Recognize the Pattern This is a classic Depth-First Search (DFS) approach (bottom-up) ⚙️ Complexity Time Complexity: O(N) — visit each node once Space Complexity: O(H) — recursion stack (tree height) Trees used to be my biggest fear… Now they’re becoming one of my favorite topics Curious to hear from you 👇 What’s a data structure or concept that finally “clicked” for you recently? #LeetCode #BinaryTrees #Blind75 #DataStructures #Recursion #DFS #ProblemSolving #CodingJourney #Python #TechCareers
To view or add a comment, sign in
-
-
A “small bug” once cost almost a full day. Not because it was complex. Because it was invisible. Everything looked fine: • API responses were correct • database had valid data • no errors in logs But users were seeing wrong results. After hours of tracing, the issue was: A single condition checking the wrong type. Python if status == "1": The actual value was an integer. So the condition silently failed. No crash. No warning. Just wrong behavior. That day changed how I write backend code. Now I double-check: • data types • implicit conversions • assumptions Because real bugs are rarely dramatic. They’re subtle. What’s the smallest mistake that caused the biggest issue for you? #PythonDeveloper #Debugging #BackendBugs #SoftwareEngineering #DjangoDeveloper #RealWorldCoding #DevLife
To view or add a comment, sign in
-
-
Solving more problems doesn’t always make you better. Solving them the right way does. While practicing Data Structures & Algorithms, I realized that problem solving is not about writing code quickly - it’s about thinking clearly before coding. The best approach to problem solving: 1. Understand the problem deeply Before writing code, make sure you clearly understand: Input and output Constraints Edge cases 2. Start with brute force First think of the simplest solution, even if it’s not efficient. This helps in building the logic step by step. 3. Identify patterns Instead of solving each problem from scratch, ask: Is this Two Pointers? Sliding Window? Prefix Sum? Recognizing patterns saves time and effort. 4. Optimize step by step Once the brute force is clear, improve it: Reduce time complexity Avoid unnecessary space Use better data structures 5. Write clean and readable code Meaningful variable names Simple logic Minimal complexity 6. Review and learn After solving, revisit the problem: Can it be improved further? Is there a better approach? Focus on solving fewer problems - but understanding them deeply. This shift has made problem solving more structured and effective. Currently strengthening my skills in Python, Data Structures, and algorithm patterns. Consistent practice and the right approach will make a big difference. #DataStructures #Algorithms #DSA #Python #Coding #SoftwareEngineering #ProblemSolving #TechLearning
To view or add a comment, sign in
More from this author
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development