The ultimate Pi 5 arrives carrying 16GB ... and a price to match
The Raspberry Pi has come a long way from its early days, as demonstrated by the single-board computer maker's latest iteration of the Pi 5 in 16GB guise.…
The posh Essex flats perfect for commuters that used to be the HQ of a famous multi-billion company
Inside the bloody turf war tearing south London apart: Map reveals where gangs control streets and ply schoolchildren with drugs in vicious postcode rivalry that led to machete murder of a 14-year-old
Inside the hardest year of Kate's life: From trolls' conspiracy theories amid cancer diagnosis to THAT Mother's Day photograph - as the Princess of Wales turns 43 today we look back at all the twists and turns of her brutal year
Revealed: How Kylie Jenner arranged Timothée Chalamet's 'induction' into the Kardashian clan on a romantic Italian holiday with her entire family after 6 months of dating - and they returned a 'real couple'
Designer to the royals, Amanda Wakeley, reveals why Kate Middleton's fashion choices are now making more of an impact than ever before
Melania Trump joins Donald in the Capitol Rotunda to pay respects to Jimmy Carter ahead of his funeral
Japanese police claim China ran five-year cyberattack campaign targeting local orgs
Japan’s National Police Agency and Center of Incident Readiness and Strategy for Cybersecurity have confirmed third party reports of attacks on local orgs by publishing details of a years-long series of attacks attributed to a China-backed source.…
Kate Middleton is honoured by jewellery designer with stunning £27 earrings for her birthday after her 'compassionate' act for the brand founder who faced tragedy
Grooming gang inquiry: How did your MP vote?
Tributes paid to 'beloved brother' killed in Lamborghini crash that left woman fighting for her life in hospital
Essex woman who 'couldn't bend over' due to weight lost 3.5 stone with one celebrity diet
NASA's Jet Propulsion Lab Closed Due to Raging LA Fires
Read more of this story at Slashdot.
To save the energy grid from AI, use open source AI, says open source body
The energy industry needs to adopt open source AI software, and the collaborative processes used to create it, to satisfy demand for energy created by the growing use of ... artificial intelligence.…
CodeSOD: Crossly Joined
Antonio's team hired some very expensive contractors and consultants to help them build a Java based application. These contractors were very demure, very mindful, about how using ORMs could kill performance.
So they implemented a tool that would let them know any time the Hibernate query generator attempted to perform a cross join.
public class DB2390Dialect extends org.hibernate.dialect.DB2390Dialect { private Logger logger = LoggerFactory.getLogger(DB2390Dialect.class); @Override public String getCrossJoinSeparator() { try { Exception e = new Exception(); throw e; } catch (Exception xe) { logger.warn("cross join ", xe.getMessage()); } return ", "; } }I'm going to call this one a near miss. I understand what they were trying to do.
Hibernate uses a set of "dialect"s to convert logical operations in a query to literal syntax- as you can see here, this function turns a cross join operation into a ", ".
What they wanted to do was detect where in the code this happened and log a message. They wanted the message to contain a stack trace, and that's why they threw an exception. Unfortunately, they logged, not the stack trace, but the message- a message which they're not actually setting. Thus, the logger would only ever log "cross join ", but with no information to track down when or why it happened.
That said, the standard way in Java of getting the stack trace skips the exception throwing: StackTraceElement[] st = new Throwable().getStackTrace(). Of course, that would have made them do some actual logging logic, and not just "I dunno, drop the message in the output?"
The only remaining question is how much did this feature cost? Since these were "expert consultants", we can ballpark it as somewhere between "a few thousand dollars" to "many thousands of dollars"..