This document discusses exception handling in Ruby. It begins by explaining why exception handling is needed by describing errors, error codes, and their shortcomings. It then discusses Ruby's exception handling mechanisms which include the Exception class hierarchy, raising exceptions with raise, and handling exceptions with rescue blocks. Finally, it briefly covers catch/throw clauses which allow continuing execution up the call stack.
Exceptions are a powerful mechanism for centralized processing of errors and exceptional situations. This mechanism replaces the procedure-oriented method of error handling in which each function returns a code indicating an error or a successful execution.
Exceptions are a powerful mechanism for centralized processing of errors and exceptional situations. This mechanism replaces the procedure-oriented method of error handling in which each function returns a code indicating an error or a successful execution.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
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
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Welocme to ViralQR, your best QR code generator.ViralQR
Welcome to ViralQR, your best QR code generator available on the market!
At ViralQR, we design static and dynamic QR codes. Our mission is to make business operations easier and customer engagement more powerful through the use of QR technology. Be it a small-scale business or a huge enterprise, our easy-to-use platform provides multiple choices that can be tailored according to your company's branding and marketing strategies.
Our Vision
We are here to make the process of creating QR codes easy and smooth, thus enhancing customer interaction and making business more fluid. We very strongly believe in the ability of QR codes to change the world for businesses in their interaction with customers and are set on making that technology accessible and usable far and wide.
Our Achievements
Ever since its inception, we have successfully served many clients by offering QR codes in their marketing, service delivery, and collection of feedback across various industries. Our platform has been recognized for its ease of use and amazing features, which helped a business to make QR codes.
Our Services
At ViralQR, here is a comprehensive suite of services that caters to your very needs:
Static QR Codes: Create free static QR codes. These QR codes are able to store significant information such as URLs, vCards, plain text, emails and SMS, Wi-Fi credentials, and Bitcoin addresses.
Dynamic QR codes: These also have all the advanced features but are subscription-based. They can directly link to PDF files, images, micro-landing pages, social accounts, review forms, business pages, and applications. In addition, they can be branded with CTAs, frames, patterns, colors, and logos to enhance your branding.
Pricing and Packages
Additionally, there is a 14-day free offer to ViralQR, which is an exceptional opportunity for new users to take a feel of this platform. One can easily subscribe from there and experience the full dynamic of using QR codes. The subscription plans are not only meant for business; they are priced very flexibly so that literally every business could afford to benefit from our service.
Why choose us?
ViralQR will provide services for marketing, advertising, catering, retail, and the like. The QR codes can be posted on fliers, packaging, merchandise, and banners, as well as to substitute for cash and cards in a restaurant or coffee shop. With QR codes integrated into your business, improve customer engagement and streamline operations.
Comprehensive Analytics
Subscribers of ViralQR receive detailed analytics and tracking tools in light of having a view of the core values of QR code performance. Our analytics dashboard shows aggregate views and unique views, as well as detailed information about each impression, including time, device, browser, and estimated location by city and country.
So, thank you for choosing ViralQR; we have an offer of nothing but the best in terms of QR code services to meet business diversity!
1. ‘Exception Handling in RUBY’
‘Exception Handling in RUBY’
Joy Menon
Department of Computer Science and Engineering, IIT Mumbai.
24 November 2004
2. ‘Exception Handling in RUBY’
A Brief Outline
Exception Handling: WHY?
Errors and Error Codes
The Need for Exception Handling
Exception Handling in Ruby:
The Exception Class
Exception Class Heirarchy
Handling Exceptions
Raising Exceptions
Catch/Throw Clauses
Conclusions
3. ‘Exception Handling in RUBY’
Exception Handling: WHY?
Errors and Error Codes
Errors and Error Codes
In any programming, occurance of errors is a distinct reality.
Errors need to be handled gracefully to avoid abrupt failures.
Code that detects error may not have context to handle it.
For example, attempting to open a file that doesn’t exist is
acceptable in some circumstances and is a fatal error at other
times. What does the file-handling module do?
Conventionally it was done using error-checking and
return-codes mechanism.
Functions were checked for return values, and if the return
code indicated failure, this code was interpreted and passed
up the call stack.
4. ‘Exception Handling in RUBY’
Exception Handling: WHY?
The Need for Exception Handling
The Need for Exception Handling
However Error-codes mechanism has following shortcomings:
Handling all errors through error codes is simply not possible.
Moving error codes up the function call stack is complicated.
Managing all the error-codes and associated code is tedious.
The Exception Handling mechanism addresses these
shortcomings.
Exceptions allow packaging info about error in an object.
Exception handling helps propagate object up the call stack.
Runtime system locates code that knows to handle the error.
Exception handling is essential for achieving well-designed object
oriented code, and therefore Ruby provides a mechanism for same.
5. ‘Exception Handling in RUBY’
Exception Handling in Ruby
The Exception Class
The Exception Class
As in other object oriented languages, Ruby offers a
mechanism for exception handling.
When an exception occurs..
Object of class Exception, or one of it’s children, created.
Exception is associated to message string & a stack backtrace.
All information about the exception is packaged in this object.
IOError, ZeroDivisionError, TypeError, SystemCallError, etc
are examples of exceptions derived from class Exception.
Ruby predefines a hierarchy of exceptions: see next slide.
7. ‘Exception Handling in RUBY’
User Defined Exceptions
User Defined Exceptions
User-Defined Exception
Users can create exception classes of their own.
These must inherit from class StandardError or its children.
If they dont, such exceptions will not be detected by default.
They may include more specific information about the
exception.
8. ‘Exception Handling in RUBY’
User Defined Exceptions
Handling Exceptions
Handling Exceptions
The basic approach to exception handling involves the use of:
Enclose candidate code in begin/end block.
Use rescue block to handle specific class of exceptions,
where:
Report the error,
Code to handle detected error,
Raise the exception using raise.
Use ensure block to ensure execution of some essential code
after handling, like deallocation of resources such as DB
connections, etc.
We can draw analogies to C++/Java exception handling:
begin/end block for candidate code. (like try block)
rescue blocks for handling code. (like catch blocks)
raise command for raising the exception. (like throw)
ensure command for necessary handling. (like final)
9. ‘Exception Handling in RUBY’
User Defined Exceptions
Handling Exceptions
Example: Using rescue, raise and ensure
10. ‘Exception Handling in RUBY’
User Defined Exceptions
Handling Exceptions
Handling Exceptions (continued..)
Variables
$ refers to the default global variable that stores the exception
object for the exception.
stderrobj is an example of user-defined variable storing the
reference to the exception object.
Matching exceptions to correct rescue block is like the case
statement mechanism,
object.kindof? result compared to exception types in
rescue statements.
11. ‘Exception Handling in RUBY’
User Defined Exceptions
Raising Exceptions
Raising Exceptions
Raising exceptions deliberately in code help to trigger alerts
where errors are expected and need to be handled.
The raise statement can take the following forms:
raise
Raises current exception again, or RuntimeError if none.
raise <message>
Creates new RuntimeError exception, associates it with
mentioned string, and raises the exception up the call stack.
raise <exception class>, <message>, <call stack>
Creates exception with arg-1 used as required exception type,
arg-2 as message string, and arg-3 as stack trace.
12. ‘Exception Handling in RUBY’
User Defined Exceptions
Raising Exceptions
Example: Typical Usage of raise
13. ‘Exception Handling in RUBY’
User Defined Exceptions
The Catch/Throw Clauses
The catch/throw Clauses
The rescue and raise mechanism is thus used for
abandoning execution when unwanted errors occur.
The catch and throw mechanism is used to continue
execution at some point up the call stack.
Working of catch/throw:
catch defines a block with a specific label.
The block is exeuted, typically accross nested functions, till a
throw followed by the label is encountered.
The call stack is then scoured for a catch block with a
matching label.
On a match, Ruby rolls back execution to the point and
terminates the block.
If the throw had an optional 2nd argument, it is returned as
value of the catch block.
14. ‘Exception Handling in RUBY’
User Defined Exceptions
The Catch/Throw Clauses
Example: Typical usage of catch/throw
15. ‘Exception Handling in RUBY’
Conclusions
Conclusions
Exception Handling is essential for managing errors in
object-oriented code.
The Ruby Exception Handling mechanism includes:
rescue and final clauses - for handling unwanted errors and
exit gracefully.
raise - for deliberately creating and raising exceptions in
code.
catch and throw clause - for continuing execution at some
point up the function call stack.
16. ‘Exception Handling in RUBY’
Conclusions
References
http://www.insula.cz/dali/material/rbycl/.
http://www.ruby-lang.org/.
Dave Thomas and Chad Fowler and Andy Hunt.
Programming Ruby: The Pragmatic Programmers’ Guide.
Pragmatic Bookshelf, Oct 2004.