Home Blog Page 3823

Fixing “Worth of non-Sendable sort accessed after being transferred; later accesses might race;” – Donny Wals


Revealed on: August 23, 2024

When you begin migrating to the Swift 6 language mode, you may most probably activate strict concurrency first. As soon as you have performed this there shall be a number of warings and errors that you will encounter and these errors will be complicated at instances.

I am going to begin by saying that having a strong understanding of actors, sendable, and information races is a big benefit once you need to undertake the Swift 6 language mode. Just about the entire warnings you may get in strict concurrency mode will let you know about potential points associated to working code concurrently. For an in-depth understanding of actors, sendability and information races I extremely advocate that you simply check out my Swift Concurrency course which can get you entry to a sequence of movies, workout routines, and my Sensible Swift Concurrency e book with a single buy.

WIth that out of the way in which, let’s check out the next warning that you simply may encounter in your undertaking:

Worth of non-Sendable sort ‘MyType’ accessed after being transferred; later accesses might race;

For instance, the next code produces such an error:

var myArray = [Int]()

Activity {
  // Worth of non-Sendable sort '@remoted(any) @async @callee_guaranteed @substituted <τ_0_0> () -> @out τ_0_0 for <()>' accessed after being transferred; later accesses might race;
  myArray.append(1)
}

myArray.append(2)

Xcode provides somewhat steering as to what that error is telling us:

Entry can occur concurrently

In different phrases, the compiler is telling us that we’re accessing myArray after we have “transferred” that property to our Activity. You possibly can see how we’re appending to the array each within the duty in addition to outdoors of it.

Swift is telling us that we’re probably inflicting information races right here as a result of our append on myArray after the duty may really collide with the append inside of the duty. When this occurs, we now have a knowledge race and our code would crash.

The repair right here could be to explicitly make a replica for our activity when it is created:

Activity { [myArray] in
  var myArray = myArray
  myArray.append(1)
}

This eliminates our information race potential however it’s additionally not likely reaching our aim of appending to the array from within the duty.

The repair right here may very well be one in all a number of approaches:

  1. You possibly can wrapp your array in an actor to make sure correct isolation and synchronization
  2. You possibly can rework your strategy fully
  3. International actors may very well be helpful right here relying on the construction of your code

In the end, most strict concurrency associated points do not have a single resolution that works. It is all the time going to require a case-by-case evaluation of why a sure error seems, and from there you need to work out an answer.

On this case, we’re taking a mutable object that we’re mutating from inside a activity in addition to proper after the place we have outlined the duty. The compiler is warning us that that may most probably trigger a knowledge race and you will want to find out which resolution works for you. My first try at fixing this could be to wrap the mutable state in an actor to verify we obtain correct isolation and stop future information races.

This is to Apple’s little ones

0


Apple’s free Passwords app can change your paid password supervisor (kinda)

0



Expertise the Energy of a Should-Have All-in-One Cybersecurity Platform


Aug 23, 2024The Hacker InformationRisk Detection / Safety Automation

Expertise the Energy of a Should-Have All-in-One Cybersecurity Platform

Let’s be trustworthy. The world of cybersecurity seems like a relentless warfare zone. You are bombarded by threats, scrambling to maintain up with patches, and drowning in an countless flood of alerts. It is exhausting, is not it?

However what if there was a greater means?

Think about having each important cybersecurity device at your fingertips, all inside a single, intuitive platform, backed by skilled help 24/7. That is the game-changing energy of an All-in-One answer.

Prepare for a dwell, no-nonsense demonstration.

Be part of us for the webinar “Step by Step: Easy methods to Obtain Whole Safety with an All-in-One Platform,” the place Cynet’s consultants—celebrated for his or her stellar efficiency within the MITRE ATT&CK Evaluations—will take you inside a dwell simulation of real-world cyberattacks.

Expertise firsthand the unparalleled power of a unified cybersecurity method and discover ways to safe complete safety to your group.

Here is what you will witness:

  • Simulating real-world threats: Watch how the platform detects, investigates, and neutralizes assaults in real-time.
  • Attaining environment-wide visibility: Acquire immediate, complete insights into your whole safety panorama.
  • Boosting alert accuracy: Drastically cut back false positives and 0 in on what really issues.
  • Chopping guide dealing with by 90%: Obtain outcomes 50 instances quicker with automated investigation and response.
  • Maximizing efficiency with 24/7 MDR steerage: Leverage Cynet’s in-house SOC experience for steady safety.
All-in-One Cybersecurity Platform

