gregcpb has added a photo to the pool:
De scanauto gold ooit als een wonder van efficiëntie: in één straatrit duizenden kentekens checken en automatisch beboeten wie niet betaald heeft. Maar in de praktijk rammelt het systeem aan alle kanten. In steeds meer gemeenten duiken voorbeelden op van foutief geregistreerde boetes, van verkeerd gelezen kentekens tot auto’s die helemaal niet geparkeerd stonden. In Amsterdam gaat het volgens de gemeente om 2 procent van de boetes ddie na protest wordt ingetrokken. En omdat weinig mensen protesteren (onfeilbare scanauto, niet waar) zal het percentage hoger liggen.
De foutmarge blijft meestal geheim, maar interne cijfers wijzen erop dat een paar procent van alle boetes onterecht is. Dat lijkt weinig, maar bij miljoenen controles per jaar loopt dat uit op tienduizenden valse beschuldigingen. Toch vertrouwen gemeenten blind op hun computersysteem – en moeten burgers zelf maar bewijzen dat ze níét fout stonden.
Bezwaar maken heeft zin: uit cijfers van de RDW en meerdere lokale onderzoeken blijkt dat een aanzienlijk deel van de bezwaren wordt toegekend. Vaak is een betaalbewijs of GPS-data al genoeg om een boete kwijtgescholden te krijgen. Maar veel automobilisten slikken de straf uit gemak, waardoor de fout onopgemerkt blijft.
De les is duidelijk: technologie is handig, maar niet onfeilbaar. Als je zeker weet dat je hebt betaald, laat die scanauto je niet intimideren – en vecht je boete aan.
DEN HAAG (ANP) - Publieke omroepen moeten samen met streamingdiensten series kunnen maken, stelt Tweede Kamerlid Mohammed Mohandis (GroenLinks-PvdA). Het is volgens Mohandis nu nog onduidelijk of omroepen die samenwerking mogen aangaan, of dat dit het dienstbaarheidsverbod schendt. Hij wil dat dit wordt opgehelderd.
Het dienstbaarheidsverbod houdt in dat publieke omroepen niet mogen bijdragen aan "meer dan normale winst of ander concurrentievoordeel" van commerciële partijen. Dit zou ervoor kunnen zorgen dat de omroepen geen samenwerking mogen aangaan met de commerciële streamingdiensten.
Als voorbeeld noemt Mohandis de Belgische series Undercover en Knokke Off, die door de publieke omroep VRT en Netflix zijn gemaakt. Volgens het Kamerlid kan de samenwerking leiden tot kwalitatief goede Nederlandse series in het Nederlands en vergroot het de naamsbekendheid van de omroepen. "Zo blijft de publieke omroep relevant in een digitaal tijdperk, kunnen streamingdiensten zich ook met lokale content onderscheiden en wordt de positie van de makers versterkt."
Steun
BNNVARA, AVROTROS en de koepelorganisatie voor streamingdiensten in Nederland scharen zich achter het plan van GroenLinks-PvdA. "Samenwerking met commerciële platforms stelt ons in staat om het budget en de kwaliteit van fictieseries te vergroten én nieuwe doelgroepen te bereiken die we via traditionele kanalen minder goed bedienen", zegt directeur content van BNNVARA Susanne Kunzeler in een persbericht.
Maandag wordt in een commissiedebat in de Tweede Kamer gesproken over de mediabegroting. Het gaat dan onder meer ook over de bezuinigingen die eraan zitten te komen. Mohandis wil die bezuinigingen uitstellen tot de hervorming van de NPO in 2029, zodat er niet eerst bezuinigd hoeft te worden voordat de omroepen in 2029 samengaan in nieuwe omroephuizen.
Today we return to Jessica (previously), who still suffers under Windows Forms. But it's not all Windows Forms. There's also random CLI tools kicking around. CLI tools which should really be designed to run as a service,
Let's start with the Main method of this particular tool.
static void Main(string[] args)
{
if (!LoadConfigs())
{
return;
}
if (args.Length > 0)
{
if (args.Any(a => string.Compare(a, "Test", true) == 0))
{
RunTest(out string message);
Console.WriteLine(message);
return;
}
}
_userCache = new Dictionary<string, Employee>();
_itemCache = new Dictionary<string, bool>();
InitializeFileCache();
WriteLog("File watcher started.");
Task.Run(() => { ProcessLogQueue(); });
Task.Run(() => { ProcessFilesInFolder(); });
while (true)
{
Thread.Sleep(1000);
}
}
We first try and load a config file, and if we fail, we quit. Then, if the word "Test" appears in any of the CLI arguments, we run a test of some kind, and then quit. Then, we prepare a pair of cache objects that map IDs to either employees or boolean values, and initialize that from a file. Then we kick off a pair of background threads, and then we sleep forever. Now, there are obvious nits here- you're not meant to kick off tasks directly, really, and async/await keywords are a "better" way to do this.
That they aren't awaiting the tasks is a problem we'll come back to.
For now, let's start with the logging portion. You can see WriteLog, which Jessica did not provide the implementation of, but I can infer it's pretty simple: it puts your message into a thread safe queue. How do I know this? Because of ProcessLogQueue's implementation:
private static void ProcessLogQueue()
{
if (!Directory.Exists(_config.LogLocation))
{
Directory.CreateDirectory(_config.LogLocation);
WriteLog($"Created Log location: {_config.LogLocation}");
}
while (true)
{
while (_concurrentQueue.TryDequeue(out string result))
{
string fileName = _config.LogLocation + $@"\{DateTime.Now.ToString("yyyy-MM-dd")}_CreationLog.log";
if (!File.Exists(fileName))
{
using var fs = File.Create(fileName);
}
using (var fw = File.AppendText(fileName))
{
fw.WriteLine(result);
}
}
Thread.Sleep(5000);
}
}
They wrote their own logging library, but left out anything like "log levels" or "filtering" or "safe error handling against write failures". Mostly, this pulls a message off the queue and appends it to a file. It doesn't keep the filehandle open, which I'd make a comment about the performance overhead, but a bigger barrier to performance is the fact that if the queue is empty, this thread sleeps for five seconds. So if you're not logging so fast that multiple messages are in the queue, you're spacing out your log messages by five seconds at a time.
What's important to note about this logger is that this is not a logging program. It's a file watcher which needs to log messages. They just reinvented the logging library badly, is all. It'd be trivially easy to drop in a logging library and ditch this entirely.
How about processing files?
private static void ProcessFilesInFolder()
{
while (true)
{
bool canAccess = RunTest(out string message);
if (canAccess)
{
foreach (var file in Directory.GetFiles(_config.WatchLocation, "*.csv"))
{
ProcessFile(file);
}
}
else
{
WriteLog(message);
}
Thread.Sleep(60000);
}
}
Here, we see RunTest is used again- clearly this is a test to see if we can read from the correct directory. If we can't, we keep trying once a minute, though. If we can, we scan a directory, do something to all the CSV files, and try again in a minute. Once again, we don't see any error handling around Directory.GetFiles. Maybe there is in ProcessFile somewhere.
But the key here is that if I'm reading the docs right, exceptions in Task objects arrive at the main thread when you call Wait or otherwise check the result of the task. Which means this is the kind of program which fails silently- nothing checks for exceptions in the child threads, and since the child threads are where the work happens, it's easy for this program to reach a state where the main thread spins away, waking up every second just to go back to sleep, without any errors being detected.
And that brings us to the other key point here. Remember those two "cache" dictionaries? They're populated out of a file, and the entire point of those caches is to keep tabs on which entries have already been processed. Something the program can't do otherwise. I mean, it could, because processed IDs are stored in the database and there is an API that lets you query the database. It just doesn't. It relies on a local cache file to tell it what it's already processed. And while you or I might use some sort of unique key constraint to keep existing entries from being reprocessed by the database, the people behind this did not. Which means if the cache file is inaccurate (because the program crashed), or worse gets lost this processing program will create hordes of duplicate entries in the database.
Which is a thing that has happened, and is the reason Jessica ended up looking into this code. The customer refuses to run the service, because they ran it and it created duplicate entries. Now they don't trust it to work correctly.
After arresting political opponents, banning the most popular party and using violence to crush dissent, the military’s proxy is on course to win by a landslide
The polls have closed in Myanmar, but no one is waiting in suspense. After arresting political opponents, banning the most popular political party and using violence to crush dissent, the military’s proxy is on course to win by a landslide.
“This is a fake election,” says a man who voted on Sunday in Mandalay, the second most populous city, his finger freshly dipped in purple ink. Like many, he voted only out of fear, worried that junta officials could retaliate if he stayed home.
Continue reading...Preventing the mayor from returning to Westminster deprives the party of its most potent candidate in Gorton and Denton
When Labour dignitaries gathered at the Titanic hotel in Liverpool on Friday night, one question loomed above all others: to change captain or not?
For many, that question has become even more pressing after Keir Starmer’s allies brutally stopped Andy Burnham’s return to Westminster before it had even begun.
Continue reading...Crimefighting nuns, giant killer white balloons and Aubrey Plaza getting stuck in a wall … here are your favourite ever mind-bending TV series
Catterick is my favourite baffling TV show. It stars Vic and Bob and a stellar backup cast – Reece Shearsmith, Tim Healey, Mark Benton, Matt Lucas and Morwenna Banks. It starts off innocuously enough with Carl Palmer (Bob) returning to Catterick to visit his brother Chris (Vic) but quickly descends into anarchy. The extremely loose plot centres around the criminal antics of mummy’s boy Tony (Shearsmith) but there are more tangents than a geometry conference. From ripped up posters of George Clooney and haunting dance routines to Chris Rea and Foreigner, Catterick should be top of your TV destinations. Tom Whelan, South Shields
Continue reading...Ministers plan to license content from institutions such as National History Museum and National Library of Scotland
Met Office data and legal documents from the National Archives could be used by artificial intelligence systems as the UK government pushes ahead with plans to employ nationally owned material in AI tools.
The government is providing funds for researchers to test how Met Office content could be used by the technology, such as in helping agencies and councils know when to buy more road grit. Another project will explore whether legal data from the National Archives – the UK’s repository for official documents – could help medium- and small-sized businesses with legal support.
Continue reading...Study finds top performers over past decade have companies in industries such software, marketing and finance
A southern town in the north: how Warrington has adapted to change
Eleven towns and cities in the UK, including Warrington, Barnsley and Wakefield, have seen their disposable incomes rise twice as fast as the rest of the UK over the past decade, a study has found.
A report from Centre for Cities, a thinktank, showed that between 2013 and 2023, disposable income for residents of these top performing towns and cities rose by an average of 5.2%, compared with an increase of 2.4% for urban areas in the UK overall.
Continue reading...Exclusive: Outgoing director general indicates support for update to licence-fee model as part of wider changes
The BBC will face “profound jeopardy” over its future unless it embraces significant changes to its funding, its outgoing director general has said, as he signalled his support for an overhaul of the licence fee.
Speaking to the Guardian, Tim Davie called for supporters of the corporation to “stand up and fight” for it, amid increased hostility from its commercial and political critics.
Continue reading...Mediterranean chicken meatballs with feta and black olives, Persian-style saffron chicken and rice, and a garlicky, Korean-inspired chicken and potato traybake
When it comes to traybakes, chicken is the undisputed hero, because it’s endlessly adaptable and perfect for carrying bold, global flavours. First up, some eastern Mediterranean chicken meatballs, flecked with feta and black olives for a sharp, savoury punch. Then a Persian-style saffron chicken and rice; the rice cooks with the chicken, absorbing all the flavours of the sunshine-yellow saffron and crisping up at the edges. Finally, a Korean-inspired chicken and potato traybake in which gochujang and soy create a deeply savoury sauce that elevates a simple midweek meal.
Continue reading...Mark Carney and other custodians of the order are right to contemplate its death, but are they really willing to unpick the the entire system?
When precisely did the rules-based order die? Mark Carney’s speech last week at Davos was the first time a western head of state has said outright what has been hanging over political proceedings for some time. The rules-based order is “fading”, in the middle of a “rupture” and there’s no going back. But outside Davos, the G7 and Nato, that is old news – many believed the rules-based order had expired long ago, depending on what moment you take as your watershed.
There were several components to the order, which of course was a layered, complex thing. The first is structural, that is, the agreement between powerful and prosperous countries that there would be certain mechanisms and protocols to maintain political stability, contain the outbreak of wars and promote their mutual economic interests. All the bodies that direct international traffic – the EU, Nato, the UN, the WTO, the IMF – make up that top layer of organisation.
Continue reading...Rising fears that another US shutdown looms pushes gold price to new height amid nearly 90% rise since Trump’s inauguration
Gold has jumped above US$5,000 an ounce for the first time, as Donald Trump’s chaotic policies and proclamations drive more investors to seek safe harbour in the precious metal.
The price of the yellow metal jumped 1.8% to $5,078 an ounce on Monday, according to Bloomberg.
Continue reading...Read more of this story at Slashdot.