Feed aggregator

Crunchyroll Passes 15 Million Monthly Paid Subscribers

Slashdot - Thu, 2024-08-08 02:45
Sony's Crunchyroll streaming service dedicated to anime has passed 15 million monthly paid subscribers. "Today marks an exciting milestone not only for Crunchyroll, but for the entire anime industry," Rahul Purini, president of Crunchyroll, said in a press release. "It is proof that the rich stories, characters and experiences that our partners create are resonating deeply with fans at record numbers all over the world. As the number of people excited about anime continues to explode and the breadth of content continues to widen, we believe it has never been a better time to be an anime fan." TheWrap reports: Currently, the streamer has the world's largest streaming library dedicated to anime, including 50,000 episodes and more than 25,000 hours of anime series, music and films. Every season, the streamer brings in between 45 and 60 new and returning series to its service. Those include series such as "Demon Slayer Kimetsu no Yaiba," "JUJUTSU KAISEN," "One Piece," "Chainsaw Man" and "Solo Leveling." Last year, the streamer also partnered with SMEJ (Sony Music Entertainment Japan) to bring anime-related music to the platform, a collaboration that has resulted in 3,300 music videos and concerts so far.

Read more of this story at Slashdot.

Categories: Computer, News

Dell Reportedly Laying Off 12,500 Employees

Slashdot - Thu, 2024-08-08 02:02
"We are getting leaner," said Dell's Bill Scannell and John Byrne in an internal memo to employees on Monday. "We're streamlining layers of management and reprioritizing where we invest." While no official numbers have been confirmed, a source close to the matter told SiliconANGLE that 12,500 layoffs, or about 10% of Dell's worldwide workforce, were planned across the company starting Tuesday. However, that number could be high. "It's unlikely the number is that high because that would typically trigger an SEC filing," said theCUBE Research Chief Analyst Dave Vellante. From the report: Indeed, in February 2023, a 10-K filing with the Securities and Exchange Commission was made for a reduction of about 6,000 employees. The number of new layoffs might become more apparent when Dell files its latest earnings report on Aug. 29, which should show severance and other costs. Dell declined to provide specifics on the layoff. "Through a reorganization of our go-to-market teams and an ongoing series of actions, we are becoming a leaner company," the company said in an email to SiliconANGLE. "We are combining teams and prioritizing where we invest across the company. We continually evolve our business so we're set up to deliver the best innovation, value and service to our customers and partners." Rumors of layoffs were swirling today on TheLayoff.com website. "Despite whatever person from corporate put in here earlier about this being a 1% layoff, it is in fact larger than that and is hitting services, sales, marketing & engineers," one person said. "Half of my team is gone in marketing and still no coms." Dell has been cutting staff for at least the past year. It laid off a total of 13,000 last year, according to CRN, including the 6,000 in February 2023 and another round in August whose numbers the company didn't specify. The layoffs follow a 15% reduction announced by Intel last week, affecting over 16,000 workers.

Read more of this story at Slashdot.

Categories: Computer, News

Australian State Orders Public Servants To Stop Remote Working After a Newspaper Campaign Against It

