Ant and Dec speak out on chaotic I'm A Celeb live final and their after show carpark confrontation with Jimmy Bullard and David Haye
Labour is on course to lose THREE-QUARTERS of its seats in next week's local elections, as disaffected voters turn to Reform and the Greens
Ashley Roberts, 44, digs her Pussycat Dolls costumes out of storage to try on corsets and skimpy mini skirts ahead of reunion tour
The top 20 WORST Premier League signings of the season: From the £30m Nottingham Forest error to a terrible Tottenham duo and goal-shy Liverpool buys to the 'awkward fit' at Everton... who is the biggest flop?
QUENTIN LETTS: As he declaimed his government's heroic achievements, a nimbus of righteousness haloed Sir Keir's oblong head. He actually seemed to believe himself
The Queen joins Sarah Jessica Parker and Anna Wintour in starry reception at the New York Public Library and presents a surprise gift for the landmark's collection
First Tesla Semi Rolls Off High-Volume Production Line
Read more of this story at Slashdot.
Microsoft levels up Azure Local to make it fit for large-scale sovereign clouds
Microsoft has given its Azure Local on-prem cloud a major makeover to make it fit for duty powering large-scale sovereign infrastructure.…
How an elephant named Tswale has been welcomed into a wild herd after spending decades in captivity
Glossy, high voltage and so true to life - and the Devil has all the best lines: ALEXANDRA SHULMAN reviews the Devil Wears Prada 2
Everyone on Instagram is talking about the Sudoku Packing Method as a way to revolutionise holiday dressing - here's what happened when I tried it
Victoria Beckham is boosting Cruz's girlfriend Jackie Apostel's influencer career as she promotes Gap collection and builds up 'Brand Beckham' reveals MOLLY CLAYTON
Stephen Fry, 68, sues tech conference for £100,000 in damages after he fell six feet off a stage breaking his leg, ribs and hip
Record number of parking tickets quashed last year after appeals soared to 107,202 amid growing drivers' anger at 'cowboy' operators
CodeSOD: Cancel Catch
"This WTF is in Matlab" almost feels like cheating. At one place I worked, somebody's job was struggling through a mountain of Matlab code and porting it into C. "This Matlab code looks like it was written by an alien," also doesn't really get much traction- all Matlab code looks like it was written by an alien. This falls into the realm of "Researchers use Matlab, researchers may be very smart about their domain, but generally don't know the first thing about writing maintainable code, because that's not their job."
But let's take a look at some MatLab Carl W found:
try if (~isempty(fieldnames(bigStruct)) && isfield(bigStruct,'pathName')) [FileName, PathName] = uigetfile(bigStruct.pathName); else [FileName, PathName] = uigetfile(lastPath); %lastPath holds previous path end catch bigStruct = struct; endThe uigetfile function opens a file dialog box. When the user selects a file, FileName holds the filename, PathName holds the containing path. If the user doesn't select a valid file, or clicks "Cancel", both of those variables get set to 0. It's then up to the caller to check the return value and decide what happens next.
Which is not what happens here, obviously. The developer responsible seems to believe that it maybe throws an exception? And they can just catch it? Carl's best guess is that this is a "weird" way to catch the cancel button. But it does mean that FileName and PathName get set to 0, and those zeros propagate until something finally tries to open those files, at which point everything blows up and the user doesn't know why.
[Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!