Who ought to attend:

  • Managed service suppliers: Remodel into an MSSP and ship full breach safety to your shoppers inside 24 hours.
  • Small-to-medium enterprises: Defend in opposition to the identical threats confronted by Fortune 500 firms, even with restricted sources.

Do not miss this opportunity to realize actionable insights that may simplify your workload and fortify your group’s safety.

Safe your spot in the present day—register for the webinar and expertise the transformative energy of an all-in-one cybersecurity platform.

Discovered this text attention-grabbing? This text is a contributed piece from one in every of our valued companions. Observe us on Twitter and LinkedIn to learn extra unique content material we put up.



Do not Miss this Anthropic’s Immediate Engineering Course in 2024

0


Introduction

Immediate Engineering has been a scorching subject in 2024, with the fast development of Generative AI driving learners to talent up on this aggressive discipline. Mastering immediate engineering is like having the keys to a robust machine that may remodel concepts into actuality. Whereas many immediate engineering programs can be found, they typically lack practicality and good use circumstances. Anthropic’s Immediate Engineering Interactive Tutorial stands out by providing a free, hands-on studying expertise. This course teaches you learn how to form and refine your interactions with Claude, one of the subtle AI fashions (for FREE)!

Do not Miss this Anthropic’s Immediate Engineering Course in 2024

Overview

  • Immediate Engineering is now a vital talent for excelling in AI-driven fields.
  • Anthropic’s Immediate Engineering Interactive Tutorial affords hands-on studying to grasp AI prompts.
  • Efficient immediate engineering enhances AI outputs, saving time and enhancing productiveness.
  • The course covers all the things from primary to superior immediate engineering strategies utilizing Claude.
  • This course is tailor-made to numerous industries and is on the market on Google Sheets for interactive studying.

Why you need to take a Immediate Engineering Course?

Whether or not you’re a budding knowledge scientist, an AI developer, or somebody fascinated with leveraging AI instruments for enterprise or analysis, mastering immediate engineering provides you the total potential to discover AI fashions, significantly Generative ones. If you happen to’re encountering immediate engineering for the primary time, you may surprise why you need to make investments time in working towards this talent. The reply is easy: efficient prompts result in higher AI outputs, enabling you to create extra correct, related, and impactful outcomes.

Immediate engineering means that you can talk extra successfully with AI fashions, making them produce outputs that align intently together with your targets. By honing this talent, it can save you time, scale back errors, and enhance productiveness, whether or not you’re automating duties, producing inventive content material, or conducting analysis. As AI continues to evolve, these with sturdy, immediate engineering expertise might be higher geared up to harness the facility of those applied sciences and keep forward in a quickly altering panorama.

Anthropic Immediate Engineering Course Targets

By the top of this course, you received’t simply perceive immediate engineering; you’ll excel at it. You’ll study:

  • Mastering Immediate Construction: Perceive the constructing blocks of an important immediate.
  • Figuring out and Overcoming Pitfalls: Be taught the 80/20 strategies to sort out widespread immediate failures.
  • Leveraging Claude’s Strengths: Know when to make use of Claude for optimum outcomes and keep away from its limitations.
  • Crafting Efficient Prompts for Varied Eventualities: Develop prompts from scratch tailor-made to your particular wants.

Claude Mannequin: Claude-3-haiku-20240307

This isn’t only a course; it’s a journey into the guts of AI interplay, designed to be as interactive and hands-on as potential.

Anthropic Immediate Engineering Course Construction

Right here’s the course hyperlink: Anthropic Immediate Engineering Course Construction

The course is split into 9 chapters, every full of classes and workout routines that may progressively construct your expertise. Right here’s what you may anticipate:

  1. Newbie Stage:
    • Chapter 1: Fundamental Immediate Construction
    • Chapter 2: Being Clear and Direct
    • Chapter 3: Assigning Roles
  2. Intermediate Stage:
    • Chapter 4: Separating Information from Directions
    • Chapter 5: Formatting Output & Talking for Claude
    • Chapter 6: Precognition (Pondering Step by Step)
    • Chapter 7: Utilizing Examples
  3. Superior Stage:
    • Chapter 8: Avoiding Hallucinations
    • Chapter 9: Constructing Advanced Prompts (Business Use Instances)

Every chapter not solely teaches you concept but additionally immerses you in follow. The “Instance Playground” on the finish of every lesson allows you to experiment with immediate variations, serving to you see firsthand how completely different inputs yield completely different outputs.

Anthropic Immediate Engineering Course: Why it Stands Out?

