Home Blog Page 13

SwiftUI @ObservedObject not updating


My challenge is that once I edit a template, the UI in BeginWorkoutView doesn’t replace appropriately. I consider I’m by some means misusing @ObservableObject/@Printed/@Mainactor, however can’t for the lifetime of me work out how. Each tutorial appears to make use of the sample I’m presently utilizing, and it really works for them.

I’ve a important web page, BeginWorkoutView. From right here, you’ll be able to create new exercise or create exercise templates. You can even see all created templates, and click on to edit them.

here’s a simplified model of that:

struct BeginWorkoutView: View {
    
    @ObservedObject var templateManager = TemplateManager.shared
    
    var physique: some View {
        NavigationView{
            ScrollView{
                Part("Begin from scratch"){
                    HStack{
                        NavigationLink("New Exercise"){
                            //new exercise web page
                        }
                        
                        NavigationLink("New Template"){
                            CreateTemplateView( viewModel: CreateTemplateViewModel(), editMode: true)
                            
                        }
                        
                    }
                }
                Part("Begin from template") {
                    ForEach(templateManager.templates, id: .id.self) { template in
                        TemplateRowView(template: template)
                    }
                }
            }
        }
        
    }
}

I handle my information in a template supervisor. Im ready so as to add new exercises and so they present up on my BeginWorkoutView web page no challenge. As I mentioned, once I edit the title, it doesn’t replace in BeginWorkoutView. From what I can inform, the templateManager record of templates IS being up to date, but it surely doesnt appear to set off the UI. I’m presently utilizing the @mainactor/@Observable object construction as a result of i need to help pre-IOS 17.

@MainActor
closing class TemplateManager:  ObservableObject {
    @Printed personal(set) var templates: [WorkoutTemplate] = []
    
    static let shared = TemplateManager()
    
    init(){
        getTemplates()
    }
    
    func getTemplates() {
        
      //will get templates from firebase
  
    }
        func updateTemplates(template: WorkoutTemplate) {
            Job{
                do {
                    //updates templates in firebase
                   //HERE is the place the UI ought to be getting the sign to replace. Clearly spot changing the template didnt work, however changing the whole factor wont work both. 

                                    var up to date = templates

                                    if let index = up to date.firstIndex(the place: { $0.id == template.id }) {
                                        up to date[index] = template
                                    } else {
                                        up to date.append(template)
                                    }

                                    self.templates = up to date
                                
                } catch {
                    print("unable to replace templates")
                }
                
            }
            
        }

    
    
}

whether or not i’m creating a brand new template or enhancing one, i take advantage of createtemplateview/createtemplateviewmodel. listed here are simplified variations with largely simply the perform calls. I dont consider the problem is right here however im including them in case they’re useful.

@MainActor
closing class CreateTemplateViewModel: ObservableObject {
    
    @Printed var template: WorkoutTemplate
    
    var templateManager = TemplateManager.shared
    init(template: WorkoutTemplate) {
        self.template = template
    }
    
    init(){
        self.template = WorkoutTemplate(identify: "Exercise Template", workoutModules: [])
    }

    func addTemplateList() {
        templateManager.updateTemplates(template: template)
    }
    
    
    
    
    func removeTemplateList() {
        templateManager.removeTemplateList(templateId: template.id)
        
    }
    
}
struct CreateTemplateView: View {
    @StateObject var viewModel: CreateTemplateViewModel

    var physique: some View {
            ScrollView{
                StringTextField(preview: "Template Title",  $viewModel.template.identify )
                    .padding()
                
                //reveals editable modules for the template
                
                Button("save"){
                    viewModel.addTemplateList()
                }
            }
    }
    
}

there are "hacks" on the market like utilizing notifications or mix to inform the UI to replace, however I consider this could work if carried out appropriately. I’m largely penning this to be taught these information constructions and i am having a troublesome time greedy this one so I would positively prefer to unravel it relatively than slap a bandaid repair on it.

Harness launches Traceable Cloud WAAP to unify safety and observability for cloud-native functions, APIs


Harness has introduced a brand new providing to assist builders safe their cloud-native functions and APIs, the primary main replace to characteristic Traceable’s know-how because the firms merged earlier this 12 months. 

