The C# nullability features help you minimize the likelihood of encountering that dreaded System.NullReferenceException. Nullability syntax and annotations give hints as to whether a type can be nullable or not, and better static analysis is available to catch unhandled nulls while developing your code. What's not to like?
Introducing explicit nullability into an existing code bases is a Herculean effort. There's much more to it than just sprinkling some `?` and `!` throughout your code. It's not a silver bullet either: you'll still need to check non-nullable variables for null.
In this talk, we'll see some techniques and approaches that worked for me, and explore how you can migrate an existing code base to use the full potential of C# nullability.
Report
Share
Report
Share
1 of 66
Download to read offline
More Related Content
Similar to Bringing nullability into existing code - dammit is not the answer.pptx
PVS-Studio is a static code analyzer that checks C, C++ and C# code for bugs. It supports projects developed with Windows (Visual Studio) and Linux (Clang, GCC). It integrates with tools like Visual Studio, SonarQube and supports standalone use. PVS-Studio detects many types of bugs like null pointer dereferences, uninitialized variables, dead code, buffer overflows, security issues and more. It has been effective at finding real bugs in major open source projects.
introduction to Applied Programming is designed for students who are enrolled in the Bachelor of Information Technology. The course introduces the fundamental concepts of procedural and event driven programming, with a focus on approaches to programming relevant for IT, including scripting languages. Students take a practical approach to learning the fundamental topics in programming, including, data types and algorithms, functions, control structures, arrays, GUI, files, as well as the mechanics of running, testing, and debugging.
The document discusses C++ and its evolution over time. Some key points include:
- C++ has been active for over 30 years and remains relevant due to its performance and use in applications like mobile.
- The new C++11 standard adds many new features that make the language more powerful yet easier to use, such as rvalue references, lambdas, and type inference.
- Examples are provided showing how new C++11 features like futures, lambdas and static assertions can be used concisely to solve common programming problems in a more modern style.
Applying Compiler Techniques to Iterate At Blazing SpeedPascal-Louis Perez
In this session, we will present real life applications of compiler techniques helping kaChing achieve ultra confidence and power its incredible 5 minutes commit-to-production cycle [1]. We'll talk about idempotency analysis [2], dependency detection, on the fly optimisations, automatic memoization [3], type unification [4] and more! This talk is not suitable for the faint-hearted... If you want to dive deep, learn about advanced JVM topics, devoure bytecode and see first hand applications of theoretical computer science, join us.
[1] http://eng.kaching.com/2010/05/deployment-infrastructure-for.html
[2] http://en.wikipedia.org/wiki/Idempotence
[3] http://en.wikipedia.org/wiki/Memoization
[4] http://eng.kaching.com/2009/10/unifying-type-parameters-in-java.html
C++ is an object-oriented programming language that is based on C and adds object-oriented programming features like classes, inheritance, and polymorphism. It was created by Bjarne Stroustrup at Bell Labs in the early 1980s. The document provides an introduction to C++ including its history, differences from C, program structure, data types, variables, input/output, and integrated development environments.
Type Profiler: An Analysis to guess type signaturesmametter
This document discusses type profiling, which is a technique for extracting type information from Ruby code without requiring type annotations. It proposes three type profilers:
1. Static Analysis 1 (SA1) guesses type signatures for method parameters based on which methods are called on those parameters.
2. Static Analysis 2 (SA2) focuses on guessing types for built-in classes.
3. Dynamic Analysis (DA) enhances the existing RubyTypeInference tool by running test suites and monitoring method calls and returns to aggregate type information.
The document evaluates SA1 on a sample WEBrick codebase and finds some common failures in the guessed types. Overall, type profiling aims to extract type information automatically as an alternative
This document provides information on variables, data types, and keywords in C# programming. It discusses the differences between static and normal variables, with static variables allocating memory in the class and maintaining their value until the application closes. Different data types are described like integral, floating point, and nullable types. Value, reference, and pointer data types are also explained. The document contains code examples demonstrating static and normal variables as well as printing the limits of different data types. Keywords in C# that cannot be used as identifiers are listed.
This document discusses code analysis and techniques for predicting runtime errors in source code. It describes existing solutions like detecting uninitialized variables, overflows, divide by zeros, incorrect argument data types. It also discusses detecting out-of-bounds array and pointer references, memory allocation/deallocation errors, and memory leaks. The document outlines the design of a code analyzer that takes C code as input, performs lexical and syntax analysis to generate intermediate code, and then uses the intermediate code to predict possible runtime errors. Further work mentioned includes evaluating the intermediate code to perform data and control flow analysis for error prediction.
This document provides an overview of memory management concepts in Java and C++, including pointers, the heap, stack, activation records, classes and objects. It discusses how objects are allocated in memory in both languages, with objects in Java being referenced by pointers on the stack and allocated on the heap, while in C++ objects can be allocated on the stack or heap. The document also covers issues like memory leaks in C++ if objects are not deleted from the heap, and garbage collection handling object deletion in Java. Methods and calling conventions are compared between the two languages.
The document provides an overview of getting started with C#, including:
- An introduction to C# and its evolution from versions 1.0 to 9.0.
- Key topics covered include data types, variables, value types vs reference types, and keywords.
- Coding standards, sample programs, and operators are also discussed to help newcomers get up and running with C#.
The document discusses Project Roslyn, which rewrote the C# and VB compilers and IDE from scratch. This enabled new capabilities like incremental compilation for faster builds, predictive capabilities in the IDE, and opening the compiler APIs so others can build on top of it. The Roslyn compiler API unifies how C# code is understood, allowing third parties to build custom tools like analyzers, refactorings, and documentation generators. The document also previews upcoming C# features like pattern matching, tuples, and records being added to the language.
The document discusses the new features in C++11 including new language features such as rvalue references, decltype, lambdas, and auto; new library features such as smart pointers, regular expressions, and hash tables; and the status of support for C++11 in Visual Studio 2010 and 2012. It also discusses modern C++ style using features like lambdas, smart pointers, and move semantics.
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...PVS-Studio
Microsoft have given open access to the source code of a tool kit that is used in the company to speed up the development of artificial intelligence: Computational Network Toolkit is now available at Github. The developers had to create their own custom solution, because the existing tools did not work fast enough.
C++ allows for concise summaries in 3 sentences or less:
The document provides an overview of C++ concepts including data types, variables, operators, functions, classes, inheritance and virtual members. It also covers process and thread concepts at a high level. Code examples are provided to illustrate namespaces, input/output, program flow control, overloading, dynamic memory allocation, and classes. The document serves as a brief review of fundamental C++ and system programming concepts.
It is quite often that software developers have absolutely no clue about the cost of an error. It is very important that the error be found at the earliest possible stage.
Static analysis and writing C/C++ of high quality code for embedded systemsAndrey Karpov
This document discusses static analysis for improving code quality in embedded systems. It begins by introducing the speaker and providing background on trends in IoT devices and code size growth. Examples are given of potential errors like divide by zero, use of uninitialized variables, and returning addresses of stack variables. Frameworks for finding vulnerabilities like CWE and real vulnerabilities like CVE are described. The value of code reviews and dynamic analysis are discussed but their limitations for embedded code. Finally, standards like MISRA and SEI CERT for preventing errors and examples of correctly using static analysis are provided.
C# - what's new with C# 7, what's planned with C# 8: productivity, performance, avoiding errors with tuples, pattern matching, nullable reference types, and more
Code is not text! How graph technologies can help us to understand our code b...Andreas Dewes
Today, we almost exclusively think of code in software projects as a collection of text files. The tools that we use (version control systems, IDEs, code analyzers) also use text as the primary storage format for code. In fact, the belief that “code is text” is so deeply ingrained in our heads that we never question its validity or even become aware of the fact that there are other ways to look at code.
In my talk I will explain why treating code as text is a very bad idea which actively holds back our understanding and creates a range of problems in large software projects. I will then show how we can overcome (some of) these problems by treating and storing code as data, and more specifically as a graph. I will show specific examples of how we can use this approach to improve our understanding of large code bases, increase code quality and automate certain aspects of software development.
Finally, I will outline my personal vision of the future of programming, which is a future where we no longer primarily interact with code bases using simple text editors. I will also give some ideas on how we might get to that future.
Similar to Bringing nullability into existing code - dammit is not the answer.pptx (20)
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...Maarten Balliauw
After buying a set of Sonos-compatible speakers at IKEA, I was disappointed there's no support for playing audio from a popular video streaming service. They stream Internet radio, podcasts and what not. Well, not that service I want it to play!
Determined - and not knowing how deep the rabbit hole would be - I ventured on a trip that included network sniffing on my access point, learning about UPnP and running a web server on my phone (without knowing how to write anything Android), learning how MP4 audio is packaged (and has to be re-packaged). This ultimately resulted in an Android app for personal use, which does what I initially wanted: play audio from that popular video streaming service on Sonos.
Join me for this story about an adventure that has no practical use, probably violates Terms of Service, but was fun to build!
Building a friendly .NET SDK to connect to SpaceMaarten Balliauw
Space is a team tool that integrates chats, meetings, git hosting, automation, and more. It has an HTTP API to integrate third party apps and workflows, but it's massive! And slightly opinionated.
In this session, we will see how we built the .NET SDK for Space, and how we make that massive API more digestible. We will see how we used code generation, and incrementally made the API feel more like a real .NET SDK.
Microservices for building an IDE - The innards of JetBrains Rider - NDC Oslo...Maarten Balliauw
Ever wondered how IDE’s are built? In this talk, we’ll skip the marketing bit and dive into the architecture and implementation of JetBrains Rider. We’ll look at how and why we have built (and open sourced) a reactive protocol, and how the IDE uses a “microservices” architecture to communicate with the debugger, Roslyn, a WPF renderer and even other tools like Unity3D. We’ll explore how things are wired together, both in-process and across those microservices.
Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday...Maarten Balliauw
Which NuGet package was that type in again? In this session, let's build a "reverse package search" that helps finding the correct NuGet package based on a public type.
Together, we will create a highly-scalable serverless search engine using Azure Functions and Azure Search that performs 3 tasks: listening for new packages on NuGet.org (using a custom binding), indexing packages in a distributed way, and exposing an API that accepts queries and gives our clients the best result.
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...Maarten Balliauw
Ever wondered how IDE’s are built? In this talk, we’ll skip the marketing bit and dive into the architecture and implementation of JetBrains Rider.
We’ll look at how and why we have built (and open sourced) a reactive protocol, and how the IDE uses a “microservices” architecture to communicate with the debugger, Roslyn, a WPF renderer and even other tools like Unity3D. We’ll explore how things are wired together, both in-process and across those microservices. Let’s geek out!
JetBrains Australia 2019 - Exploring .NET’s memory management – a trip down m...Maarten Balliauw
This document discusses .NET memory management and the garbage collector. It explains that the CLR manages memory in a heap and the garbage collector reclaims unused memory. It describes how objects are allocated in generations and discusses how to help the garbage collector perform better by reducing allocations, using value types when possible, and properly disposing of objects. The document also provides examples of hidden allocations and demonstrates tools for analyzing memory usage like ClrMD and dotMemory Unit.
.NET Conf 2019 - Indexing and searching NuGet.org with Azure Functions and Se...Maarten Balliauw
Which NuGet package was that type in again? In this session, let's build a "reverse package search" that helps finding the correct NuGet package based on a public type.
Together, we will create a highly-scalable serverless search engine using Azure Functions and Azure Search that performs 3 tasks: listening for new packages on NuGet.org (using a custom binding), indexing packages in a distributed way, and exposing an API that accepts queries and gives our clients the best result.
https://blog.maartenballiauw.be/post/2019/07/30/indexing-searching-nuget-with-azure-functions-and-search.html
CloudBurst 2019 - Indexing and searching NuGet.org with Azure Functions and S...Maarten Balliauw
Which NuGet package was that type in again? In this session, let's build a "reverse package search" that helps finding the correct NuGet package based on a public type.
Together, we will create a highly-scalable serverless search engine using Azure Functions and Azure Search that performs 3 tasks: listening for new packages on NuGet.org (using a custom binding), indexing packages in a distributed way, and exposing an API that accepts queries and gives our clients the best result.
NDC Oslo 2019 - Indexing and searching NuGet.org with Azure Functions and SearchMaarten Balliauw
Which NuGet package was that type in again? In this session, let's build a "reverse package search" that helps finding the correct NuGet package based on a public type.
Together, we will create a highly-scalable serverless search engine using Azure Functions and Azure Search that performs 3 tasks: listening for new packages on NuGet.org (using a custom binding), indexing packages in a distributed way, and exposing an API that accepts queries and gives our clients the best result.
Approaches for application request throttling - Cloud Developer Days PolandMaarten Balliauw
Speaking from experience building a SaaS: users are insane. If you are lucky, they use your service, but in reality, they probably abuse. Crazy usage patterns resulting in more requests than expected, request bursts when users come back to the office after the weekend, and more! These all pose a potential threat to the health of our web application and may impact other users or the service as a whole. Ideally, we can apply some filtering at the front door: limit the number of requests over a given timespan, limiting bandwidth, ...
In this talk, we’ll explore the simple yet complex realm of rate limiting. We’ll go over how to decide on which resources to limit, what the limits should be and where to enforce these limits – in our app, on the server, using a reverse proxy like Nginx or even an external service like CloudFlare or Azure API management. The takeaway? Know when and where to enforce rate limits so you can have both a happy application as well as happy customers.
Indexing and searching NuGet.org with Azure Functions and Search - Cloud Deve...Maarten Balliauw
This document discusses indexing NuGet packages using Azure Functions and Azure Search to power search capabilities in ReSharper and Rider. It proposes using Functions triggered by changes to the NuGet.org catalog to download packages, index them using reflection metadata, and upload the results to an Azure Search index. Each step would be a separate function to allow independent scaling. The final system would watch the catalog, index new/updated packages, and provide APIs for searching packages by type or namespace.
Approaches for application request throttling - dotNetCologneMaarten Balliauw
Speaking from experience building a SaaS: users are insane. If you are lucky, they use your service, but in reality, they probably abuse. Crazy usage patterns resulting in more requests than expected, request bursts when users come back to the office after the weekend, and more! These all pose a potential threat to the health of our web application and may impact other users or the service as a whole. Ideally, we can apply some filtering at the front door: limit the number of requests over a given timespan, limiting bandwidth, ...
In this talk, we’ll explore the simple yet complex realm of rate limiting. We’ll go over how to decide on which resources to limit, what the limits should be and where to enforce these limits – in our app, on the server, using a reverse proxy like Nginx or even an external service like CloudFlare or Azure API management. The takeaway? Know when and where to enforce rate limits so you can have both a happy application as well as happy customers.
CodeStock - Exploring .NET memory management - a trip down memory laneMaarten Balliauw
The .NET Garbage Collector (GC) is really cool. It helps providing our applications with virtually unlimited memory, so we can focus on writing code instead of manually freeing up memory. But how does .NET manage that memory? What are hidden allocations? Are strings evil? It still matters to understand when and where memory is allocated. In this talk, we’ll go over the base concepts of .NET memory management and explore how .NET helps us and how we can help .NET – making our apps better. Expect profiling, Intermediate Language (IL), ClrMD and more!
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...Maarten Balliauw
Ever wondered how IDE’s are built? In this talk, we’ll skip the marketing bit and dive into the architecture and implementation of JetBrains Rider. We’ll look at how and why we have built (and open sourced) a reactive protocol, and how the IDE uses a “microservices” architecture to communicate with the debugger, Roslyn, a WPF renderer and even other tools like Unity3D. We’ll explore how things are wired together, both in-process and across those microservices. Let’s geek out!
ConFoo Montreal - Approaches for application request throttlingMaarten Balliauw
Speaking from experience building a SaaS: users are insane. If you are lucky, they use your service, but in reality, they probably abuse. Crazy usage patterns resulting in more requests than expected, request bursts when users come back to the office after the weekend, and more! These all pose a potential threat to the health of our web application and may impact other users or the service as a whole. Ideally, we can apply some filtering at the front door: limit the number of requests over a given timespan, limiting bandwidth, ...
In this talk, we’ll explore the simple yet complex realm of rate limiting. We’ll go over how to decide on which resources to limit, what the limits should be and where to enforce these limits – in our app, on the server, using a reverse proxy like Nginx or even an external service like CloudFlare or Azure API management. The takeaway? Know when and where to enforce rate limits so you can have both a happy application as well as happy customers.
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...Maarten Balliauw
Ever wondered how IDE’s are built? In this talk, we’ll skip the marketing bit and dive into the architecture and implementation of JetBrains Rider. We’ll look at how and why we have built (and open sourced) a reactive protocol, and how the IDE uses a “microservices” architecture to communicate with the debugger, Roslyn, a WPF renderer and even other tools like Unity3D. We’ll explore how things are wired together, both in-process and across those microservices. Let’s geek out!
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...Maarten Balliauw
The .NET Garbage Collector (GC) is really cool. It helps providing our applications with virtually unlimited memory, so we can focus on writing code instead of manually freeing up memory. But how does .NET manage that memory? What are hidden allocations? Are strings evil? It still matters to understand when and where memory is allocated. In this talk, we’ll go over the base concepts of .NET memory management and explore how .NET helps us and how we can help .NET – making our apps better. Expect profiling, Intermediate Language (IL), ClrMD and more!
The .NET Garbage Collector (GC) is really cool. It helps providing our applications with virtually unlimited memory, so we can focus on writing code instead of manually freeing up memory. But how does .NET manage that memory? What are hidden allocations? Are strings evil? It still matters to understand when and where memory is allocated. In this talk, we’ll go over the base concepts of .NET memory management and explore how .NET helps us and how we can help .NET – making our apps better. Expect profiling, Intermediate Language (IL), ClrMD and more!
VISUG - Approaches for application request throttlingMaarten Balliauw
Speaking from experience building a SaaS: users are insane. If you are lucky, they use your service, but in reality, they probably abuse. Crazy usage patterns resulting in more requests than expected, request bursts when users come back to the office after the weekend, and more! These all pose a potential threat to the health of our web application and may impact other users or the service as a whole. Ideally, we can apply some filtering at the front door: limit the number of requests over a given timespan, limiting bandwidth, ...
In this talk, we’ll explore the simple yet complex realm of rate limiting. We’ll go over how to decide on which resources to limit, what the limits should be and where to enforce these limits – in our app, on the server, using a reverse proxy like Nginx or even an external service like CloudFlare or Azure API management. The takeaway? Know when and where to enforce rate limits so you can have both a happy application as well as happy customers.
What is going on - Application diagnostics on Azure - TechDays FinlandMaarten Balliauw
We all like building and deploying cloud applications. But what happens once that’s done? How do we know if our application behaves like we expect it to behave? Of course, logging! But how do we get that data off of our machines? How do we sift through a bunch of seemingly meaningless diagnostics? In this session, we’ll look at how we can keep track of our Azure application using structured logging, AppInsights and AppInsights analytics to make all that data more meaningful.
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfNeo4j
Presented at Gartner Data & Analytics, London Maty 2024. BT Group has used the Neo4j Graph Database to enable impressive digital transformation programs over the last 6 years. By re-imagining their operational support systems to adopt self-serve and data lead principles they have substantially reduced the number of applications and complexity of their operations. The result has been a substantial reduction in risk and costs while improving time to value, innovation, and process automation. Join this session to hear their story, the lessons they learned along the way and how their future innovation plans include the exploration of uses of EKG + Generative AI.
Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.
Mitigating the Impact of State Management in Cloud Stream Processing SystemsScyllaDB
Stream processing is a crucial component of modern data infrastructure, but constructing an efficient and scalable stream processing system can be challenging. Decoupling compute and storage architecture has emerged as an effective solution to these challenges, but it can introduce high latency issues, especially when dealing with complex continuous queries that necessitate managing extra-large internal states.
In this talk, we focus on addressing the high latency issues associated with S3 storage in stream processing systems that employ a decoupled compute and storage architecture. We delve into the root causes of latency in this context and explore various techniques to minimize the impact of S3 latency on stream processing performance. Our proposed approach is to implement a tiered storage mechanism that leverages a blend of high-performance and low-cost storage tiers to reduce data movement between the compute and storage layers while maintaining efficient processing.
Throughout the talk, we will present experimental results that demonstrate the effectiveness of our approach in mitigating the impact of S3 latency on stream processing. By the end of the talk, attendees will have gained insights into how to optimize their stream processing systems for reduced latency and improved cost-efficiency.
Coordinate Systems in FME 101 - Webinar SlidesSafe Software
If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights.
During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to:
- Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value
- Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems
- Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors
- Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported
- Look Ahead: Gain insights into where FME is headed with coordinate systems in the future
Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!
Sustainability requires ingenuity and stewardship. Did you know Pigging Solutions pigging systems help you achieve your sustainable manufacturing goals AND provide rapid return on investment.
How? Our systems recover over 99% of product in transfer piping. Recovering trapped product from transfer lines that would otherwise become flush-waste, means you can increase batch yields and eliminate flush waste. From raw materials to finished product, if you can pump it, we can pig it.
Measuring the Impact of Network Latency at TwitterScyllaDB
Widya Salim and Victor Ma will outline the causal impact analysis, framework, and key learnings used to quantify the impact of reducing Twitter's network latency.
Best Practices for Effectively Running dbt in Airflow.pdfTatiana Al-Chueyr
As a popular open-source library for analytics engineering, dbt is often used in combination with Airflow. Orchestrating and executing dbt models as DAGs ensures an additional layer of control over tasks, observability, and provides a reliable, scalable environment to run dbt models.
This webinar will cover a step-by-step guide to Cosmos, an open source package from Astronomer that helps you easily run your dbt Core projects as Airflow DAGs and Task Groups, all with just a few lines of code. We’ll walk through:
- Standard ways of running dbt (and when to utilize other methods)
- How Cosmos can be used to run and visualize your dbt projects in Airflow
- Common challenges and how to address them, including performance, dependency conflicts, and more
- How running dbt projects in Airflow helps with cost optimization
Webinar given on 9 July 2024
An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)
Details of description part II: Describing images in practice - Tech Forum 2024BookNet Canada
This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator.
Link to presentation recording and transcript: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/
Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.
Quality Patents: Patents That Stand the Test of TimeAurora Consulting
Is your patent a vanity piece of paper for your office wall? Or is it a reliable, defendable, assertable, property right? The difference is often quality.
Is your patent simply a transactional cost and a large pile of legal bills for your startup? Or is it a leverageable asset worthy of attracting precious investment dollars, worth its cost in multiples of valuation? The difference is often quality.
Is your patent application only good enough to get through the examination process? Or has it been crafted to stand the tests of time and varied audiences if you later need to assert that document against an infringer, find yourself litigating with it in an Article 3 Court at the hands of a judge and jury, God forbid, end up having to defend its validity at the PTAB, or even needing to use it to block pirated imports at the International Trade Commission? The difference is often quality.
Quality will be our focus for a good chunk of the remainder of this season. What goes into a quality patent, and where possible, how do you get it without breaking the bank?
** Episode Overview **
In this first episode of our quality series, Kristen Hansen and the panel discuss:
⦿ What do we mean when we say patent quality?
⦿ Why is patent quality important?
⦿ How to balance quality and budget
⦿ The importance of searching, continuations, and draftsperson domain expertise
⦿ Very practical tips, tricks, examples, and Kristen’s Musts for drafting quality applications
https://www.aurorapatents.com/patently-strategic-podcast.html
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Erasmo Purificato
Slide of the tutorial entitled "Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Emerging Trends" held at UMAP'24: 32nd ACM Conference on User Modeling, Adaptation and Personalization (July 1, 2024 | Cagliari, Italy)
Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data.
The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs.
Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution!
Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.
YOUR RELIABLE WEB DESIGN & DEVELOPMENT TEAM — FOR LASTING SUCCESS
WPRiders is a web development company specialized in WordPress and WooCommerce websites and plugins for customers around the world. The company is headquartered in Bucharest, Romania, but our team members are located all over the world. Our customers are primarily from the US and Western Europe, but we have clients from Australia, Canada and other areas as well.
Some facts about WPRiders and why we are one of the best firms around:
More than 700 five-star reviews! You can check them here.
1500 WordPress projects delivered.
We respond 80% faster than other firms! Data provided by Freshdesk.
We’ve been in business since 2015.
We are located in 7 countries and have 22 team members.
With so many projects delivered, our team knows what works and what doesn’t when it comes to WordPress and WooCommerce.
Our team members are:
- highly experienced developers (employees & contractors with 5 -10+ years of experience),
- great designers with an eye for UX/UI with 10+ years of experience
- project managers with development background who speak both tech and non-tech
- QA specialists
- Conversion Rate Optimisation - CRO experts
They are all working together to provide you with the best possible service. We are passionate about WordPress, and we love creating custom solutions that help our clients achieve their goals.
At WPRiders, we are committed to building long-term relationships with our clients. We believe in accountability, in doing the right thing, as well as in transparency and open communication. You can read more about WPRiders on the About us page.
Best Programming Language for Civil EngineersAwais Yaseen
The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era.
Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.
Bringing nullability into existing code - dammit is not the answer.pptx
1. Bringing C# nullability into
existing code
Maarten Balliauw
https://mastodon.online/@maartenballiauw
2. Agenda
• Nullable reference types in C#
• Internals of C# nullable reference types
• Annotating your C# code
• Techniques and tools to update your project
5. What will be the output of this code?
string s = GetValue();
Console.WriteLine($"Length of '{s}': {s.Length}");
string GetValue() => null;
Unhandled exception. System.NullReferenceException: Object reference
not set to an instance of an object.
at Program.<Main>$(String[] args) in Program.cs:line 2
6. Add a check for null
string s = GetValue();
Console.WriteLine(s != null
? $"Length of '{s}': {s.Length}"
: "String is null.");
string GetValue() => null;
7. How do you know you need a check?
• For reference types, not particularly clear…
• For value types, easy!
int? bool? long? decimal? DateTime?
• ? denotes null is possible
Note: value types can’t really be null:
compiler magic converts to Nullable<T>
8. Clear intent: ? tells you if null is possible
Reference types
string s = GetValue();
Console.WriteLine(s != null
? $"Length of '{s}': {s.Length}"
: "String is null.");
string GetValue() => null;
Value types
DateTime? s = GetValue();
Console.WriteLine(s.HasValue
? $"The date is: {s.Value:O}"
: "No date was given.");
DateTime? GetValue() => null;
10. Nullable reference types (NRT)
• Have always been a part of C#: every reference type is nullable
• C#8+ nullable reference types flip the idea:
• Non-nullable by default
• Syntax to annotate a reference type as nullable
• What will be the output of this code?
string s = GetValue();
Console.WriteLine($"Length of '{s}': {s.Length}");
string? GetValue() => null;
Unhandled exception. System.NullReferenceException: Object reference
not set to an instance of an object.
at Program.<Main>$(String[] args) in Program.cs:line 2
11. Nullable reference types (NRT)
• The above code will emit compiler warnings
• CS8600 - Converting null literal or possible null value to non-nullable type.
• CS8602 - Dereference of a possibly null reference.
• Your IDE will show them, too
string s = GetValue();
Console.WriteLine($"Length of '{s}': {s.Length}");
string? GetValue() => null;
12. Nullable reference types (NRT)
• C#8+ nullable reference types are just annotations
• Compiler and IDE help you detect potential null values
• Design-time and compile-time
15. Flow analysis
• IDE and compiler analyze code flow
• Code path analysis determines warning/no warning
• Using var is always considered nullable
• Until flow analysis determines otherwise
• The null-coalescing / null-forgiving operator (“dammit”)
• Suppress warnings, postfix expression with !
• May help with directing flow analysis (e.g. while migrating to NRT)…
• …but should be considered an antipattern.
16. Summary: Nullable reference types in C#
• No runtime safety
• Design-time and compile-time help
to determine if a variable may be null before dereferencing it
• Give better static flow analysis on your code
• Your null checks will help flow analysis
• Null-forgiving operator may help if really needed
• But it is an antipattern!
18. Reference types vs. value types
• Value type: compiler magic to Nullable<T>
• Reference type: always nullable
• How do compiler and IDE know about reference type nullability?
23. Information for flow analysis
• Oblivious: 0
• Default, pre-C#8 behaviour (everything is maybe null)
• Not annotated: 1
• Every reference type is non-nullable by default
• Annotated: 2
• Every reference type has an implicit ?
.custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor([in] unsigned
int8)
= (01 00 02 00 00 ) // .....
// unsigned int8(2) // 0x02
24. More attributes!
#nullable enable
public string GetString3(string? a, string b, string? c) => "";
.method public hidebysig instance string GetString3(string a, string b, string c) cil managed
{
.custom instance void NullableContextAttribute::.ctor([in] unsigned int8)
= (01 00 01 00 00 ) // int8(1) – by default treat ref. types as not annotated
.param [1]
.custom instance void NullableAttribute::.ctor([in] unsigned int8)
= (01 00 02 00 00 ) // int8(2) – treat param[1] as annotated
.param [3]
.custom instance void NullableAttribute::.ctor([in] unsigned int8)
= (01 00 02 00 00 ) // int8(2) – treat param[3] as annotated
.maxstack 8
25. More attributes!
#nullable enable
public string GetString3(string? a, string b, string? c) => "";
.method public hidebysig instance string GetString3(string a, string b, string c) cil managed
{
.custom instance void NullableContextAttribute::.ctor([in] unsigned int8)
= (01 00 01 00 00 ) // int8(1) – by default treat ref. types as not annotated
.param [1]
.custom instance void NullableAttribute::.ctor([in] unsigned int8)
= (01 00 02 00 00 ) // int8(2) – treat param[1] as annotated
.param [3]
.custom instance void NullableAttribute::.ctor([in] unsigned int8)
= (01 00 02 00 00 ) // int8(2) – treat param[3] as annotated
.maxstack 8
26. More attributes!
#nullable enable
public string GetString3(string? a, string b, string? c) => "";
.method public hidebysig instance string GetString3(string a, string b, string c) cil managed
{
.custom instance void NullableContextAttribute::.ctor([in] unsigned int8)
= (01 00 01 00 00 ) // int8(1) – by default treat ref. types as not annotated
.param [1]
.custom instance void NullableAttribute::.ctor([in] unsigned int8)
= (01 00 02 00 00 ) // int8(2) – treat param[1] as annotated
.param [3]
.custom instance void NullableAttribute::.ctor([in] unsigned int8)
= (01 00 02 00 00 ) // int8(2) – treat param[3] as annotated
.maxstack 8
27. Information for flow analysis
• Default for method: NullableContextAttribute
• Per-parameter overrides: NullableAttribute
• C# compiler tries to emit as few attributes as possible
• Default that applies to most parameters
• Overrides to that default where needed
• Reduce overhead when analyzing code during compilation or in IDE
28. How do you want to surface NRT?
• Nullable annotation context
• In code, using #nullable value
• In project file <Nullable>value</Nullable>
• Possible values:
• disable - pre-C# 8.0 behavior (no NRT)
• enable - all analysis and language features
• warnings - all analysis, and warnings when code might dereference null
• annotations - no analysis, but lets you use ?
29. Which annotation context to use?
• New projects: enable it.
• Migration: “It depends” 🤷
• Disable as the default, enable file-per-file until done
• Enable as the default, live with many warnings as you go through
• Warnings as the default, enable file-per-file until done
• See warnings where you can improve
• Annotations as the default
• Allow adding ?, but no real benefit.
30. Summary: Nullable reference types in C#
• Nullable context: what the compiler emits and consumes
• Nullable annotation context: what you want to surface
• enable by default for new projects
• disable by default for existing, gradual #nullable enable
32. Is ? enough…
#nullable enable
public static string? Slugify(string? value)
{
if (value == null)
{
return null;
}
return value.Replace(" ", "-").ToLowerInvariant();
}
33. Is ? enough…
public static string? Slugify(string? value)
• Returns a non-null string when a non-null parameter is passed
• Returns a null string when a null parameter is passed
36. Fine-grained annotations!
• Preconditions
• When writing to a parameter, field, or property setter
• Postconditions
• When reading from a field, property or return value
• Conditional postconditions
• Make arguments dependent on return value
• Failure conditions
• Further analysis is not needed
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis
38. JetBrains.Annotations
• Many libraries ship them, can help with migration
• Entity Framework Core, Unity, Hangfire, …
• More powerful, but only in ReSharper and JetBrains Rider
• [CanBeNull], [NotNull]
• [ItemNotNull], [ItemCanBeNull]
• [ContractAnnotation]
https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html
[ContractAnnotation("json:null => false,person:null")]
public bool TryDeserialize(string? json, out Person? person)
{
// ...
}
39. Nullability and generics
• Use ? where needed
List<string>
List<string?>
List<string?>?
• Use annotations
[return: MaybeNull]
public T Find<T>(IEnumerable<T> sequence, Func<T, bool> predicate)
• Use notnull constraint
public static void WriteToConsole<T>(T item) where T : notnull
WriteToConsole(null); // CS8714 doesn't match 'notnull' constraint
40. Referenced code, libraries & frameworks
• Using NRT is easy if your dependencies use it
• .NET BCL is annotated
• Many OSS libraries are annotated
• Annotate your own code for dependents
• Provide design-time and compile-time hints
• Remember NRT are not runtime safety!
• Consider null checks for code that others consume
• They may not use C#, or have #nullable disable
41. Summary: Annotating your C# code
• There are more annotations than ?
• Clearly communicates intent with flow analyzer
• Compiler annotations and JetBrains.Annotations
• You may still need null checks for your libraries
43. Default nullable annotation context
• #nullable enable/disable/warnings/annotations
• New projects: enable it
• Existing projects:
• Small: enable it and plow through
• Large:
• Enable file by file
• Combine with warnings at project level
44. Start at the center and work outwards
• Classes with few or zero dependencies on others
• Often: DTOs / POCOs
• Typically used by many dependents
• Small change flows to many places
45. Start at the center and work outwards
ReSharper Type Hierarchy Diagram
Visual Studio architecture tools
NDepend
…
46. Start at the edges and work inwards
ReSharper Type Hierarchy Diagram
47. Per class…
• Enable NRT (#nullable enable)
• For every property and constructor parameter
• Find all write usages
• If potentially set to null, annotating with ? is needed
49. Annotate, and redesign!
• Sometimes redesign makes more sense
• Nullable annotations surface through code base (like async/await)
• Do you want to check for null at every current and future usage?
• Or do it once and return a “null object”?
• “It depends”
50. Suppressions should be temporary
• Temporarily disable flow analysis
• “what if this was non-null”?
• Remove suppressions
51. Don’t be afraid of null
• ✅ Gain more confidence in compiler/IDE flow analysis
• ⛔ Completely get rid of all null usages in code
• Build a safety net!
• Annotate, suppress, redesign – passing null is totally fine
• Know where it is potentially passed
• Reduce chance of NullReferenceException
52. Summary: Techniques
• Always enable NRT for new projects
• Start at the center and work outwards
• Annotate, and redesign
• Suppressions should be temporary
• Don’t be afraid of null
56. Automatic migration*
• Inserts [NotNull] and
[CanBeNull] from base classes
• Infers annotations by looking at
usages
• If null anywhere, gets annotated
*Not a silver bullet, but a great help
57. Infer from existing null checks
• Your code has clear hints about nullability
• Quiz: should we annotate?
public static string ReadColumn(
string columnName,
string defaultValue = "")
{
if (columnName != null)
{
if (_mappings.TryGetValue(columnName, out var columnIndex)
&& _data.TryGetValue(columnIndex, out var columnData))
{
return columnData ?? defaultValue;
}
}
return defaultValue;
}
58. Third-party libraries
• .NET BCL and some libraries are annotated – great!
• Some libraries use JetBrains.Annotations – great!
• Many (most 😔) are not annotated
• Have to assume null everywhere
• R#/Rider – try pessimistic analysis
https://www.jetbrains.com/help/resharper/Code_Analysis__Value_Analysis.html#modes_
60. (De)serializing JSON
• // 1
[JsonProperty("name")]
public string? Name { get; set; }
• // 2
[JsonProperty("name")]
public string Name { get; set; } = default!;
• // 3
[JsonProperty("name")]
public string Name { get; set; } = "Unknown";
• // 4
private readonly string _name;
[AllowNull]
[JsonProperty("name")]
public string Name
{
get => _name;
init => _name = value ?? "Unknown";
}
Loses nullability information
antipattern (incorrect information)
Good alternative
Good (cumbersome) alternative
61. (De)serializing JSON
• // 5
[JsonProperty("name")]
public required string Name { get; set; } Personal recommendation*
*Your JSON data may still be null…
Checking input in the property or using
IJsonOnDeserialized may be helpful.
62. Be careful with Entity Framework Core
A property is considered optional if it is valid for it to contain null. If null is
not a valid value to be assigned to a property then it is considered to be a
required property. When mapping to a relational database schema, required
properties are created as non-nullable columns, and optional properties are
created as nullable columns.
TL;DR: When you enable NRT in a project or file, your database schema
may change unexpectedly.
https://docs.microsoft.com/en-us/ef/core/modeling/entity-properties?tabs=data-annotations%2Cwithout-
nrt#:~:text=A%20property%20is,as%20nullable%20columns
https://docs.microsoft.com/en-us/ef/core/miscellaneous/nullable-reference-types#required-and-optional-properties
65. Nullable reference types in C#
• Design-time and compile-time safety net. Not runtime!
• Nullable annotation context to determine level of help
• Annotations to communicate intent
(null is fine if you know where)
• Null-forgiving operator is an antipattern
• Tools and techniques to migrate
In LocationInfo, set #nullable enable
Find Usages on properties for potential null, there should be none
Same for constructor. Call site has potential null reference!
Should the property be updated to accommodate for this one? Or should we do a null check and return “Unknown” instead?
In many cases, Find Usages will be sufficient to get an idea of the direct usages of a class, constructor, method, or property. In other cases, you may need more information.
ReSharper (R#) and JetBrains Rider come with value tracking and call tracking to help you out here. Visual Studio 2022 also has a Track Value Source command, but your mileage with it will vary.
With value tracking, you can follow the entire flow of a specific value and determine where it is originating from and where it is being used.
Not sure if this TrackingAccount property should be annotated? The Inspect | Value Origin action will track all places where a value for this property can be assigned, and provides a tool window to jump to every location.
JSON.NET allows you to use constructor as well, might be useful.
JSON.NET allows you to use constructor as well, might be useful.