This document provides an overview of advanced object-oriented programming concepts in Java, including method overloading, inheritance, abstract classes, interfaces, polymorphism, packages, and visibility modifiers. It includes examples and explanations of how to implement these concepts through code samples. The document also discusses using comments and JavaDoc to document code.
Fundamentals of computer system and Programming EC-105NUST Stuff
This document provides an overview of the EC-102 Computer System and Programming course. It includes information about the course title, code, semester, required textbooks and references. The document also outlines the course contents which cover topics like computer organization, programming, data types, operators, selection statements, repetition structures, functions, arrays, pointers and more. Finally, it lists the course learning outcomes and some policies like no assignment deadline extensions and penalties for plagiarism.
This document provides an overview of advanced object-oriented programming concepts in Java, including method overloading, inheritance, abstract classes, interfaces, polymorphism, packages, and visibility modifiers. It includes examples and explanations of how to implement these concepts through code samples. The document also discusses using comments and JavaDoc to document code.
Fundamentals of computer system and Programming EC-105NUST Stuff
This document provides an overview of the EC-102 Computer System and Programming course. It includes information about the course title, code, semester, required textbooks and references. The document also outlines the course contents which cover topics like computer organization, programming, data types, operators, selection statements, repetition structures, functions, arrays, pointers and more. Finally, it lists the course learning outcomes and some policies like no assignment deadline extensions and penalties for plagiarism.
Object Oriented Programming involves analyzing a problem to identify classes, their responsibilities, and relationships. It aims to make software more modular, manageable, predictable, reusable, and maintainable. The analysis phase identifies what the software should do, design identifies classes and relationships, and implementation involves programming, testing and deployment. Key concepts include classes, objects, encapsulation, inheritance, polymorphism and relationships like dependency, aggregation and inheritance.
Cloud Computing in Systems Programming CurriculumSteven Miller
This document discusses proposed changes to a Systems Programming course (CS252) to incorporate cloud computing concepts. The course currently focuses on C/C++, operating systems, and networking. The proposal is to have students write mobile and web applications using HTML5, JavaScript frameworks, and cloud services on Bluemix. Students would work in groups on semester-long projects developing games, social apps, or other programs that run in browsers and mobile devices while calling APIs hosted on Bluemix. This aims to teach new generation web development skills and how applications can leverage cloud computing technologies.
Ever heard of the Law of Demeter? How about the Liskov Substitution Principle? This talk introduces key object-oriented laws and principles currently used in our field and provides guidance for their use when building applications on the .NET platform.
This document summarizes a talk given by Tyler Treat about using simple solutions for complex distributed systems problems. Some key points:
- Distributed systems are inherently asynchronous and unreliable, but many try to build them as if they are synchronous.
- Exact delivery guarantees are expensive and impossible at scale. Replayable and idempotent delivery are better alternatives.
- NATS is a simple, high performance, and highly available messaging system that embraces asynchronous communication.
- Workiva uses NATS as a messaging backplane between microservices for pub/sub, RPC, and load balancing. Running a local NATS daemon per VM improves performance.
The document provides an introduction to system administration. It discusses what system administration entails, including managing computers, hardware, software, operating systems, applications, networks, and users. It outlines the duties of a system administrator, such as applying updates, installing/configuring hardware/software, managing user accounts, performing backups and troubleshooting issues. It also describes the duties of a datacenter engineer, which involves server installation, monitoring, maintenance and issue resolution. The document discusses different types of administrators and users as well as operating systems that support system administration like Windows, Unix and Linux.
This document discusses advance object-oriented programming concepts. It covers procedural programming vs object-oriented programming, features of OOP like classes, objects, inheritance and polymorphism. It also discusses OOP design principles like single responsibility, open-closed, Liskov substitution, dependency inversion and interface segregation principles. Examples are provided to explain concepts like inheritance, polymorphism, abstraction and interfaces. The document provides a comprehensive overview of key OOP concepts and design principles.
The document provides guidance on system administration. It discusses key roles like system administrator, network administrator, and security administrator. It outlines important skills like operating systems, applications, hardware/software troubleshooting, and programming languages. Duties involve installing and maintaining systems, applying updates, managing users, auditing systems, and more. The document also discusses Linux distributions, desktop environments, and the steps to install Ubuntu Linux.
This short document thanks Marek and provides two blog URLs related to Csharp and SharePoint by Agni Campos. It focuses on technical topics as the blogs are named after Csharp and SharePoint.
This document discusses various topics related to synchronization in distributed systems, including distributed algorithms, logical clocks, global state, and leader election. It provides definitions and examples of key synchronization concepts such as coordination, synchronization, and determining global states. Examples of logical clock algorithms like Lamport clocks and vector clocks are provided. Challenges around clock synchronization and calculating global system states are also summarized.
From Mainframe to Microservice: An Introduction to Distributed SystemsTyler Treat
An introductory overview of distributed systems—what they are and why they're difficult to build. We explore fundamental ideas and practical concepts in distributed programming. What is the CAP theorem? What is distributed consensus? What are CRDTs? We also look at options for solving the split-brain problem while considering the trade-off of high availability as well as options for scaling shared data.
Systems programming involves developing programs that interface computer systems with users and other programs. These programs include compilers, interpreters, and I/O routines. Systems programs must handle unpredictable events like errors and coordinate asynchronously executing programs. The document introduces concepts like syntax, semantics, domains, semantic gaps, and language processors like compilers and interpreters. It discusses how programming languages bridge gaps between application and execution domains.
Distributed Systems: scalability and high availabilityRenato Lucindo
Distributed systems use multiple computers that interact over a network to achieve common goals like scalability and high availability. They work to handle increasing loads by either scaling up individual nodes or scaling out by adding more nodes. However, distributed systems face challenges in maintaining consistency, availability, and partition tolerance as defined by the CAP theorem. Techniques like caching, queues, logging, and understanding failure modes can help address these challenges.
- InfoQ is a news and community site for software developers with 750,000 unique visitors per month publishing content in 4 languages.
- It posts content from QCon conferences including news, articles, presentations, interviews and books to empower software development through spreading knowledge and innovation.
- QCon conferences are practitioner-driven and designed for influencers of change and innovation, connecting them and catalyzing innovation, and have been attended by over 12,000 delegates since 2007 across 9 cities worldwide.
System administration involves tasks like maintaining computer systems and networks, setting up user accounts, monitoring performance and security, updating software, and troubleshooting issues. It requires broad technical knowledge as well as skills in areas like communication, problem solving, and planning for future needs of systems and users. While computer systems and the roles of system administrators have become more complex over time, the core goals remain ensuring systems and networks are operational, secure, and meeting the needs of users.
Distributed systems allow independent computers to appear as a single coherent system by connecting them through a middleware layer. They provide advantages like increased reliability, scalability, and sharing of resources. Key goals of distributed systems include resource sharing, openness, transparency, and concurrency. Common types are distributed computing systems, distributed information systems, and distributed pervasive systems.
Object Oriented Programming involves analyzing a problem to identify classes, their responsibilities, and relationships. It aims to make software more modular, manageable, predictable, reusable, and maintainable. The analysis phase identifies what the software should do, design identifies classes and relationships, and implementation involves programming, testing and deployment. Key concepts include classes, objects, encapsulation, inheritance, polymorphism and relationships like dependency, aggregation and inheritance.
Cloud Computing in Systems Programming CurriculumSteven Miller
This document discusses proposed changes to a Systems Programming course (CS252) to incorporate cloud computing concepts. The course currently focuses on C/C++, operating systems, and networking. The proposal is to have students write mobile and web applications using HTML5, JavaScript frameworks, and cloud services on Bluemix. Students would work in groups on semester-long projects developing games, social apps, or other programs that run in browsers and mobile devices while calling APIs hosted on Bluemix. This aims to teach new generation web development skills and how applications can leverage cloud computing technologies.
Ever heard of the Law of Demeter? How about the Liskov Substitution Principle? This talk introduces key object-oriented laws and principles currently used in our field and provides guidance for their use when building applications on the .NET platform.
This document summarizes a talk given by Tyler Treat about using simple solutions for complex distributed systems problems. Some key points:
- Distributed systems are inherently asynchronous and unreliable, but many try to build them as if they are synchronous.
- Exact delivery guarantees are expensive and impossible at scale. Replayable and idempotent delivery are better alternatives.
- NATS is a simple, high performance, and highly available messaging system that embraces asynchronous communication.
- Workiva uses NATS as a messaging backplane between microservices for pub/sub, RPC, and load balancing. Running a local NATS daemon per VM improves performance.
The document provides an introduction to system administration. It discusses what system administration entails, including managing computers, hardware, software, operating systems, applications, networks, and users. It outlines the duties of a system administrator, such as applying updates, installing/configuring hardware/software, managing user accounts, performing backups and troubleshooting issues. It also describes the duties of a datacenter engineer, which involves server installation, monitoring, maintenance and issue resolution. The document discusses different types of administrators and users as well as operating systems that support system administration like Windows, Unix and Linux.
This document discusses advance object-oriented programming concepts. It covers procedural programming vs object-oriented programming, features of OOP like classes, objects, inheritance and polymorphism. It also discusses OOP design principles like single responsibility, open-closed, Liskov substitution, dependency inversion and interface segregation principles. Examples are provided to explain concepts like inheritance, polymorphism, abstraction and interfaces. The document provides a comprehensive overview of key OOP concepts and design principles.
The document provides guidance on system administration. It discusses key roles like system administrator, network administrator, and security administrator. It outlines important skills like operating systems, applications, hardware/software troubleshooting, and programming languages. Duties involve installing and maintaining systems, applying updates, managing users, auditing systems, and more. The document also discusses Linux distributions, desktop environments, and the steps to install Ubuntu Linux.
This short document thanks Marek and provides two blog URLs related to Csharp and SharePoint by Agni Campos. It focuses on technical topics as the blogs are named after Csharp and SharePoint.
This document discusses various topics related to synchronization in distributed systems, including distributed algorithms, logical clocks, global state, and leader election. It provides definitions and examples of key synchronization concepts such as coordination, synchronization, and determining global states. Examples of logical clock algorithms like Lamport clocks and vector clocks are provided. Challenges around clock synchronization and calculating global system states are also summarized.
From Mainframe to Microservice: An Introduction to Distributed SystemsTyler Treat
An introductory overview of distributed systems—what they are and why they're difficult to build. We explore fundamental ideas and practical concepts in distributed programming. What is the CAP theorem? What is distributed consensus? What are CRDTs? We also look at options for solving the split-brain problem while considering the trade-off of high availability as well as options for scaling shared data.
Systems programming involves developing programs that interface computer systems with users and other programs. These programs include compilers, interpreters, and I/O routines. Systems programs must handle unpredictable events like errors and coordinate asynchronously executing programs. The document introduces concepts like syntax, semantics, domains, semantic gaps, and language processors like compilers and interpreters. It discusses how programming languages bridge gaps between application and execution domains.
Distributed Systems: scalability and high availabilityRenato Lucindo
Distributed systems use multiple computers that interact over a network to achieve common goals like scalability and high availability. They work to handle increasing loads by either scaling up individual nodes or scaling out by adding more nodes. However, distributed systems face challenges in maintaining consistency, availability, and partition tolerance as defined by the CAP theorem. Techniques like caching, queues, logging, and understanding failure modes can help address these challenges.
- InfoQ is a news and community site for software developers with 750,000 unique visitors per month publishing content in 4 languages.
- It posts content from QCon conferences including news, articles, presentations, interviews and books to empower software development through spreading knowledge and innovation.
- QCon conferences are practitioner-driven and designed for influencers of change and innovation, connecting them and catalyzing innovation, and have been attended by over 12,000 delegates since 2007 across 9 cities worldwide.
System administration involves tasks like maintaining computer systems and networks, setting up user accounts, monitoring performance and security, updating software, and troubleshooting issues. It requires broad technical knowledge as well as skills in areas like communication, problem solving, and planning for future needs of systems and users. While computer systems and the roles of system administrators have become more complex over time, the core goals remain ensuring systems and networks are operational, secure, and meeting the needs of users.
Distributed systems allow independent computers to appear as a single coherent system by connecting them through a middleware layer. They provide advantages like increased reliability, scalability, and sharing of resources. Key goals of distributed systems include resource sharing, openness, transparency, and concurrency. Common types are distributed computing systems, distributed information systems, and distributed pervasive systems.
1. .NET Framework & C#
module 1. Огляд платформи
Andrey Gladky
KspDevelop@gmail.co
m 1
2. В цьому уроці ви:
взнаєте про платформу .NET і мову C#;
познайомитесь з базовим синтаксисом мови;
взнаєте про змінні, типи і операції над ними;
взнаєте про приведення типів в C#;
взнаєте про літерали;
взнаєте про розгалуження і цикли;
отримаєте базові знання про об’єкти і класи;
створите най простішу програму
2
Andrey Gladky
KspDevelop@gmail.com
11. Змінні
Змінна – логічна комірка
Змінна зберігає інформацію
Має визначений тип
Види:
• Типи значень
• Типи посилань
11
Andrey Gladky
KspDevelop@gmail.com
12. Типи значень
Структури
• Числові типи
• Символьні типи
• Логічні типи
• Користувацькі структури
• Перерахування
12
Andrey Gladky
KspDevelop@gmail.com
15. Типи даних для чисел з плаваючою
комою
Andrey Gladky
KspDevelop@gmail.com 15
16. Основні типи значень
16
Тип Опис
bool Логічний оператор. Може приймати значення “істина” (true) і “хибне”
(false).
byte Займає в пам’яті один байт. Може зберігати в себе число в діапазоні 0-254
char Зберігає в себе один текстовий символ.
double Тип з плаваючою комою подвійної точності. Приймає значення в діапазоні
±5.0 × 10-324 - ±1.7 × 10308, має точність 15, 16 знаків після коми.
enum Тип перерахування. Визначається користувачем. Містить в собі задану
кількість різних значень, які потім можуть приймати змінні цього типу.
float Число з плаваючою комою. Приймає значення в діапазоні ±1.5 × 10-45 - ±3.4
× 1038, має точність 7 знаків після коми.
int Ціле число. Може приймати значення в діапазоні -2 147 483 648 - 2 147 483
647.
struct Структура – тип даних, який може зберігати в собі змінні, методи,
конструктори, тобто володіє всі властивостями об’єкта, однак являється
типом значення.
Andrey Gladky
KspDevelop@gmail.com
17. Типи посилань
17
Змінна 1
Змінна 3
Змінна 2Значення 1
Значення 2
Значення 3
Значення 4
Значення 5
Значення 6
Andrey Gladky
KspDevelop@gmail.co
m
18. Символьні типи
Тип даних char використовується для представлення
символьної інформації у форматі Unicode
Деякі корисні методи
Andrey Gladky
KspDevelop@gmail.co
m 18
20. Інші типи даних
Серед вище перерахованих типів даних в .Net Framework
передбачені такі типи як object i string.
Тип даних string (.Net Class: System.String) представляє
собою колекцію Unicode символів.
Клас String містить сукупність наступних
статичних методів:
• Compare – порівнює два рядки передані в якості
аргументів;
• CompareOrdinal -- порівнює два рядки передані в якості
аргументів з урахуванням регістру;
• Concat – повертає результат об’єднання масиву рядків;
• Copy – створює новий екземпляр рядка;
• Equals – порівнює значення двох рядків;
• IsNullOrEmpty -- визначає являється рядок пустим або
еквівалентним Null.
Andrey Gladky
KspDevelop@gmail.co
m 20
21. Нестандартні методи
• Clone – повертає посилання на новий екземпляр рядка;
• Contains – визначає чи містить поточний рядок вказане
в параметрах значення;
• CopyTo – копіює поточний рядок у вказаний масив
символів;
• EndsWith – визначає чи закінчується поточний рядок
вказаним значенням;
• Insert – вставляє під рядок у вказану позицію в поточний
рядок;
• Remove – видаляє з поточного рядка всі входження
вказаного під рядка;
• Replace – замінює вказаний під рядок новим під рядком;
• Split – ділить рядок на масив рядків, основуючись на
переданому масиві розділювачів(сепароторів);
Andrey Gladky
KspDevelop@gmail.co
m 21
22. • StartsWith – визначає чи починається поточний рядок з
вказаного під рядка;
• Substring – повертає вказаний під рядок поточного рядка;
• ToLower – переводить поточний рядок в нижній регістр;
• ToUpper – переводить рядок в верхній регістр;
• Trim – видаляє пробільні символи з обох боків;
• TrimEnd – видаляє пробіли в кінці рядка;
• TrimStart – видаляє пробіли на початку рядка
Andrey Gladky
KspDevelop@gmail.com 22
23. Тип object
Тип даних object (.NET Class: System.Object)
являється базовим для всіх типів даних і має 5
методів:
• ToString ;
• GetType;
• Equals;
• ReferenceEquals;
• GetHashCode.
Andrey Gladky
KspDevelop@gmail.co
m 23
25. Операції над змінними
Присвоєння (=)
Арифметичні операції (+, -, *, /)
• Комбіновані (+=, -=, *=, /=)
Логічні операції
Andrey Gladky
KspDevelop@gmail.com 25
26. Логічні операції
Операція Опис
|| Логічне “або”. Повертає true , якщо хоча б один із операндів
дорівнює true.
&& Логічне “і”. Повертає true лише тоді, коли всі операнди
дорівнюють true, інакше повертає false
== Операція порівняння на рівність. Порівнює дві змінні одного
типу і повертає true, якщо вони рівні.
!= Операція порівняння на нерівність. Порівнює дві змінні одного
типу і повертає true, якщо вони нерівні.
> Операція порівняння “більше”. Порівнює дві змінні одного типу і
повертає true, якщо ліва більша правої.
< Операція порівняння “менше”. Порівнює дві змінні одного типу і
повертає true, якщо ліва менша правої.
>= Операція порівняння “більше дорівнює”. Порівнює дві змінні
одного типу і повертає true, якщо ліва більша або рівна правій.
<= Операція порівняння “менше дорівнює”. Порівнює дві змінні
одного типу і повертає true, якщо ліва менша або рівна правій.
Andrey Gladky
KspDevelop@gmail.com 26
27. Приведення типів
Автоматичне (не явне) приведення типів відбувається при
наступних умовах:
два типи сумісні
діапазон представлення чисел цільового типу більший, ніж у вихідного типу
Явне приведення не сумісних типів
Роль класу System.Convert()
Andrey Gladky
KspDevelop@gmail.com 27
(цільовий_тип) вираз
byte sum =
Convert.ToByte(var1 + var2)
31. Overflow і underflow
Ключові слова:
• checked
• unchecked
Andrey Gladky
KspDevelop@gmail.co
m 31
32. Літерали в C#
Літерали – це фіксовані значення, які представленні
в зрозумілій формі. Всі літерали мають мати тип.
Для явної специфікацій типу даних, літералу в С#
передбачені спеціальні суфікси:
об’явлення з суфіксом “L” буде мати тип long;
з суфіксом “F” буде мати тип float;
з суфіксом “D” буде мати тип double;
з суфіксом “M” буде мати тип decimal;
суфікс “U” робить число без знаковим.
Andrey Gladky
KspDevelop@gmail.com 32
34. Літерали як керуючі символи
Використовується для форматування тексту
Andrey Gladky
KspDevelop@gmail.co
m 34
Літерал Дія
a Звуковий сигнал
b Повернення на одну позицію
f Перехід на початок наступної сторінки
n Новий рядок
r Повернення каретки
t Горизонтальна табуляція
v Вертикальна табуляція
0 Нуль-символ (символ кінця рядка)
’ Одинарні лапки
” Подвійні лапки
Зворотній слеш
35. Умовні оператори
Виконують або одну або іншу дію, в залежності від
умови
Види
• if-else
• switch
Andrey Gladky
KspDevelop@gmail.co
m 35
37. if-else
Починається з if
Умова в дужках
Умова рівна true – виконуємо блок if
Умова рівна false – виконуємо блок else
Декілька дій заключають в {i}
Andrey Gladky
KspDevelop@gmail.com 37
38. switch
Синтаксис:
Andrey Gladky
KspDevelop@gmail.com 38
С# Сенс
switch (умова)
{
case [варіант 1]:
[вираз 1]
break;
case [варіант 2]:
case [варіант 3]:
[вираз 2]
break;
default:
[вираз 3]
break;
}
вибрати (умова) з
{
значення [варіант 1]:
[вираз 1]
стоп;
значення [варіант 2]:
значення [варіант 3]:
[вираз 2]
стоп;
[нічого з попереднього]:
[вираз 3]
стоп;
}
39. switch
Починається з switch
Умова в дужках (і) – будь яка змінна
Варіанти починаються з case
Можна об’єднати варіанти
Після кожного варіанту – brake
Дія за замовчуванням – default
Andrey Gladky
KspDevelop@gmail.com 39
40. Цикли
Використовуються для циклічного повторення
послідовності дій
Види:
• for
• foreach
• while
Andrey Gladky
KspDevelop@gmail.com 40
41. Цикл for
Andrey Gladky
KspDevelop@gmail.com 41
[операція 1] – 1 раз на початку
[умова] – перевірка значення лічильника
[тіло циклу] – виконується n-раз поки умова циклу
істина
[операція 2] – після кожної ітерації циклу
continue – для переривання і продовження
break – для дострокового виходу з циклу
Застерігайтесь зациклювання
for ([операція 1]; [умова]; [операція 2])
{
[тіло циклу]
}
42. Цикл foreach
Цикл foreach служить для циклічного звернення до
елементів колекції, що представляє собою групу
об’єктів.
Andrey Gladky
KspDevelop@gmail.com 42
foreach (тип ім’я_змінної_цикла in колекція)
{
[тіло циклу]
}
43. Цикл while
Виконується поки умова істина
Виконається хоча б один раз
Andrey Gladky
KspDevelop@gmail.com 43
while (умова)
{
[вираз тіла циклу]
}
do
{
[вираз тіла циклу]
}
while (умова);
44. Класи і об’єкти
ООП – основа .Net Framework
Об’єкт екземпляр класу
Весь функціонал програми – класи і об’єкти
Клас:
• Методи
• Властивості
• Події
Рівні видимості:
• public
• protected
• private
Andrey Gladky
KspDevelop@gmail.com 44
45. Простір імен
Сукупність класів
Зручні для групування
Використовуйте using для підключення просторів
імен
Основа – System
Andrey Gladky
KspDevelop@gmail.com 45
46. Завдання
Розробити консольний додаток:
◦ Запитати ім’я користувача і пароль (зберегти у відповідних
змінних)
◦ Для чотирьох місяців ввести прибуток компанії (місяць -
дохід)
◦ Посортувати рахунки по зростанню
◦ Ще раз запитати ім’я користувача і пароль
◦ Якщо введені дані вірні, вивести на консоль сортований
список доходів відповідно до місяця
◦ По завершенню вивести середнє значення доходу
Andrey Gladky
KspDevelop@gmail.com 46