Slashdot - Thu, 2024-08-08 01:20
An anonymous reader quotes a report from the Associated Press: The government of Australia's most populous state ordered all public employees to work from their offices by default beginning Tuesday and urged stricter limits on remote work, after news outlets provoked a fraught debate about work-from-home habits established during the pandemic. Chris Minns, the New South Wales premier, said in a notice to agencies Monday that jobs could be made flexible by means other than remote working, such as part-time positions and role sharing, and that "building and replenishing public institutions" required "being physically present." His remarks were welcomed by business and real estate groups in the state's largest city, Sydney, who have decried falling office occupancy rates since 2020, but denounced by unions, who pledged to challenge the initiative if it was invoked unnecessarily. The instruction made the state's government, Australia's largest employer with more than 400,000 staff, the latest among a growing number of firms and institutions worldwide to attempt a reversal of remote working arrangements introduced as the coronavirus spread. But it defied an embrace of remote work by the governments of some other Australian states, said some analysts, who suggested lobbying by a major newspaper prompted the change. "It seems that the Rupert Murdoch-owned Daily Telegraph in Sydney has been trying to get the New South Wales government to mandate essentially that workers go back to the office," said Chris F. Wright, an associate professor in the discipline of work at the University of Sydney. The newspaper cited prospective economic boons for struggling businesses. The newspaper wrote Tuesday that the premier's decision "ending the work from home era" followed its urging, although Minns did not name it as a factor. But the union representing public servants said there was scant evidence for the change and warned the state government could struggle to fill positions. "Throughout the New South Wales public sector, they're trying to retain people," said Stewart Little, the General Secretary of the Public Service Association. "In some critical agencies like child protection we're looking at 20% vacancy rates, you're talking about hundreds of jobs." Little added that government offices have shrunk since 2020 and agencies would be unable to physically accommodate every employee on site. Minns said the state would lease more space, according to the Daily Telegraph. Further reading: Ordered Back To the Office, Top Tech Talent Left Instead, Study Finds

Read more of this story at Slashdot.

Categories: Computer, News

macOS Sequoia Makes It Harder To Run Apps That Aren't Properly Signed or Notarized

Slashdot - Thu, 2024-08-08 00:40
Ryan Christoffel writes via 9to5Mac: Since the Mac doesn't have the same locked-down app distribution system of iOS and iPadOS, Apple has created other tools meant to protect users. Some of those tools include app signing and notarization. Essentially, these provide a way for Apple to perform a level of vetting for macOS apps, even ones that don't hit the Mac App Store. The intent is to ultimately prevent harmful software from being inadvertently opened by Mac users. Trying to open an app that isn't correctly signed or notarized results in some scary warnings. But until now, power users could bypass those warnings -- and Apple's overall security process -- using a Control-click shortcut. But that shortcut is going away in macOS Sequoia. According to a new post on the Apple Developer site: "In macOS Sequoia, users will no longer be able to Control-click to override Gatekeeper when opening software that isn't signed correctly or notarized. They'll need to visit System Settings > Privacy & Security to review security information for software before allowing it to run." The post then urges developers to make sure their software is properly signed so users won't need to jump through these hoops.

Read more of this story at Slashdot.

Categories: Computer, News

Morgan Stanley Tells Wealth Advisors They Can Pitch Bitcoin ETFs

Slashdot - Thu, 2024-08-08 00:00
Starting today, Morgan Stanley's advisors are allowed to offer bitcoin ETFs to some clients -- a first among major Wall Street banks. "Those funds are BlackRock's iShares Bitcoin Trust and Fidelity's Wise Origin Bitcoin Fund," reports CNBC. From the report: Morgan Stanley made the move in response to demand from clients and in an attempt to follow an evolving marketplace for digital assets [...].The bank is still striking a note of caution, however, in the rollout: Only clients with a net worth of at least $1.5 million, an aggressive risk tolerance and the desire to make speculative investments are suitable for bitcoin ETF solicitation, said the people. The investments are for taxable brokerage accounts, not retirement accounts, they added. The bank will monitor clients' crypto holdings to make sure they don't end up with excessive exposure to the volatile asset class, according to the sources. The only crypto investments approved for solicited purchase at Morgan Stanley are the pair of bitcoin ETFs from BlackRock and Fidelity; private funds from Galaxy and FS NYDIG that the bank made available starting in 2021 were phased out earlier this year. Morgan Stanley is watching how the market for newly approved ether ETFs develops and hasn't committed to whether it would provide access to those, the people said.

Read more of this story at Slashdot.

Categories: Computer, News

The Business World's Favorite Laptop Has Barely Changed in 30 Years