Traceable Cloud Net Software and API Safety (WAAP) supplies net software safety, API safety, bot mitigation, and DDoS protection. In line with Sudhir Patamsetti, senior. director of product administration of Traceable by Harness, the aim is to mix these protections right into a single, unified expertise in order that organizations now not have to make use of a number of instruments. 

In line with the corporate, conventional WAAP choices rely upon static alerts, however Traceable Cloud WAAP analyzes conduct throughout customers, APIs, and classes to achieve an understanding of how visitors ought to behave in order that it may well intervene when an anomaly happens. 

“APIs have change into the common assault vector—not simply increasing the assault floor, however redefining it. With 57% of organizations experiencing an API-related breach within the final two years, it’s clear conventional defenses are now not sufficient,” mentioned Patamsetti.

Key capabilities of Traceable Cloud WAAP embrace:

  • API discovery from visitors, encrypted flows, and code repositories
  • Delicate knowledge circulate mapping and API threat scoring
  • Actual-time runtime safety with attacker fingerprinting, consumer and session attribution, and anomaly detection
  • Shift-left API testing built-in into CI/CD pipelines

“Traceable Cloud WAAP supplies deep, real-time   visibility into software and API visitors. Immediately determine and reply to OWASP High 10 threats, blocked assaults, and probably the most focused companies—all from a single, context-rich dashboard designed for contemporary, cloud-native environments,” the corporate wrote in a weblog submit

Enhanced instruments for safe & environment friendly improvement



Enhanced instruments for safe & environment friendly improvement

Posted by Suzanne Frey – VP, Product, Belief & Development for Android & Play

Realizing that you just’re constructing on a secure, safe ecosystem is important for any app developer. We repeatedly put money into defending Android and Google Play, so hundreds of thousands of customers world wide can belief the apps they obtain and you’ll construct thriving companies. And we’re devoted to repeatedly bettering our developer instruments to make world–class safety even simpler to implement.

Collectively, we’ve made Google Play one of many most secure and most safe platforms for builders and customers. Our partnership over the previous few years contains serving to you:

At present, we’re excited to share extra about how we’re making it simpler than ever for builders to construct secure apps, whereas additionally persevering with to strengthen our ecosystem’s safety in 2025 and past.

Making it simpler so that you can construct safer apps from the beginning

Google Play’s insurance policies are a crucial element of guaranteeing a secure expertise for our shared customers. Play Console pre-review checks are an effective way to resolve sure coverage and compatibility points earlier than you submit your app for assessment. We just lately added the power to test privateness coverage hyperlinks and login credential necessities, and we’re launching even extra pre-review checks this yr that will help you keep away from widespread coverage pitfalls.

That will help you keep away from coverage issues earlier than you submit apps for assessment, we’ve been notifying you earlier about sure insurance policies related to your apps – beginning proper as you code in Android Studio. We at the moment notify builders by way of Android Studio about a number of key coverage areas, however this yr we’ll increase to a a lot wider vary of insurance policies.

Offering extra coverage help

Appearing in your suggestions, we’ve improved our coverage expertise to offer you clearer updates, extra time for substantial adjustments, extra versatile necessities whereas nonetheless sustaining security requirements, and extra useful data with reside Q&A’s. Quickly, we’ll be making an attempt a brand new approach of speaking with you in Play Console so that you get data whenever you want it most. This yr, we’re investing in much more methods to get your suggestions, enable you perceive our insurance policies, navigate our Coverage Middle, and assist to repair points earlier than app submission by way of new options in Console and Android Studio.

We’re additionally increasing our in style Google Play Developer Assist Neighborhood, which noticed 2.7 million visits final yr from builders seeking to discover solutions to coverage questions, share data, and join with fellow builders. This yr, we’re planning to increase the neighborhood to incorporate extra languages, corresponding to Indonesian, Japanese, Korean, and Portuguese.

Defending your corporation and customers from scams and assaults

