18.6 C
New York
Saturday, March 29, 2025
Home Blog Page 3

ios – ButtonStyle makeBody ViewBuilder triggers PreferenceKey cut back


I’ve an issue with ButtonStyle’s perform makeBody triggers PreferenceKey cut back perform, if I’ve swap or if assertion inside makeBody.

I’ve a code beneath:

struct TestPreferenceKey: PreferenceKey {
    
    static var defaultValue: Int = 0

    static func cut back(worth: inout Int, nextValue: () -> Int) {

        print("cut back worth:", worth)
        print("cut back nextValue:", nextValue())

        worth = nextValue()
    }
}

struct TestButtonStyle: ButtonStyle {

    enum `Kind` {
        case a
        case b
    }

    let kind: `Kind`

    func makeBody(configuration: Configuration) -> some View {
        swap kind {
        case .a:
            configuration.label
        case .b:
            configuration.label
        }
    }
}

struct ButtonView: View {
    var physique: some View {
        Button {

        } label: {
            Textual content("Button")
        }
        .buttonStyle(TestButtonStyle(kind: .a))
    }
}

struct ContentView: View {

    var physique: some View {
        VStack {
            ButtonView()
            ButtonView()
        }
        .onPreferenceChange(TestPreferenceKey.self) { worth in
            print("worth:", worth)
        }
    }
}

And I’ve the subsequent prints in log:

cut back worth: 0
cut back nextValue: 0
worth: 0

As I perceive how PreferenceKey works, I ought to don’t have anything printed out.
And it really works so, if I name completely different perform from ButtonStyle’s makeBody:

struct TestButtonStyle: ButtonStyle {

    enum `Kind` {
        case a
        case b
    }

    let kind: `Kind`

    func makeBody(configuration: Configuration) -> some View {
        switcher(configuration: configuration)
    }

    func switcher(configuration: Configuration) -> some View {
        swap kind {
        case .a:
            configuration.label
        case .b:
            configuration.label
        }
    }
}

Now, I’ve nothing printed out.
However, if I add @ViewBuilder wrapper to switcher perform, I’ve printed out once more:

...
    @ViewBuilder
    func switcher(configuration: Configuration) -> some View {
        swap kind {
        case .a:
            configuration.label
        case .b:
            configuration.label
        }
    }
cut back worth: 0
cut back nextValue: 0
worth: 0

Is it anticipated habits with ViewBuilder? Or is it a bug?
Is it all the time essential to do such a traversal with an extra perform?

If anybody is aware of the reply, it will be a lot appreciated! I’d additionally be pleased about helpful hyperlinks on the subject!

UDP:
If I add .desire for certainly one of Views, I get a incorrect results of TestPreferenceKey worth:

...
var physique: some View {
    VStack {
        ButtonView()
            .desire(
                key: TestPreferenceKey.self,
                worth: 3
            )
        ButtonView()
    }
    .onPreferenceChange(TestPreferenceKey.self) { worth in
            print("worth:", worth)
    }
}

Result’s:

cut back worth: 3
cut back nextValue: 0
worth: 0

Though the TestPreferenceKey worth must be 3.
After all, with out @ViewBuilder on switcher TestPreferenceKey worth is true – 3

Printed out:

worth: 3

Kollmorgen releases SFD-M high-resolution encoder with multi-turn absolute suggestions

0


Kollmorgen releases SFD-M high-resolution encoder with multi-turn absolute suggestions

The SFD-M high-resolution encoder presents multi-turn absolute suggestions. | Supply: Kollmorgen

Kollmorgen Corp., a developer of movement management and automation techniques, this week launched the Sensible Suggestions Gadget, Multi-Flip, or SFD-M, encoder. It mentioned the SFD-M permits machine builders to attain high-resolution, multi-turn suggestions with absolute positioning info accessible at system startup.