They’ve designed this course together with your studying journey in thoughts. Right here’s what makes it distinctive:

  • Interactive Studying: Each lesson comes with workout routines that problem you to suppose, attempt, and iterate.
  • Tailor-made to Your Wants: Whether or not you’re centered on authorized providers, monetary operations, or coding, our superior sections present industry-specific workout routines.
  • Superior Strategies: For these seeking to transcend the fundamentals, our appendix affords superior strategies like chaining prompts, integrating instruments, and using search and retrieval methods.

This tutorial can be out there on Google Sheets by way of Anthropic’s Claude for Sheets extension, providing an much more user-friendly interface. We advocate attempting each variations to see which fits your type greatest.

Tutorial How you can Use this on Google Sheets?

Firstly, you want an API key to work together with this tutorial. If you happen to don’t have one, you may join it via the Anthropic Console or use the static tutorial reply key.

Getting Began:

  1. Make a Copy:
    Save a replica of this sheet to your Google Drive.
  2. Set up Claude for Sheets Extension:
    a. Go to the Claude for Sheets extension web page.
    b. Click on the blue set up button.
    (If you have already got it put in, skip to step 3.)
  3. Allow the Extension for This Doc:
    a. Within the toolbar, go to Extensions > Add-ons > Handle add-ons.
    b. Click on the three-dot menu within the prime proper nook of the Claude for Sheets extension.
    c. Guarantee “Use on this doc” is checked.
  4. Add Your API Key:
    a. Get hold of your distinctive Anthropic API key by following the offered directions.
    b. Enter your API key by going to Extensions > Claude for Sheets™ > Enter your Anthropic API Key.

Listed below are articles on Immediate Engineering that may enable you to in your research:

Article Supply
Implementing the Tree of Ideas Methodology in AI Hyperlink
What are Delimiters in Immediate Engineering? Hyperlink
What’s Self-Consistency in Immediate Engineering? Hyperlink
What’s Temperature in Immediate Engineering? Hyperlink
Chain of Verification: Immediate Engineering for Unparalleled Accuracy Hyperlink
Mastering the Chain of Dictionary Approach in Immediate Engineering Hyperlink
What’s the Chain of Image in Immediate Engineering? Hyperlink
What’s the Chain of Emotion in Immediate Engineering? Hyperlink

Vital Issues to Take into account

This course makes use of Claude 3 Haiku with a temperature setting of 0, leading to sooner and extra constant outputs. These immediate engineering strategies additionally apply to different Claude fashions.

So as to add a brand new line in a cell:

  • Mac: Cmd + Enter
  • Home windows: Alt + Enter

Navigating Pages:

Click on on the grey hyperlinks at every web page’s backside or the highest proper nook.

Use the blue-linked pop-up for navigation.

If you attain the right reply, Claude’s response cell will flip inexperienced.

Conclusion

Because the world of AI continues to evolve at a breakneck tempo, the significance of mastering immediate engineering can’t be overstated. This talent is turning into a cornerstone for anybody aiming to excel in AI-driven fields, enabling you to speak extra successfully with AI fashions and obtain higher, extra exact outputs. The Anthropic Immediate Engineering Course affords a novel alternative to realize hands-on expertise and deepen your understanding of this vital talent. Whether or not you’re a novice or an skilled AI person, this course equips you with the information and instruments wanted to harness AI’s full potential, making you a precious asset in an more and more AI-centric world. Don’t simply adapt to the long run—form it with the facility of immediate engineering.

Additionally, if you wish to excel in immediate engineering, then discover – the GenAI Pinnacle Program at the moment! Right here’s the roadmap:

Are you prepared to remodel the best way you work together with AI? Let’s get began!

Regularly Requested Questions

Q1. What’s Immediate Engineering?

Ans. Immediate Engineering is designing and refining prompts to information AI fashions, like GPT or Claude, in producing the specified output.

Q2. Who ought to take a Immediate Engineering course?

Ans. This course is good for AI fans, builders, knowledge scientists, and anybody fascinated with extra successfully utilizing AI fashions.

Q3. What’s going to I study in a Immediate Engineering course?

Ans. You’ll learn to craft efficient prompts, perceive AI mannequin conduct, troubleshoot immediate points, and optimize outputs for numerous purposes.

This fall. Do I would like prior expertise in AI to take this course?

Ans. Whereas some programs could require primary AI information, many are designed for rookies and can cowl important ideas from scratch.

Q5. How can Immediate Engineering expertise profit my profession?

Ans. Mastering Immediate Engineering could make you simpler in roles involving AI, improve your problem-solving talents, and open up new alternatives within the quickly rising AI discipline.