Templates allow functions and classes to work with different data types. Templates are used when code needs to work with multiple types but the exact types are not yet known. Template syntax allows functions and classes to be written in a generic way that can accept different types as arguments that are specified when the template is used. The Standard Template Library (STL) makes extensive use of templates to provide container, iterator, and algorithm classes and functions that work on different data types.
Mobile apps are programs designed to run on mobile devices like smartphones and tablets. There are three main types - native apps written for a specific platform, web apps that run in a mobile browser, and hybrid apps that are native apps with a web view component. Native apps have direct access to device features but must be developed for each platform separately, while web apps can be used across platforms but have limited features. Popular mobile platforms include Android, iOS, and Windows Phone, each with their own programming languages, SDKs, and IDEs for app development. Mobile UIs are optimized for touchscreens and mobility with gestures, simple designs, and standard interface elements.
The document discusses relational databases and SQL. It describes how data is stored in tables with rows and columns, and how a primary key ensures each row is unique. It also explains how to use SQL commands to define the database structure, manipulate the data by inserting, selecting, updating, deleting rows, and join tables together through foreign keys.
Qt Creator is a free, open-source IDE that provides a full development cycle for Qt applications. It includes tools for designing user interfaces, debugging, code editing, and project management. Qt uses signals and slots for communication between QObjects, which allows for asynchronous execution and easy management of connections. The parent-child relationship in Qt handles object ownership, drawing of child widgets, and ensures child objects are removed when their parent is destroyed.
"How we optimized our product without paid solutions", Dmytro NemeshFwdays
油
The story of how we refused third-party DevOps services and took over all services ourselves. In the process, we made a complete revision of the infrastructure, added new monitoring and profiling tools on production. Action algorithms were built based on tools: Graylog, Grafana, influxDB, Pyroscope, Prometheus. As a result, the utilization of resources decreased by two times, and responses to key APIs were accelerated. During the talk, I'll cover what problems we found, how exactly we improved the metrics, and how we got to swoole.
Templates allow functions and classes to work with different data types. Templates are used when code needs to work with multiple types but the exact types are not yet known. Template syntax allows functions and classes to be written in a generic way that can accept different types as arguments that are specified when the template is used. The Standard Template Library (STL) makes extensive use of templates to provide container, iterator, and algorithm classes and functions that work on different data types.
Mobile apps are programs designed to run on mobile devices like smartphones and tablets. There are three main types - native apps written for a specific platform, web apps that run in a mobile browser, and hybrid apps that are native apps with a web view component. Native apps have direct access to device features but must be developed for each platform separately, while web apps can be used across platforms but have limited features. Popular mobile platforms include Android, iOS, and Windows Phone, each with their own programming languages, SDKs, and IDEs for app development. Mobile UIs are optimized for touchscreens and mobility with gestures, simple designs, and standard interface elements.
The document discusses relational databases and SQL. It describes how data is stored in tables with rows and columns, and how a primary key ensures each row is unique. It also explains how to use SQL commands to define the database structure, manipulate the data by inserting, selecting, updating, deleting rows, and join tables together through foreign keys.
Qt Creator is a free, open-source IDE that provides a full development cycle for Qt applications. It includes tools for designing user interfaces, debugging, code editing, and project management. Qt uses signals and slots for communication between QObjects, which allows for asynchronous execution and easy management of connections. The parent-child relationship in Qt handles object ownership, drawing of child widgets, and ensures child objects are removed when their parent is destroyed.
"How we optimized our product without paid solutions", Dmytro NemeshFwdays
油
The story of how we refused third-party DevOps services and took over all services ourselves. In the process, we made a complete revision of the infrastructure, added new monitoring and profiling tools on production. Action algorithms were built based on tools: Graylog, Grafana, influxDB, Pyroscope, Prometheus. As a result, the utilization of resources decreased by two times, and responses to key APIs were accelerated. During the talk, I'll cover what problems we found, how exactly we improved the metrics, and how we got to swoole.
"Black Monday: The Story of 5.5 Hours of Downtime", Dmytro DziubenkoFwdays
油
We will explore the most significant incident in our product's history. We'll discuss the causes that led to the failure, how our team responded, and the measures we took to prevent future incidents. Special attention will be paid to identifying the root cause of the incident and the role of the VACUUM mechanism in PostgreSQL.
This document provides an overview of advanced C# concepts, including:
- C# can be used to create various types of applications like console apps, Windows forms, web services, and ASP.NET MVC apps.
- Assemblies are deployment units that contain code and metadata. They can be EXEs or DLLs.
- Types in C# can contain fields, methods, properties, and events. Methods are not virtual by default. Access modifiers include private, protected, internal, and public.
- Objects are allocated in memory and cleaned up through constructors, finalizers, and the garbage collector. Exceptions provide a way to handle errors.
This document discusses iterators and custom iteration in .NET. It explains that data structures know how to iterate themselves by default, but sometimes additional ways of iteration are needed. The iterator pattern provides a nice abstraction for defining custom ways to iterate over data. Iterators are implemented using yield return, which allows iteration to be lazy and only occur when the sequence is iterated. LINQ takes this further by allowing declarative specification of queries over data using keywords like select, where, orderby etc. This avoids explicitly writing iteration code and makes queries more readable and reusable.
The document discusses problems with imperative code and how functional programming ideas in C# can help address these problems. It introduces delegates as a way to treat code as data by storing functions in variables and passing them as parameters. This allows separating logic from execution through higher-order functions like mapping and filtering collections. Lambdas and closures make code more concise. Together these techniques help write less, more reusable code with fewer bugs.
The document summarizes key classes in the C# standard library including generics, extension methods, Math, DateTime, Regex, collections, Nullable<T>, Path, DriveInfo, Directory, File, encodings, streams, and serialization/deserialization. It provides code examples and links to Microsoft documentation for each topic.
37. Data race
int count = 0;
for (int i = 0; i < data.Length; i++)
{
var task = Task.Factory.StartNew(() =>
{
count++; Not atomic!
});
tasks.Add(task);
}
Task.WaitAll(tasks.ToArray());
38. Preemption
Thread A
reg = read count (1) Thread B
reg = read count (1)
inc reg (2)
write reg to count (2)
inc reg (2)
write reg to count (2)
39. 亠仆仆 1 interlocked
int count = 0;
for (int i = 0; i < data.Length; i++)
{
var task = Task.Factory.StartNew(() =>
{
Atomic,
Interlocked.Increment(ref count);
Flushes caches
});
tasks.Add(task);
}
Task.WaitAll(tasks.ToArray());
40. 亠仆仆 2 locking (critical section)
int count = 0;
object syncRoot = new object();
for (int i = 0; i < data.Length; i++)
{
var task = Task.Factory.StartNew(() =>
{
lock (syncRoot) Other threads
{ cannot acquire
held lock
count++;
}
});
tasks.Add(task);
}
Task.WaitAll(tasks.ToArray());
42. Parallel.For() and ForEach()
舒弍仍仂从, 亟仂从亳 于 亠舒 仆亠 于亳从仂仆舒ム
Parallel.For(0, data.Length, i =>
{ 仄仂亢仍亳于 亰仂弍亳亳
Break, 仗亠亠亟舒于亳 state
ProcessItem(data, i);
});
Parallel.ForEach(data, value =>
{
ProcessItem(value);
});
43. Parallel LINQ (PLINQ)
var result =
from value in data.AsParallel()
where value % 2 == 0
let cube = Math.Pow(value, 3)
let processed = ProcessItem(value)
select new { Cube = cube, Result = processed };
parallelResult.ToArray();
亳从仂仆舒仆仆 仗仂仆亠