Slashdot - Wed, 2024-08-07 23:20
Lenovo's widely used ThinkPad laptop hasn't changed much over the years. Corporate technology leaders say that's why they love it. From a report: "There's a lot to be said for familiarity and that consistent experience," said Ace Hardware Chief Information Officer Rick Williams, whose company uses about 4,000 ThinkPads. The ThinkPad brand of personal computers, originally created by International Business Machines, hit the market in 1992 before Lenovo acquired it, along with IBM's PC division, in 2005. Since then, the boxy design -- originally inspired by the Japanese bento box -- has gotten thinner and lighter, but not much else has changed from a design perspective, Lenovo said. The logo is the same, although in 2005 Lenovo did add the red dot over the "i" in "Think" that remains today. That logo has remained angled at 37 degrees on the device. And on the keyboard the small, red, old-timey trackpoint remains nestled between the "B," "G" and "H" keys (which Lenovo says some users swear by and some CIOs say they never use). Ports and camera placement have also been relatively consistent. And despite some experimentation with colors, the laptop itself primarily remains its original black. "You're going to recognize the iconic ThinkPad," said Tom Butler, executive director for worldwide commercial portfolio and product management at Hong Kong-based Lenovo. Its strategy might seem counterintuitive in an industry where winners and losers are often determined based on their pace of innovation, and where to stay the same often means to become obsolete. Big consumer tech companies that dominated the early 2000s, like BlackBerry, Nokia and Motorola, ultimately couldn't keep pace with competitors and struggled. But for Lenovo, which plays in the enterprise space, it's paying off. Lenovo has been leading in market share in the worldwide personal computer vendor market, based on unit shipments, on and off for more than 10 years, according to research firm Gartner.

Read more of this story at Slashdot.

Categories: Computer, News

NASA Says Boeing Starliner Astronauts May Fly Home On SpaceX In 2025

Slashdot - Wed, 2024-08-07 22:42
An anonymous reader quotes a report from the New York Times: For weeks, NASA has downplayed problems experienced by Starliner, a Boeing spacecraft that took two astronauts to the International Space Station in June. But on Wednesday, NASA officials admitted that the problems with the spacecraft were more serious than first thought and that the astronauts may not travel home on the Boeing vehicle, after all. The agency is exploring a backup option for the astronauts, Suni Wiliams and Butch Wilmore, to hitch a ride back to Earth on a vehicle built by Boeing's competitor SpaceX instead. Their stay in orbit, which was to be as short as eight days, may extend into next year. "We could take either path," Ken Bowersox, NASA's associate administrator for the space operations mission directorate, said during a news conference on Wednesday. "And reasonable people could pick either path." NASA and Boeing officials had maintained that the crew that launched with Starliner on its first crewed test flight was not stranded in space. Ms. Williams and Mr. Wilmore have spent two months aboard the orbital outpost while engineers continue to analyze data about the faulty performance of several of the Starliner's thrusters when it approached for docking. Under the contingency plan, a SpaceX Crew Dragon capsule would travel to the space station with two astronauts instead of its planned crew of four. Ms. Williams and Mr. Wilmore would then join as full-time members of the space station crew for a half-year stay, returning on the Crew Dragon around next February. "In the last few weeks, we have decided to make sure we have that capability there, as our community, I would say, got more and more uncomfortable," said Steve Stich, the manager of the commercial crew program at NASA. NASA officials said no decision had been made yet.

Read more of this story at Slashdot.

Categories: Computer, News

Hottest Ocean Temperatures in 400 years an 'Existential Threat' To the Great Barrier Reef, Report Finds

Slashdot - Wed, 2024-08-07 22:01
Ocean temperatures in the Great Barrier Reef are now the hottest in at least 400 years and are an "existential threat" to the planet's unique natural wonder , according to new scientific research. From a report: Scientists analysed long-lived corals in and around the reef that keep a record of temperature hidden in their skeleton and matched them to modern observations. The research, published in the journal Nature, used climate models to find the extreme temperatures of recent decades could not have happened without the extra greenhouse gases in the atmosphere caused mostly by burning fossil fuels. The "existential threat" to the reef from the climate crisis was "now realised," the scientists wrote, and without ambitious and rapid cuts to greenhouse gas emissions "we will likely be witness to the demise of one of the Earth's natural wonders." The research comes two weeks after the World Heritage committee decided not to place the reef, which covers an area larger than Italy, on its list of sites "in danger," saying it would consider the question again in 2026.