The Play Integrity API is a necessary software to assist defend your corporation from abuse corresponding to fraud, bots, dishonest, and knowledge theft. Builders are already utilizing our new app entry threat function in Play Integrity API to make over 500M every day checks for probably fraudulent or dangerous conduct. In truth, apps that use Play Integrity options to detect suspicious exercise are seeing an 80% drop in unauthorized utilization on common in comparison with different apps.

Important stats: The Play Integrity API's new app access risk detection is already being used by developers to makle over 500M daily check for potentially fraudulent or risky behavior, and apps that use the Play Integrity API are seeing 80% lower usage from unverified, untrusted sources on average.

This yr, we’ll proceed to improve the Play Integrity API with stronger safety for much more customers. We just lately improved the know-how that powers the API on all units operating Android 13 (API degree 33) and above, making it sooner, extra dependable, and extra personal for customers. We additionally launched enhanced safety indicators that will help you resolve how a lot you belief the surroundings your app is operating in, which we’ll robotically roll out to all builders who use the API in Might. You possibly can decide in now to begin utilizing the improved verdicts in the present day.

We’ll be including new options later this yr that will help you cope with rising threats, corresponding to the power to re-identify abusive and dangerous units in a approach that additionally preserves consumer privateness. We’re additionally constructing extra instruments that will help you information customers to repair points, like in the event that they want a safety replace or they’re utilizing a tampered model of your app.

Offering extra validation in your app

For apps in choose classes, we provide badges that present an additional layer of validation and join customers with secure, high-quality, and helpful experiences. Constructing on the work of final yr’s “Authorities” badge, which helps customers determine official authorities apps, this yr we launched a “Verified” badge to assist customers uncover VPN apps that take further steps to reveal their dedication to safety. We’ll proceed to increase on this and add badges to extra app classes sooner or later.

Partnering to maintain children secure

Whether or not your app is particularly designed for teenagers or just attracts their consideration, there may be an added duty to make sure a secure and trusted expertise. We need to associate with you to maintain children and teenagers secure on-line, and defend their privateness, and empower households. Along with Google Play’s Instructor Accepted program, Households insurance policies, and instruments like Limit Declared Minors setting throughout the Google Play Console, we’re constructing instruments like Credential Supervisor API, now in Beta for Digital IDs.

Strengthening the Android ecosystem

Along with serving to builders construct stronger, safer apps on Google Play, we stay dedicated to defending the broader Android ecosystem. Final yr, our investments in stronger privateness insurance policies, AI-powered risk detection and different safety measures prevented 2.36 million policy-violating apps from being revealed on Google Play. In contrast, our most up-to-date evaluation discovered over 50 instances extra Android malware from Web-sideloaded sources (like browsers and messaging apps) than on Google Play. This yr we’re engaged on methods to make it even more durable for malicious actors to cover or trick customers into dangerous installs, which is not going to solely defend your corporation from fraud but in addition assist customers obtain your apps with confidence.

Our most recent analysis found over 50 times more Android malware from Internet-sideloaded sources than on Google Play

In the meantime, Google Play Shield is all the time evolving to fight new threats and defend customers from dangerous apps that may result in scams and fraud. As it is a core a part of consumer security, we’re doing extra to maintain customers from being socially-engineered by scammers to show this off. First, Google Play Shield reside risk detection is increasing its safety to focus on malicious functions that attempt to impersonate monetary apps. And our enhanced monetary fraud safety pilot has continued to increase after a profitable launch in choose nations the place we noticed malware primarily based monetary fraud coming from Web-sideloaded sources. We’re planning to increase the pilot all through this yr to extra nations the place we’ve seen larger ranges of malware-based monetary fraud.

We’re even working with different leaders throughout the {industry} to guard all customers, it doesn’t matter what system they use or the place they obtain their apps. As a founding member of the App Protection Alliance, we’re working to determine and promote industry-wide safety requirements for cell and net functions, in addition to cloud configurations. Lately, the ADA launched Software Safety Assessments (ASA) v1.0, which gives clear steering to builders on defending delicate knowledge and defending in opposition to cyber assaults to strengthen consumer belief.

What’s subsequent

Please preserve the suggestions coming! We recognize realizing what could make our builders’ experiences extra environment friendly whereas guaranteeing we keep the best requirements in app security. Thanks in your continued partnership in making Android and Google Play a secure, thriving platform for everybody.

