05 - Java. Collections Framework и GenericsRoman Brovko
Обзор стандартных коллекций и их реализации:
* Списки, стеки, очереди.
* Множества.
* Ассоциативные массивы.
Generics:
* Параметризация классов и методов
* Синтаксис и реализация в Java
05 - Java. Collections Framework и GenericsRoman Brovko
Обзор стандартных коллекций и их реализации:
* Списки, стеки, очереди.
* Множества.
* Ассоциативные массивы.
Generics:
* Параметризация классов и методов
* Синтаксис и реализация в Java
Продвинутое использование Celery — Александр КошелевYandex
Доклад будет интересен как тем, кто уже знаком с библиотекой для реализации очередей задач Celery, так и тем, кто только собирается её попробовать. Основные темы выступления:
- как устроена Celery;
- как перейти на альтернативные брокеры;
- как обеспечить эффективный доступ к ресурсам;
- как отслеживать работоспособность процессов Celery
JavaScript - мой основной язык программирования, но два года я была в “Java-JavaScript” иммиграции, а последние полгода провела со Swift. Теперь, возвращаясь к JavaScript, я часто сравниваю, как там у “них”.
Этот доклад о том, чего мне не хватает в JavaScript, и почему JavaScript разработчику следует путешествовать в другие языки.
Продвинутое использование Celery — Александр КошелевYandex
Доклад будет интересен как тем, кто уже знаком с библиотекой для реализации очередей задач Celery, так и тем, кто только собирается её попробовать. Основные темы выступления:
- как устроена Celery;
- как перейти на альтернативные брокеры;
- как обеспечить эффективный доступ к ресурсам;
- как отслеживать работоспособность процессов Celery
JavaScript - мой основной язык программирования, но два года я была в “Java-JavaScript” иммиграции, а последние полгода провела со Swift. Теперь, возвращаясь к JavaScript, я часто сравниваю, как там у “них”.
Этот доклад о том, чего мне не хватает в JavaScript, и почему JavaScript разработчику следует путешествовать в другие языки.
Валерий Чугреев, ИСЭРТ РАН — Архитектура MVC в контексте web-разработки — про...Dev_Party
Валерий Чугреев, ИСЭРТ РАН — Архитектура MVC в контексте web-разработки — проблемы и решения.
Конференция Dev Party (http://devparty.ru).
Вологда, 02.04.2016.
«MVVM в Swift», Александр Зимин, независимый iOS-разработчикMail.ru Group
Александр рассказал про использование паттерна MVVM в языке Swift. Были рассмотрены его отличия от MVC, что можно использовать уникального из Swift. И напоследок было продемонстрировано небольшое демо.
The 1-st lecture from the course "Java Core".
Chair of Information Net Technologies.
St-Petersburg State University Of Aerospace Instrumentation.
Russia
Similar to 08 - Java. Java-классы: взгляд изнутри (20)
The document provides instructions for extending a UDP server to handle additional commands for reading the state of GPIO pins connected to LEDs on a board. The UDP server extension should accept "read gpio<PORT> <PIN>" commands to check the status of LEDs connected to pins 13, 12, 14, and 15, and reply with the pin and state like "GPIOD.15=1". The ncat utility can be used as a UDP client to send commands to control the LEDs or get their status by communicating with ports 5678 and 1234 of the UDP server, respectively.
This document provides an agenda and overview of topics related to the transport layer and networking essentials. The agenda includes discussions of the transport layer, UDP overview, TCP communication process, the socket API, and tools and utilities. Specific topics that will be covered include the role and functions of the transport layer, UDP features and headers, TCP reliability mechanisms like connection establishment and termination, sequence numbers and acknowledgments, window sliding, and data loss/retransmission. The document also provides brief overviews and usage examples for common networking tools like ifconfig, nmcli, route, ping, traceroute, netstat, dig, ncat, nmap, tcpdump, and wireshark.
This document provides an overview of connecting the STM32F407x microcontroller on the GlobalLogic Embedded Starter Kit to Ethernet. It discusses the STM32F407x Ethernet interface, HAL Ethernet driver, Lightweight TCP/IP stack, and examples of implementing TCP client/server and an HTTP server. The KSZ8081RND PHY chip is used along with the RMII interface. The document also outlines configuring LwIP and developing a UDP server to control LEDs on the board via commands from a UDP client.
The document provides an agenda and overview of key topics related to networking essentials including the network layer, IPv4 and IPv6 packets and addresses, and network address translation (NAT). Specifically, it discusses network layer characteristics such as addressing, encapsulation, routing and de-encapsulation. It also examines IPv4 packet headers, fragmentation, and maximum transmission units. IPv6 is introduced as improving on IPv4 by providing increased address space and simplified packet handling. Network address translation is defined as a method for mapping an IP address space to overcome IPv4 address depletion.
This document provides an overview of networking concepts including network types, medium access control protocols, TCP/IP protocol suite, addressing, Ethernet frames, ARP, and standards organizations. It begins with an agenda that lists these topics and includes diagrams to illustrate CSMA/CD, the OSI model, TCP/IP encapsulation, and Ethernet encapsulation. Examples are provided for different network devices, addressing formats and protocols.
This document is a training presentation on I2C interface. It discusses understanding I2C, the internal structure of I2C modules, the I2C interface in an embedded starter kit schematic, using an I2C PWM LED controller, and using I2C in blocking mode. The individual task is to control LED brightness using I2C PWM outputs by modifying the duty cycle, frequency, and number of outputs.
The document describes a workshop for the GlobalLogic Embedded Starter Kit (GL ESK). It includes instructions for a "Hello World" project using the kit to blink an LED. It also provides guidance on additional exercises including controlling more LEDs with buttons, using interrupts to check buttons, and debugging techniques. The document recommends downloading documentation and sources from GitHub and provides information on the STM32F407 microcontroller and Discovery board used with the kit.
This document is a training module on using UART interfaces. It discusses UART fundamentals, the UART interface on an embedded starter kit, the internal structure of UART modules, and how to use UART in both polling and interrupt modes. Learners are assigned the tasks of modifying an existing UART code to control additional LEDs and print sensor values to a terminal using UART communication.
Bare metal training_04_adc_temp_sensorRoman Brovko
This document outlines the goals, theory, and practice of a training on using analog to digital converters (ADCs) in polling and interrupt modes. The training covers the internal structure of ADCs, using an on-board temperature sensor, reading voltage values from an external potentiometer, and reading multiple ADC channels. Trainees are assigned individual tasks like controlling LED brightness based on temperature sensor readings.
This document provides an overview of a training on timers and PWM for bare metal embedded systems. The goals are to learn clock control, generate 1Hz signals using delays and timers, and create PWM signals at predefined duty cycles. It explains clock control diagrams and settings, and provides code examples to generate a 1Hz signal using delays, use Timer4 to toggle a pin in an interrupt handler, and set up PWM on Timer4 Channel 3. Finally, it lists an individual task to control 4 LEDs with PWM using different channels and buttons to fade the LEDs in/out.
Bare metal training_02_le_ds_and_buttonsRoman Brovko
This document provides an overview of training materials for an embedded starter kit focused on bare metal programming of LEDs and buttons. The goals are to create firmware to control LEDs and read button presses, learn about the hardware operation of LEDs and buttons, and learn GPIO input/output and interrupt basics. It introduces GPIO configuration as digital I/O with pull-up/down resistors or analog, covers GPIO pin functionality, and discusses using interrupts to address the delay issues of polling button states in a main loop. The practice section has the learner set up a project to control an LED based on a button press via polling initially, then refactors to use interrupts to eliminate delays.
This document outlines a training for creating a "Hello World" firmware project for an embedded starter kit using the Keil IDE. The goals are to create an LED blinking firmware, learn the hardware basics of the starter kit, and learn how to create, build, flash and debug firmware projects. Trainees will go through adding LEDs to the project, implementing a custom blinking sequence, and stepping through the code using the debugger.
This document provides instructions for installing software prerequisites for a bare metal embedded training using a GlobalLogic starter kit. The instructions include downloading and installing: 1) An ST-Link driver to interface with the board; 2) Keil uVision IDE for embedded development; and 3) STM32 CubeMx for configuration. Completing these steps prepares the hardware and software for the trainings by setting up the development environment and debugger connection to the board.
The document discusses several topics related to advanced C language programming including:
1. Decomposing a program into multiple files by creating libraries and header files.
2. The structure of a software component including public header files, private header files, and library object files.
3. Techniques for building a program such as compilation, linking, and conditional compilation.
4. Reflection API
Reflection API — программный интерфейс для получения
информации об объектах и классах во время исполнения
программы
Пакет java.lang.reflect
Для каждого типа, в том числе примитивного, можно получить
описывающий его экземпляр класса Class
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 4 / 29
5. Reflection API
Возможности Reflection API
Получение списка конструкторов, методов и полей класса
Создание экземпляров класса
Вызов методов и чтение/запись полей, в том числе закрытых
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 5 / 29
6. Reflection API
Как получить Class
Получение класса по объекту:
Class c1 = object.getClass();
Получение класса через литерал:
Class c2 = String[].class;
Class c3 = int.class;
Загрузка класса по имени:
Class c4 = Class.forName("java.lang.Integer");
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 6 / 29
7. Reflection API
Как загрузить класс с диска
URL jarFileURL =
Paths.get("library.jar"). toUri (). toURL ();
ClassLoader classLoader =
new URLClassLoader(new URL[] {jarFileURL });
Class clazz = classLoader.loadClass(
"ru.csc.java2014.DemoClass");
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 7 / 29
8. Reflection API
Имя класса
int[] Object[] Foo.Bar
getName() [I [Ljava.lang.Object; Foo$Bar
getCanonicalName() int[] java.lang.Object[] Foo.Bar
getSimpleName() int[] Object[] Bar
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 8 / 29
9. Reflection API
Типы классов
boolean isPrimitive()
boolean isArray()
boolean isEnum()
boolean isInterface()
boolean isAnnotation()
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 9 / 29
10. Reflection API
Специфика массивов
if (clazz.isArray ()) {
System.out.println(
"Array of " + c.getComponentType ());
}
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 10 / 29
11. Reflection API
Специфика enum
if (clazz.isEnum ()) {
System.out.println("Enum of:");
for (Object e : clazz.getEnumConstants ()) {
System.out.println(e);
}
}
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 11 / 29
12. Reflection API
Конструкторы
Открытые конструкторы:
Constructor getConstructor(Class... types)
Constructor[] getConstructors()
Все конструкторы:
Constructor getDeclaredConstructor(Class... types)
Constructor[] getDeclaredConstructors()
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 12 / 29
13. Reflection API
Вызов конструктора
Constructor constructor =
clazz.getConstructor(String.class );
Object instance =
constructor.newInstance("Hello World!");
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 13 / 29
14. Reflection API
Методы
Открытые методы, в том числе унаследованные:
Method getMethod(String name, Class... types)
Method[] getMethods()
Все методы, но только из текущего класса:
Method getDeclaredMethod(String name, Class... types)
Method[] getDeclaredMethods()
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 14 / 29
15. Reflection API
Вызов метода
Method method =
clazz.getMethod("doSomething", int.class );
Object result =
method.invoke(instance , 42);
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 15 / 29
16. Reflection API
Поля
Открытые поля, в том числе унаследованные:
Field getField(String name)
Field[] getFields()
Все поля, но только из текущего класса:
Field getDeclaredField(String name)
Field[] getDeclaredFields()
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 16 / 29
17. Reflection API
Чтение/запись поля
Field field = clazz.getDeclaredField("x");
field.setAccessible(true );
Object value = field.get(instance );
field.set(instance , null );
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 17 / 29
18. Reflection API
Аннотации
Version version =
clazz.getAnnotation(Version.class );
if (version != null) {
System.out.println(version.value ());
System.out.println(version.date ());
}
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 18 / 29
19. Расположение объекта в памяти
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 19 / 29
20. Расположение объекта в памяти
Инструмент JOL
Демо
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 20 / 29
22. Байткод Java
Структура .class файла
Заголовок (CAFEBABE, версия формата)
Constant pool (числа, строки, имена классов, полей и методов)
Объявление класса (модификаторы, имя класса, имя суперкласса,
имена реализуемых интерфейсов)
Поля класса
Методы класса
Атрибуты класса (аннотации, debug info, . . . )
javap -v -p ru.csc.java2014.DemoClass
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 22 / 29
23. Байткод Java
Имена в байткоде
Никаких импортов, все имена полные
Имена классов: java/lang/String
Имена типов:
B, C, D, F, I, J, S, Z
Ljava/lang/Object;
[[I
Имена методов:
<init> ()V
<clinit> ()V
equals (Ljava/lang/Object;)Z
toString ()Ljava/lang/String;
sort ([III)V
Имена параметров и локальных переменных отсутствуют
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 23 / 29
24. Байткод Java
Исполняемый код
Состоит из простых инструкций (около 200)
Работает в рамках одного фрейма стека вызовов
Имеет локальный стек заданного размера, где и выполняет все
вычисления
Может обращаться к полям и методам объектов, а также к своим
аргументам и локальным переменным
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 24 / 29
28. Байткод Java
Зачем работать с байткодом?
Альтернативные языки для JVM
Статический и динамический анализ кода
Enterprise фреймворки
Библиотеки для mock’ов
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 28 / 29
29. Что сегодня узнали
Что такое Reflection API и какие возможности он предоставляет
Как узнать, сколько места занимает объект и как расположены
его поля в памяти
Как устроен байткод Java, и что это дает
Алексей Владыкин Java-классы: взгляд изнутри 27 октября 2014 29 / 29