This document discusses building reusable components with generics and protocols in Swift. It begins by outlining goals of understanding how to design code using generics, simple generics and associated types, and protocols with associated types and generics. An example problem of wanting a generic cache is presented. The document then walks through steps to build such a generic cache, including defining generics, protocols with associated types, and assembling the pieces while ensuring type safety. It concludes by summarizing best practices like designing the API first, introducing abstractions like generics and protocols as needed, and using constraints for type safety.
Exploring push server options for Django. My presentation for Python User Group meetup, March 2018.
Some images borrowed from https://blog.heroku.com/in_deep_with_django_channels_the_future_of_real_time_apps_in_django.
A quick introduction to the object-oriented programming language Ruby, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
Exploring push server options for Django. My presentation for Python User Group meetup, March 2018.
Some images borrowed from https://blog.heroku.com/in_deep_with_django_channels_the_future_of_real_time_apps_in_django.
A quick introduction to the object-oriented programming language Ruby, part of a full lecture on Programming Paradigms at UCL university in Belgium, focussing on the programming languages Smalltalk, Ruby and Java, with reflection and meta programming as underlying theme.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
Natural Language Processing using JavaScript "Natural" Library. This deck covers Natural Language Understanding using JavaScript "Natural" library in detail
It has been said that one should code as if the person maintaining the code is a violent psychopath who knows where you live. But why do we work with psychopaths? That question unfortunately cannot be answered in this presentation. However, we can shed some light on how to code for readability hopefully avoiding the problem altogether.
Readable code is about a lot more than producing beautiful code. In fact, it has nothing really to do with the beauty of the code and everything to do with the ability to quickly understand what the code does.
In this presentation we will discuss why readable code is so important. We will cover six commonly reoccurring patterns that made code hard to read, why they occur, and how they can easily be avoided:
* Deep Nesting
* Unnecessary Generalization
* Ambiguous Naming
* Hard to Follow Flow of Execution
* Code Style vs. Individualism
* Code Comments
These concepts may be applied to any programming language.
A beginner's guide to annotation processing.
In this talk that I gave at Droidcon Tel Aviv in 2016, I walk you through the process of building a custom annotation processor which mimics some of the behavior you may be familiar with from the popular Android library: Butter Knife.
Software Engineering Thailand: Programming with ScalaBrian Topping
Meet-up, May 28, 2015, Launchpad, Bangkok. http://www.meetup.com/Software-Engineering-Thailand/events/222548484/.
Apologies for the rendering quality not matching the presentation, I did these with Apple Keynote and Slideshare does not support this format. I will try to edit them when there is more time.
Thanks to Bangkok LaunchPad (https://www.facebook.com/launchpadhq) for generously hosting this event!
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi Krzysztof (Chris) Ozog
Being rookie especially in PHP world means constantly dealing with legacy software that’s in maintenance mode and won't be rewritten. And you have to deal with awful codebase with files spanning over couple thousand lines.
I'm here to help, been there, done that and want to share with you with some tricks... how to get to know even oldest of systems.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
Natural Language Processing using JavaScript "Natural" Library. This deck covers Natural Language Understanding using JavaScript "Natural" library in detail
It has been said that one should code as if the person maintaining the code is a violent psychopath who knows where you live. But why do we work with psychopaths? That question unfortunately cannot be answered in this presentation. However, we can shed some light on how to code for readability hopefully avoiding the problem altogether.
Readable code is about a lot more than producing beautiful code. In fact, it has nothing really to do with the beauty of the code and everything to do with the ability to quickly understand what the code does.
In this presentation we will discuss why readable code is so important. We will cover six commonly reoccurring patterns that made code hard to read, why they occur, and how they can easily be avoided:
* Deep Nesting
* Unnecessary Generalization
* Ambiguous Naming
* Hard to Follow Flow of Execution
* Code Style vs. Individualism
* Code Comments
These concepts may be applied to any programming language.
A beginner's guide to annotation processing.
In this talk that I gave at Droidcon Tel Aviv in 2016, I walk you through the process of building a custom annotation processor which mimics some of the behavior you may be familiar with from the popular Android library: Butter Knife.
Software Engineering Thailand: Programming with ScalaBrian Topping
Meet-up, May 28, 2015, Launchpad, Bangkok. http://www.meetup.com/Software-Engineering-Thailand/events/222548484/.
Apologies for the rendering quality not matching the presentation, I did these with Apple Keynote and Slideshare does not support this format. I will try to edit them when there is more time.
Thanks to Bangkok LaunchPad (https://www.facebook.com/launchpadhq) for generously hosting this event!
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi Krzysztof (Chris) Ozog
Being rookie especially in PHP world means constantly dealing with legacy software that’s in maintenance mode and won't be rewritten. And you have to deal with awful codebase with files spanning over couple thousand lines.
I'm here to help, been there, done that and want to share with you with some tricks... how to get to know even oldest of systems.
Fine-tuning your development environment means more than just getting your editor set up just so -- it means finding and setting up a variety of tools to take care of the mundane housekeeping chores that you have to do -- so you have more time to program, of course! I'll share the benefits of a number of yak shaving expeditions, including using App::GitGot to batch manage _all_ your git repos, App::MiseEnPlace to automate getting things _just_ so in your working environment, and a few others as time allows.
Delivered at OpenWest 2016, 13 July 2016
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018Mike Harris
I never wrote it; everybody else did! How many times have you waded through an ageing, decaying, tangled forrest of code and wished it would just die? How many times have you heard someone say that what really needs to happen is a complete rewrite? I have heard this many times, and, have uttered that fatal sentence myself. But shouldn’t we love our legacy code? Doesn’t it represent our investment and the hard work of ourselves and our predecessors? Throwing it away is dangerous, because, before we do, we’ll need to work out exactly what it does, and we’ll need to tweeze out that critical business logic nestled in a deeply entangled knot of IF statements. It could take us years to do, and we’ll have to maintain two systems whilst we do it, inevitably adding new features to them both. Yes we get to reimplement using the latest, coolest programming language, instead of an old behemoth, but how long will our new cool language be around, and who will maintain that code, when it itself inevitably turns to legacy? We can throw our arms in the air, complaining and grumbling about how we didn’t write the code, how we would never have written it the way it is, how those that wrote it were lesser programmers, possibly lesser humans themselves, but the code still remains, staring us in the face and hanging around for longer that we could possibly imagine. We can sort it out, we can improve it, we can make it testable, and we can learn to love our legacy code.
https://www.youtube.com/watch?v=qRP45l5UugE
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1KRPXlL.
Brian Holt talks about what is React and is desirable; what are some specific things to pay attention to for performance when writing React; some general web performance tips; what are some lessons learned while helping write m.reddit.com using React. Filmed at qconsf.com.
Brian Holt is Senior UI Engineer at Netflix.
Workshop slides originally given at the WOPR Summit in Atlantic City. Use JavaScript parsers and generators like Shift combined with Puppeteer and Chrome to reverse engineer web applications
Similar to Building reusable components with generics and protocols (20)
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...Donny Wals
Learn how to use Combine, SwiftUI and Swift 5.2's callAsFunction to build an experimental localization system and familiarize yourself with these new APIs in iOS 13.
Combine is Apple's own Functional Reactive Programming framework. In this talk, I explain three of the main pillars that Combine is built on. By re-implementing Combine's sink subscriber we explore every aspect Combine's subscription stream.
In this talk I demonstrate and explain how I tackled the problem of importing a huge data set with many repetitive contents. The dataset was provided in JSON format.
Many developers know that they should be writing tests for their apps. However, it’s often hard to know how to get started or to convince your manager that you should be spending half of your time writing and maintaining test code. In this talk, you will learn how you can integrate testing into your day-to-day workflow and you’ll learn why a good test suite will not cost you a lot of time. Instead, it should end up saving you time. And as you know, the manager loves it when you manage to save time. You will understand how TDD works, how to integrate the important bits of TDD and how to build a high-quality test suite that is a pleasure to maintain. To round things out, you will also learn about Xcode 11’s new test plans feature and how you can use it to make your test suite even better!
Over the years, Core Data has gained a pretty bad reputation amongst developers who prefer to use another service like Realm for their local persistence. In this talk I will make an argument for using Core Data and why it's not so bad. I will share some examples of where it's easy to go wrong with Core Data, and how to avoid those pitfalls. I will also quickly go over setting up Core Data in an app and by the end, the audience should have a couple of simple rules that should help them safely integrate Core Data in their apps.
Effectively Producing And Shipping Frameworks For Multiple PlatformsDonny Wals
In this presentation I will demonstrate how you can orchestrate the development cycles for several teams that work on native SDKs for several platforms, including Android and iOS. This talk will explain how features get designed, approved and implemented. The focus will mostly be on how you can ensure that all teams provide stable and robust public APIs, accompanied by a solid and reliable test suite. By the end of this talk, attendees will understand how they can improve their multi-platform SDKs through feature specs, Behaviour Driven Development and Test Driven Development. The talk is given from an iOS developers perspective so the code samples and experiences will be mostly based on that of an iOS developer that works together with several teams to build an SDK.
Improving apps with iOS 10 notifications (do iOS 2016)Donny Wals
Notifications in iOS 10 have received a major overhaul. We can now implement extensions for our notifications meaning that the user experience for notifications s greatly improved.
Developing in the Fastlane -> How LookLive uses Fastlane to automate and spee...Donny Wals
App deployment can be frustrating and time consuming. At LookLive, we have optimized this process using a tool called Fastlane. In this talk, I will demonstrate how we did it and you'll learn how you can set up Fastlane for your own projects.
Building RAG with self-deployed Milvus vector database and Snowpark Container...Zilliz
This talk will give hands-on advice on building RAG applications with an open-source Milvus database deployed as a docker container. We will also introduce the integration of Milvus with Snowpark Container Services.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
6. Goals
• Learn how to design code that uses Generics
• Understand simple generics and associated types
7. Goals
• Learn how to design code that uses Generics
• Understand simple generics and associated types
• Know how to use protocols with associated types with generics
8. Goals
• Learn how to design code that uses Generics
• Understand simple generics and associated types
• Know how to use protocols with associated types with generics
• To (not) blow your mind (too much)
9. “I want to have a cache. But it should be able to cache, like,
anything.”
10. “I want to have a cache. But it should be able to cache, like,
anything.”
“And it should have a remote backup, so if the item isn’t available
locally, I can take it from the server.”
11. “I want to have a cache. But it should be able to cache, like,
anything.”
“And it should have a remote backup, so if the item isn’t available
locally, I can take it from the server.”
“And when the data is taken from the server, the local cache should
be updated with the remote version.”
12. “I want to have a cache. But it should be able to cache, like,
anything.”
“And it should have a remote backup, so if the item isn’t available
locally, I can take it from the server.”
“And when the data is taken from the server, the local cache should
be updated with the remote version.”
“And I don’t want to create special cache managers for every type of
object or something. Maybe the underlying storage could be specific,
but that’s it!”
13. –Me, in the morning. Before I realize what I’m about to get myself into.
“I want to have a cache. But it should be able to cache, like,
anything.”
“And it should have a remote backup, so if the item isn’t available
locally, I can take it from the server.”
“And when the data is taken from the server, the local cache should
be updated with the remote version.”
“And I don’t want to create special cache managers for every type of
object or something. Maybe the underlying storage could be specific,
but that’s it!”
19. Designing the call site
• Figure out how I want to use whatever it is that I’m building
20. Designing the call site
• Figure out how I want to use whatever it is that I’m building
• This helps to validate your ideas
21. Designing the call site
• Figure out how I want to use whatever it is that I’m building
• This helps to validate your ideas
• Don’t worry about any generics, type names or details yet
22. Designing the call site
An easy to use, straightforward API that uses existing data stores
and applies the caching logic internally.
26. So far, so good
But this isn’t the actual thing, is it?
27. So far, so good
But this isn’t the actual thing, is it?
Oh good, because we were promised
generics and protocols and the possibility
of getting our minds blown.
107. When is all this useful to know?
• Code duplication in Swift is often related to types. Generics can help you
clean this up.
• You’re most likely to encounter generics in your model/networking layer.
• If you want to write frameworks or SDKs.
110. In summary
• Figure out how you want to use your code first.
• Then find out what that means for your implementation.
111. In summary
• Figure out how you want to use your code first.
• Then find out what that means for your implementation.
• If needed, introduce generics and protocols as abstractions.
112. In summary
• Figure out how you want to use your code first.
• Then find out what that means for your implementation.
• If needed, introduce generics and protocols as abstractions.
• Constrain your generics and associated types where needed so the
compiler can help you.
113. In summary
• Figure out how you want to use your code first.
• Then find out what that means for your implementation.
• If needed, introduce generics and protocols as abstractions.
• Constrain your generics and associated types where needed so the
compiler can help you.
• Generics can help you limit code duplication.