“Our new SFD-M encoder supplies multi-turn absolute performance with distinctive place accuracy and determination at zero extra price over Kollmorgen motors with single-turn encoders,” mentioned Chris Cooper, senior director of worldwide product administration at Kollmorgen.

“That’s an enormous profit for precision and productiveness at a financial savings of lots of of {dollars} per motor and doubtlessly a number of thousand {dollars} in a posh, multi-axis machine,” he added. “Single motor-to-drive cable expertise with auto drive setup additional lowers complete prices. We’re very proud to supply all of those advantages to our prospects as an integral a part of Kollmorgen’s industry-leading servo techniques.”

Designed to work with AKD and AKD2G drives, the SFD-M absolute multi-turn encoder could be built-in into Kollmorgen-housed servo motors. This comes at no extra cost compared with the SFD-3 single-turn absolute encoder. This allows it to offer multi-turn efficiency, 4 occasions higher positioning accuracy, and 50 occasions decrease EMF noise.

Kollmorgen has greater than 100 years of movement expertise. Its in depth product portfolio contains motors, drives, linear actuators, automated guided car (AGV) management techniques, and automation management platforms. The Radford, Va.-based firm mentioned its expertise combines efficiency, reliability, and ease of use to offer machine builders a market benefit.


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


SFD-M supplies absolute multi-turn positioning

Kollmorgen mentioned the SFD-M is equal to different third-party encoders that include a premium worth. With the SFD-M, prospects can obtain substantial financial savings in machine designs that carry out at excessive ranges of precision, effectivity, and effectiveness, it asserted.

The SFD-M measures the place of the rotor shaft all through every 360º rotation with out requiring reference to a house place. As well as, it registers the whole variety of rotations the shaft has made in both course.

This absolute multi-turn positioning functionality is necessary when exact monitoring of place is required over massive rotational distances, akin to in machine software positioning, packaging machines, materials dealing with, satellite tv for pc monitoring, and lots of different functions, mentioned Kollmorgen.

The SFD-M additionally maintains absolute positioning info in actual time, even when the system is powered down, eliminating the necessity for time-consuming homing sequences upon startup, the corporate mentioned.

Kollmorgen shares key specs

Absolute multi-turn encoders from different suppliers typically require a battery to retain positioning info when the system is powered down or throughout an influence failure, famous Kollmorgen. These exterior batteries require substitute and could be topic to failure. Different options use mechanical gear trains, that are noisy, backlash-prone, and add measurement to the motor.

The brand new Kollmorgen SFD-M eliminates these points, as a substitute utilizing energy-harvesting expertise to reliably keep positioning info without having for batteries or gear trains. Battery-free operation eliminates upkeep points whereas additionally supporting efforts to scale back the consumption of pure assets and reduce waste.

Kollmorgen mentioned the SFD-M is extremely correct and listed extra specs:

  • Decision of 24 bits per revolution
  • 16,777,216 counts per revolution
  • 0.0772 arc-sec per depend
  • Multi-turn absolute vary of 16 bits = 65,536 motor revolutions
  • Accurcy of < +/– 1 arc-min typical at 25ºC an < +/– 3 arc-min worst case

See Kollmorgen on the Robotics Summit & Expo

To be taught extra about Kollmorgen’s newest merchandise, see it on the 2025 Robotics Summit & Expo, which takes place April 30 to Might 1 on the Boston Conference and Exhibition Heart. The corporate can be exhibiting at Sales space 644.

As well as, on Thursday at 2:30 PM, Stephen Funk, an electromagnetics design engineer knowledgeable at Kollmorgen, can be talk about “ Choose the Proper Motor to Scale back Price and Time to Market.”

His presentation will discover the stability between configuration and customization. Funk will take a look at the continuum from normal and configurable merchandise, which supply fast options, to customization, which supplies the flexibleness wanted for exact optimization. That is significantly necessary in tailoring motor properties to satisfy stringent necessities, providing a definite benefit in robotic functions, in response to Funk.