Read more of this story at Slashdot.

Categories: Computer, News

Your Windows Updates Can All Be Downgraded, Says Security Researcher

Slashdot - Wed, 2024-08-07 21:20
Security researchers from SafeBreach have found what they say is a Windows downgrade attack that's invisible, persistent, irreversible and maybe even more dangerous than last year's BlackLotus UEFI bootkit. From a report: After seeing the damage that UEFI bootkit could do by bypassing secure boot processes in Windows, SafeBreach's Alon Leviev became curious whether there were any other fundamental Windows components that could be abused in a similar manner. He hit the jackpot in one of the most unlikely places: The Windows update process. "I found a way to take over Windows updates to update the system, but with control over all of the actual update contents," Leviev told us in an interview ahead of his Black Hat USA conference presentation today detailing his findings. Using his technique, having compromised a machine so that he could get in as a normal user, Leviev was able to control which files get updated, which registry keys are changed, which installers get used, and the like. And he was able to do all of it while side-stepping every single integrity verification implemented in the Windows update process. After that, "I was able to downgrade the OS kernel, DLLs, drivers ... basically everything that I wanted." To make matters worse, Leviev said that poking and prodding around the vulnerabilities he found enabled him to attack the entire Windows virtualization stack, including virtualization-based security (VBS) features that are supposed to isolate the kernel and make attacker access less valuable.

Read more of this story at Slashdot.

Categories: Computer, News

After Breaking Free, World's Largest Iceberg Is Stuck Spinning in Circles

Slashdot - Wed, 2024-08-07 20:45
For more than 30 years, the world's largest iceberg was stuck in the Antarctic. Five times the size of New York City's land area and more than 1,000 feet deep, the mammoth piece of ice finally became loose in 2020 and began a slow drift toward the Southern Ocean. Now, A23a, as it's known, is spinning in place. From a report: After leaving Antarctic waters, the iceberg got stuck in a vortex over a seamount, or an underwater mountain. Imagine a 1,400-square-mile piece of ice as deep as the Empire State Building spinning slowly but steadily enough to fully rotate it on its head over the course of about 24 days. The iceberg is spinning near the South Orkney Islands, about 375 miles northeast of the Antarctic Peninsula, "maintaining a chill 15 degree rotation per day," the British Antarctic Survey, the United Kingdom's polar research institute, said on social media. "It's basically just sitting there, spinning around and it will very slowly melt as long as it stays there," said Alex Brearley, a physical oceanographer and head of the Open Oceans research group at the British Antarctic Survey. "What we don't know is how quickly it will actually come out of this." A23a has been embroiled in drama since the start, a trait it picked up from its parent-berg. A23, which was even bigger than A23a, was one of three icebergs that broke off, or calved, from the Filchner Ice Shelf in 1986. At the time of the calving, A23 was home to a Soviet Union research center and researchers eventually had to abandon the base. A23a broke off later that year and hit bottom in the Weddell Sea, where it would remain for 34 more years.

Read more of this story at Slashdot.

Categories: Computer, News

Humane's Daily Returns Are Outpacing Sales