How one midwest producer automated heavy lifting and unlocked new worth with PCC

0


Labor shortages. Ergonomic danger. Turnover on the packaging line.
Sound acquainted? For a lot of producers, particularly within the meals and chemical sectors, these challenges are a every day actuality. However one Midwest-based producer of meals components lately confirmed that with the proper companion, automation doesn’t need to be difficult, or costly.

Melting Arctic Ice Might Unleash Historical Lethal Ailments, Scientists Warn – NanoApps Medical – Official web site


Melting Arctic ice will increase human and animal interactions, elevating the chance of infectious illness unfold. Researchers urge early intervention and surveillance.

Local weather change is opening new pathways for the unfold of infectious illnesses reminiscent of brucellosis, tularemia, and E. coli within the Arctic, based on a broad worldwide workforce of scientists with experience in human, animal, and environmental well being within the North Pole.

The researchers revealed their findings within the journal Science of the Complete Setting, displaying how melting ice is making new areas accessible for journey and trade, bringing folks into nearer contact with what had been as soon as remoted Arctic ecosystems.

They warning that the thawing of soil that has been frozen for hundreds of years might launch dormant microbes preserved within the stays of useless animals and different organisms, growing the chance of illness outbreaks with pandemic potential.

Potential Routes of Transmission of the Zoonotic Parasite Toxoplasma gondii
Potential routes of transmission of the zoonotic parasite Toxoplasma gondii within the North, with concentrate on free-ranging wildlife hosts and the shared surroundings. Credit score: Reprinted and modified with permission from Springer Nature: Springer, Toxoplasmosis in Northern Areas. Supply: Bouchard et al. (2022). Tailored underneath a Inventive Commons Attribution License CC BY 4.0.). Science of the Complete Setting (2024)

The authors suggest actions “to boost consciousness and administration of present and rising zoonoses with epidemic and pandemic potential whereas additionally specializing in the impacts of varied environmental stressors and way of life elements on zoonoses within the Arctic.”

Industrial exercise and historic microbes

Because the ice within the Arctic melts, extra industries and individuals are flocking to the world, elevating the prospect for infectious illnesses to unfold, says Dr. Khaled Megahed Abass of the College of Sharjah and a co-author, stressing that “permafrost thawing might even launch historic micro organism or viruses which have been frozen for hundreds of years.”

Of their in depth evaluation, the authors analyze scientific research about and authorities paperwork from the Arctic, with a selected concentrate on Canada, Alaska, Greenland, and Northern Europe.

“The intention of this investigation was to grasp what classes we are able to be taught the previous to assist Arctic communities higher put together for future well being dangers,” provides Dr. Abbas. “Local weather change and air pollution are affecting each animal and human well being — our analysis regarded into how these two forces are interconnected. Because the Arctic warms sooner than most different components of the world, we’re seeing modifications within the surroundings—like melting permafrost and shifting ecosystems—that might assist unfold infectious illnesses between animals and folks.”

Zoonotic pathogens and permafrost thaw

In scientific jargon, these illnesses are known as zoonotic pathogens with the flexibility to leap from wildlife to people, particularly when human actions and animal habitats overlap in a way upsetting environmental steadiness. The pathogens could also be parasitic, viral, or bacterial. They’ll embody unconventional brokers with the flexibility to unfold to people by means of totally different means like water meals or the surroundings.

Local weather change is blamed for the erratic and long-term shifts within the Earth’s climate and temperature with scientists reporting a world that has been warming up shortly prior to now a long time.

One Health Concept Diagram
The One Well being idea of the Arctic displaying how the massive variety of environmental stressors driving zoonotic infectious illnesses, and the place the cycle could be damaged by means of evidence-based collective motion. Credit score: Science of the Complete Setting (2024)

The Earth’s warming is behind the permafrost thaw – a course of which refers back to the melting of the ice within the frosty soil of Arctic areas. A thawing permafrost can have grave penalties on the surroundings and the inhabitants because the frozen soil melts.