The Robotics Summit additionally presents quite a few networking alternatives, a Profession Truthful, a robotics growth problem, the RBR50 Robotics Innovation Awards Gala, and extra.

VinFast: The EV Revolution Wants Extra Than Vehicles



Join every day information updates from CleanTechnica on e mail. Or comply with us on Google Information!


VinFast and different {industry} leaders are proving that the success of electrical automobiles relies upon not simply on know-how however on constructing a seamless possession ecosystem—one which eliminates vary anxiousness, ensures dependable service, and makes switching to EVs as easy as attainable.

MARKHAM, Ontario — The transfer to electrical automobiles is now not solely about bettering battery life or lowering prices. It’s about crafting an setting the place proudly owning an EV feels easy, reliable, and reassuring. World EV gross sales reached a report 17.1 million models in 2024. However because the ranks of early adopters dwindle, many customers stay hesitant to make the change.

The reply is easy: With no community of charging stations, service facilities, and restore amenities, mass adoption stays a distant dream.

The Ecosystem Benefit

Firms adopting an ecosystem technique stand out. Nasdaq-listed VinFast, which isn’t simply manufacturing EVs. It is usually investing closely in infrastructure. Throughout its house market of Vietnam, VinFast arrange charging stations each 3.5 kilometers in cities, far denser than typical city targets elsewhere. On highways, their stations seem each 65 kilometers, surpassing the U.S. authorities’s guideline of 1 each 80 kilometers.

This strategy can deal with one of many largest client fears head-on: vary anxiousness. If drivers know discovering a charging station is sort of as simple as fueling at a gasoline station, they’ll be extra assured in making the change. This has contributed to VinFast changing into Vietnam’s prime EV model in 2024.

VinFast is now increasing this technique past Vietnam. In Indonesia it’s working with V-GREEN to put in 30,000 chargers by 2025, with plans for an additional 100,000 by way of collaboration with outdoors companions. To ease monetary issues, the corporate presents a buyback program protecting as much as 90% of the unique car value.

In Canada, VinFast has tailored once more. Past providing aggressive lease offers and an industry-leading 10-year/100,000 km guarantee, it has partnered with native dealerships and built-in its app with 95% of public charging stations throughout North America. The objective is evident: to take away limitations and guarantee a clean, stress-free EV possession expertise.

Backed by vital assets from Vietnam’s largest non-public conglomerate, Vingroup, VinFast can prioritize long-term ecosystem constructing over instant income. Conventional automakers, nonetheless balancing gasoline and electrical manufacturing strains, discover this transition more difficult.

The Stakes for the Trade

Nonetheless, legacy automakers aren’t sitting idle. Many are investing closely in battery know-how and partnering to broaden infrastructure. Governments are stepping up, too. However progress isn’t uniform, and with out widespread help, electrical automobiles threat remaining area of interest merchandise somewhat than mainstream automobiles globally.

The message is changing into more and more clear that electrical automobiles can’t achieve isolation. The know-how itself—the automobiles, the batteries, the motors—is actually vital, however solely a part of the equation that drives adoption. The whole possession expertise should be reimagined, even from the act of charging fee.

For mainstream customers, shopping for an EV isn’t simply concerning the car itself. It’s about figuring out they’ll cost simply, entry dependable service, and belief that their funding can be supported in the long term.

The businesses that take an ecosystem-first strategy will form the way forward for mobility. People who don’t might discover themselves repeating the destiny of early electrical pioneers.

In an EV future, the ecosystem issues greater than ever.

Whether or not you may have solar energy or not, please full our newest solar energy survey.



Chip in a couple of {dollars} a month to assist help impartial cleantech protection that helps to speed up the cleantech revolution!


Have a tip for CleanTechnica? Need to promote? Need to counsel a visitor for our CleanTech Speak podcast? Contact us right here.


