Home Blog Page 54

ios – Process code being known as twice for revenuecat code


I’ve the next code. The self.buy code contained in the Process {} is being known as twice. Although the remainder of the code above is known as as soon as. Can somebody please assist?

@MainActor func purchaseProduct(productId: String, plan: String, supply: String, vc: UIViewController) async -> Bool {
    
Purchases.shared.getOfferings { (choices, error) in
            if let choices = choices {
                for providing in choices.all {
                    let packages = providing.worth.availablePackages
                    if let indexOfItem = packages.firstIndex(the place: { $0.storeProduct.productIdentifier == productId }) {
                        let bundle = packages[indexOfItem]
                        
                        Purchases.shared.buy(bundle: bundle) { (transaction, customerInfo, error, userCancelled) in
                            if customerInfo?.entitlements["premium"]?.isActive == true {
                                Process {
                                    await self.buy (vc: vc, productId: productId, product: productId, transaction: transaction?.transactionIdentifier ?? "")
                                }
                            } else if userCancelled {
                                DispatchQueue.major.async {
                                    Amplitude.sharedInstance.observe(
                                        eventType: "payment_cancelled",
                                        eventProperties: [
                                            "PlanId": productId,
                                            "UserId": WUser.sharedInstance.userId,
                                            "Source": source
                                        ]
                                    )
                                    if (self.loadingIndicator != nil) {
                                        self.loadingIndicator.removeFromSuperview()
                                    }
                                }
                            } else if error != nil {
                                DispatchQueue.major.async {
                                    Amplitude.sharedInstance.observe(
                                        eventType: "payment_failed",
                                        eventProperties: [
                                            "PlanId": productId,
                                            "UserId": WUser.sharedInstance.userId,
                                            "Source": source,
                                            "ErrorObject": String(describing: error),
                                            "Error": error?.localizedDescription
                                        ]
                                    )
                                }
                            } else {
                                DispatchQueue.major.async {
                                    Amplitude.sharedInstance.observe(
                                        eventType: "payment_failed_no_error",
                                        eventProperties: [
                                            "PlanId": productId,
                                            "UserId": WUser.sharedInstance.userId,
                                            "Source": source
                                        ]
                                    )
                                    
                                    if (self.loadingIndicator != nil) {
                                        self.loadingIndicator.removeFromSuperview()
                                    }
                                    showMessageWithTitle("Error", "We have been unable to course of your buy.", .error)
                                }
                            }
                        }
                    }
                }
            } else {
                DispatchQueue.major.async {
                    Amplitude.sharedInstance.observe(
                        eventType: "payment_failed",
                        eventProperties: [
                            "PlanId": productId,
                            "UserId": WUser.sharedInstance.userId,
                            "Source": source,
                            "Error": "Error fetching packages"
                        ]
                    )
                    
                    if (self.loadingIndicator != nil) {
                        self.loadingIndicator.removeFromSuperview()
                    }
                    showMessageWithTitle("Error", "We have been unable to course of your buy.", .error)
                }
            }
        }

Waymo to start testing robotaxis on Tokyo public roads

0


Waymo to start testing robotaxis on Tokyo public roads

Waymo mentioned it goals to turn into part of the Tokyo transportation ecosystem, enhancing security and mobility. | Supply: Waymo

Waymo LLC’s autonomous automobiles will start driving on public roads in Tokyo subsequent week. This marks the corporate’s first deployment outdoors the U.S. and furthers its partnership with Dihon Kotsu and GO.

Throughout the testing, educated Nihon Kotsu drivers will manually drive Waymo automobiles throughout seven central-Tokyo wards, together with Minato, Shinjuku, Shibuya, Chiyoda, Chūō, Shinagawa, and Kōtō. The firm mentioned this guide operation will present its engineers expertise to check, refine, and adapt its autonomous driving expertise to native site visitors patterns and street options.

“After months of robust collaboration with Nihon Kotsu and GO, Waymo has reached a historic milestone — our first enterprise on worldwide public roads,” acknowledged Nicole Gavel, head of enterprise improvement and strategic partnerships at Waymo.

“Our partnership demonstrates how Waymo’s 15 years of operational experience can adapt to new environments via strategic initiatives with trade leaders,” she added. “In Tokyo, we’re abiding by the identical steadfast rules that information us within the U.S. — dedication to security, dedication to incomes belief in communities the place we function, and collaboration with native officers and neighborhood teams right here in Tokyo.”

Waymo lays groundwork for Tokyo deployment

Waymo first introduced its plans to convey its robotaxis to Japan in December 2024. The corporate mentioned its preparation in Tokyo has been complete.

Nihon Kotsu, Tokyo’s largest taxi firm, will oversee the administration and servicing of the automobiles. Waymo educated the groups from taxicab app supplier GO and Nihon Kotsu on fleet-management greatest practices and established first-responder coaching protocols.

“Since my first experience in Phoenix, which deeply moved me, I’m thrilled to lastly see Waymo automobiles arrive in Japan,” mentioned Ichiro Kawanabe, the chairman of GO, board director of Nihon Kotsu, and chairman of the Japan Taxi Affiliation. “I’m notably grateful that Waymo selected Tokyo for this launch. Whereas I had coaching to function Waymo automobiles within the U.S., I imagine we now have constructed a good stronger unified group with Waymo members right here.”

Waymo has additionally began constructing relationships with the broader neighborhood via outreach to the general public, native organizations, and authorities companies, in line with Reuters. As the corporate introduces its companies to Tokyo, it mentioned it plans to proceed working carefully with Japanese policymakers, regulators, and native security officers.

Extra robotaxis take to the street

Waymo has achieved robust momentum within the U.S. in recent times. It mentioned it now delivers extra 200,000 totally autonomous rides weekly throughout its deployments in San Francisco, Phoenix, and Los Angeles.

Already in 2025, the Mountain View, Calif.-based firm made its robotaxis accessible in Austin solely via the Uber app.

Whereas the corporate’s longtime rival, Cruise, is now not in operation, Waymo nonetheless faces competitors from robotaxi corporations like Zoox and Nuro, that are earlier of their deployment journeys.

In 2024, Nuro expanded its capabilities utilizing zero-occupant automobiles with the Nuro Driver system, whereas Zoox has grown its operations in California and Nevada.

Waymo can be planning to to launch companies in Miami, Atlanta, and Washington. D.C.. The Mountain View, Calif.-based firm received the 2025 RBR50 Robotic of the 12 months award for its achievements. Be taught extra in regards to the RBR50 Robotics Innovation Award winners on the RBR50 Gala on the Robotics Summit & Expo.


SITE AD for the 2025 Robotics Summit registration.
Register now so you do not miss out!


‘File renewables technology underscores untapped potential of economic photo voltaic’



‘File renewables technology underscores untapped potential of economic photo voltaic’
An set up by photo voltaic options agency Solivus (picture credit score: Solivus).

Current UK renewables statistics showcase vital progress but additionally spotlight the essential position that business rooftop photo voltaic installations should play within the nation’s renewable vitality transition, says photo voltaic options agency Solivus.

Based on the newest Power Tendencies report from the Division of Power Safety and Internet Zero (DESNZ),1 renewable vitality accounted for greater than half (50.8%) of the UK’s electrical energy technology for the primary time in 2024. Solar energy alone reached a file excessive, growing by 6.5% to 14.8TWh. Nonetheless, regardless of home photo voltaic installations comprising the vast majority of photo voltaic quantity, they contribute solely 30% of the UK’s complete photo voltaic capability

Whereas these figures mark vital progress within the UK’s low-carbon economic system, light-weight photo voltaic specialist Solivus argues that business rooftop photo voltaic stays an underutilised alternative.

Jo Parker-Swift, CEO and founding father of Solivus, acknowledged: “Solar energy is central to the UK’s web zero ambitions, and it’s unbelievable to see the nation’s photo voltaic capability rising at such a formidable price. Nonetheless, a lot of the main target stays on residential installations, whereas the actual sport changer lies within the growth of economic photo voltaic. That is the place we now have the potential for a seismic shift in how we generate and eat energy.”

“A single dwelling putting in photo voltaic panels is a win, however a largescale business or industrial outlet outfitting its complete facility with rooftop photo voltaic is transformative. Companies, significantly energy-intensive ones, eat considerably extra electrical energy than residential properties. Their adoption of photo voltaic not solely reduces demand on the grid but additionally decreases reliance on fossil fuels and strengthens the UK’s renewable vitality infrastructure.”

Regardless of the advantages, a latest evaluation reveals that lower than 10% of the UK’s non-domestic buildings at present utilise their out there rooftop area for photo voltaic vitality.2 By harnessing this untapped potential, business buildings might generate an estimated 117TWh of electrical energy yearly—sufficient to energy roughly 30 million properties, exceeding the overall variety of households within the UK. Financially, this might equate to financial savings of £35 billion, with lifetime financial savings reaching £703 billion.”

Jo provides: “The federal government has set an formidable goal to extend photo voltaic capability practically fivefold to 70GW by 2035 as a part of its broader technique to safe cleaner and extra inexpensive vitality. Whereas residential photo voltaic stays vital, unlocking the total potential of economic photo voltaic is crucial. That is the place probably the most profound and lasting influence shall be made, and it have to be prioritised accordingly.”

Notes
[1] https://www.solarpowerportal.co.uk/renewables-generated-50-8-of-the-uks-electricity-in-2024/
[2] https://powermarket.ai/buildings-could-save-35bn/#:~:textual content=Apercent20groundbreakingpercent20analysispercent20bypercent20PowerMarket,leavingpercent20apercent20vastpercent20untappedpercent20potential.

DeepMind’s New AI Teaches Itself to Play Minecraft From Scratch

0


My nephew couldn’t cease taking part in Minecraft when he was seven years previous.

One of the preferred video games ever, Minecraft is an open world wherein gamers construct terrain and craft varied objects and instruments. Nobody confirmed him the right way to navigate the sport. However over time, he discovered the fundamentals by trial and error, finally determining the right way to craft intricate designs, comparable to theme parks and full working cities and cities. However first, he needed to collect supplies, a few of which—diamonds particularly—are troublesome to gather.

Now, a brand new DeepMind AI can do the identical.

With out entry to any human gameplay for instance, the AI taught itself the principles, physics, and complicated maneuvers wanted to mine diamonds. “Utilized out of the field, Dreamer is, to our data, the primary algorithm to gather diamonds in Minecraft from scratch with out human information or curricula,” wrote examine creator, Danijar Hafner, in a weblog publish.

However taking part in Minecraft isn’t the purpose. AI scientist have lengthy been after normal algorithms that may resolve duties throughout a variety of issues—not simply those they’re skilled on. Though a few of as we speak’s fashions can generalize a ability throughout comparable issues, they wrestle to switch these abilities throughout extra complicated duties requiring a number of steps.

Within the restricted world of Minecraft, Dreamer appeared to have that flexibility. After studying a mannequin of its setting, it might “think about” future eventualities to enhance its resolution making at every step and in the end was capable of accumulate that elusive diamond.

The work “is about coaching a single algorithm to carry out properly throughout numerous…duties,” mentioned Harvard’s Keyon Vafa, who was not concerned within the examine, to Nature. “This can be a notoriously laborious downside and the outcomes are unbelievable.”

Studying From Expertise

Youngsters naturally absorb their setting. Via trial and error, they shortly be taught to keep away from touching a scorching range and, by extension, a lately used toaster oven. Dubbed reinforcement studying, this course of incorporates experiences—comparable to “yikes, that damage”—right into a mannequin of how the world works.

A psychological mannequin makes it simpler to think about or predict penalties and generalize earlier experiences to different eventualities. And when choices don’t work out, the mind updates its modeling of the results of actions—”I dropped a gallon of milk as a result of it was too heavy for me”—so that youngsters finally be taught to not repeat the identical habits.

Scientists have adopted the identical rules for AI, basically elevating algorithms like kids. OpenAI beforehand developed reinforcement studying algorithms that discovered to play the fast-paced multiplayer Dota 2 online game with minimal coaching. Different such algorithms have discovered to regulate robots able to fixing a number of duties or beat the hardest Atari video games.

Studying from errors and wins sounds simple. However we stay in a posh world, and even easy duties, like, say, making a peanut butter and jelly sandwich, contain a number of steps. And if the ultimate sandwich turns into an overloaded, soggy abomination, which step went incorrect?

That’s the issue with sparse rewards. We don’t instantly get suggestions on each step and motion. Reinforcement studying in AI struggles with an analogous downside: How can algorithms work out the place their choices went proper or incorrect?

World of Minecraft

Minecraft is an ideal AI coaching floor.

Gamers freely discover the sport’s huge terrain—farmland, mountains, swamps, and deserts—and harvest specialised supplies as they go. In most modes, gamers use these supplies to construct intricate buildings—from rooster coups to the Eiffel Tower—craft objects like swords and fences, or begin a farm.

The sport additionally resets: Each time a participant joins a brand new recreation the world map is completely different, so remembering a earlier technique or place to mine supplies doesn’t assist. As an alternative, the participant has to extra typically be taught the world’s physics and the right way to accomplish objectives—say, mining a diamond.

These quirks make the sport an particularly helpful check for AI that may generalize, and the AI neighborhood has centered on amassing diamonds as the last word problem. This requires gamers to finish a number of duties, from chopping down timber to creating pickaxes and carrying water to an underground lava movement.

Children can discover ways to accumulate diamonds from a 10-minute YouTube video. However in a 2019 competitors, AI struggled even after as much as 4 days of coaching on roughly 1,000 hours of footage from human gameplay.

Algorithms mimicking gamer habits had been higher than these studying purely by reinforcement studying. One of many organizers of the competitors, on the time, commented that the latter wouldn’t stand an opportunity within the competitors on their very own.

Dreamer the Explorer

Relatively than counting on human gameplay, Dreamer explored the sport by itself, studying by experimentation to gather a diamond from scratch.

The AI is comprised of three primary neural networks. The primary of those fashions the Minecraft world, constructing an inner “understanding” of its physics and the way actions work. The second community is mainly a guardian that judges the result of the AI’s actions. Was that basically the correct transfer? The final community then decides the very best subsequent step to gather a diamond.

All three parts had been concurrently skilled utilizing information from the AI’s earlier tries—a bit like a gamer taking part in time and again as they goal for the right run.

World modeling is the important thing to Dreamer’s success, Hafner instructed Nature. This element mimics the best way human gamers see the sport and permits the AI to foretell how its actions might change the longer term—and whether or not that future comes with a reward.

“The world mannequin actually equips the AI system with the power to think about the longer term,” mentioned Hafner.

To judge Dreamer, the crew challenged it towards a number of state-of-the-art singular use algorithms in over 150 duties. Some examined the AI’s capability to maintain longer choices. Others gave both fixed or sparse suggestions to see how the applications fared in 2D and 3D worlds.

“Dreamer matches or exceeds the very best [AI] specialists,” wrote the crew.

They then turned to a far tougher job: Amassing diamonds, which requires a dozen steps. Intermediate rewards helped Dreamer decide the following transfer with the most important probability of success. As an additional problem, the crew reset the sport each half hour to make sure the AI didn’t kind and keep in mind a selected technique.

Dreamer collected a diamond after roughly 9 days of steady gameplay. That’s far slower than professional human gamers, who want simply 20 minutes or so. Nevertheless, the AI wasn’t particularly skilled on the duty. It taught itself the right way to mine one of many recreation’s most coveted objects.

The AI “paves the best way for future analysis instructions, together with educating brokers world data from web movies and studying a single world mannequin” to allow them to more and more accumulate a normal understanding of our world, wrote the crew.

“Dreamer marks a major step in the direction of normal AI techniques,” mentioned Hafner.

April 11, 2025: AI updates from the previous week — Google’s new instruments for constructing AI brokers, agent mode in GitHub Copilot, and extra


Software program corporations are continuously making an attempt so as to add increasingly more AI options to their platforms, and AI corporations are continuously releasing new fashions and options. It may be laborious to maintain up with all of it, so we’ve written this roundup to share a number of notable updates round AI that software program builders ought to learn about. 

Google broadcasts new and up to date instruments for constructing AI brokers

The corporate introduced the Agent Growth Equipment (ADK), an open-source framework that covers the end-to-end strategy of constructing and deploying brokers and multi-agent methods.

Google additionally introduced the Agent2Agent (A2A) protocol, an open protocol that enables AI brokers to speak with one another, change info in a safe approach, and coordinate actions on high of enterprise functions. It was developed with assist and contributions from over 50 different corporations, together with Atlassian, Field, MongoDB, Salesforce, ServiceNow.

In Agentspace, organizations will now be capable of give their workers entry to the platform’s unified enterprise search, evaluation, and synthesis capabilities from inside Chrome’s search field. Different new capabilities embody a no-code Agent Designer for constructing customized brokers, and entry to 2 new brokers constructed by Google: Deep Analysis and Thought Era. 

GitHub Copilot provides agent mode, MCP assist in newest launch

A new model of GitHub Copilot has begun rolling out to customers, including plenty of new capabilities, such because the addition of agent mode to VS Code. 

With agent mode, Copilot can iterate throughout a complete mission, suggesting terminal instructions, analyzing run-time errors, and extra. “With easy prompts, agent mode takes Copilot past answering a query, as an alternative finishing all mandatory subtasks throughout routinely recognized or generated recordsdata to make sure your major aim is achieved,” the corporate’s CEO Thomas Dohmke wrote in a weblog put up. 

For instance, GitHub revealed a demo video through which a developer must replace a web site for runners that enables them to type races by title, distance, and time. Upon receiving the request, Copilot analyzes the location to find out what must be modified, then begins by updating the backend and the UI, then producing unit checks for each, earlier than handing it again over to the consumer to run these checks.

Microsoft updates Copilot to be a extra personalised AI companion

In accordance with Microsoft, the newest updates are designed to convey it from simply an “AI companion” to “your AI companion.” It is going to now be capable of keep in mind what you discuss to be taught your likes and dislikes, in addition to particulars about your life, reminiscent of your canine’s title or work initiatives you’re assigned to. 

Different new capabilities added to Copilot embody:

  • Deep Analysis, for conducting multi-step analysis duties
  • Actions, for finishing duties in your behalf, reminiscent of reserving occasion tickets or making dinner reservations
  • Pages, which mixes notes, content material, and different analysis right into a single canvas
  • Imaginative and prescient, which lets Copilot see what you see and reply in actual time

“Copilot will perceive you within the context of your life, and present up, in your phrases, in the proper approach on the proper time. That is far richer, extra dynamic, supportive and emergent than any software program we’ve seen earlier than. It’s a brand new sort of relationship with know-how, a brand new period,” Microsoft wrote in a weblog put up

Amazon Nova Sonic is introduced

That is the newest mannequin to be added to the Nova household, and it’s a speech-to-speech mannequin for conversational AI. 

In accordance with Amazon, usually, speech understanding and technology are lined by two separate fashions, however Nova Sonic unifies each into one mannequin. “The result’s an adaptive speech response that dynamically adjusts its supply based mostly on prosody, reminiscent of tempo and timbre, of enter speech,” Amazon wrote in a weblog put up

Gemini 2.5 Professional now in public preview

Because of the adoption of Gemini 2.5 Professional and suggestions from customers, Google has determined to maneuver it to public preview within the Gemini API in Google AI Studio. It is going to even be accessible by Vertex AI shortly, Google stated. 

The pricing for Gemini 2.5 Professional is $1.25/1 million tokens for textual content, picture, audio, and video inputs in a 200k context window or much less, and $2.50/1 million tokens textual content higher than a 200k context window. The output pricing is $10/1 million tokens for context home windows below 200k and $15.00/1 million tokens for context home windows higher than that. The experimental model will stay free, however can have decrease price limits. 

Meta releases first Llama 4 fashions 

The announcement lined three fashions which can be a part of the Llama 4 household:

  • Llama 4 Behemoth (in preview), a trainer mannequin for distillation that gives 288B lively parameter, 16 specialists, and 2T whole parameters
  • Llama 4 Maverick, a local multimodal mannequin with 1M context size, providing 17B lively parameters, 128 specialists, and 400B whole parameters
  • Llama 4 Scout, optimized for inference with a 10M context size, that has 17B lively parameters, 16 specialists, and 109B whole parameters

Cloudflare broadcasts distant MCP server to scale back boundaries to creating AI brokers

Cloudflare is making it simpler for builders to create AI brokers with a number of new updates that  had been introduced earlier this week. 

First, the corporate introduced a distant Mannequin Context Protocol (MCP) server. MCP is an open customary that enables AI brokers to work together with exterior companies, which is necessary in enabling them to finish duties on a consumer’s behalf.

In accordance with Cloudflare, MCP has so far been restricted to operating regionally, which has prevented its mainstream adoption. Now, customers will be capable of construct and deploy distant MCP servers by Cloudflare, which can permit brokers to attach and work together with companies with no need to depend on a regionally hosted server.

Progress packs Sitefinity 15.3 with AI updates

The most recent model of the content material administration system provides AI capabilities for customers like summarizing content material, enhancing writing, personalizing messages, and producing tag options. Customers may even be capable of seek for photographs utilizing pure language descriptions.

Different AI capabilities embody AI translation, content material optimization, and the power to export advertising and marketing information within the Parquet format. 

“AI is revolutionizing what is feasible in creating digital content material and experiences, and any organizations not utilizing these capabilities might be at a big aggressive drawback,” stated Loren Jarrett, EVP & GM of digital expertise of Progress. “Sitefinity is on the forefront of innovation, empowering entrepreneurs, builders and content material groups with probably the most superior instruments to allow them to ship digital experiences that may allow them to compete and win in an AI-driven world.”


Learn final week’s bulletins right here: April 4, 2025: AI updates from the previous week — Claude for Schooling, new web site for exploring Amazon Nova fashions, and Solo.io’s MCP Gateway