This document discusses how to use three C++17 vocabulary types: std::optional, std::variant, and std::any. It begins with an introduction and overview of the types. It then provides examples and explanations of how to create, access, and manipulate values for each type. Key points covered include initialization, accessing contained values, performance characteristics, and common use cases.
Empty Base Class Optimisation, [[no_unique_address]] and other C++20 AttributesBartlomiej Filipek
Those are the slides from my presentation for our local C++ Cracow User Grup. This time I described what is empty base class optimisation, how it affects unique_ptr and also how can we simplify the code with C++20's new attribute: [[no_unique_address]].
The document provides an overview of C++17's std::filesystem library. It introduces the Path class for representing file system paths, the DirectoryEntry class for modeling directory entries, and DirectoryIterator for iterating over directories. It also summarizes key support functions for querying and modifying files and directories, handling permissions, and catching errors and exceptions. Examples are provided demonstrating how to get a file size, iterate over a directory, and monitor a directory for changes using std::filesystem.
The document provides an overview of new features in C++20, including small language and library improvements. Some key points summarized:
1. Aggregate initialization allows initialization of aggregates using designated initializers (e.g. {.a = 3, .c = 7}) and direct initialization syntax (e.g. Widget w(1,2)).
2. Structured bindings allow capturing initialized variables from aggregates into auto variables (e.g. auto [a,b] = getWidget()).
3. Lambdas can be used in more contexts like static/thread_local variables and allow capturing initialized variables. Templates see expanded use of generic lambdas, non-type template parameters, and class
The presentation shows major features of the new C++ standard (language and the library). The full list of new things is very broad, so I've categorized them to be easier to understand.
Антон Бикинеев, Writing good std::future< C++ >Sergey Platonov
В докладе Антон расскажет о грядущих мажорных изменениях языка, которые, не войдя в Стандарт 17-го года и оставшись в Technical Specifications, будут ждать своего мержа в 20-м, а также быть уже реализованными в некоторых компиляторах. Осветятся также минорные, уже одобренные фичи следующего Стандарта, как языковые, так и библиотечные. Антон расскажет об их целях, покажет методы использования, а также осветит некоторые гайдлайны и трики.
[C++ Korea] Effective Modern C++ Study, Item 11 - 13Chris Ohk
The document discusses various techniques in modern C++, including deleting implicitly declared functions, deleting function templates for certain types, overriding virtual functions consistently, using const_iterators to allow modifying non-const containers, and writing generic functions that work with both const and non-const containers by SFINAE-enabling calls to cbegin/cend.
[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
This document discusses how to use three C++17 vocabulary types: std::optional, std::variant, and std::any. It begins with an introduction and overview of the types. It then provides examples and explanations of how to create, access, and manipulate values for each type. Key points covered include initialization, accessing contained values, performance characteristics, and common use cases.
Empty Base Class Optimisation, [[no_unique_address]] and other C++20 AttributesBartlomiej Filipek
Those are the slides from my presentation for our local C++ Cracow User Grup. This time I described what is empty base class optimisation, how it affects unique_ptr and also how can we simplify the code with C++20's new attribute: [[no_unique_address]].
The document provides an overview of C++17's std::filesystem library. It introduces the Path class for representing file system paths, the DirectoryEntry class for modeling directory entries, and DirectoryIterator for iterating over directories. It also summarizes key support functions for querying and modifying files and directories, handling permissions, and catching errors and exceptions. Examples are provided demonstrating how to get a file size, iterate over a directory, and monitor a directory for changes using std::filesystem.
The document provides an overview of new features in C++20, including small language and library improvements. Some key points summarized:
1. Aggregate initialization allows initialization of aggregates using designated initializers (e.g. {.a = 3, .c = 7}) and direct initialization syntax (e.g. Widget w(1,2)).
2. Structured bindings allow capturing initialized variables from aggregates into auto variables (e.g. auto [a,b] = getWidget()).
3. Lambdas can be used in more contexts like static/thread_local variables and allow capturing initialized variables. Templates see expanded use of generic lambdas, non-type template parameters, and class
The presentation shows major features of the new C++ standard (language and the library). The full list of new things is very broad, so I've categorized them to be easier to understand.
Антон Бикинеев, Writing good std::future< C++ >Sergey Platonov
В докладе Антон расскажет о грядущих мажорных изменениях языка, которые, не войдя в Стандарт 17-го года и оставшись в Technical Specifications, будут ждать своего мержа в 20-м, а также быть уже реализованными в некоторых компиляторах. Осветятся также минорные, уже одобренные фичи следующего Стандарта, как языковые, так и библиотечные. Антон расскажет об их целях, покажет методы использования, а также осветит некоторые гайдлайны и трики.
[C++ Korea] Effective Modern C++ Study, Item 11 - 13Chris Ohk
The document discusses various techniques in modern C++, including deleting implicitly declared functions, deleting function templates for certain types, overriding virtual functions consistently, using const_iterators to allow modifying non-const containers, and writing generic functions that work with both const and non-const containers by SFINAE-enabling calls to cbegin/cend.
[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
2018 cosup-delete unused python code safely - englishJen Yee Hong
The talk is about doing cleanup and refactor for legacy Python code base in a safer way. I introduced several existing tools for this task and demonstrated how (surprisingly) Python ast module can also help in this case.
中文摘要:
不管是 open source 專案還是工作上,經過長時間開發累積,source code 內可能會殘留許多不再需要的 code,造成維護以及 refactor 的困難,也造成新手 trace code 時的障礙。
對 C/C++ 這類編譯式語言來說,開啟編譯器最佳化能自動清除 dead code,但對於 Python 這類動態語言,則沒有公認完美的方法。
本議程分享一些相關經驗,佐以利用 Python AST 的簡易自製工具,討論如何從較複雜的 python source tree 中,安全的清除不再需要的 code。
Code: https://github.com/PCMan/python-find-unused-func
C++11 introduced several new features for functions and lambdas including:
1. Lambda expressions that allow the definition of anonymous inline functions.
2. The std::function wrapper that allows functions and lambdas to be used interchangeably.
3. std::bind that binds arguments to function parameters for creating function objects.
These features improved support for functional programming patterns in C++.
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17LogeekNightUkraine
The document discusses polymorphism in C++, including static polymorphism through function overloading and templates, and dynamic polymorphism using virtual functions and inheritance. It explains key concepts like the virtual method table that allows dynamic dispatch at runtime. The document provides examples of polymorphism techniques like the curiously recurring template pattern and proper use of virtual destructors. It warns against invoking virtual functions from constructors due to the class hierarchy not being fully established yet.
The document is a tutorial on C++11 concurrency features such as asynchronous tasks, threads, promises, mutexes, and condition variables. It covers topics like spawning asynchronous tasks using std::async and std::thread, returning values from asynchronous tasks, passing parameters, handling exceptions, manually setting futures using std::promise and std::packaged_task, waiting for multiple futures, and using mutexes and lock guard templates for synchronization. Code examples are provided to illustrate the various concurrency features.
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
This document provides information about C++ classes and objects. It defines what a class is, noting that classes are like structures but with additional features such as data hiding and default private access. An object is defined as an instance of a class. The document discusses access specifiers like public, private, and protected. It also covers static variables and functions, constant functions, and friend functions/classes.
This document discusses various usability enhancements introduced in modern C++, including C++11/14/17. It covers topics such as auto type deduction, decltype, nullptr, range-based for loops, uniform initialization, lambda expressions, and more. The enhancements aim to improve code readability, reduce errors and increase developer productivity when programming in C++.
This document discusses C++11/14 enhancements including data types, literals, attributes, loops, constants, enumerations, typedefs, pointers, smart pointers, references, type inference, functions, and lambda expressions. It provides examples and explanations of new features in each category.
Дмитрий Нестерук, Паттерны проектирования в XXI векеSergey Platonov
The document discusses several design patterns including decorator, composite, specification, and builder patterns. It provides examples of implementing a simple string decorator to add split and length methods. It also shows a composite pattern example using neurons and layers. The specification pattern is demonstrated for flexible filtering of product objects. Finally, fluent and Groovy-style builders are explored for constructing HTML elements in a cleaner way.
The document discusses hacking the Go compiler by modifying various phases. The lexer phase scans source code and tokenizes it. The parser phase builds an abstract syntax tree from the tokens by making parser calls. Examples are given of modifying the lexer to accept emoji identifiers and adding a new operator by extending the parser phase. Helpful debugging functions are also outlined.
This document describes several modern C++ design patterns including Adapter, Composite, Specification, Builder, and Maybe Monad patterns. It provides code examples for each pattern to illustrate how they can be implemented in C++. For the Adapter pattern, it shows how to wrap a std::string to expose a split method. For Composite, it demonstrates connecting neurons and layers of neurons generically. The Specification pattern section covers filtering products based on criteria. Builder examples include fluent and Groovy-style builders for HTML. Finally, it introduces the Maybe Monad pattern for handling absent values through chained evaluations.
An introductory PowerPoint to understanding and applying the C++ programming language. Broken down into lessons covering:
Introduction: Definitions and the History of Programming
Lesson 1: Libraries, Variables and Types, Blocks and Namespaces, Functions
Lesson 2: If...Else Statements, For and While Loops, Scope
Exercise: Program a Gumball Game
Lesson 3: Classes and Objects, Pointers
The document discusses avoiding new and delete in modern C++ code by using smart pointers and containers provided by the standard library and third-party libraries. It provides examples of managing memory with new/delete in C and early C++ compared to modern approaches using classes, constructors, destructors, and smart pointers. The document also discusses specific cases where new and delete may still be needed, such as with intrusive reference counting objects and some GUI frameworks. Overall, it promotes using make functions like make_unique, make_shared, and containers by default to simplify memory management in C++.
The document summarizes new features in C++ 11 and C++ 14, including language features like auto variables, lambda functions, rvalue references, and move semantics. It discusses new library features like smart pointers, the concurrency library, and user-defined literals. The presentation covers status and compiler support, best practices for modern C++, and what to expect in upcoming standards like C++ 14 with further language and library improvements.
HKG15-207: Advanced Toolchain Usage Part 3
---------------------------------------------------
Speaker: Ryan Arnold, Maxim Kuvyrkov, Will Newton, Yvan Roux
Date: February 10, 2015
---------------------------------------------------
★ Session Summary ★
This session is a continuation of the Advanced Toolchain Usage Part 1 & 2 presentations given at LCU14. Parts 3 and 4 will cover a variety of topics, such as: Linker tips and tricks, adding symbol versioning interfaces to a system library, debugging the dynamic linker, debugging applications that use malloc, gcc attributes, manually constructing a backtrace on arm & Aarch64, how to add lightweight debugging to your program, how to use a signal handler appropriately, and TLS Models on Aarch64 and when to use them.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250788
Video: https://www.youtube.com/watch?v=EhNqFCN0YJ0
Etherpad: http://pad.linaro.org/p/hkg15-207
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Asynchronous operations are getting more and more popular. To the point that we are getting frameworks and environments revolving strictly around that concept. Boost.ASIO, Twisted and node.js are notable example. We will not explore that area. We will focus on techniques for making asynchronous more readable. We will present different currently used solutions. At the end we will introduce coroutines and explain the concept. We will show how these can be integrated with asynchronous code and what we benefit from using coroutines in asynchronous code.
The document discusses clang-tidy, which is a tool for statically analyzing C++ code and finding typical programming errors. It has over 200 built-in rules for checking adherence to coding guidelines and best practices. The document provides examples of running clang-tidy on sample code and detecting issues. It also discusses how to develop custom rules by traversing the AST and registering matchers. Overall, the document serves as an introduction to using clang-tidy for code reviews and improving code quality.
The document provides an overview of rvalue references and move semantics in C++, which allow avoiding unnecessary copying by allowing objects to be moved instead of copied in certain situations. It discusses the differences between lvalues and rvalues, the purpose of rvalue references, how move semantics and std::move work, and briefly covers forwarding references and perfect forwarding. The objective is to leave the reader with a high-level understanding of these C++11 features rather than detailed specifics.
The document provides an introduction to the C programming language, including its history and evolution. It discusses key elements of C programs like functions, variables, data types, comments, preprocessor directives, libraries and headers. It also covers pointers, arrays, passing command line arguments and standard header files in C. Examples of simple C programs are provided to illustrate various concepts.
Gor Nishanov, C++ Coroutines – a negative overhead abstractionSergey Platonov
C++ coroutines are one of the few major features that may land in C++17. We will look at the current standardization status, available experimental implementations and develop a small coroutine adapter over raw C networking APIs that will beat hand-crafted state machine in performance.
Basic c++ 11/14 for python programmersJen Yee Hong
A short list of some common python programming patterns and their C++ equivalents. This can help programmers learn C++ in a more efficient way if he or she already knows Python.
Part of this material is used for internal training of Appier Inc, one of the leading artificial intelligence company in Asia.
Thank Appier Inc. for allowing me to share this.
This document discusses common gateway interface (CGI) programming and server-side programming. It provides examples of CGI programs written in C to multiply two numbers submitted through an HTML form using GET and POST methods. It discusses how CGI works, including getting environment variables and user input. Some disadvantages of CGI include spawning new processes for each request and security issues. It suggests using server-side scripting languages like PHP for more efficient and secure server-side programming.
This document discusses how encryption performance and costs have improved over time due to new hardware, algorithms, and protocols. It analyzes the performance of AES-128-GCM, AES-256-GCM and ChaCha20-Poly1305 on CPUs from 2011 to 2013, showing significant throughput increases. It also discusses challenges in building secure systems, including backward compatibility issues, complex APIs, insecure defaults, and flaws in CBC mode and TLS protocol design. Finally, it presents opportunities like ChaCha20, DNS security methods, and opportunistic transport encryption to further improve security.
2018 cosup-delete unused python code safely - englishJen Yee Hong
The talk is about doing cleanup and refactor for legacy Python code base in a safer way. I introduced several existing tools for this task and demonstrated how (surprisingly) Python ast module can also help in this case.
中文摘要:
不管是 open source 專案還是工作上,經過長時間開發累積,source code 內可能會殘留許多不再需要的 code,造成維護以及 refactor 的困難,也造成新手 trace code 時的障礙。
對 C/C++ 這類編譯式語言來說,開啟編譯器最佳化能自動清除 dead code,但對於 Python 這類動態語言,則沒有公認完美的方法。
本議程分享一些相關經驗,佐以利用 Python AST 的簡易自製工具,討論如何從較複雜的 python source tree 中,安全的清除不再需要的 code。
Code: https://github.com/PCMan/python-find-unused-func
C++11 introduced several new features for functions and lambdas including:
1. Lambda expressions that allow the definition of anonymous inline functions.
2. The std::function wrapper that allows functions and lambdas to be used interchangeably.
3. std::bind that binds arguments to function parameters for creating function objects.
These features improved support for functional programming patterns in C++.
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17LogeekNightUkraine
The document discusses polymorphism in C++, including static polymorphism through function overloading and templates, and dynamic polymorphism using virtual functions and inheritance. It explains key concepts like the virtual method table that allows dynamic dispatch at runtime. The document provides examples of polymorphism techniques like the curiously recurring template pattern and proper use of virtual destructors. It warns against invoking virtual functions from constructors due to the class hierarchy not being fully established yet.
The document is a tutorial on C++11 concurrency features such as asynchronous tasks, threads, promises, mutexes, and condition variables. It covers topics like spawning asynchronous tasks using std::async and std::thread, returning values from asynchronous tasks, passing parameters, handling exceptions, manually setting futures using std::promise and std::packaged_task, waiting for multiple futures, and using mutexes and lock guard templates for synchronization. Code examples are provided to illustrate the various concurrency features.
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
This document provides information about C++ classes and objects. It defines what a class is, noting that classes are like structures but with additional features such as data hiding and default private access. An object is defined as an instance of a class. The document discusses access specifiers like public, private, and protected. It also covers static variables and functions, constant functions, and friend functions/classes.
This document discusses various usability enhancements introduced in modern C++, including C++11/14/17. It covers topics such as auto type deduction, decltype, nullptr, range-based for loops, uniform initialization, lambda expressions, and more. The enhancements aim to improve code readability, reduce errors and increase developer productivity when programming in C++.
This document discusses C++11/14 enhancements including data types, literals, attributes, loops, constants, enumerations, typedefs, pointers, smart pointers, references, type inference, functions, and lambda expressions. It provides examples and explanations of new features in each category.
Дмитрий Нестерук, Паттерны проектирования в XXI векеSergey Platonov
The document discusses several design patterns including decorator, composite, specification, and builder patterns. It provides examples of implementing a simple string decorator to add split and length methods. It also shows a composite pattern example using neurons and layers. The specification pattern is demonstrated for flexible filtering of product objects. Finally, fluent and Groovy-style builders are explored for constructing HTML elements in a cleaner way.
The document discusses hacking the Go compiler by modifying various phases. The lexer phase scans source code and tokenizes it. The parser phase builds an abstract syntax tree from the tokens by making parser calls. Examples are given of modifying the lexer to accept emoji identifiers and adding a new operator by extending the parser phase. Helpful debugging functions are also outlined.
This document describes several modern C++ design patterns including Adapter, Composite, Specification, Builder, and Maybe Monad patterns. It provides code examples for each pattern to illustrate how they can be implemented in C++. For the Adapter pattern, it shows how to wrap a std::string to expose a split method. For Composite, it demonstrates connecting neurons and layers of neurons generically. The Specification pattern section covers filtering products based on criteria. Builder examples include fluent and Groovy-style builders for HTML. Finally, it introduces the Maybe Monad pattern for handling absent values through chained evaluations.
An introductory PowerPoint to understanding and applying the C++ programming language. Broken down into lessons covering:
Introduction: Definitions and the History of Programming
Lesson 1: Libraries, Variables and Types, Blocks and Namespaces, Functions
Lesson 2: If...Else Statements, For and While Loops, Scope
Exercise: Program a Gumball Game
Lesson 3: Classes and Objects, Pointers
The document discusses avoiding new and delete in modern C++ code by using smart pointers and containers provided by the standard library and third-party libraries. It provides examples of managing memory with new/delete in C and early C++ compared to modern approaches using classes, constructors, destructors, and smart pointers. The document also discusses specific cases where new and delete may still be needed, such as with intrusive reference counting objects and some GUI frameworks. Overall, it promotes using make functions like make_unique, make_shared, and containers by default to simplify memory management in C++.
The document summarizes new features in C++ 11 and C++ 14, including language features like auto variables, lambda functions, rvalue references, and move semantics. It discusses new library features like smart pointers, the concurrency library, and user-defined literals. The presentation covers status and compiler support, best practices for modern C++, and what to expect in upcoming standards like C++ 14 with further language and library improvements.
HKG15-207: Advanced Toolchain Usage Part 3
---------------------------------------------------
Speaker: Ryan Arnold, Maxim Kuvyrkov, Will Newton, Yvan Roux
Date: February 10, 2015
---------------------------------------------------
★ Session Summary ★
This session is a continuation of the Advanced Toolchain Usage Part 1 & 2 presentations given at LCU14. Parts 3 and 4 will cover a variety of topics, such as: Linker tips and tricks, adding symbol versioning interfaces to a system library, debugging the dynamic linker, debugging applications that use malloc, gcc attributes, manually constructing a backtrace on arm & Aarch64, how to add lightweight debugging to your program, how to use a signal handler appropriately, and TLS Models on Aarch64 and when to use them.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250788
Video: https://www.youtube.com/watch?v=EhNqFCN0YJ0
Etherpad: http://pad.linaro.org/p/hkg15-207
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Asynchronous operations are getting more and more popular. To the point that we are getting frameworks and environments revolving strictly around that concept. Boost.ASIO, Twisted and node.js are notable example. We will not explore that area. We will focus on techniques for making asynchronous more readable. We will present different currently used solutions. At the end we will introduce coroutines and explain the concept. We will show how these can be integrated with asynchronous code and what we benefit from using coroutines in asynchronous code.
The document discusses clang-tidy, which is a tool for statically analyzing C++ code and finding typical programming errors. It has over 200 built-in rules for checking adherence to coding guidelines and best practices. The document provides examples of running clang-tidy on sample code and detecting issues. It also discusses how to develop custom rules by traversing the AST and registering matchers. Overall, the document serves as an introduction to using clang-tidy for code reviews and improving code quality.
The document provides an overview of rvalue references and move semantics in C++, which allow avoiding unnecessary copying by allowing objects to be moved instead of copied in certain situations. It discusses the differences between lvalues and rvalues, the purpose of rvalue references, how move semantics and std::move work, and briefly covers forwarding references and perfect forwarding. The objective is to leave the reader with a high-level understanding of these C++11 features rather than detailed specifics.
The document provides an introduction to the C programming language, including its history and evolution. It discusses key elements of C programs like functions, variables, data types, comments, preprocessor directives, libraries and headers. It also covers pointers, arrays, passing command line arguments and standard header files in C. Examples of simple C programs are provided to illustrate various concepts.
Gor Nishanov, C++ Coroutines – a negative overhead abstractionSergey Platonov
C++ coroutines are one of the few major features that may land in C++17. We will look at the current standardization status, available experimental implementations and develop a small coroutine adapter over raw C networking APIs that will beat hand-crafted state machine in performance.
Basic c++ 11/14 for python programmersJen Yee Hong
A short list of some common python programming patterns and their C++ equivalents. This can help programmers learn C++ in a more efficient way if he or she already knows Python.
Part of this material is used for internal training of Appier Inc, one of the leading artificial intelligence company in Asia.
Thank Appier Inc. for allowing me to share this.
This document discusses common gateway interface (CGI) programming and server-side programming. It provides examples of CGI programs written in C to multiply two numbers submitted through an HTML form using GET and POST methods. It discusses how CGI works, including getting environment variables and user input. Some disadvantages of CGI include spawning new processes for each request and security issues. It suggests using server-side scripting languages like PHP for more efficient and secure server-side programming.
This document discusses how encryption performance and costs have improved over time due to new hardware, algorithms, and protocols. It analyzes the performance of AES-128-GCM, AES-256-GCM and ChaCha20-Poly1305 on CPUs from 2011 to 2013, showing significant throughput increases. It also discusses challenges in building secure systems, including backward compatibility issues, complex APIs, insecure defaults, and flaws in CBC mode and TLS protocol design. Finally, it presents opportunities like ChaCha20, DNS security methods, and opportunistic transport encryption to further improve security.
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.
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/
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2PVS-Studio
The document summarizes analysis of the Haiku operating system using the PVS-Studio static analyzer. Various bugs and issues were detected, including: incorrect string handling, bad loops, improper use of variables with the same name, array overruns, unsafe memory handling, and other logical errors. The analyzer identified multiple areas for improvement to enhance code quality and eliminate potential bugs.
In most of our articles about project checks, we mention that bugs are found by the PVS-Studio static code analyzer. In certain cases – when dealing with projects of a complex structure – it is this particular analyzer that is needed. However, many developers will also appreciate its lightweight version, the CppCat analyzer. In this connection, we decided to use CppCat this time, when checking the TortoiseGit project.
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.
The document discusses exploiting a buffer overflow vulnerability in Internet Explorer's VML implementation (MS06-055) to execute arbitrary code. It describes overwriting the structured exception handler to gain control of the instruction pointer, using heap spraying to load a buffer in memory, and having the instruction pointer jump to the buffer to execute shellcode and spawn a command shell. Metasploit is introduced as an open-source framework for developing exploits.
This document discusses WebRTC development for both current and future applications. It provides an overview of WebRTC fundamentals including protocols like ICE, STUN, TURN, SDP, DTLS and SRTP. It also discusses building WebRTC services and considerations for quality and performance when developing real-time video applications using WebRTC.
RailswayCon 2010 - Dynamic Language VMsLourens Naudé
The document discusses Ruby virtual machines and optimizations. It covers topics like Ruby VM internals, system resources, Ruby optimizations like constant folding and inlining, object structures, classes and modules, method dispatch, garbage collection. The goal is to understand tools and techniques for building high performance Ruby applications.
C++ CoreHard Autumn 2018. Concurrency and Parallelism in C++17 and C++20/23 -...corehard_by
What do threads, atomic variables, mutexes, and conditional variables have in common? They are the basic building blocks of any concurrent application in C++, which are even for the experienced C++ programmers a big challenge. This massively changed with C++17 and change even more with C++20/23. What did we get with C++17, what can we hope for with C++20/23? With C++17, most of the standard template library algorithms are available in sequential, parallel, and vectorised variants. With the upcoming standards, we can look forward to executors, transactional memory, significantly improved futures and coroutines. To make it short. These are just the highlights from the concurrent and parallel perspective. Thus there is the hope that in the future C++ abstractions such as executors, transactional memory, futures and coroutines are used and that threads, atomic variables, mutexes and condition variables are just implementation details.
Presto is an open source distributed SQL query engine for running interactive analytic queries against data sources of all sizes ranging from gigabytes to petabytes. It is written in Java and uses a pluggable backend. Presto is fast due to code generation and runtime compilation techniques. It provides a library and framework for building distributed services and fast Java collections. Plugins allow Presto to connect to different data sources like Hive, Cassandra, MongoDB and more.
This document discusses compilers, libraries, and optimization. It notes that compilers must handle complex processor behaviors and target systems different than build systems. Libraries have contradictory requirements like unknown usage but high performance. Examples show how a simple loop can be optimized from linear 1979 code to parallelized 2014 code using SIMD instructions. It also discusses concepts like store forwarding and how libraries must consider multiplatform differences. The document ends by noting the company is hiring.
Rust — это современный, практический, быстрый и безопасный язык программирования. Некоторые говорят, что Rust — это как C++, если бы его писал человек, знающий Haskell.
Система типов Rust решает главную проблему C++ — небезопасность. C++ очень легко сделать ошибки, которые приведут к поломкам (например, use after free). Rust позволяет писать безопасный код, сохраняя при этом выразительность и околонулевые накладные расходы C++. В докладе будут подробно описаны механизмы языка, которые контролируют безопасность программы.
Хотя в данный момент Rust ещё не подходит для использования в продакшне, его всё равно стоит изучать. Во-первых, потому что это очень интересный подход к программированию, а во-вторых, потому что через несколько лет для разработки требовательных к ресурсам программ будет необходим именно Rust или другой похожий инструмент.
Node has captured the attention of early adopters by clearly differentiating itself as being asynchronous from the ground up while remaining accessible. Now that server side JavaScript is at the cutting edge of the asynchronous, real time web, it is in a much better position to establish itself as the go to language for also making synchronous, CRUD webapps and gain a stronger foothold on the server.
This talk covers the current state of server side JavaScript beyond Node. It introduces Common Node, a synchronous CommonJS compatibility layer using node-fibers which bridges the gap between the different platforms. We look into Common Node's internals, compare its performance to that of other implementations such as RingoJS and go through some ideal use cases.
Story of static code analyzer developmentAndrey Karpov
The document discusses the history and development of static code analyzers. It describes how early tools used regular expressions that were ineffective for complex code analysis. Modern static analyzers overcome these limitations through techniques like type inference, data flow analysis, symbolic execution, and pattern-based analysis. They also leverage method annotations and a mixture of analysis approaches. While machine learning is hyped, static analysis remains very challenging due to the complexity of code and rapid language evolution.
"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.
The document discusses exploiting a use-after-free vulnerability on Android devices to gain remote code execution. It explains how the vulnerability works, analyzing the crash to gain control of the R0 register and needing to control heap memory to redirect execution to shellcode. The goal is to populate the heap to control where shellcode is placed, hijack control flow to it by overwriting a pointer, and thereby execute arbitrary code on the device.
This document provides an introduction and overview of embedded C programming for microcontrollers. It discusses C basics, the compilation process, C extensions for microcontrollers, variables, data types, statements, operators, functions, loops, decision making, interrupts, in-line assembly, and provides an example temperature display case study.
Similar to Let's talks about string operations in C++17 (20)
Hyperledger Besu 빨리 따라하기 (Private Networks)wonyong hwang
Hyperledger Besu의 Private Networks에서 진행하는 실습입니다. 주요 내용은 공식 문서인https://besu.hyperledger.org/private-networks/tutorials 의 내용에서 발췌하였으며, Privacy Enabled Network와 Permissioned Network까지 다루고 있습니다.
This is a training session at Hyperledger Besu's Private Networks, with the main content excerpts from the official document besu.hyperledger.org/private-networks/tutorials and even covers the Private Enabled and Permitted Networks.
Orca: Nocode Graphical Editor for Container OrchestrationPedro J. Molina
Tool demo on CEDI/SISTEDES/JISBD2024 at A Coruña, Spain. 2024.06.18
"Orca: Nocode Graphical Editor for Container Orchestration"
by Pedro J. Molina PhD. from Metadev
The Role of DevOps in Digital Transformation.pdfmohitd6
DevOps plays a crucial role in driving digital transformation by fostering a collaborative culture between development and operations teams. This approach enhances the speed and efficiency of software delivery, ensuring quicker deployment of new features and updates. DevOps practices like continuous integration and continuous delivery (CI/CD) streamline workflows, reduce manual errors, and increase the overall reliability of software systems. By leveraging automation and monitoring tools, organizations can improve system stability, enhance customer experiences, and maintain a competitive edge. Ultimately, DevOps is pivotal in enabling businesses to innovate rapidly, respond to market changes, and achieve their digital transformation goals.
Superpower Your Apache Kafka Applications Development with Complementary Open...Paul Brebner
Kafka Summit talk (Bangalore, India, May 2, 2024, https://events.bizzabo.com/573863/agenda/session/1300469 )
Many Apache Kafka use cases take advantage of Kafka’s ability to integrate multiple heterogeneous systems for stream processing and real-time machine learning scenarios. But Kafka also exists in a rich ecosystem of related but complementary stream processing technologies and tools, particularly from the open-source community. In this talk, we’ll take you on a tour of a selection of complementary tools that can make Kafka even more powerful. We’ll focus on tools for stream processing and querying, streaming machine learning, stream visibility and observation, stream meta-data, stream visualisation, stream development including testing and the use of Generative AI and LLMs, and stream performance and scalability. By the end you will have a good idea of the types of Kafka “superhero” tools that exist, which are my favourites (and what superpowers they have), and how they combine to save your Kafka applications development universe from swamploads of data stagnation monsters!
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsOnePlan Solutions
Clinical operations professionals encounter unique challenges. Balancing regulatory requirements, tight timelines, and the need for cross-functional collaboration can create significant internal pressures. Our upcoming webinar will introduce key strategies and tools to streamline and enhance clinical development processes, helping you overcome these challenges.
Hands-on with Apache Druid: Installation & Data Ingestion StepsservicesNitor
Supercharge your analytics workflow with https://bityl.co/Qcuk Apache Druid's real-time capabilities and seamless Kafka integration. Learn about it in just 14 steps.
Folding Cheat Sheet #6 - sixth in a seriesPhilip Schwarz
Left and right folds and tail recursion.
Errata: there are some errors on slide 4. See here for a corrected versionsof the deck:
https://speakerdeck.com/philipschwarz/folding-cheat-sheet-number-6
https://fpilluminated.com/deck/227
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...kalichargn70th171
Visual testing plays a vital role in ensuring that software products meet the aesthetic requirements specified by clients in functional and non-functional specifications. In today's highly competitive digital landscape, users expect a seamless and visually appealing online experience. Visual testing, also known as automated UI testing or visual regression testing, verifies the accuracy of the visual elements that users interact with.
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Paul Brebner
Closing talk for the Performance Engineering track at Community Over Code EU (Bratislava, Slovakia, June 5 2024) https://eu.communityovercode.org/sessions/2024/why-apache-kafka-clusters-are-like-galaxies-and-other-cosmic-kafka-quandaries-explored/ Instaclustr (now part of NetApp) manages 100s of Apache Kafka clusters of many different sizes, for a variety of use cases and customers. For the last 7 years I’ve been focused outwardly on exploring Kafka application development challenges, but recently I decided to look inward and see what I could discover about the performance, scalability and resource characteristics of the Kafka clusters themselves. Using a suite of Performance Engineering techniques, I will reveal some surprising discoveries about cosmic Kafka mysteries in our data centres, related to: cluster sizes and distribution (using Zipf’s Law), horizontal vs. vertical scalability, and predicting Kafka performance using metrics, modelling and regression techniques. These insights are relevant to Kafka developers and operators.
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.
What’s new in VictoriaMetrics - Q2 2024 UpdateVictoriaMetrics
These slides were presented during the virtual VictoriaMetrics User Meetup for Q2 2024.
Topics covered:
1. VictoriaMetrics development strategy
* Prioritize bug fixing over new features
* Prioritize security, usability and reliability over new features
* Provide good practices for using existing features, as many of them are overlooked or misused by users
2. New releases in Q2
3. Updates in LTS releases
Security fixes:
● SECURITY: upgrade Go builder from Go1.22.2 to Go1.22.4
● SECURITY: upgrade base docker image (Alpine)
Bugfixes:
● vmui
● vmalert
● vmagent
● vmauth
● vmbackupmanager
4. New Features
* Support SRV URLs in vmagent, vmalert, vmauth
* vmagent: aggregation and relabeling
* vmagent: Global aggregation and relabeling
* vmagent: global aggregation and relabeling
* Stream aggregation
- Add rate_sum aggregation output
- Add rate_avg aggregation output
- Reduce the number of allocated objects in heap during deduplication and aggregation up to 5 times! The change reduces the CPU usage.
* Vultr service discovery
* vmauth: backend TLS setup
5. Let's Encrypt support
All the VictoriaMetrics Enterprise components support automatic issuing of TLS certificates for public HTTPS server via Let’s Encrypt service: https://docs.victoriametrics.com/#automatic-issuing-of-tls-certificates
6. Performance optimizations
● vmagent: reduce CPU usage when sharding among remote storage systems is enabled
● vmalert: reduce CPU usage when evaluating high number of alerting and recording rules.
● vmalert: speed up retrieving rules files from object storages by skipping unchanged objects during reloading.
7. VictoriaMetrics k8s operator
● Add new status.updateStatus field to the all objects with pods. It helps to track rollout updates properly.
● Add more context to the log messages. It must greatly improve debugging process and log quality.
● Changee error handling for reconcile. Operator sends Events into kubernetes API, if any error happened during object reconcile.
See changes at https://github.com/VictoriaMetrics/operator/releases
8. Helm charts: charts/victoria-metrics-distributed
This chart sets up multiple VictoriaMetrics cluster instances on multiple Availability Zones:
● Improved reliability
● Faster read queries
● Easy maintenance
9. Other Updates
● Dashboards and alerting rules updates
● vmui interface improvements and bugfixes
● Security updates
● Add release images built from scratch image. Such images could be more
preferable for using in environments with higher security standards
● Many minor bugfixes and improvements
● See more at https://docs.victoriametrics.com/changelog/
Also check the new VictoriaLogs PlayGround https://play-vmlogs.victoriametrics.com/
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.
Stork Product Overview: An AI-Powered Autonomous Delivery FleetVince Scalabrino
Imagine a world where instead of blue and brown trucks dropping parcels on our porches, a buzzing drove of drones delivered our goods. Now imagine those drones are controlled by 3 purpose-built AI designed to ensure all packages were delivered as quickly and as economically as possible That's what Stork is all about.
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Let's talks about string operations in C++17
1. LET'S TALK ABOUT STRING
OPERATIONS IN C++17
string_view, searchers and conversion routines
Bartłomiej Filipek, bfilipek.com18th September 2018
2. About me
See my coding blog at:
www.bfilipek.com
11y+ experience
Currently @Xara.com
Text related features for advanced
document editors
Somehow addicted to C++
Xara Cloud Demo
C++17 In Detail
25. Searchers
• default_searcher
• boyer_moore_searcher
• boyer_moore_horspool_searcher
template< class ForwardIt1, class ForwardIt2 >
ForwardIt1 search(ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last);
template<class ForwardIterator, class Searcher>
ForwardIterator search(ForwardIterator first, ForwardIterator last, const Searcher& searcher);
26. Searchers
P: word
T: There would have been a time for such a word
^
|
word
https://www.youtube.com/watch?v=4Xyhb72LCX4
Bad character rule
Good Suffix Rule
http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/bmen.htm
http://www.cs.jhu.edu/~langmea/resources/lecture_notes/boyer_moore.pdf
http://www-igm.univ-mlv.fr/%7Elecroq/string/node18.html
27. Searchers – some code
std::string testString = "Hello Super World";
std::string needle = "Super";
auto it = search(testString.begin(), testString.end(),
boyer_moore_searcher(needle.begin(), needle.end()));
if (it == testString.end())
cout << "The string " << needle << " not foundn";
29. Summary
string_view – good potential, with some risks!
Conversion routines – finally!
Searchers – nice addition!
Editor's Notes
How many copies?
The first one is for str.
• The second one is for the second argument in StartFromWordStr - the argument is const
string& so since we pass const char* it will create a new string.
• The third one comes from substr which returns a new string.
• Then we might also have another copy or two - as the object is returned from the function.
But usually, the compiler can optimise and elide the copies (especially since C++17 when Copy
Elision became mandatory in that case).
• If the string is short, then there might be no heap allocation as Small String Optimisation¹.
What else?
When matching and finding a mismatch we know that “u” doesn’t occur in “word” so we can skip the next two positions.
When matching and finding a mismatch we know that “u” doesn’t occur in “word” so we can skip the next two positions.