Slashdot - Wed, 2024-08-07 20:05
Things aren't working out well for Humane, a heavily-funded startup that launched an eponymous AI device earlier this year. Despite significant funding from prominent Silicon Valley figures, the product has been grappling with negative reviews -- and now more pressing issues are emerging. An anonymous reader shares a report: Shortly after Humane released its $699 AI Pin in April, the returns started flowing in. Between May and August, more AI Pins were returned than purchased, according to internal sales data obtained by The Verge. By June, only around 8,000 units hadn't been returned, a source with direct knowledge of sales and return data told me. As of today, the number of units still in customer hands had fallen closer to 7,000, a source with direct knowledge said. At launch, the AI Pin was met with overwhelmingly negative reviews. Our own David Pierce said it "just doesn't work," and Marques Brownlee called it "the worst product" he's ever reviewed. Now, Humane is attempting to stabilize its operations and maintain confidence among staff and potential acquirers. The New York Times reported in June that HP is considering purchasing the company, and The Information reported last week that Humane is negotiating with its current investors to raise debt, which could later be converted into equity.

Read more of this story at Slashdot.

Categories: Computer, News

AI Is Coming for India's Famous Tech Hub

Slashdot - Wed, 2024-08-07 19:31
AI is upending India's technology outsourcing business. The industry is pivoting to adapt, but the changes could cost a large number of coveted jobs. From a report: The country's big outsourcing companies are already using AI and have plans to integrate it throughout their businesses. That might not save the low-end operations that run call centers or do other basic tasks within the so-called business process outsourcing sector. AI is threatening to disrupt most businesses around the world, not just India's $250 billion outsourcing industry. The outsourcing boom in India over the past few decades created the "getting Bangalore-d" phenomenon in the U.S., often used for Americans who lost their jobs to more affordable Indian talent. AI's impact could have big repercussions as the industry employs 5.4 million people, according to tech-industry body Nasscom, and contributes about 8% of the country's economy. More than 80% of companies in the S&P 500 outsource some operations to India, according to HSBC.

Read more of this story at Slashdot.

Categories: Computer, News

Parody Site ClownStrike Refused To Bow To CrowdStrike's Bogus DMCA Takedown

Slashdot - Wed, 2024-08-07 18:49
Parody site creator David Senk has rebuffed CrowdStrike's attempt to shut down his "ClownStrike" website, which lampoons the cybersecurity firm's role in a recent global IT outage. Senk swiftly contested the Digital Millennium Copyright Act takedown notice, asserting fair use for parody. When hosting provider Cloudflare failed to acknowledge his counter-notice, Senk defiantly relocated the site to a Finnish server beyond U.S. jurisdiction. The IT consultant decried the takedown as "corporate cyberbullying," accusing CrowdStrike of exploiting copyright law to silence criticism. Despite CrowdStrike's subsequent admission that parody sites were not intended targets, Senk is remaining resolute, demanding a public apology and refusing to return to Cloudflare's services.

Read more of this story at Slashdot.

Categories: Computer, News

Logitech Says the 'Forever Mouse' Was Just an Idea

Slashdot - Wed, 2024-08-07 18:05
Logitech has quashed its earlier remarks about building a subscription-based mouse, following widespread backlash to comments made by CEO Hanneke Faber. The Swiss-American computer peripherals maker clarified that the "forever mouse" concept, mentioned by Faber in a recent podcast interview, was merely speculative internal discussion and not a planned product.

Read more of this story at Slashdot.

Categories: Computer, News

Reddit CEO Teases AI Search Features and Paid Subreddits

Slashdot - Wed, 2024-08-07 17:36
An anonymous reader shares a report: Reddit just wrapped up its second earnings call as a public company and CEO Steve Huffman hinted at some significant changes that could be coming to the platform. During the call, the Reddit co-founder said the company would begin testing AI-powered search results later this year. "Later this year, we will begin testing new search result pages powered by AI to summarize and recommend content, helping users dive deeper into products, shows, games and discover new communities on Reddit," Huffman said. He didn't say when those tests would begin, but said it would use both first-party and third-party models. Huffman noted that search on Reddit has "gone unchanged for a long time" but that it's a significant opportunity to bring in new users. He also said that search could one day be a significant source of advertising revenue for the company. Huffman hinted at other non-advertising sources of revenue as well. He suggested that the company might experiment with paywalled subreddits as it looks to monetize new features.

