The document describes an idiomatic pattern language for message-based product families using C++. It discusses using self-instantiating singleton objects to avoid issues with object creation order. Commands and subsystems register themselves with catalogs instead of catalogs knowing all objects. Catalogs are lazy singletons to solve initialization order problems. The approach helps manage product families with variable feature sets through message passing between self-contained subsystems and commands.
The document discusses different implementations of shared pointers in C++ and proposes an adaptive approach. It summarizes three common implementations of shared pointers: invasive, slim, and fat. It then proposes a "linked small pointer" implementation that is optimized for small object counts by using a linked list instead of a reference count. For larger object counts, it would transition to a traditional reference counted implementation. Finally, it proposes an "adaptive linked pointer" that uses unused bits in pointers to track reference counts for smaller objects and dynamically transitions between the linked and reference counted approaches. Benchmark results show this adaptive approach has performance comparable to traditional implementations.
The document discusses three different buffer overflow exploits against three users (superuser, hyperuser, and masteruser) on a Linux machine. The superuser's program can be exploited through a simple buffer overflow. The hyperuser's program uses a canary but can still be exploited by overwriting a vulnerable function pointer. The masteruser's program must be exploited by overwriting the virtual pointer table. Code examples and steps are provided for each exploit.
The document discusses the introduction of ARM 64-bit architecture. It begins with an introduction of the speaker and then covers several topics on ARM64 including:
- ARM64 terminology such as AArch64 for 64-bit mode and AArch32 for 32-bit mode
- The ARM64 execution model including 64-bit general purpose registers and 128-bit floating point registers
- The ARM64 instruction set architecture including new instructions for cache control and floating point support
- Demonstrations of ARM64 assembly code for various C examples compiled to ARM64
- Trying out ARM64 emulation using QEMU to debug ARM64 code with GDB.
The document discusses the author's experience learning and using XS (eXternal Subroutines) to integrate C code with Perl. It provides an overview of key concepts like data types, memory management, and libraries in C and Perl. It also demonstrates how to create an XS module that defines and exports a C function to Perl using common macros like MODULE and PACKAGE.
The document discusses JIT-aware programming for ActionScript virtual machines. It provides examples of how different programming patterns can affect JIT compilation results. Specifically, it shows how using classes, methods, and types can influence optimization of JIT outputs. The author encourages programmers to be mindful of these language features in order to better facilitate JIT compilation and potentially improve performance.
Valgrind overview: runtime memory checker and a bit more aka использование #v...Minsk Linux User Group
Sergei Trofimovich «Valgrind overview: runtime memory checker and a bit more aka использование #valgrind на селе»
Доклад на майской линуксовке MLUG 2013
Tech Webinar: AUMENTARE LA SCALABILITÀ DELLE WEB APP CON SERVLET 3.1 ASYNC I/OCodemotion
Tech Webinar tenuto da Simone Bordet.
Per partecipare ad altri Tech Webinar gratuiti potete iscrivervi qui: http://goo.gl/iW81VD
In questo Tech Webinar si parlerà di:
Le nuove Servlet API versione 3.1 per effettuare asynchronous I/O
API per async I/O presenti nel JDK nei moduli NIO e NIO2
Introduzioni ai principali pattern usati nel design di API asincrone
verranno esaminate in dettaglio le nuove Servlet API per async I/O, a partire dalle motivazioni per introdurle
Best Practice di utilizzo delle Servlet API per async I/O
Come evitare gli errori più comuni nel loro utilizzo
The document discusses different implementations of shared pointers in C++ and proposes an adaptive approach. It summarizes three common implementations of shared pointers: invasive, slim, and fat. It then proposes a "linked small pointer" implementation that is optimized for small object counts by using a linked list instead of a reference count. For larger object counts, it would transition to a traditional reference counted implementation. Finally, it proposes an "adaptive linked pointer" that uses unused bits in pointers to track reference counts for smaller objects and dynamically transitions between the linked and reference counted approaches. Benchmark results show this adaptive approach has performance comparable to traditional implementations.
The document discusses three different buffer overflow exploits against three users (superuser, hyperuser, and masteruser) on a Linux machine. The superuser's program can be exploited through a simple buffer overflow. The hyperuser's program uses a canary but can still be exploited by overwriting a vulnerable function pointer. The masteruser's program must be exploited by overwriting the virtual pointer table. Code examples and steps are provided for each exploit.
The document discusses the introduction of ARM 64-bit architecture. It begins with an introduction of the speaker and then covers several topics on ARM64 including:
- ARM64 terminology such as AArch64 for 64-bit mode and AArch32 for 32-bit mode
- The ARM64 execution model including 64-bit general purpose registers and 128-bit floating point registers
- The ARM64 instruction set architecture including new instructions for cache control and floating point support
- Demonstrations of ARM64 assembly code for various C examples compiled to ARM64
- Trying out ARM64 emulation using QEMU to debug ARM64 code with GDB.
The document discusses the author's experience learning and using XS (eXternal Subroutines) to integrate C code with Perl. It provides an overview of key concepts like data types, memory management, and libraries in C and Perl. It also demonstrates how to create an XS module that defines and exports a C function to Perl using common macros like MODULE and PACKAGE.
The document discusses JIT-aware programming for ActionScript virtual machines. It provides examples of how different programming patterns can affect JIT compilation results. Specifically, it shows how using classes, methods, and types can influence optimization of JIT outputs. The author encourages programmers to be mindful of these language features in order to better facilitate JIT compilation and potentially improve performance.
Valgrind overview: runtime memory checker and a bit more aka использование #v...Minsk Linux User Group
Sergei Trofimovich «Valgrind overview: runtime memory checker and a bit more aka использование #valgrind на селе»
Доклад на майской линуксовке MLUG 2013
Tech Webinar: AUMENTARE LA SCALABILITÀ DELLE WEB APP CON SERVLET 3.1 ASYNC I/OCodemotion
Tech Webinar tenuto da Simone Bordet.
Per partecipare ad altri Tech Webinar gratuiti potete iscrivervi qui: http://goo.gl/iW81VD
In questo Tech Webinar si parlerà di:
Le nuove Servlet API versione 3.1 per effettuare asynchronous I/O
API per async I/O presenti nel JDK nei moduli NIO e NIO2
Introduzioni ai principali pattern usati nel design di API asincrone
verranno esaminate in dettaglio le nuove Servlet API per async I/O, a partire dalle motivazioni per introdurle
Best Practice di utilizzo delle Servlet API per async I/O
Come evitare gli errori più comuni nel loro utilizzo
This document discusses using the prove command-line tool to run tests and other scripts. Prove is a test runner that uses the Test Anything Protocol (TAP) to aggregate results. It can run tests and scripts written in any language by specifying the interpreter with --exec. Extensions other than .t can be run by setting --ext. Prove searches for tests in the t/ directory by default but can run any kind of scripts or tasks placed in t/, such as service monitoring scripts. The .proverc file can save common prove options for a project.
This document discusses setting up a network bridge without Docker. It provides a Vagrantfile to configure a virtual machine environment with Ubuntu 18.04, along with tools like Go and Docker installed. Instructions are given to create a bridge between two network namespaces called RED and BLUE using IP addresses in the 11.11.11.0/24 range. Tests show that hosts can ping each other within this network but not across the real interface and IP range of the host machine. Additional routing and IP configuration is needed to allow outside communication.
The document summarizes techniques for Unix programming with Perl, focusing on advanced topics like inter-process communication, signals, and avoiding race conditions. It discusses using IPC::Open3 to avoid deadlocks when communicating between processes via pipes. It also covers how to safely sleep while waiting for a signal using POSIX::pselect or a socketpair to avoid race conditions. Proper error handling for signals is mentioned but not shown.
100 bugs in Open Source C/C++ projects Andrey Karpov
This article demonstrates capabilities of the static code analysis methodology. The readers are offered to study the samples of one hundred errors found in open-source projects in C/C++.
- The document discusses various aspects of Unix programming using Perl, including handling errors, filehandles after forking processes, and signals.
- It provides examples of how to properly check for errors, avoid resource collisions after forking, and make code cancellable using signals.
- Key topics covered include using the Errno module to check for errors, closing filehandles after forks to prevent sharing issues, and trapping signals like SIGPIPE and SIGTERM.
The document discusses code for serial port (com) device drivers in FreeBSD. It shows code from the comstart() function, which is called by the tty layer when there is outgoing data to transmit. Comstart() grabs the data from the tty queue and sets up the com_softc structure to start transmission. It then calls the chip-specific transmit function. The com_softc structure contains a pointer to the associated tty structure.
The document discusses Nanite, a platform that combines the strengths of Erlang and Ruby. It allows using Erlang for messaging, networking and scalability while using Ruby for rapid development. Nanite uses RabbitMQ for messaging and Redis for distributed agent state storage. It describes Nanite's use of AMQP and how agents can advertise services and tags to enable routing of requests. Security is implemented using encrypted and signed packets. The document invites readers to get involved with the Nanite open source project.
The document discusses PHP performance and dives into the internals of how PHP works, including details on the Zend engine, compilation process involving lexing, parsing and compiling to opcodes, and execution through opcode interpretation by the virtual machine. It provides examples and tips on optimizing performance by reducing compilation overhead through opcode caching, profiling execution to find bottlenecks, and analyzing PHP functions at the C level to optimize system calls and memory usage.
Connecting C++ and JavaScript on the Web with EmbindChad Austin
Embind allows binding C++ code to JavaScript, enabling use of high-performance C++ code in web applications. It uses Emscripten to compile C++ to asm.js, a low-level subset of JavaScript. Embind features include binding C++ classes, enums, constants, and functions to JavaScript. It supports calling JavaScript functions from C++ using emscripten::val. Embind minimizes overhead through techniques like generating signature strings at compile-time and using lightweight RTTI instead of full typeid. select_overload and optional_override help bind overloaded and lambda functions in a clean way.
Play framework supports asynchronous and non-blocking code using Scala. Asynchronous applications use message passing and events to handle requests in a non-blocking way across threads. This improves performance by reducing thread switching and allowing many concurrent connections using fewer system resources. However, non-blocking code is more difficult to manage state and data. The Play framework uses Akka which handles requests asynchronously using a single thread per connection. To take advantage of this, code needs to be written using non-blocking APIs to avoid blocking the thread and reducing latency.
Make container without_docker_6-overlay-network_1 Sam Kim
분산환경에서 컨테이너 간의 통신은 어떻게 이루어 지는 것일까요? 3,4편에서는 호스트 안에 가상네트워크를 만들어보았습니다. 6편에서는 이를 바탕으로 분산환경에서 호스트 간에 가상 네트워크로 통신이 가능하도록 만들어 봅니다. 이 방법은 실제 쿠버네티스 flannel 등의 CNI에서 사용하고 있는 vxlan 기반의 오버레이 네트워크 구성을 다룹니다.
How to make a large C++-code base manageablecorehard_by
My talk will cover how to work with a large C++ code base professionally. How to write code for debuggability, how to work effectively even due the long C++ compilation times, how and why to utilize the STL algorithms, how and why to keep interfaces clean. In addition, general convenience methods like making wrappers to make the code less error prone (for example ranged integers, listeners, concurrent values). Also a little bit about common architecture patterns to avoid (virtual classes), and patterns to encourage (pure functions), and how std::function/lambda functions can be used to make virtual classes copyable.
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...Moabi.com
This presentation given in 2011 during the first Ruxcon Monthly (Ruxmon) Sydney focuses on proprietary protocols reverse engineering and vulnerability audits.
Go uses goroutines and channels for concurrency. Goroutines are lightweight threads that communicate through channels, which are typed queues that allow synchronous message passing. Channels can be used to synchronize access to shared memory, allowing both shared memory and message passing for concurrency. The language is designed for scalable fine-grained concurrency but further improvements are still needed, especially to the goroutine scheduler.
This document discusses various tools and techniques for improving the quality of robotics software, including ROS 2 code. It covers using compiler instrumentation like AddressSanitizer and ThreadSanitizer to detect memory bugs and concurrency issues. It also discusses annotating code with thread safety annotations, fuzz testing ROS 2 to find crashes, and integrating these techniques into continuous integration systems to catch issues early. The goal is to help the robotics community build more robust, secure software.
A glimpse at some of the new features for the C++ programming languages that will be introduced by the upcoming C++17 Standard.
This talk was given at the Munich C++ User Group Meetup.
Such a weird Processor: messing with opcodes (...and a little bit of PE) (Has...Ange Albertini
After being trapped by a malware, I went back to the basics, studied ASM and PE from scratch, and failed all tools I tried in the process.
This presentation introduces the complete details that are shared on Corkami.com, and highlights some of the most interesting cases.
This document discusses using the prove command-line tool to run tests and other scripts. Prove is a test runner that uses the Test Anything Protocol (TAP) to aggregate results. It can run tests and scripts written in any language by specifying the interpreter with --exec. Extensions other than .t can be run by setting --ext. Prove searches for tests in the t/ directory by default but can run any kind of scripts or tasks placed in t/, such as service monitoring scripts. The .proverc file can save common prove options for a project.
This document discusses setting up a network bridge without Docker. It provides a Vagrantfile to configure a virtual machine environment with Ubuntu 18.04, along with tools like Go and Docker installed. Instructions are given to create a bridge between two network namespaces called RED and BLUE using IP addresses in the 11.11.11.0/24 range. Tests show that hosts can ping each other within this network but not across the real interface and IP range of the host machine. Additional routing and IP configuration is needed to allow outside communication.
The document summarizes techniques for Unix programming with Perl, focusing on advanced topics like inter-process communication, signals, and avoiding race conditions. It discusses using IPC::Open3 to avoid deadlocks when communicating between processes via pipes. It also covers how to safely sleep while waiting for a signal using POSIX::pselect or a socketpair to avoid race conditions. Proper error handling for signals is mentioned but not shown.
100 bugs in Open Source C/C++ projects Andrey Karpov
This article demonstrates capabilities of the static code analysis methodology. The readers are offered to study the samples of one hundred errors found in open-source projects in C/C++.
- The document discusses various aspects of Unix programming using Perl, including handling errors, filehandles after forking processes, and signals.
- It provides examples of how to properly check for errors, avoid resource collisions after forking, and make code cancellable using signals.
- Key topics covered include using the Errno module to check for errors, closing filehandles after forks to prevent sharing issues, and trapping signals like SIGPIPE and SIGTERM.
The document discusses code for serial port (com) device drivers in FreeBSD. It shows code from the comstart() function, which is called by the tty layer when there is outgoing data to transmit. Comstart() grabs the data from the tty queue and sets up the com_softc structure to start transmission. It then calls the chip-specific transmit function. The com_softc structure contains a pointer to the associated tty structure.
The document discusses Nanite, a platform that combines the strengths of Erlang and Ruby. It allows using Erlang for messaging, networking and scalability while using Ruby for rapid development. Nanite uses RabbitMQ for messaging and Redis for distributed agent state storage. It describes Nanite's use of AMQP and how agents can advertise services and tags to enable routing of requests. Security is implemented using encrypted and signed packets. The document invites readers to get involved with the Nanite open source project.
The document discusses PHP performance and dives into the internals of how PHP works, including details on the Zend engine, compilation process involving lexing, parsing and compiling to opcodes, and execution through opcode interpretation by the virtual machine. It provides examples and tips on optimizing performance by reducing compilation overhead through opcode caching, profiling execution to find bottlenecks, and analyzing PHP functions at the C level to optimize system calls and memory usage.
Connecting C++ and JavaScript on the Web with EmbindChad Austin
Embind allows binding C++ code to JavaScript, enabling use of high-performance C++ code in web applications. It uses Emscripten to compile C++ to asm.js, a low-level subset of JavaScript. Embind features include binding C++ classes, enums, constants, and functions to JavaScript. It supports calling JavaScript functions from C++ using emscripten::val. Embind minimizes overhead through techniques like generating signature strings at compile-time and using lightweight RTTI instead of full typeid. select_overload and optional_override help bind overloaded and lambda functions in a clean way.
Play framework supports asynchronous and non-blocking code using Scala. Asynchronous applications use message passing and events to handle requests in a non-blocking way across threads. This improves performance by reducing thread switching and allowing many concurrent connections using fewer system resources. However, non-blocking code is more difficult to manage state and data. The Play framework uses Akka which handles requests asynchronously using a single thread per connection. To take advantage of this, code needs to be written using non-blocking APIs to avoid blocking the thread and reducing latency.
Make container without_docker_6-overlay-network_1 Sam Kim
분산환경에서 컨테이너 간의 통신은 어떻게 이루어 지는 것일까요? 3,4편에서는 호스트 안에 가상네트워크를 만들어보았습니다. 6편에서는 이를 바탕으로 분산환경에서 호스트 간에 가상 네트워크로 통신이 가능하도록 만들어 봅니다. 이 방법은 실제 쿠버네티스 flannel 등의 CNI에서 사용하고 있는 vxlan 기반의 오버레이 네트워크 구성을 다룹니다.
How to make a large C++-code base manageablecorehard_by
My talk will cover how to work with a large C++ code base professionally. How to write code for debuggability, how to work effectively even due the long C++ compilation times, how and why to utilize the STL algorithms, how and why to keep interfaces clean. In addition, general convenience methods like making wrappers to make the code less error prone (for example ranged integers, listeners, concurrent values). Also a little bit about common architecture patterns to avoid (virtual classes), and patterns to encourage (pure functions), and how std::function/lambda functions can be used to make virtual classes copyable.
[Ruxcon Monthly Sydney 2011] Proprietary Protocols Reverse Engineering : Rese...Moabi.com
This presentation given in 2011 during the first Ruxcon Monthly (Ruxmon) Sydney focuses on proprietary protocols reverse engineering and vulnerability audits.
Go uses goroutines and channels for concurrency. Goroutines are lightweight threads that communicate through channels, which are typed queues that allow synchronous message passing. Channels can be used to synchronize access to shared memory, allowing both shared memory and message passing for concurrency. The language is designed for scalable fine-grained concurrency but further improvements are still needed, especially to the goroutine scheduler.
This document discusses various tools and techniques for improving the quality of robotics software, including ROS 2 code. It covers using compiler instrumentation like AddressSanitizer and ThreadSanitizer to detect memory bugs and concurrency issues. It also discusses annotating code with thread safety annotations, fuzz testing ROS 2 to find crashes, and integrating these techniques into continuous integration systems to catch issues early. The goal is to help the robotics community build more robust, secure software.
A glimpse at some of the new features for the C++ programming languages that will be introduced by the upcoming C++17 Standard.
This talk was given at the Munich C++ User Group Meetup.
Such a weird Processor: messing with opcodes (...and a little bit of PE) (Has...Ange Albertini
After being trapped by a malware, I went back to the basics, studied ASM and PE from scratch, and failed all tools I tried in the process.
This presentation introduces the complete details that are shared on Corkami.com, and highlights some of the most interesting cases.
The document introduces the Boo programming language, which was created by the author out of frustration with existing languages and a desire to take advantage of the .NET framework features. Boo aims to have a Python-like syntax while still providing static typing, automatic type inference, and extensibility through features like syntactic attributes and macros. The goals of Boo include having a clean syntax, syntactic sugar for common patterns, and allowing programmers to take full advantage of the .NET framework and Common Language Infrastructure.
Checking the Open-Source Multi Theft Auto GameAndrey Karpov
We haven't used PVS-Studio to check games for a long time. So, this time we decided to return to this practice and picked out the MTA project. Multi Theft Auto (MTA) is a multiplayer modification for PC versions of the Grand Theft Auto: San Andreas game by Rockstar North that adds online multiplayer functionality. As Wikipedia tells us, the specific feature of the game is "well optimized code with fewest bugs possible". OK, let's ask our analyzer for opinion.
Compiler Construction | Lecture 12 | Virtual MachinesEelco Visser
The document discusses the architecture of the Java Virtual Machine (JVM). It describes how the JVM uses threads, a stack, heap, and method area. It explains JVM control flow through bytecode instructions like goto, and how the operand stack is used to perform operations and hold method arguments and return values.
The document discusses the motivation for creating a hybrid programming language called ooc. It aims to remove obstacles, encourage experimentation, and minimize frustration compared to existing languages. Ooc takes useful aspects from other languages like Java but without their downsides. It allows generating C code for various compilers while providing its own tools and modules system. The language is still being improved with future plans including additional optimizations and type system enhancements.
An introduction to the motivation behind the ooc project.
In a nutshell: software sucks, tools sucks, languages sucks - examples of what not to do. How ooc allows you to do pretty much aything with a few building blocks. An overview of the advantages/strong points of ooc.
C Programming Language Tutorial for beginners - JavaTpointJavaTpoint.Com
JavaTpoint share a presentation of C Programming language for beginners and professionals. now in this slideshare you will be learned basics of c programming language, what is c programming language, history of c programming, installing turbo c, features of c programming language, datatypes of c language, operaters in c, control statement of c language, c language functions, c array, pointer in c programming, and structure and union.
I am Joseph G . I am a Programming Assignment Expert at programminghomeworkhelp.com. I hold a Ph.D. Programming, Schiller International University, USA. I have been helping students with their homework for the past 8 years. I solve assignments related to Programming.
Visit programminghomeworkhelp.com or email support@programminghomeworkhelp.com.
You can also call on +1 678 648 4277 for any assistance with Programming Assignments.
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...Francesco Casalegno
••• Exploit the full potential of the CRTP! •••
In this presentation you will learn:
▸ what is the curiously recurring template pattern
▸ the actual cost (memory and time) of virtual functions
▸ how to implement static polymorphism
▸ how to implement expression templates to avoid loops and copies
Presto generates Java bytecode at runtime to optimize query execution. Key query operations like filtering, projections, joins and aggregations are compiled into efficient Java methods using libraries like ASM and Fastutil. This bytecode generation improves performance by 30% through techniques like compiling row hashing for join lookups directly into machine instructions.
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...apidays
Apidays Paris 2023 - Software and APIs for Smart, Sustainable and Sovereign Societies
December 6, 7 & 8, 2023
Forget TypeScript, Choose Rust to build Robust, Fast and Cheap APIs
Zacaria Chtatar, Backend Software Engineer at HaveSomeCode
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
[CCC-28c3] Post Memory Corruption Memory AnalysisMoabi.com
The document summarizes the Post Memory Corruption Memory Analysis (PMCMA) tool. PMCMA allows finding and testing exploitation scenarios resulting from invalid memory accesses. It provides a roadmap to exploitation without generating exploit code. The tool analyzes programs after crashes to overwrite memory locations in forked processes and test impact on execution flow.
Just how different is "Modern C++" from "legacy C++"? Is my codebase ready for C++17? Do I need a full rewrite of my app to modernize my code? If you're looking for answers to some of these questions, join us for a session on how to effectively leverage modern C++17 features in your existing C++ projects; and no, you don't need to rewrite your app.
Just how different is "Modern C++" from "legacy C++"? Is my codebase ready for C++17? Do I need a full rewrite of my app to modernize my code? If you're looking for answers to some of these questions, join us for a session on how to effectively leverage modern C++17 features in your existing C++ projects; and no, you don't need to rewrite your app.
1) Stackless Python is used extensively in EVE Online to support over 130,000 active players and 24,000 concurrent users on a single server cluster.
2) Stackless Python enables lightweight tasklets that can be scheduled cooperatively to improve concurrency without the overhead of OS threads.
3) Channels provide a synchronization mechanism that allows tasklets to communicate and block waiting for data in a way that enables efficient tasklet switching.
What to do when you have a perfect model for your software but you are constrained by an imperfect business model?
This talk explores the challenges of bringing modelling rigour to the business and strategy levels, and talking to your non-technical counterparts in the process.
Boost Your Savings with These Money Management AppsJhone kinadey
A money management app can transform your financial life by tracking expenses, creating budgets, and setting financial goals. These apps offer features like real-time expense tracking, bill reminders, and personalized insights to help you save and manage money effectively. With a user-friendly interface, they simplify financial planning, making it easier to stay on top of your finances and achieve long-term financial stability.
Manyata Tech Park Bangalore_ Infrastructure, Facilities and Morenarinav14
Located in the bustling city of Bangalore, Manyata Tech Park stands as one of India’s largest and most prominent tech parks, playing a pivotal role in shaping the city’s reputation as the Silicon Valley of India. Established to cater to the burgeoning IT and technology sectors
A neural network is a machine learning program, or model, that makes decisions in a manner similar to the human brain, by using processes that mimic the way biological neurons work together to identify phenomena, weigh options and arrive at conclusions.
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...kalichargn70th171
In today's fiercely competitive mobile app market, the role of the QA team is pivotal for continuous improvement and sustained success. Effective testing strategies are essential to navigate the challenges confidently and precisely. Ensuring the perfection of mobile apps before they reach end-users requires thoughtful decisions in the testing plan.
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...The Third Creative Media
"Navigating Invideo: A Comprehensive Guide" is an essential resource for anyone looking to master Invideo, an AI-powered video creation tool. This guide provides step-by-step instructions, helpful tips, and comparisons with other AI video creators. Whether you're a beginner or an experienced video editor, you'll find valuable insights to enhance your video projects and bring your creative ideas to life.
What is Continuous Testing in DevOps - A Definitive Guide.pdfkalichargn70th171
Once an overlooked aspect, continuous testing has become indispensable for enterprises striving to accelerate application delivery and reduce business impacts. According to a Statista report, 31.3% of global enterprises have embraced continuous integration and deployment within their DevOps, signaling a pervasive trend toward hastening release cycles.
Enhanced Screen Flows UI/UX using SLDS with Tom KittPeter Caitens
Join us for an engaging session led by Flow Champion, Tom Kitt. This session will dive into a technique of enhancing the user interfaces and user experiences within Screen Flows using the Salesforce Lightning Design System (SLDS). This technique uses Native functionality, with No Apex Code, No Custom Components and No Managed Packages required.
Transforming Product Development using OnePlan To Boost Efficiency and Innova...OnePlan Solutions
Ready to overcome challenges and drive innovation in your organization? Join us in our upcoming webinar where we discuss how to combat resource limitations, scope creep, and the difficulties of aligning your projects with strategic goals. Discover how OnePlan can revolutionize your product development processes, helping your team to innovate faster, manage resources more effectively, and deliver exceptional results.
The Comprehensive Guide to Validating Audio-Visual Performances.pdfkalichargn70th171
Ensuring the optimal performance of your audio-visual (AV) equipment is crucial for delivering exceptional experiences. AV performance validation is a critical process that verifies the quality and functionality of your AV setup. Whether you're a content creator, a business conducting webinars, or a homeowner creating a home theater, validating your AV performance is essential.
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
14 th Edition of International conference on computer visionShulagnaSarkar2
About the event
14th Edition of International conference on computer vision
Computer conferences organized by ScienceFather group. ScienceFather takes the privilege to invite speakers participants students delegates and exhibitors from across the globe to its International Conference on computer conferences to be held in the Various Beautiful cites of the world. computer conferences are a discussion of common Inventions-related issues and additionally trade information share proof thoughts and insight into advanced developments in the science inventions service system. New technology may create many materials and devices with a vast range of applications such as in Science medicine electronics biomaterials energy production and consumer products.
Nomination are Open!! Don't Miss it
Visit: computer.scifat.com
Award Nomination: https://x-i.me/ishnom
Conference Submission: https://x-i.me/anicon
For Enquiry: Computer@scifat.com
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISTier1 app
Are you ready to unlock the secrets hidden within Java thread dumps? Join us for a hands-on session where we'll delve into effective troubleshooting patterns to swiftly identify the root causes of production problems. Discover the right tools, techniques, and best practices while exploring *real-world case studies of major outages* in Fortune 500 enterprises. Engage in interactive lab exercises where you'll have the opportunity to troubleshoot thread dumps and uncover performance issues firsthand. Join us and become a master of Java thread dump analysis!
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Itacpp.2.la
1. Carlo Pescio http://carlopescio.com http://eptacom.net
Carlo Pescio
An overly simple, C++ idiomatic
pattern language for message-
based product families
overly simple
pattern language
based product families
message-
C++ idiomatic
2. Carlo Pescio http://carlopescio.com http://eptacom.net
Time-proven
- Used many times over ~20y
- Used in small (PIC 32 w/ KB of RAM) embedded systems
- Used in “big” (i7 w/ GB of RAM) embedded systems
- N x 100K units around the world using this stuff
5. Carlo Pescio http://carlopescio.com http://eptacom.net
Product
a subset of a “feature set”
Defined extensionally : P = { F1, …, Fp }
Most likely dynamic over time
- Products can be standard or custom
- | P | is “relevant”
6. Carlo Pescio http://carlopescio.com http://eptacom.net
Product family
a set of products
Defined extensionally : F = { P1, …, Pf }
Dynamic over time
| Pi ∩Pj | ≈ ∑| Pi |_____
f
- | F | is “relevant”
8. Carlo Pescio http://carlopescio.com http://eptacom.net
“expansive force”
“good response”
- New feature -> New code
- Grow / shrink product
- include / remove file
- Add product to family
- Choose file set
Product growth
Family growth
Feature set growth
9. Carlo Pescio http://carlopescio.com http://eptacom.net
“bad response”
Custom code, “feature aware” code for each product
|F| “relevant” => lots of custom artifacts
|P| “relevant” => each artifact is “relevant”
| Pi ∩Pj | ≈ ∑| Pi | => custom yet highly similar
________
f
|F| and |P| unstable and usually growing => maintenance cost
Common traps: switch/case, pattern matching, case classes, sum
types, builders, … (anything “enumerative” in nature)
11. Carlo Pescio http://carlopescio.com http://eptacom.net
class MessageHandler // or Dispatcher
{
void handle( const Message& m )
{
switch( m.getSubsystem() )
{
case SS1 :
{
switch( m.getCommand() )
{
case CMD1:
{
// now what?
}
}
}
}
}
}
The ugliness
- Ugly naming
- Can’t share among products
- Maintenance black hole
- Same issue with pattern matching
12. Carlo Pescio http://carlopescio.com http://eptacom.net
Half-hearted
I know, I’ll use a map of commands!
MessageHandler
Message -> SID,CID,params
CmdMap : (SID,CID) -> Command
Command -> Execute( params )
Ok, who is filling the map?
- A “main”
- A “factory”
still the same problem /
shape
- A “configuration file”
- not idiomatic (reflection?)
- better for “full-blown”
- [ dynamic loading not available
everywhere, e.g. PIC 32]
13. Carlo Pescio http://carlopescio.com http://eptacom.net
A 1st idiomatic notion
Self-instantiating object
Avoid the common trap of a single artifact which knows many objects.
Add a class (artifact) -> Get an object (run-time)
The object is born before main is executed. Avoids threading issues as well.
Idiomatic: can’t do this in Java or C#, they only got lazy statics.
14. Carlo Pescio http://carlopescio.com http://eptacom.net
Code: overly simple
class SelfCreating
{
private:
SelfCreating()
{
std::cout << "I'm the magical self-creating object" << std::endl;
}
static SelfCreating instance;
};
#include "SelfCreating.h"
SelfCreating SelfCreating::instance;
int main()
{
cout << "I'm the main function" << endl;
return 0;
}
15. Carlo Pescio http://carlopescio.com http://eptacom.net
The self-creating singleton
Useful outside this restricted application.
The C++ idiomatic solution to the real hard question:
who creates the creator? << it creates itself (seems just right too)
See:
prototype
abstract factory
factory method
etc.
16. Carlo Pescio http://carlopescio.com http://eptacom.net
Bring in some domain
A command is a self-instantiating, stateless singleton
- Self instantiating: no one needs to “know all the commands”
- Commands register themselves with a catalog
reversing the dependency
- Being stateless is not strictly necessary, but it’s often the right choice
commands are ok with being stateless anyway
17. Carlo Pescio http://carlopescio.com http://eptacom.net
A singleton (booooo!!!)
Stateless, immutable, single function -> it’s a function (ooohhhhh!!!!!)
Added Value: the singleton constructor will register the function in a catalog
that’s the magic functions can’t do
But the catalog must be a singleton too, and born before (ain’t that difficult?)
18. Carlo Pescio http://carlopescio.com http://eptacom.net
Commands & subsystem
Being realistic:
same command code in different susbsystems should be ok
Therefore: a command catalog for each subsystem
Therefore: the [concrete] command should know its own subsystem
it’s OK, it’s the opposite that we do not want (ss->cmd)
19. Code: simple enough
class Command
{
public:
virtual ~Command()
{
}
virtual void Process(
const char* payload) = 0;
};
template<class SS, class CMD> class
RegisteredCommand : public Command
{
protected:
RegisteredCommand()
{
CommandCatalog<SS::SID>::
RegisterCommand(CMD::CID, instance);
}
private:
// eager singleton - MUST be eager
static CMD instance;
};
template<class SS, class CMD> CMD
RegisteredCommand<SS,CMD>::instance;
CRTP
(2nd Idiomatic notion)
20. Carlo Pescio http://carlopescio.com http://eptacom.net
Code: simple enough
class StartEngineCMD : public
RegisteredCommand< EngineSS, StartEngineCMD >
{
public:
static const int CID = 2;
void Process(const char* payload) override;
private:
friend class RegisteredCommand< EngineSS, StartEngineCMD >;
StartEngineCMD();
};
22. Carlo Pescio http://carlopescio.com http://eptacom.net
A 3rd idiomatic notion
A command catalog is a stateful, semi-immutable lazy singleton
- Lazy: simplest way to solve the initialization order problem
commands are eagerly created before main is started,
the first command creates the catalog as well
- The catalog is read-only / immutable when the main is started
all mutations happen in a single thread before main is called
thread-safe, read-only access after that (don’t worry – live happy)
23. Code: again, overly simple
template< int SID > class CommandCatalog
{
public:
static void RegisterCommand(int CID, Command& c)
{
auto& r = Recipients();
assert(r.find(CID) == r.end());
std::pair< int, Command& > p(CID, c);
r.insert(p);
}
private:
static std::map< int, Command& >& Recipients()
{
// lazy singleton - MUST be lazy
static std::map< int, Command& > recipients;
return recipients;
}
};
// later
// static bool DeliverMessage(
// const Message& m)
25. Carlo Pescio http://carlopescio.com http://eptacom.net
Mocking commands?
Assuming it makes sense – depends on the application
sometimes mocking hardware resources is a better option
If you want a “test build” vs. a “standard build”
trivial, just define mock and std commands, use the makefile
If you want to choose at runtime
create both, register both, enable one [with a command]
one more template parameter will help
26. Carlo Pescio http://carlopescio.com http://eptacom.net
Rinse and repeat
- Subsystems are self-creating singleton[s] too
- Subsystems register themselves with a postman / catalog
no one needs to “know all the subsystems”
- The postman is a lazy singleton as well
- See the symmetry: Command<->CommandCatalog, Subsystem<->Postman
sort of, there is 1 catalog per subsystem, but ok
28. Carlo Pescio http://carlopescio.com http://eptacom.net
Subsystems responsibilities
- Defines its own address (SID, this is in the sample too)
- Owns exclusive HW resources (e.g. a RS485, some I/O, etc.)
- Usually offers some logic to its own commands
- Is usually stateful / mutable: mirrors the state of hw devices
29. Carlo Pescio http://carlopescio.com http://eptacom.net
A mutable singleton!
- In the sample code, it’s all synchronous, but in a real system, a SS will probably
have its own message queue and a thread. N SS could share 1 thread if reasonable.
- Commands belonging to a SS will be executed in the SS thread.
So even if they call back into the SS, it’s still single -threaded.
We never need to synchronize (except [maybe] the command queue).
- CMD1 in SS1 can send messages to SS2, using the Postman
So it’s also an internal communication channel.
- So, a subsystem is an actor (oooohhh).
- What about mocking?? (same as commands…)
30. Carlo Pescio http://carlopescio.com http://eptacom.net
A little more code
bool Postman::DeliverMessage(const Message& m)
{
auto r = Recipients();
auto i = r.find(m.SID());
if (i != r.end())
return i->second.OnIncomingMessage(m);
return false;
}
static bool DeliverMessage(const Message& m)
{
auto r = Recipients();
auto i = r.find(m.CID());
if (i != r.end())
{
i->second.Process(m.Payload());
return true;
}
return false;
}
31. Carlo Pescio http://carlopescio.com http://eptacom.net
Variations
Protocol: encoding, ack/nak, synchronous vs asynchronous answer, etc.
Threading: synchronous, 1 thread per SS, 1 thread * N SS, N thread * 1 SS
Queuing: selective coalescence or not.
Execution: 1 active command, N active commands, background activity
Substitution: Mocking commands, Activable commands, etc.
“Details”: splitting payload parsing and execution (stateful commands, cloning).
32. Carlo Pescio http://carlopescio.com http://eptacom.net
Why “a pattern language”
“Many patterns form a language”
Trying to generalize will turn this short code into the usual abstract monster
File Name Lines Statements Average Statements per Method
Command.h 12 3 0.0
CommandCatalog.h 41 20 4.0
Message.h 31 10 0.8
Postman.cpp 33 17 3.7
Postman.h 15 7 0.0
RegisteredCommand.h 18 7 1.0
RegisteredSubsystem.h 24 10 1.0
Subsystem.h 14 4 0.0
33. Carlo Pescio http://carlopescio.com http://eptacom.net
The abstract monster
- Policies everywhere
- Parameters everywhere
- N times longer to account for any possible variability
- Names far removed from domain terminology
- Steep learning curve
- Cross maintenance
VS.
understand the Pattern Language ad adapt on your system
34. Carlo Pescio http://carlopescio.com http://eptacom.net
PhysicsOfSoftware.com
Notes on Software Design, Chapter 12: Entanglement
http://www.carlopescio.com/2010/11/notes-on-software-design-chapter-12.html
Notes on Software Design, Chapter 13: On Change
http://www.carlopescio.com/2011/02/notes -on-software-design-chapter-14.html
Notes on Software Design, Chapter 14: the Enumeration Law
http://www.carlopescio.com/2011/02/notes -on-software-design-chapter-14.html
On Growth and Software (nCrafts, Paris, May 2016)
Video: http://videos.ncrafts.io/video/167699028
35. Thanks to the sponsors!
Italian C++ Conference 2017 #itCppCon17
36. Carlo Pescio http://carlopescio.com http://eptacom.net
Brain-Driven Design
Design your software by squeezing your brain, not by following trends
carlo.pescio@gmail.com