Спросите любого программиста и он честно вам ответит, что 90% процентов его времени уходит на поиск ошибок. Подпишусь под этим и я, сменивший за долгие годы множество языков и фреймворков. Действительно, "человеку свойственно ошибаться". Так что же делать, если из человека это свойство не выбить? Как сократить это бездарно потраченное время?
Тот же программист вам и ответ: "отлаживать, конечно". Это искуство сродни магии, доступно всем и покоряется немногим. Но к счастью, помимо проверенной временем практики "вставь сюда print" к услугам питонистов целый зоопарк инструментов.
В этом докладе я постараюсь обобщить самые частые практики отладки, описать их плюсы/минусы и как они соотносятся с Python. Кроме этого, мы совершим обзорный экскурс по экосистеме и посмотрим, чем можно помочь себе в этой нелегкой борьбе. Для особенных эстетов мы рассмотрим техники получения информации из уже запущенного кода. Buckle up!
======
Ссылки
======
Python Debugger Uncovered
https://www.youtube.com/watch?v=2sEPipctTxw
How I built a power debugger out of the standard library and
things I found on the internet
https://www.youtube.com/watch?v=g8kF9tuYZ6s
Architecture of Open Source Applications: GDB
http://www.aosabook.org/en/gdb.html
Advanced Python Debugging Techniques Using GDB
https://www.youtube.com/watch?v=rB9rPdMRxIA
pdb – Interactive Debugger
https://pymotw.com/2/pdb/
bdb — Debugger framework
https://docs.python.org/2/library/bdb.html
Слайды с одноименного доклада на IT Global Meetup 2015, прошедшего в Санкт-Петербурге 6 июля.
Тезисы:
* Контроль за качеством кода - это необходимая процедура при работе нескольких человек в одной команде над продуктом из более чем сотни строк. Зачем это нужно? Каждый пишет код по-своему, ожидает понимания от остальных участников команды, но в жизни этого не происходит.
* Недостатки разнобоя в стиле написанного кода: увеличивается время ревью, усложняется внесение правок кем-либо кроме автора кода, увеличивается вероятность пропустить глазами ошибку.
* Основные шаги к решению этой проблемы: создание единого свода правил по оформлению кода (style guide), согласование процедуры разрешения конфликтных ситуаций относительно разночтений этих правил, устранение человеческого фактора в процессе оценки через автоматизацию.
* Что из экосистемы Питона может помочь? При составлении style guide можно взять за основу PEP8 и PEP257, дополнив их принятыми в команде конвенциями (какие кавычки использовать для строк и докстрингов, и т.д. и т.п.). Автоматизировать проверки можно как с помощью уже готовых утилит (pep8, flake8, pylint), так и написав свои с помощью встроенного в язык инструментария (модули ast, tokenizer, сторонние библиотеки для работы с кодом).
* Где производить проверки? Есть несколько возможных этапов:
- IDE разработчика
- Локальная VCS (working copy)
- Общая VCS
- Сервер Continous Integration.
В идеале проверки должны быть на каждом этапе, но при этом как можно меньше затруднять обычный рабочий процесс. Здесь стоит задуматься, какая комбинация из этих этапов лучше всего впишется в стиль разработчки команды.
* Если же нет достаточных ресурсов или проект находится
Иван Кочуркин. Теория и практика парсинга формальных языковMskDotNet Community
В докладе рассказывается об инструментах и практиках парсинга формальных языков: как исходного кода, так и собственных предметно-ориентированных (DSL). О том, какие бывают парсеры и проблемы при их использовании. Доклад повествует как о базовых вещах: о токенах, деревьях разбора, абстрактных синтаксических деревьях (AST), так и о продвинутых: о методах обработки препроцессорных директив и восстановления от ошибок, о парсинге островных, нечувствительных к регистру языков и фрагментов кода. Помимо парсинга в докладе затрагивается тема обработки древовидных структур. Материал доклада основан на практических задачах и акцентирован на технологиях ANTLR и Roslyn.
Eirik Solheims presentasjon fra Record-prosjektets fagseminar 2. Oktober 2009.
Presentasjonen i denne formen duger ikke til mye annet enn en repetisjon for de som var der. Mesteparten av innholdet i mine presentasjoner ligger i det jeg sier og den vinklingen jeg velger i forhold til publikum.
Спросите любого программиста и он честно вам ответит, что 90% процентов его времени уходит на поиск ошибок. Подпишусь под этим и я, сменивший за долгие годы множество языков и фреймворков. Действительно, "человеку свойственно ошибаться". Так что же делать, если из человека это свойство не выбить? Как сократить это бездарно потраченное время?
Тот же программист вам и ответ: "отлаживать, конечно". Это искуство сродни магии, доступно всем и покоряется немногим. Но к счастью, помимо проверенной временем практики "вставь сюда print" к услугам питонистов целый зоопарк инструментов.
В этом докладе я постараюсь обобщить самые частые практики отладки, описать их плюсы/минусы и как они соотносятся с Python. Кроме этого, мы совершим обзорный экскурс по экосистеме и посмотрим, чем можно помочь себе в этой нелегкой борьбе. Для особенных эстетов мы рассмотрим техники получения информации из уже запущенного кода. Buckle up!
======
Ссылки
======
Python Debugger Uncovered
https://www.youtube.com/watch?v=2sEPipctTxw
How I built a power debugger out of the standard library and
things I found on the internet
https://www.youtube.com/watch?v=g8kF9tuYZ6s
Architecture of Open Source Applications: GDB
http://www.aosabook.org/en/gdb.html
Advanced Python Debugging Techniques Using GDB
https://www.youtube.com/watch?v=rB9rPdMRxIA
pdb – Interactive Debugger
https://pymotw.com/2/pdb/
bdb — Debugger framework
https://docs.python.org/2/library/bdb.html
Слайды с одноименного доклада на IT Global Meetup 2015, прошедшего в Санкт-Петербурге 6 июля.
Тезисы:
* Контроль за качеством кода - это необходимая процедура при работе нескольких человек в одной команде над продуктом из более чем сотни строк. Зачем это нужно? Каждый пишет код по-своему, ожидает понимания от остальных участников команды, но в жизни этого не происходит.
* Недостатки разнобоя в стиле написанного кода: увеличивается время ревью, усложняется внесение правок кем-либо кроме автора кода, увеличивается вероятность пропустить глазами ошибку.
* Основные шаги к решению этой проблемы: создание единого свода правил по оформлению кода (style guide), согласование процедуры разрешения конфликтных ситуаций относительно разночтений этих правил, устранение человеческого фактора в процессе оценки через автоматизацию.
* Что из экосистемы Питона может помочь? При составлении style guide можно взять за основу PEP8 и PEP257, дополнив их принятыми в команде конвенциями (какие кавычки использовать для строк и докстрингов, и т.д. и т.п.). Автоматизировать проверки можно как с помощью уже готовых утилит (pep8, flake8, pylint), так и написав свои с помощью встроенного в язык инструментария (модули ast, tokenizer, сторонние библиотеки для работы с кодом).
* Где производить проверки? Есть несколько возможных этапов:
- IDE разработчика
- Локальная VCS (working copy)
- Общая VCS
- Сервер Continous Integration.
В идеале проверки должны быть на каждом этапе, но при этом как можно меньше затруднять обычный рабочий процесс. Здесь стоит задуматься, какая комбинация из этих этапов лучше всего впишется в стиль разработчки команды.
* Если же нет достаточных ресурсов или проект находится
Иван Кочуркин. Теория и практика парсинга формальных языковMskDotNet Community
В докладе рассказывается об инструментах и практиках парсинга формальных языков: как исходного кода, так и собственных предметно-ориентированных (DSL). О том, какие бывают парсеры и проблемы при их использовании. Доклад повествует как о базовых вещах: о токенах, деревьях разбора, абстрактных синтаксических деревьях (AST), так и о продвинутых: о методах обработки препроцессорных директив и восстановления от ошибок, о парсинге островных, нечувствительных к регистру языков и фрагментов кода. Помимо парсинга в докладе затрагивается тема обработки древовидных структур. Материал доклада основан на практических задачах и акцентирован на технологиях ANTLR и Roslyn.
Eirik Solheims presentasjon fra Record-prosjektets fagseminar 2. Oktober 2009.
Presentasjonen i denne formen duger ikke til mye annet enn en repetisjon for de som var der. Mesteparten av innholdet i mine presentasjoner ligger i det jeg sier og den vinklingen jeg velger i forhold til publikum.
The document discusses advances in solar technology including using pokeberry dye to coat solar cells, thin-film technology to reduce waste and costs, and using cow brain protein in batteries and solar cells. It also discusses silicon ink-based solar cells that reached 19% conversion efficiency, giant gravel batteries to store solar energy, and the world's largest solar power tower called Ivanpah in California. The document concludes by mentioning the first solar airplane called Solar Impulse HB-SIA that flew between cities in 2012 and Japan sending a solar-powered craft into space.
The document contains over 30 hyperlinks to a website that sells Cambridge satchels and bags in various colors and styles, including hot deals, fluorescent colors, metallic styles, vintage options, classics, batchels, music bags, and designer bags. The site appears to offer a wide selection of Cambridge satchels and bags for sale.
This document outlines goals and requirements for a technology integration workshop that teaches educators advanced search techniques to find online resources, how to use a digital video repository to share lesson resources, how to research a STEM concept and create a digital lesson to upload, and how to incorporate the STEM concept into a flipped lesson to share with students. Participants will need Google, YouTube, and TED-Talk accounts, a laptop with internet, word processing and video editing software, a digital camera, microphone and earbuds.
The quest the journey from a student to a technopreneurshoaibmak
Talk given by myself @ GDG CiSTech Karachi in NEDUET.
The objective of this talk was to introduce and enhance the understanding of technology entrepreneurship and was tailored for an audience made up of students.
The slides are fairly simplistic and were only meant for guiding the flow of the conversation rather than restrict it.
Este documento descreve um sistema de votação online com cadastro de usuários. Ele contém classes PHP para conexão com banco de dados MySQL, formulários HTML para votação, pesquisa e cadastro e arquivos PHP para inserção e atualização de dados no banco.
This document summarizes a study on plasma lipid profiles in sarcoma patients. The study included 60 sarcoma patients and 60 normal control subjects. Fasting blood samples were collected and tested for triglycerides, total cholesterol, LDL-cholesterol, and HDL-cholesterol. The results showed that sarcoma patients had significantly lower levels of all lipids tested compared to controls, with triglycerides and total cholesterol being 37% and 41% lower respectively. The study concludes that plasma lipid levels are decreased in sarcoma patients and that lipid profiling may be helpful for diagnosis.
The document describes an online store called HandbagsHub.com.au that sells high quality purses at discounted prices. It offers a wide range of leather bags, fashion bags, casual bags, clutches, and men's bags. The site also sells jewelry and accessories. It aims to provide women nationwide access to stylish bags at competitive prices.
This document provides an overview of Cambicci+Associates, a consulting engineering firm that specializes in mechanical, electrical, plumbing and energy studies. It outlines the company's services such as MEP installations studies for various project types including buildings, infrastructure, renewable energy, lighting design and more. It also lists example projects the company has worked on in categories like services, culture, hotels, education, health, retail, recreation, sports, housing, urban planning and industry.
A vintage cambridge satchel style handmade in britain using the highest quality Uk leather-based. Which has a nicely structured system, a variable neck straps and also silver gear closures by cambridge satchel.
The document lists various natural and man-made superlatives from around the world, including:
- The highest airport is Daocheng Yading Airport in China at an elevation of 4,411 meters.
- The longest river is the Nile in Africa, and the largest river by discharged water is the Amazon in South America.
- The tallest structures are Burj Khalifa in Dubai at 828 meters and Mount Everest at 8,848 meters from sea level.
1) A mechanism is an assembly of rigid bodies connected by joints that allow constrained motion. A machine is a mechanism that transmits and modifies energy to perform useful work.
2) The document discusses the slider crank mechanism as an example and provides diagrams to illustrate it.
3) It defines the terms rigid body, resistant body, link, and the different types of links based on the number of joints connecting them.
This presentation was created to teach community members in the Eola Hills Groundwater Limited Area (northwest of Salem, OR) about groundwater. Please see this webpage for more information: http://www.wrd.state.or.us/OWRD/GW/NGWN_homepage.shtml.
Tom Hood, CEO of MACPA and the Business Learning Institute, gave a presentation on the future of accounting professionals. The presentation covered several topics:
1. Changes in the accounting profession such as new standards, globalization, and the use of new technologies like XBRL.
2. Emerging issues like the changing workforce as different generations enter the profession, and the need for accountants to expand their skills and take on more strategic advisory roles.
3. Trends that will impact organizations like the CGMA designation which recognizes management accounting expertise, and initiatives like integrated reporting that evaluate organizational performance more holistically.
Motivation is driven by needs and desires that cause people to act. Maslow's hierarchy of needs proposes that more basic needs like physiological and safety must be met before higher-level needs can be a motivation. A 1992 Georgia tax amnesty campaign was successful because its ads appealed to tax offenders' basic needs for security, social values of citizenship, and goal of avoiding penalties by informing them they could pay overdue taxes without penalty during the amnesty period.
The document discusses advances in solar technology including using pokeberry dye to coat solar cells, thin-film technology to reduce waste and costs, and using cow brain protein in batteries and solar cells. It also discusses silicon ink-based solar cells that reached 19% conversion efficiency, giant gravel batteries to store solar energy, and the world's largest solar power tower called Ivanpah in California. The document concludes by mentioning the first solar airplane called Solar Impulse HB-SIA that flew between cities in 2012 and Japan sending a solar-powered craft into space.
The document contains over 30 hyperlinks to a website that sells Cambridge satchels and bags in various colors and styles, including hot deals, fluorescent colors, metallic styles, vintage options, classics, batchels, music bags, and designer bags. The site appears to offer a wide selection of Cambridge satchels and bags for sale.
This document outlines goals and requirements for a technology integration workshop that teaches educators advanced search techniques to find online resources, how to use a digital video repository to share lesson resources, how to research a STEM concept and create a digital lesson to upload, and how to incorporate the STEM concept into a flipped lesson to share with students. Participants will need Google, YouTube, and TED-Talk accounts, a laptop with internet, word processing and video editing software, a digital camera, microphone and earbuds.
The quest the journey from a student to a technopreneurshoaibmak
Talk given by myself @ GDG CiSTech Karachi in NEDUET.
The objective of this talk was to introduce and enhance the understanding of technology entrepreneurship and was tailored for an audience made up of students.
The slides are fairly simplistic and were only meant for guiding the flow of the conversation rather than restrict it.
Este documento descreve um sistema de votação online com cadastro de usuários. Ele contém classes PHP para conexão com banco de dados MySQL, formulários HTML para votação, pesquisa e cadastro e arquivos PHP para inserção e atualização de dados no banco.
This document summarizes a study on plasma lipid profiles in sarcoma patients. The study included 60 sarcoma patients and 60 normal control subjects. Fasting blood samples were collected and tested for triglycerides, total cholesterol, LDL-cholesterol, and HDL-cholesterol. The results showed that sarcoma patients had significantly lower levels of all lipids tested compared to controls, with triglycerides and total cholesterol being 37% and 41% lower respectively. The study concludes that plasma lipid levels are decreased in sarcoma patients and that lipid profiling may be helpful for diagnosis.
The document describes an online store called HandbagsHub.com.au that sells high quality purses at discounted prices. It offers a wide range of leather bags, fashion bags, casual bags, clutches, and men's bags. The site also sells jewelry and accessories. It aims to provide women nationwide access to stylish bags at competitive prices.
This document provides an overview of Cambicci+Associates, a consulting engineering firm that specializes in mechanical, electrical, plumbing and energy studies. It outlines the company's services such as MEP installations studies for various project types including buildings, infrastructure, renewable energy, lighting design and more. It also lists example projects the company has worked on in categories like services, culture, hotels, education, health, retail, recreation, sports, housing, urban planning and industry.
A vintage cambridge satchel style handmade in britain using the highest quality Uk leather-based. Which has a nicely structured system, a variable neck straps and also silver gear closures by cambridge satchel.
The document lists various natural and man-made superlatives from around the world, including:
- The highest airport is Daocheng Yading Airport in China at an elevation of 4,411 meters.
- The longest river is the Nile in Africa, and the largest river by discharged water is the Amazon in South America.
- The tallest structures are Burj Khalifa in Dubai at 828 meters and Mount Everest at 8,848 meters from sea level.
1) A mechanism is an assembly of rigid bodies connected by joints that allow constrained motion. A machine is a mechanism that transmits and modifies energy to perform useful work.
2) The document discusses the slider crank mechanism as an example and provides diagrams to illustrate it.
3) It defines the terms rigid body, resistant body, link, and the different types of links based on the number of joints connecting them.
This presentation was created to teach community members in the Eola Hills Groundwater Limited Area (northwest of Salem, OR) about groundwater. Please see this webpage for more information: http://www.wrd.state.or.us/OWRD/GW/NGWN_homepage.shtml.
Tom Hood, CEO of MACPA and the Business Learning Institute, gave a presentation on the future of accounting professionals. The presentation covered several topics:
1. Changes in the accounting profession such as new standards, globalization, and the use of new technologies like XBRL.
2. Emerging issues like the changing workforce as different generations enter the profession, and the need for accountants to expand their skills and take on more strategic advisory roles.
3. Trends that will impact organizations like the CGMA designation which recognizes management accounting expertise, and initiatives like integrated reporting that evaluate organizational performance more holistically.
Motivation is driven by needs and desires that cause people to act. Maslow's hierarchy of needs proposes that more basic needs like physiological and safety must be met before higher-level needs can be a motivation. A 1992 Georgia tax amnesty campaign was successful because its ads appealed to tax offenders' basic needs for security, social values of citizenship, and goal of avoiding penalties by informing them they could pay overdue taxes without penalty during the amnesty period.
[RU] Connecting AutoCAD and Python (by Alex Bausk)Alexander Bausk
(Russian) Future of Engineering Automation: Building a Distributed Application to Connect AutoCAD and Python
Speech given at Autodesk University 2014.
А. Бауск. "Создание распределенного приложения на примере AutoCAD и Python". Доклад на Autodesk University 2014.
SWIG — cоздание мультиязыковых интерфейсов для C/C++ библиотекPython Meetup
"SWIG — cоздание мультиязыковых интерфейсов для C/C++ библиотек", Алексей Черкес
Кратко рассказано о том, что такое биндинг и Pуthon c API. Краткий обзор средств биндинга для Python. SWIG: что такое, зачем нужен, особенности, схема работы утилит, порядок запуска и сборки, принципы работы, как происходит сопоставление объектных моделей С++ и целевого языка. Примеры на Python и C#. Опыт применения, плюсы/минусы.
Особенности мобильной платформы Windows Phone 8GetDev.NET
Видеозапись и материалы доклада: http://getdev.net/Event/wp8
Можно ли писать приложения на C++? Правда ли, что у Windows 8 и Windows Phone 8 единое ядро? Будет ли аналог Siri в новых смартфонах? Вся правда о новой мобильной платформе от Microsoft только на GetDev.NET!
Основы "мобильной" разработки на примере платформы iOs (iPhone)Pavel Tsukanov
Легкая обзорная лекция по платформе iOS. Рассмотрим специфику разработки под мобильные платформы, средства разработки, язык Objective-C, концепции применяемые при разработке под iOS. Расскажу шаги которые нужно сделать для создания вашего первого мобильного приложения.
2. Android
Android для программиста, это
инструмент позволяющий
совершать телефонные звонки, слать SMS сообщения
получать показания сенсоров, GPS
производить аудио и видео запись
работать с
средствами синтеза и распознавания речи
Wi-Fi, Bluetooth
базами данных
...
...
Java ?
3. SL4A
Scripting Layer for Android
интерфейс к Android API
RPC сервер
интерпретаторы языков
JavaScript (Rhino)
Lua
Brainfuck
Tcl
Perl
...
Python !
4. Пример Python кода
import android
droid = android . Android ()
r = droid . dialogGetInput ( ’ Dialog␣Header ’ ,
’ Dialog␣Message ’ ,
’ Default ␣ text ’ )
i f (not r . error ) and r . r e s u lt :
droid . ttsSpeak ( r . r e s u lt )
e l i f droid . vibrate (32 ∗ 1000). error :
droid . makeToast ( ’ All ␣the␣systems ␣ in ␣norm ! ’ )