Read more of this story at Slashdot.

Categories: Computer, News

Disney's Password-Sharing Crackdown Starts 'in Earnest' Next Month

Slashdot - Wed, 2024-08-07 16:40
Disney Plus will soon no longer let you share your password with people outside your household. From a report: During an earnings call on Wednesday, Disney CEO Bob Iger said the crackdown will kick off "in earnest" this September. The timeline for Disney's password-sharing crackdown has been a bit confusing so far. In February, Disney announced plans to roll out paid sharing and also began notifying users about the change. It then launched paid sharing in a "few countries" in June but provided no information on when it would reach the US.

Read more of this story at Slashdot.

Categories: Computer, News

How Intel Spurned OpenAI and Fell Behind the Times

Slashdot - Wed, 2024-08-07 16:00
An anonymous reader shares a report: For U.S. chip giant Intel, the darling of the computer age before it fell on harder times in the AI era, things might have been quite different. About seven years ago, the company had the chance to buy a stake in OpenAI, then a fledgling non-profit research organization working in a little-known field called generative AI, four people with direct knowledge of those discussions told Reuters. Over several months in 2017 and 2018, executives at the two companies discussed various options, including Intel buying a 15% stake for $1 billion in cash, three of the people said. They also discussed Intel taking an additional 15% stake in OpenAI if it made hardware for the startup at cost price, two people said. Intel ultimately decided against a deal, partly because then-CEO Bob Swan did not think generative AI models would make it to market in the near future and thus repay the chipmaker's investment, according to three of the sources, who all requested anonymity to discuss confidential matters.

Read more of this story at Slashdot.

Categories: Computer, News

Scientists Find Water Molecules in Lunar Rock Sample for the First Time

Slashdot - Wed, 2024-08-07 12:00
Chinese scientists discovered water molecules in lunar samples brought back by the Chang'e 5 moon probe, marking the first time whole H2O molecules were found in lunar material. The findings have been published in Nature Astronomy. Smithsonian Magazine reports: The team used X-ray diffraction to analyze the grains of moon soil, in which they found a lunar mineral dubbed ULM-1 whose mass is made up of more than 40 percent water and also includes ammonia. "This is a new form of water stored on the moon," Xiaolong Chen, co-author of the study and physics researcher at the Chinese Academy of Sciences, tells New Scientist's Alex Wilkins. In the words of CNN's Jessie Yeung, water on the moon is nothing new. Though the samples brought back by the U.S. Apollo missions seemed to show that the moon was dry and lifeless, a recent study suggests that water or hydroxyl may be trapped in glass beads on the moon's surface -- and solar winds could turn the hydroxyl (chemical formula OH) into H2O, according to Yeung. And both American and Indian spacecrafts separately registered what is believed to be water on the moon's surface. This recent discovery, however, marks the first time scientists have found whole molecules of H2O in lunar samples. The findings suggest that "water molecules can persist in sunlit areas of the moon in the form of hydrated salts," the authors write in the study.

Read more of this story at Slashdot.

Categories: Computer, News

SpaceX's New Direct-To-Cell Starlink Satellites Are Way Brighter Than the Originals

