Posts

The Secret Life of Python: The Safety Net ('try' and 'except')

Image
  The Secret Life of Python: The Safety Net ('try' and 'except') # python # coding # programming # softwaredevelopment Understanding  try ,  except , and Input Validation. Timothy was beaming. "I learned my lesson from last time," he told Margaret. "I updated my guessing game. Now I use  int()  to cast the user's input into a number immediately. No more silent bugs!" "That is excellent progress," Margaret said, moving her chair closer. "But what happens if the user doesn't follow instructions?" "What do you mean?" Timothy asked. "It says 'Guess a number'. Why wouldn't they type a number?" "Users are creative," Margaret smiled. "Watch." She leaned over and ran his program. Prompt:   Guess the number (1-10): Margaret typed:  five Output: Traceback (most recent call last): File "game.py", line 3, in <module> guess = int(input("Guess the number (1-1...

The Secret Life of AWS: The Assembly Line (CI/CD with AWS CodePipeline)

Image
  The Secret Life of AWS: The Assembly Line (CI/CD with AWS CodePipeline) # aws # cicd # devops # cloud Why your laptop should not be a production server. An introduction to Continuous Deployment. Part 29 of The Secret Life of AWS Timothy was struggling to zip his suitcase. It was bulging at the seams. "Timothy," Margaret asked from the doorway of the office breakroom. "Are you taking your workstation on your vacation?" Timothy looked up, flushed. "I have to, Margaret. What if there is a bug? What if we need to update the checkout flow? I’m the only one who has the deployment scripts configured on my machine." Margaret walked over and gently unzipped the bag. She pulled out the heavy laptop and set it on the desk. "That is exactly the problem," she said kindly. "Right now,  you  are the deployment server. If you are on a plane, or if your laptop breaks, the business stops." "We need to move the responsibility from your laptop to th...

The Secret Life of Azure: The Function App With CEO Privileges

Image
  The Secret Life of Azure: The Function App With CEO Privileges # azure # security # devops # cloud Exploring the risks of the Owner role and the quiet danger of granting a service the power to change its own rules. Arc 1 — Identity & Access The rain drummed against the library windows as Margaret adjusted the lamp on the table. She looked at a small diagram Timothy had been sketching in his notebook. "Timothy," she said softly, "I noticed you were looking at the permissions for our new  Function App . It’s a helpful little service, isn't it?" Timothy looked up, leaning back in his chair. "It is. It’s meant to handle a few background tasks. But Margaret, I noticed something in the configuration that felt a bit heavy. It’s listed as an  Owner  at the  Subscription  level." Margaret pulled a chair closer. "You have a sharp eye for detail. Tell me, why does that particular setting give you pause?" "Well," Timothy said, tapping his...

AWS Bedrock Error: Partial Responses Returned by AWS Bedrock

Image
  AWS Bedrock Error: Partial Responses Returned by AWS Bedrock # aws # bedrock # devops # cloud A diagnostic guide to resolving AWS Bedrock responses that stop early or return fewer tokens than expected. Problem An AWS Bedrock invocation succeeds, but the response is  incomplete . Typical symptoms: Output stops mid-sentence Response is much shorter than expected Only part of the requested content is returned No error is thrown Invocation reports success The model responds—but not fully. Clarifying the Issue This is  not  an IAM issue. This is  not  a network failure. 📌 This behavior occurs when  generation is intentionally or unintentionally constrained . Common causes include: Output token limits being reached Stop sequences triggering early termination Streaming consumers disconnecting early Client-side truncation of the response Model-specific generation limits The model stopped because it was told to—or because the caller stopped listening. Why It...

The Secret Life of Python: The Phantom Copy

Image
  The Secret Life of Python: The Phantom Copy # python # coding # programming # softwaredevelopment Why  =  doesn't actually copy your data in Python. Timothy stared at his screen, his face pale. "Margaret? I think I just accidentally deleted half the database." Margaret wheeled her chair over immediately, her voice calm. "Don't panic. Tell me exactly what happened." "I was testing a script to clean up our user list," Timothy explained. "I wanted to test it safely, so I made a copy of the list first. I thought if I messed up the copy, the original would be safe." He showed her the code: # Timothy's Safety Plan # The original list of critical users users = [ " Alice " , " Bob " , " Charlie " , " Dave " ] # Create a "backup" copy to test on test_group = users # Timothy deletes 'Alice' from the test group test_group . remove ( " Alice " ) # Check the result...