You are here

Feed aggregator

News Roundup: A Brillant Copilot

The Daily WTF - Tue, 2021-07-06 07:30

The story of the week in software development is Github's Copilot, which promises to throw machine learning at autocomplete for a "smarter" experience.

Notably, one of their examples highlights its ability to store currency values in a float. Or to generate nonsense. Or outputting GPLed code that was used in its training set.

That last one raises all sorts of questions about copyright law, and the boundaries of what constitutes fair use and derivative works, and whether the GPL's virality can "infect" an ML model. These are questions I'm not qualified to answer, and that may not have a good answer at the moment. And certainly, the answer which applies to the US may not apply elsewhere.

Besides, copyright law is boring. What's fun is that Copilot also spits up API keys, because it was trained on open source projects, and sometimes people mess up and commit their API keys into their source control repository. Oops.

And even their examples don't really constitute "good" code. Like their daysBetweenDates, straight from their website:

function calculateDaysBetweenDates(date1, date2) { var oneDay = 24 * 60 * 60 * 1000; var date1InMillis = date1.getTime(); var date2InMillis = date2.getTime(); var days = Math.round(Math.abs(date2InMillis - date1InMillis) / oneDay); return days; }

Now, this code is fine for its stated task, because JavaScript has absolutely garbage date-handling, and developers are forced to do this themselves in the first place. But it's barely fine. A solution copy-pasted from StackOverflow that fails to hit the "single responsibility principle" for this method (it calculates the difference and converts it to a unit of time- days, in this case). It's not WTF code, sure, but it's also not code that I'd give a thumbs up to in a code review, either.

And it also ignores the right answer: use a date handling library, because, outside of the most limited cases, why on Earth would you write this code yourself?

Or this code, also from their website:

function nonAltImages() { const images = document.querySelectorAll('img'); for (let i = 0; i < images.length; i++) { if (!images[i].hasAttribute('alt')) { images[i].style.border = '1px solid red'; } } }

img:not([alt]) is a query selector that would find all the img tags that don't have an alt attribute. You could go put it in your stylesheet instead of directly modifying the style property on the element directly. Though the :not pseudo-class isn't available in IE6, so that maybe makes my solution a non-starter.

I'm not picking on some tech-preview tool that's still working the kinks out, here. A human being looked at these examples and decided that it's a good way to demonstrate the power of their new tool. Presumably a group of people looked at this output and said, "Yeah, that's the stuff, that feels like magic." Which brings me to my real point.

Any ML system is only as good as its training data, and this leads to some seriously negative outcomes. We usually call this algorithmic bias, and we all know the examples. It's why voice assistants have a hard time with certain names or accents. It's why sentencing tools for law enforcement mis-classify defendants. It's why facial recognition systems have a hard time with darker skin tones.

In the case of an ML tool that was trained on publicly available code, there's a blatantly obvious flaw in the training data: MOST CODE IS BAD.

Here at TDWTF, we try and curate the worst of the worst, because observing failure is often funny, and because we can also learn from these mistakes. But also: because this is also us. We've all written bad code at some point, and we're all going to write bad code again. We tell ourselves we'll refactor, but we never do. We make choices which make sense now, but in six months a new feature breaks our design and we've gotta hack things together so we can ship.

Most of the code in the world is bad.

If you feed a big pile of Open Source code into OpenAI, the only thing you're doing is automating the generation of bad code, because most of the code you fed the system is bad. It's ironic that the biggest obstacle to automating programmers out of a job is that we are terrible at our jobs.

In any case, I hope someone scrapes TDWTF and trains a GPT-3 model off of it. We can then let the Paulas of the world retire.

