'Ryanair of trains' announces new London to Scotland tickets for less than £50
Shirley Ballas, 65, showcases her amazing facial transformation following £4K procedure ahead of Strictly Come Dancing launch
CHRISTOPHER WILSON: The Duke and Duchess of Windsor received a royal welcome when they visited the White House - but Roosevelt and the FBI were convinced they were going to destroy America's way of life
'I'm not taking my Emmy to school - it'll get robbed!' The VERY normal life of Adolescence star Owen Cooper, his £135k family home... and his modest fee for a life-changing role
China slaps 1-hour deadline on reporting serious cyber incidents
Beijing will soon expect Chinese network operators to 'fess up to serious cyber incidents within an hour of spotting them – or risk penalties for dragging their feet.…
Labour's first 'one-in, one-out' migrant deportation to France 'is abandoned after last-minute legal challenge'
Margot Robbie risks a wardrobe malfunction in a cleavage-baring thigh-split dress as she heads to her movie premiere in New York
Police name Essex men charged after 'Unite the Kingdom' protest violence
Online Marketplace Fiverr To Lay Off 30% of Workforce In AI Push
Read more of this story at Slashdot.
Parents urged to use free parking permits to reduce traffic issues around school
The Duchess of Kent's mourning grandchildren: Lady Amelia Windsor attends late royal's vigil at Westminster Cathedral with her cousins
Peter Kay, 52, reveals 'shameful' moment he realised he had a binge eating problem as he admits he spent 'the first 48 years of his life' trying to lose weight
Officers holding events in Braintree district for National Spiking Awareness Week
Police 'increasingly concerned' in search for woman, 40, who is missing in busy Colchester area
It's the final countdown: Windows 10 hits end of support in less than 30 days
Start the countdown! For any administrators living under a rock, Microsoft has posted another warning that Windows 10 22H2 will reach end of servicing on October 14.…
Representative Line: Reduced to a Union
The code Clemens M supported worked just fine for ages. And then one day, it broke. It didn't break after a deployment, which implied some other sort of bug. So Clemens dug in, playing the game of "what specific data rows are breaking the UI, and why?"
One of the organizational elements of their system was the idea of "zones". I don't know the specifics of the application as a whole, but we can broadly describe it thus:
The application oversaw the making of widgets. Widgets could be assigned to one or more zones. A finished product requires a set of widgets. Thus, the finished product has a number of zones that's the union of all of the zones of its component widgets.
Which someone decided to handle this way:
zones.reduce((accumulator, currentValue) => accumulator = _.union(currentValue))So, we reduce across zones (which is an array of arrays, where the innermost arrays contain zone names, like zone-0, zone-1). In each step we union it with… nothing. The LoDash union function expects an array of arrays, and returns an array that's the union of all its inputs. This isn't how that function is meant to be used, but the behavior from this incorrect usage was that accumulator would end up holding the last element in zones. Which actually worked until recently, because until recently no one was splitting products across zones. When all the inputs were in the same zone, grabbing the last one was just fine.
The code had been like this for years. It was only just recently, as the company expanded, that it became problematic. The fix, at least, was easy- drop the reduce and just union correctly.
Ofsted says school is improving in new report after being put in special measures
Police search for Chelmsford man, 23, missing for three days
The £4million bridge for bats that Reform councillor refuses to spend taxpayer money on because it's 'nonsense'
ChatGPT: Why do most of your users ask for help writing - prose, not code?
Users of individual accounts for OpenAI’s ChatGPT mostly use it for research and to help with writing, according to a new study into the kind of queries fed into the service.…