Join our every day publication for 15 new cleantech tales a day. Or join our weekly one if every day is just too frequent.


Commercial



 


CleanTechnica makes use of affiliate hyperlinks. See our coverage right here.

CleanTechnica’s Remark Coverage




BlackLock Ransomware Uncovered After Researchers Exploit Leak Web site Vulnerability

0


Mar 29, 2025Ravie LakshmananCybercrime / Vulnerability

BlackLock Ransomware Uncovered After Researchers Exploit Leak Web site Vulnerability

In what’s an occasion of hacking the hackers, risk hunters have managed to infiltrate the net infrastructure related to a ransomware group known as BlackLock, uncovering essential details about their modus operandi within the course of.

Resecurity mentioned it recognized a safety vulnerability within the knowledge leak web site (DLS) operated by the e-crime group that made it potential to extract configuration recordsdata, credentials, in addition to the historical past of instructions executed on the server.

The flaw considerations a “sure misconfiguration within the Knowledge Leak Web site (DLS) of BlackLock Ransomware, resulting in clearnet IP addresses disclosure associated to their community infrastructure behind TOR hidden companies (internet hosting them) and extra service data,” the corporate mentioned.

Cybersecurity

It described the acquired historical past of instructions as one of many largest operational safety (OPSEC) failures of BlackLock ransomware.

BlackLock is a rebranded model of one other ransomware group generally known as Eldorado. It has since turn into some of the lively extortion syndicates in 2025, closely focusing on expertise, manufacturing, development, finance, and retail sectors. As of final month, it has listed 46 victims on its web site.

The impacted organizations are positioned in Argentina, Aruba, Brazil, Canada, Congo, Croatia, Peru, France, Italy, the Netherlands, Spain, the United Arab Emirates, the UK, and the USA.

The group, which introduced the launch of an underground affiliate community in mid-January 2025, has additionally been noticed actively recruiting traffers to facilitate early levels of the assaults by directing victims to malicious pages that deploy malware able to establishing preliminary entry to compromised methods.

The vulnerability recognized by Resecurity is an area file inclusion (LFI) bug, primarily tricking the net server into leaking delicate data by performing a path traversal assault, together with the historical past of instructions executed by the operators on the leak web site.

A few of notable findings are listed under –

  • Using Rclone to exfiltrate knowledge to the MEGA cloud storage service, in some instances even putting in the MEGA consumer instantly on sufferer methods
  • The risk actors have created not less than eight accounts on MEGA utilizing disposable e-mail addresses created by way of YOPmail (e.g., “zubinnecrouzo-6860@yopmail.com”) to retailer the sufferer knowledge
  • A reverse engineering of the ransomware has uncovered supply code and ransom notice similarities with one other ransomware pressure codenamed DragonForce, which has focused organizations in Saudi Arabia (Whereas DragonForce is written in Visible C++, BlackLock makes use of Go)
  • “$$$,” one of many foremost operators of BlackLock, launched a short-lived ransomware challenge known as Mamona on March 11, 2025
Cybersecurity

In an intriguing twist, BlackLock’s DLS was defaced by DragonForce on March 20 – seemingly by exploiting the identical LFI vulnerability (or one thing comparable) – with configuration recordsdata and inside chats leaked on its touchdown web page. A day prior, the DLS of Mamona ransomware was additionally defaced.

“It’s unclear if BlackLock Ransomware (as a bunch) began cooperating with DragonForce Ransomware or silently transitioned beneath the brand new possession,” Resecurity mentioned. “The brand new masters seemingly took over the challenge and their affiliate base due to ransomware market consolidation, understanding their earlier successors could possibly be compromised.”

“The important thing actor ‘$$$’ didn’t share any shock after incidents with BlackLock and Mamona Ransomware. It’s potential the actor was absolutely conscious that his operations could possibly be already compromised, so the silent ‘exit’ from the earlier challenge could possibly be probably the most rational possibility.”