hljs.initHighlightingOnLoad(); [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!
Categories: Technology

The Queen's very particular morning routine that she's followed for years

This Is Total Essex - Tue, 2021-07-06 07:28
She has been following the same routine for years
Categories: Essex News

How Sydney has weathered lockdown a LOT better than Melbourne

Mail Online - Tue, 2021-07-06 07:26
Gladys Berejiklian has made a point of allowing shops in Sydney to open during the lockdown. New Commonwealth Bank credit card data revealed NSW is doing a lot better than Victoria.
Categories: UK News

Chelmsford Police Station reopens to the public after refvamp

Chelmsford Weekly News - Tue, 2021-07-06 07:00
The front counter of the newly refurbished Chelmsford Police Station has reopened to the public seven days a week.
Categories: Essex News

Chelmsford: Cockapoo Lola spotted falling straight into hedge

Chelmsford Weekly News - Tue, 2021-07-06 07:00
This hilarious CCTV footage captured the moment a mischievous pooch fell through a hedge – after climbing on it in a bid to reach an old slice of burnt toast.
Categories: Essex News

Castle Hedingham vineyard scoop wine award

Braintree and Witham Times - Tue, 2021-07-06 07:00
A VILLAGE vineyard has scooped a top wine award despite a tough season brought on by the pandemic.
Categories: Essex News

'Eye of fire' flames that erupted in the Gulf of Mexico was sparked by a lightning storm 

Mail Online - Tue, 2021-07-06 06:54
The so-called 'eye of fire' circle of flames that erupted in the Gulf of Mexico Friday was caused by a lightning storm, Mexico's state-owned oil company said on Monday.
Categories: UK News

Several animals die in 'devastating' Essex petting zoo fire

This Is Total Essex - Tue, 2021-07-06 06:53
A fundraiser has since been launched
Categories: Essex News

Juul Is Fighting To Keep Its E-Cigarettes on the US Market

Slashdot - Tue, 2021-07-06 06:46
Sales have plunged by $500 million. The work force has been cut by three-quarters. Operations in 14 countries have been abandoned. Many state and local lobbying campaigns have been shut down. From a report: Juul Labs, the once high-flying e-cigarette company that became a public health villain to many people over its role in the teenage vaping surge, has been operating as a shadow of its former self, spending the pandemic largely out of the public eye in what it calls "reset" mode. Now its very survival is at stake as it mounts an all-out campaign to persuade the Food and Drug Administration to allow it to continue to sell its products in the United States. The agency is trying to meet a Sept. 9 deadline to decide whether Juul's devices and nicotine pods have enough public health benefit as a safer alternative for smokers to stay on the market, despite their popularity with young people who never smoked but became addicted to nicotine after using Juul products. Major health organizations, including the American Heart Association, American Lung Association, American Academy of Pediatrics and the American Cancer Society's Cancer Action Network, have asked the agency to reject Juul's application.

Read more of this story at Slashdot.

Categories: Technology

DARPA nails cash to project 'FENCE' — a smart camera that only sends pics when pixels change

The Register - Tue, 2021-07-06 06:29
Research agency also open-sources FETT hardware bug bounty platform and tools

The USA’s Defense Advanced Research Projects Agency (DARPA) has announced it will fund development of a new type of “event-based” camera that only transmits information about pixels that have changed.…

Categories: Technology

Eastlight homes to help drive equality for disabled people in housing

Braintree and Witham Times - Tue, 2021-07-06 06:00
A HOUSING association is set to begin working to drive equality for disabled people in housing.
Categories: Essex News

Rescuers at demolished Surfside condo battle strong winds at Tropical Storm Elsa bears down Florida

Mail Online - Tue, 2021-07-06 05:50
Tropical Elsa is tracking to make landfall north of Miami sparked renewed optimism that the search for survivors would remain uninterrupted.
Categories: UK News

Basildon women given rape alarms to combat flasher

Chelmsford Weekly News - Tue, 2021-07-06 04:00
HUNDREDS of rape alarms are being handed out to women to help protect them should they come face-to-face with a serial sex pest.
Categories: Essex News

Basildon women given rape alarms to combat flasher

Braintree and Witham Times - Tue, 2021-07-06 04:00
HUNDREDS of rape alarms are being handed out to women to help protect them should they come face-to-face with a serial sex pest.
Categories: Essex News

Gwen Stefani dances with her new husband Blake Shelton in snaps taken from their wedding day 

Mail Online - Tue, 2021-07-06 03:28
The No Doubt songstress, 51, looked breathtaking in an opulent white tulle gown with flowing train as she shot her hands into the air while her new husband carefully cut their exquisite cake.
Categories: UK News

Kaseya says it's seen no sign of supply chain attack, sets SaaS restoration target of Tuesday afternoon, on-prem fix to follow

The Register - Tue, 2021-07-06 03:24
Hikes numbers of known compromised customers and warns countermeasures will be needed before resuming usage

Kaseya has said it’s been unable to find signs its code was maliciously modified, and offered its users a ray of hope with news that it is testing a patch for its on-prem software and is considering restoring its SaaS services on Tuesday, US Eastern Daylight Time (EDT).…

Categories: Technology

Ed Sheeran receives a call to check he is complying with quarantine rules while recording a podcast 

Mail Online - Tue, 2021-07-06 03:19
Ed Sheeran was interrupted during a remote interview when he received a call from the UK Home Office to ensure he was quartering.
Categories: UK News

Student doctor reveals the little-known signs of you might be suffering depression

Mail Online - Tue, 2021-07-06 03:18
A student doctor has revealed some of the little known signs you may be suffering from depression including leaving the television on while you sleep.
Categories: UK News

Charity fronted by Carrie Johnson reveals it is exporting a herd of elephants from Kent to Kenya

Mail Online - Tue, 2021-07-06 02:24
The Aspinall Foundation, which is fronted by Carrie Johnson, has announced it will transport a total of thirteen elephants from an enclosure at Howletts Wild Animal Park in Kent to Kenya.
Categories: UK News

Team GB's first black female swimmer bids to overturn Olympic ban on swimming cap

Mail Online - Tue, 2021-07-06 02:13
Alice Dearing, 24, had previously been told the headgear designed to fit over dreadlocks, braids and Afros could not be worn at the Olympics because it did not fit 'the natural form of the head'.
Categories: UK News

Pages

Subscribe to www.ewan.cc aggregator