Sun.May 19, 2024

article thumbnail

CodeSOD: Delectable Code

The Daily WTF

Good method names are one of the primary ways to write self-documenting code. The challenge there, is that documentation often becomes out of date. Take this delectable PHP nugget, from Nathaniel P , who has previously been tortured by bad date handling. function deleteTenDays ( ) { //This delects everything from the table minus 3 days $thedel = $this ->db-> query ( 'Delete FROM ClientReportsRelationship where DateEntered db->query('Delete FROM ClientReportsRelationship where Cu

PHP 69
article thumbnail

A Quick Look at GPT-4o

Crafty CTO

Since last week’s Spring Update event from OpenAI, I’ve been wanting to test the new Omni model (GPT-4o) in my Vision-based recipe ingestor project. This Python script processes a directory of recipe images, and using GPT-4’s Vision capabilities, as well as JSON Mode, produces a structured JSON recipe that I can post directly to my Paprika Recipes app.

Testing 52
article thumbnail

May 31: Testing Without Mocks (Budapest, Hungary)

James Shore

I’m talking about “Testing Without Mocks” at the Craft Conference in Budapest, Hungary on May 30th and 31st: Automated tests are important. Without them, programmers waste a huge amount of time manually checking and fixing their code. Unfortunately, many automated test suites also waste a huge amount of time. They’re slow, fail randomly, and make refactoring difficult.

Testing 40