The research is an in depth evaluation of the literature and authorities paperwork from the North Pole through which a broad worldwide consortium of scientists with a variety of experience “describe a number of case research highlighting the significance of a One Well being strategy to zoonoses within the circumarctic, encompassing human well being, animal well being, and environmental well being facets,” the authors write.

One well being strategy and international warning

The importance of the research emerges from the authors’ adoption of and reliance on the One Well being strategy in analyzing earlier literature and authorities reviews documenting transformations going down within the Arctic as a consequence of local weather change.

Of their in depth evaluation, they try to sustainably steadiness and optimize the well being of ecosystems within the Arctic, recognizing that well being points, whether or not associated to folks, animals, crops, or the surroundings, are carefully linked and interdependent.

Seroprevalence of Antibodies
Seroprevalence of antibodies to Toxoplasma gondii in folks throughout Inuit Nunangat and foxes as sentinels of environmental transmission in northern Canada. Credit score: (Bouchard et al., 2022). Tailored underneath a Inventive Commons Attribution License CC BY 4.0. Science of the Complete Setting (2024)

The research, based on Abass, exhibits that “native communities and researchers have already seen indicators of those modifications, and a few are adapting—however many dangers are nonetheless poorly understood.”

Dr. Abass warns that what is going on “within the Arctic doesn’t keep within the Arctic. The environmental stressors we studied have ripple results that attain far past the polar areas.

Pressing want for surveillance and cooperation

“Local weather change isn’t solely melting ice—it’s melting the limitations between ecosystems, animals, and folks. This research exhibits how environmental disruption can instantly influence human well being.”

The authors reaffirm the necessity to “improve consciousness and handle Arctic zoonoses with pandemic potential,” underscoring the truth that “about three-quarters of all recognized human infectious illnesses are zoonotic together with Arctic ones” at a time “air pollution, local weather change and biodiversity loss worsen zoonoses transmission within the Arctic.”

They write, “The instances spotlight essential gaps in monitoring and present information, specializing in environmental stressors and way of life elements, and they’re examples of present occurrences within the Arctic that inform on critically wanted actions to arrange us for the longer term.”

Average Annual Nephropathia Epidemica (NE, Puumala) Incidences
Common annual Nephropathia epidemica (NE, Puumala) incidences as noticed by means of the approximate thirty-year local weather reference interval, throughout Norway, Sweden, and Finland. Credit score: Modified from Thierfelder and Evengård (2021). Science of the Complete Setting (2024)

Dr. Abass says he and colleagues authoring the research are upbeat in regards to the curiosity their challenge has already generated. “This analysis has attracted curiosity from exterior academia. Public well being organizations, environmental businesses, and even northern industries (like mining and delivery) are beginning to acknowledge the necessity to monitor well being dangers linked to altering Arctic circumstances. This consists of policymakers involved about pandemic prevention and meals security in distant areas.”

The authors see their complete evaluation as a warning for “governments and communities to take motion early—earlier than outbreaks happen. It helps the event of higher illness surveillance, extra strong environmental monitoring, and climate-resilient public well being techniques. The research additionally exhibits the significance of indigenous information in detecting early indicators of ecosystem and well being modifications.”

The research highlights the significance of worldwide cooperation coupled with transdisciplinary analysis collaboration. The truth that the findings stem from a global consortium involving over 15 establishments throughout Europe and Canada, notes Dr. Abass, is an indication “of the importance of multidirectional information trade, thematic networks and internationalization in addressing local weather change points within the Arctic.”

Reference: “Environmental stressors and zoonoses within the Arctic: Studying from the previous to arrange for the longer term” by Emilie Andersen-Ranberg, Ingebjørg H. Nymo, Pikka Jokelainen, Anastasia Emelyanova, Solveig Jore, Brian Laird, Rebecca Okay. Davidson, Sonja Ostertag, Emilie Bouchard, Freja Fagerholm, Kelly Skinner, Mario Acquarone, Morten Tryland, Rune Dietz, Khaled Abass, Arja Rautio, Sjúrður Hammer, Birgitta Evengård, Tomas Thierfelder, Raphaela Stimmelmayr and Christian Sonne, 17 October 2024, Science of The Complete Setting.
DOI: 10.1016/j.scitotenv.2024.176869