Skip to main content

Google Enters Massive 3.6-GW Power Deal With Constellation Energy

6 days 9 hours ago
An anonymous reader quotes a report from Reuters: Google has contracted for 3,590 megawatts of power from Constellation Energy on the largest US power grid, with new nuclear energy accounting for about a quarter of that supply, the companies said on Tuesday. Constellation will make more than $4.3 billion of new investments in its fleet as part of the agreement, which involves adding capacity at several of the power company's nuclear reactors in the Midwest and Mid-Atlantic regions, the companies said. [...] Over the last two years, Constellation unveiled an agreement to restart its Three Mile Island reactor in Pennsylvania to serve Microsoft data centers, while Google contracted to restart NextEra Energy's nuclear power plant in Iowa. In the latest arrangement, Google entered into a 20-year power purchase agreement for 890 megawatts of electricity from multiple Constellation-owned nuclear power plants, which would be upgraded to produce more electricity from existing reactors. Electricity from the first of the upgraded plants is expected to be delivered in 2028, the companies said. Google also entered into a 15-year supply agreement for an additional 2,700 megawatts of power from Constellation in the PJM power grid. That power is not tied to a specific generation source and serves as long-term revenue certainty for Constellation's operating plants, Google said. Maryland-based Constellation is the largest US nuclear power plant operator and owns a major fleet of natural-gas-fired power plants as well as geothermal energy following its acquisition of electricity producer Calpine Corp earlier this year. [...] The 11 nuclear units expected to be upgraded as part of the arrangement with Google are in Illinois, Pennsylvania, and New Jersey, within the footprint of the largest US electric grid -- PJM Interconnection. Joe Dominguez, chairman, president and CEO of Constellation, said the arrangement with Google is a "model for how technology companies and the energy industry can work together to responsibly develop the digital economy and invest in our nation's energy infrastructure in a way that delivers grid-wide benefits for all, funded by private entities."

Read more of this story at Slashdot.

BeauHD

CodeSOD: A Tool for You

6 days 10 hours ago

A junior dev on the team had a simple question: in Java, how do I correctly read user input from the CLI and act on it?

Now, we can wonder about a junior dev not having such basic knowledge, but maybe they're new to Java specifically. Who knows. But Robert's team has a senior on it who "likes to mentor". This senior has strong opinions about how to write software, extreme confidence in those opinions, and has somehow been around the company long enough that he knows where the bodies are buried and no one will fire him.

Here's his sample application for reading input.

import java.nio.charset.StandardCharsets; import java.util.*; public class ScannerTool { public static void main(String[] args) { Map<Optional<Character>, Map.Entry<String, Boolean>> map = new HashMap<>(); map.put(Optional.of('A'), new AbstractMap.SimpleEntry<>("You entered A.", true)); map.put(Optional.of('B'), new AbstractMap.SimpleEntry<>("You entered B.", true)); map.put(Optional.empty(), new AbstractMap.SimpleEntry<>("You entered nothing.", false)); Optional<Character> input; do { System.out.println("Please enter A or B:"); } while (!map.getOrDefault((input = nextCharacter()), new AbstractMap.SimpleEntry<>("", false)) .getValue()); System.out.println(map.get(input).getKey()); } public static Optional<Character> nextCharacter() { String l = new Scanner(System.in, StandardCharsets.UTF_8).nextLine(); if (l != null && !l.isEmpty()) { return Optional.of(l.charAt(0)); } return Optional.empty(); } }

Look, I know Java is verbose, but this is entirely next level. Giving this to a junior has to constitute an attempt to drive the youth out of the industry, because any sane person being told, "your job is to write this" would realize they've committed a grave error in their career choice and needs to escape now.

nextCharacter in this case actually returns the first character of the next line, not the next character. And if there isn't one, it returns an empty optional. Which, fine, we only expect one character per line of input for this exercise, so that's not wrong, I just don't like the name of the function.

Of course, using Scanner here is a wrecking ball fly swatter- that class is a full on parser for reading out common data types from a file. Worth showing to a junior, but a little out of scope of this question.

But the real overengineering is the map of maps- well, a map of map entries. The key to the outer map is an optional of the character that was entered by the user. The value is itself a map, the key of the map is the message we want to output, the value is whether or not the loop should continue. They've reinvented tuples using map entries. Which, in their defense, mainline Java doesn't have tuples (enterprise edition seems to have them in the javax namespace, but I'm not even certain those are meant to be general purpose tuples anyway). A quick search indicates that their absence is a perennial source of heated discussions in forums and Stack Overflow.

Robert writes:

It is remarkable in its creativity and execution and still has me in awe. When I tried to unpack it, my brain just started to pack up its things and left, haven't seen it since.

Bon voyage.

[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.
Remy Porter