This document discusses C++ template metaprogramming. It explains that templates provide a Turing complete computation subsystem that runs during compilation. Template parameters can be types or non-type values like integers. Techniques like specialization, partial specialization, and recursion allow templates to perform complex type computations and manipulations at compile-time. The Boost Type Traits and MPL libraries provide many useful metafunctions for querying and transforming types. SFINAE and enable_if/disable_if allow selecting appropriate function templates based on type properties.
This is the accompanying presentation for a session I conducted on Iterators and Iterables. You can find more details at https://www.meetup.com/Hyderabad-Python-Meetup-Group/events/244304532/
Memory management is one of the most fundamental and important aspect for any computer programming language. In the dynamic memory allocation, the memory is allocated to a variable or program at the run time.
Utah Code Camp, Spring 2016. http://utahcodecamp.com In this presentation I describe modern C++. Modern C++ assumes features introduced in the C++11/14 standard. An overview of the new features is presented and some idioms for mdoern C++ based on those features are presented.
Many times you might have wondered about all the complex and strange syntaxes of functions, variables and pointers in c. But these declarations are not as complex as it looks at first. When you know where to look and how to look, reading these syntaxes would become a piece of cake. Just see this presentation and you will find it very easy to read all the complexities in c.
This is the accompanying presentation for a session I conducted on Iterators and Iterables. You can find more details at https://www.meetup.com/Hyderabad-Python-Meetup-Group/events/244304532/
Memory management is one of the most fundamental and important aspect for any computer programming language. In the dynamic memory allocation, the memory is allocated to a variable or program at the run time.
Utah Code Camp, Spring 2016. http://utahcodecamp.com In this presentation I describe modern C++. Modern C++ assumes features introduced in the C++11/14 standard. An overview of the new features is presented and some idioms for mdoern C++ based on those features are presented.
Many times you might have wondered about all the complex and strange syntaxes of functions, variables and pointers in c. But these declarations are not as complex as it looks at first. When you know where to look and how to look, reading these syntaxes would become a piece of cake. Just see this presentation and you will find it very easy to read all the complexities in c.
This presentation is from Code::Dive conference. It is all about metaprogramming in C++ - it covers the history, current status, and future directions.
Гостевая лекция Института биоинформатики. Подробнее: http://bioinformaticsinstitute.ru/lectures/1218
Несмотря на несерьезное название, на лекции разговор пойдет о важной проблеме в работе биоинформатика, почти любая реальная задача которого связана с обработкой и анализом больших данных. И решить задачу нужно не только правильно, но и эффективно. Процесс решения можно условно разделить на две части: «придумать», как решать, и «обучить» этому компьютер. И на лекции речь пойдет именно об эффективном «обучении».
Наивно реализованные алгоритмы работают неприемлемо долго, когда дело доходит до гигабайтов реальных данных. От биоинформатика уже требуются не просто базовые навыки программирования, но и знание технических нюансов. И даже у профессионального программиста уйдет немало времени, например, чтобы выгодно использовать возможности Hadoop при работе с Big Data. Так можно ли современному ученому обойтись без тщательного изучения кучи языков, библиотек и фреймворков и сосредоточиться именно на решении?
This presentation by Denys Petrov (Senior Software Engineer, Consultant, GlobalLogic, Kharkiv) was delivered at GlobalLogic Kharkiv C++ Workshop #1 on September 14, 2019.
In this talk were covered:
- Historical development of basic C ++ template syntax.
- Use template syntax capabilities to introduce compile-time introspection and reflection.
- Browse existing SFINAE libraries and implement your own.
Conference materials: https://www.globallogic.com/ua/events/kharkiv-cpp-workshop/
Templates
Generic Programming with Templates
Need for Templates
Definition of class Templates
Normal Function Templates
Over Loading of Template Function
Bubble Sort Using Function Templates
Difference Between Templates and Macros
Linked Lists with Templates
Exception Handling
Principles of Exception Handling
The Keywords try throw and catch
Multiple Catch Statements
Specifying Exceptions
Скомпилировалось — значит работает. К сожалению это выражение не про typescript. Кажется, что количество рантайм ошибок спровоцированных несоответствием типов должно стать меньше, однако компилятор ts не помогает разработчику писать качественный код, а наоборот поощряет использование грязных хаков. Филипп Сапронов рассказывает, как прекратить войну с компилятором и писать более надёжный код, используя всю мощь системы типов. Доклад будет интересен тем, кому ts кажется простым или наоборот сложным, а также тем, кто хочет научится понимать код тайпингов таких библиотек как lodash.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
In the ever-evolving landscape of technology, enterprise software development is undergoing a significant transformation. Traditional coding methods are being challenged by innovative no-code solutions, which promise to streamline and democratize the software development process.
This shift is particularly impactful for enterprises, which require robust, scalable, and efficient software to manage their operations. In this article, we will explore the various facets of enterprise software development with no-code solutions, examining their benefits, challenges, and the future potential they hold.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Understanding Nidhi Software Pricing: A Quick Guide 🌟
Choosing the right software is vital for Nidhi companies to streamline operations. Our latest presentation covers Nidhi software pricing, key factors, costs, and negotiation tips.
📊 What You’ll Learn:
Key factors influencing Nidhi software price
Understanding the true cost beyond the initial price
Tips for negotiating the best deal
Affordable and customizable pricing options with Vector Nidhi Software
🔗 Learn more at: www.vectornidhisoftware.com/software-for-nidhi-company/
#NidhiSoftwarePrice #NidhiSoftware #VectorNidhi
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
2. Template type computations
Templates provide a Turing complete
computation subsystem – that runs during
compilation.
This capability was not entirely consciously
designed.
Erwin Unruh found this somewhat
accidentally ~ early 90s.
3. Templates
Compile time entities completely evaluated
by the compiler, based on arguments passed.
std::vector<int> nums; // std::vector<int> unrelated
std::vector<std::string> names; // to std::vector<std::string>
template <typenameT> class Foo; // declaration
template <typenameT> class Foo { … }; // definition
Foo<int> foonum; // Foo<int> is specialization
4. Non-type template parameters
Templates can have non-type parameters:
template <typename T, int N>
struct array {
T data[N];
….
}
Non-type args are compile time constants.
array<int, 10> arr; // array of 10 ints
sizeof is evaluated at compile time.
int arr[sizeof(int)]; // array of 4* ints
5. Embedded types
Typedefs inside a class / class template.
template <typename T>
struct add_const {
typedef const T type;
};
add_const<int>::type ci; // const int
6. Embedded constants
Enums inside a class / class template.
template <int M, int N> struct add {
enum { value = M + N }
}
int array[add<10, 20>::value];
7. Branching: specializations
Specialize for specific types.
template <typename T>
struct Foo { … }; // default impl
template <>
struct Foo<int> { … }; // int-specific
Applicable to function templates too.
12. Applying the techniques
Remove levels of indirection:
template <typename T>
struct deref
{ typedef T type; };
template <typename T> // partial
struct deref<T*> { // specialization
typedef typename deref<T>::type type;
}
Called as:
deref<int*****>::type x; // x is int
13. Boost Type Traits
A header-only library to query and
manipulate types at compile time.
Lots of trait metafunctions.
#include <boost/type_traits.hpp>
typedef int* intptr;
assert(boost::is_ptr<intptr>::value);
struct Foo {int a; void *b; float c; };
assert(boost::is_pod<Foo>::value);
14. SFINAE
Compiler tries to resolve function calls to a
unique overload, or unique template with
appropriate arguments.
Multiple templates may be candidates but a
unique one must survive.
All candidates instantiated.
Those that fail instantiation eliminated. Not
An Error if a single candidate survives.
15. SFINAE & enable_if
Exploit SFINAE to resolve to apt template.
boost::enable_if
#include <boost/utility/enable_if.hpp>
boost::enable_if<true, T>::type x; // T
boost::enable_if<false, T>::type y; //!def
boost::disable_if (opposite of enable_if).
16. SFINAE & enable_if (contd.)
Serialize arbitrary types:
#include <boost/utility/enable_if.hpp>
typedef vector<char> buffer_t;
template <typename T>
buffer_t serialize(const T&);
Need a fast version for POD types and
generic version for non-POD types.
template <typename T>
enable_if<is_pod<T>, vector<char>>::type
serialize(const T&) {…} // pod version
// Use disable_if for the non-POD version
17. Metafunctions
Metafunction: a class or class template taking
only type parameters, with a single
embedded typedef.
All the Boost type traits are metafunctions.
Boost TMP Library: library of metafunctions.
Provides means of composing and generating
metafunctions from simpler metafunctions.
18. Boost TMP Library
Metafunctions need to be combined:
#include <boost/type_traits.hpp>
template <typename T> void foo(T obj) {
if (boost::is_pointer<T>::value ||
boost::is_array<T>::value)
{ … }
else { … }
}
19. Boost TMP Library (contd.)
How to make another metafunction that OR’s
two type traits.
#include <boost/mpl/or.hpp>
#include <boost/type_traits.hpp>
template <typename T> void foo(T obj) {
if (boost::mpl::or_<
boost::is_pointer<T>::value
, boost::is_array<T>::value
>::value)
{ … }
else { … }
}
21. Thank you!
Q & A
Book: Modern C++ Design – Andrei
Alexandrescu
Book: Advanced C++ Template
Metaprogramming – Davide di Gennaro
Book: C++ Template Metaprogramming –
Dave Abrahams, Aleksey Gurtovoy