Slashdot - Wed, 2024-08-07 09:00
According to a recent study, SpaceX's new Starlink direct-to-cell (DTC) satellites are nearly five times brighter than traditional Starlinks due to their lower orbit. While these satellites offer the promise of widespread connectivity, their increased brightness poses challenges for astronomical observations, prompting SpaceX to consider applying brightness mitigation techniques. Space.com reports: The higher luminosity of these DTCs compared to regular Starlinks is partly because they circle Earth at just 217 miles (350 kilometers) above the surface, which is lower than traditional Starlink internet satellites, whose altitude is 340 miles (550 kilometers), the study reported. [...] At the time the study was conducted, SpaceX had not yet applied its routine brightness mitigation techniques to the DTCs, such as adjusting their chassis and solar panels to reduce the portion of spacecraft illuminated by the sun, study lead author Anthony Mallama of the IAU Centre for the Protection of Dark and Quiet Skies from Satellite Constellation Interference (IAU-CPS) told Space.com. SpaceX began applying brightness mitigation techniques to regular Starlinks in 2020, after astronomers voiced serious concerns about the satellites' trails streaking across telescope images, rendering them unusable. Prior to launch, the company now applies a mirror-like dielectric surface to the underside of each Starlink chassis, to help reflect sunlight into space rather than scattering it toward Earth. Post launch, the company adjusts spacecraft chassis and solar panels to further reduce luminosity. Together, these techniques are very effective, reducing Starlink satellites' brightness by a factor of 10, Mallama said. If SpaceX applies these brightness mitigation techniques to the DTCs, which are nearly the same size as the regular Starlinks, the DTCs would still be 2.6 times brighter than their traditional counterparts, Mallama and his colleagues reported in the recent study, which was reviewed internally by IAU-CPS and posted to the preprint server arXiv last month. However, while DTCs are brighter objects, they move at a faster apparent rate and spend more time in Earth's shadow than regular Starlinks, which would offset some of their negative impact on astronomy observations, the study noted. "I see it as a tradeoff in parameters rather than an absolute better/worse kind of situation," John Barentine, a principal consultant at Arizona-based Dark Sky Consulting who was not involved with the new study, told Space.com.

Read more of this story at Slashdot.

Categories: Computer, News

CodeSOD: Currency Format

The Daily WTF - Wed, 2024-08-07 08:30

"Dark Horse" inherited some PHP code. They had a hundred lines to submit, but only sent in a dozen- which is fine, as the dozen lines tell us what the other hundred look like.

$suite_1_1 = number_format($item -> {'suite_1_1_'.$the_currency}, 2, '.', ''); $suite_1_2 = number_format($item -> {'suite_1_2_'.$the_currency}, 2, '.', ''); $suite_1_3 = number_format($item -> {'suite_1_3_'.$the_currency}, 2, '.', ''); $suite_1_4 = number_format($item -> {'suite_1_4_'.$the_currency}, 2, '.', ''); $suite_2_1 = number_format($item -> {'suite_2_1_'.$the_currency}, 2, '.', ''); $suite_2_2 = number_format($item -> {'suite_2_2_'.$the_currency}, 2, '.', ''); $suite_2_3 = number_format($item -> {'suite_2_3_'.$the_currency}, 2, '.', ''); $suite_2_4 = number_format($item -> {'suite_2_4_'.$the_currency}, 2, '.', ''); $suite_3_1 = number_format($item -> {'suite_3_1_'.$the_currency}, 2, '.', ''); $suite_3_2 = number_format($item -> {'suite_3_2_'.$the_currency}, 2, '.', ''); $suite_3_3 = number_format($item -> {'suite_3_3_'.$the_currency}, 2, '.', ''); $suite_3_4 = number_format($item -> {'suite_3_4_'.$the_currency}, 2, '.', '');

On one level, they have an object called $item, and want to format a series of fields to two decimal places. Their approach to doing this is to just… write a line of code for each one. But this code is so much worse than that.

Let's start with the object, which has fields named in a pattern, suite_1_1_USD, and suite_2_1_EUR. Which right off the bat, why do we have so many fields in an object? What are we going to do with this gigantic pile of variables?

Now, because this object has values for different currencies, we need to ensure we only work on a single currency. They do this by dynamically constructing the field name with a variable, $the_currency. The code $item -> {"some" . "field"} is a property accessor for, well, "somefield".

On one hand, I hate the dynamic field access to begin with, as obviously this all should be organized differently. On the other, I'm frustrated that they didn't go the next logical step and loop across the two numeric fields. This whole mess would still be a mess, but it'd be a short mess.

All these currency values, and nobody thought to buy an array or two.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!
Categories: Computer

Pages