Discovered this text fascinating? Comply with us on Twitter and LinkedIn to learn extra unique content material we put up.



What Anthropic Researchers Discovered After Studying Claude’s ‘Thoughts’ Shocked Them

0


Regardless of widespread analogies to considering and reasoning, we now have a really restricted understanding of what goes on in an AI’s “thoughts.” New analysis from Anthropic helps pull the veil again just a little additional.

Tracing how massive language fashions generate seemingly clever conduct may assist us construct much more highly effective programs—but it surely is also essential for understanding find out how to management and direct these programs as they strategy and even surpass our capabilities.

That is difficult. Older pc applications had been hand-coded utilizing logical guidelines. However neural networks be taught abilities on their very own, and the way in which they symbolize what they’ve discovered is notoriously troublesome to parse, main individuals to check with the fashions as “black packing containers.”

Progress is being made although, and Anthropic is main the cost.

Final 12 months, the corporate confirmed that it may hyperlink exercise inside a big language mannequin to each concrete and summary ideas. In a pair of latest papers, it’s demonstrated that it may possibly now hint how the fashions hyperlink these ideas collectively to drive decision-making and has used this system to investigate how the mannequin behaves on sure key duties.

“These findings aren’t simply scientifically fascinating—they symbolize vital progress in the direction of our aim of understanding AI programs and ensuring they’re dependable,” the researchers write in a weblog submit outlining the outcomes.

The Anthropic crew carried out their analysis on the corporate’s Claude 3.5 Haiku mannequin, its smallest providing. Within the first paper, they educated a “substitute mannequin” that mimics the way in which Haiku works however replaces inside options with ones which can be extra simply interpretable.

The crew then fed this substitute mannequin numerous prompts and traced the way it linked ideas into the “circuits” that decided the mannequin’s response. To do that, they measured how numerous options within the mannequin influenced one another because it labored by way of an issue. This allowed them to detect intermediate “considering” steps and the way the mannequin mixed ideas right into a ultimate output.

In a second paper, the researchers used this strategy to interrogate how the identical mannequin behaved when confronted with quite a lot of duties, together with multi-step reasoning, producing poetry, finishing up medical diagnoses, and doing math. What they discovered was each stunning and illuminating.

Most massive language fashions can reply in a number of languages, however the researchers wished to know what language the mannequin makes use of “in its head.” They found that, the truth is, the mannequin has language-independent options for numerous ideas and generally hyperlinks these collectively first earlier than deciding on a language to make use of.

One other query the researchers wished to probe was the widespread conception that giant language fashions work by merely predicting what the following phrase in a sentence needs to be. Nevertheless, when the crew prompted their mannequin to generate the following line in a poem, they discovered the mannequin really selected a rhyming phrase for the tip of the road first and labored backwards from there. This means these fashions do conduct a sort of longer-term planning, the researchers say.

The crew additionally investigated one other little understood conduct in massive language fashions known as “untrue reasoning.” There’s proof that when requested to elucidate how they attain a choice, fashions will generally present believable explanations that do not match the steps they took.

To discover this, the researchers requested the mannequin so as to add two numbers collectively and clarify the way it reached its conclusions. They discovered the mannequin used an uncommon strategy of mixing approximate values after which figuring out what quantity the consequence should finish in to refine its reply.

Nevertheless, when requested to elucidate the way it got here up with the consequence, it claimed to have used a very completely different strategy—the sort you’d be taught in math class and is available on-line. The researchers say this means the method by which the mannequin learns to do issues is separate from the method used to offer explanations and will have implications for efforts to make sure machines are reliable and behave the way in which we would like them to.

The researchers caveat their work by mentioning that the strategy solely captures a fuzzy and incomplete image of what’s happening beneath the hood, and it may possibly take hours of human effort to hint the circuit for a single immediate. However these sorts of capabilities will turn out to be more and more essential as programs like Claude turn out to be built-in into all walks of life.