C-spirit reborn: why Go was bound to be createdArtem Kovardin
Go was created to address issues with other imperative languages like C and C++ through its approach to memory management, concurrency, and software architecture. Go aims to make common programming tasks like concurrency, collections, and memory management straightforward and easy to use correctly. While it has some quirks to be aware of, overall Go provides a lightweight yet powerful programming language well-suited for building reliable concurrent systems.
Garbage collector и управление памятью в GoArtem Kovardin
The document discusses Go memory management and how it differs from other languages like C, explaining that Go uses a garbage collected heap and stack per goroutine rather than malloc and free, and that values are passed by value while pointers and slices can be more complex due to being references to underlying data. Key aspects of Go memory include how structs are allocated, when data escapes to the heap, getting memory statistics, and performance differences between Go memory allocation and C malloc.
Deck is a Go package for creating presentations using a single markup language. It allows elements for text, lists, code, images and graphics with all layout and sizes expressed as percentages. Clients can interactively view presentations or export to formats like PDF and SVG. Servers use a RESTful API for uploading, listing, starting, stopping and removing presentations.
Building A Relevancy Engine Using MongoDB and Goardan-bkennedy
Big data and analytics is becoming incredibly important as information on people and their lives become more readily available. Companies are looking for ways to acquire, store and process personal information on their users to help provide intuitive experiences and sell products or services. Using Go and Mongo, you can build these analytic engines with all the flexibility, scalability and performance you need. In my talk I will show how you can leverage Go and MongoDB to load customer data and both public or personal offer feeds at runtime. Then using a Go based web service, build rules to identify products and services your customers will want.
The document discusses building games using the Go programming language. It covers topics like using goroutines for concurrency, implementing game servers, serialization, and bandwidth management. It also provides examples of defining types that implement interfaces to allow custom marshaling of data to JSON to reduce bandwidth usage.
I will show how to use Go's database/sql package, with MySQL as an example. Although the documentation is good, it's dense. I'll discuss idiomatic database/sql code, and cover some topics that can save you time and frustration, and perhaps even prevent serious mistakes.
Best practices-for-production-environmentsArtem Kovardin
This document provides best practices for production environments in Go projects, including recommendations for development environments, repository structure, formatting and style, configuration, logging and telemetry, testing and validation, dependency management, and building and deploying. It recommends using a single GOPATH, structuring repositories with README, Makefile, and package folders, formatting code with go fmt and following Google style guidelines. It also discusses setting configuration via flags, implementing logging and metrics, writing tests including integration tests, managing dependencies with the VENDOR folder, and building and deploying through Makefiles and scaling stateless services.
C-spirit reborn: why Go was bound to be createdArtem Kovardin
Go was created to address issues with other imperative languages like C and C++ through its approach to memory management, concurrency, and software architecture. Go aims to make common programming tasks like concurrency, collections, and memory management straightforward and easy to use correctly. While it has some quirks to be aware of, overall Go provides a lightweight yet powerful programming language well-suited for building reliable concurrent systems.
Garbage collector и управление памятью в GoArtem Kovardin
The document discusses Go memory management and how it differs from other languages like C, explaining that Go uses a garbage collected heap and stack per goroutine rather than malloc and free, and that values are passed by value while pointers and slices can be more complex due to being references to underlying data. Key aspects of Go memory include how structs are allocated, when data escapes to the heap, getting memory statistics, and performance differences between Go memory allocation and C malloc.
Deck is a Go package for creating presentations using a single markup language. It allows elements for text, lists, code, images and graphics with all layout and sizes expressed as percentages. Clients can interactively view presentations or export to formats like PDF and SVG. Servers use a RESTful API for uploading, listing, starting, stopping and removing presentations.
Building A Relevancy Engine Using MongoDB and Goardan-bkennedy
Big data and analytics is becoming incredibly important as information on people and their lives become more readily available. Companies are looking for ways to acquire, store and process personal information on their users to help provide intuitive experiences and sell products or services. Using Go and Mongo, you can build these analytic engines with all the flexibility, scalability and performance you need. In my talk I will show how you can leverage Go and MongoDB to load customer data and both public or personal offer feeds at runtime. Then using a Go based web service, build rules to identify products and services your customers will want.
The document discusses building games using the Go programming language. It covers topics like using goroutines for concurrency, implementing game servers, serialization, and bandwidth management. It also provides examples of defining types that implement interfaces to allow custom marshaling of data to JSON to reduce bandwidth usage.
I will show how to use Go's database/sql package, with MySQL as an example. Although the documentation is good, it's dense. I'll discuss idiomatic database/sql code, and cover some topics that can save you time and frustration, and perhaps even prevent serious mistakes.
Best practices-for-production-environmentsArtem Kovardin
This document provides best practices for production environments in Go projects, including recommendations for development environments, repository structure, formatting and style, configuration, logging and telemetry, testing and validation, dependency management, and building and deploying. It recommends using a single GOPATH, structuring repositories with README, Makefile, and package folders, formatting code with go fmt and following Google style guidelines. It also discusses setting configuration via flags, implementing logging and metrics, writing tests including integration tests, managing dependencies with the VENDOR folder, and building and deploying through Makefiles and scaling stateless services.
Антон Пискунов. Независимый разработчик.
«BeeGo для веб-приложений, API и демонов»
- Почему BeeGo? vs Revel and another guys.
- Что мы пишем на BeeGo? Наш личный опыт.
- Как написать облачный стартап и инфраструктурные сервисы на BeeGo за две недели.
- Sweet API, нэймспейсы и автодокументация.
- Демонизация BeeGo, к чему мы пришли?
- Разработчики, мэйнтейнинг, существующие проблемы
http://go-meetup-spb.timepad.ru/event/169777/
RTB и его проблематика должны быть знакомы участникам конференции - мало кто сегодня не слышал об этом способе получить много krps с жесткими ограничениями на время генерации ответа.
Вот и компания Qmobi решила поучаствовать в этой гонке и отхватить свой кусок пирога под названием “рынок мобильной рекламы”.
При первом подходе к снаряду задача выглядит довольно простой: вот запрос с критериями, вот база данных с ответами - выбирай по индексу и отвечай.
На самом деле все несколько сложнее. Начать с того, что некоторые критерии отбора - негативные. Затем мы имеем дело с выборкой по десятку индексов, каждый из которых обладает низкой cardinality. И, наконец, мы имеем дело с большими объемами: около 10М строк в исходных данных, около 10К строк в финальной выборке. Ах, нет, еще финальная выборка должна быть отсортирована по приоритету! И надо не забыть про атомарные блокировку и списание средств...
От идеи прототипа на perl пришлось отказаться еще на этапе постановки задачи :)
Итак, мы имеем задачу с интенсивным IO, высокой нагрузкой, высокими скоростями, сложными структурами данных и эвристическими алгоритмами.
Анализ имеющихся вариантов показал, что Go должен прекрасно подойти для этой задачи. О том, на основании каких соображений мы сделали такой вывод, и какие из этих соображений прошли проверку практикой, а какие - нет, будет рассказано в докладе.
Также в докладе будет рассказано о том, как сортировка была заменена случайной выборкой, и чем пришлось заплатить за то, чтобы эта замена оказалась равноценной.
Будет показано, почему мы наплевательски отнеслись к гипотетической потере 20% возможностей поучаствовать в аукционе, и почему реальный процент потерь много ниже.
Будет раскрыта роль СУБД MySQL в этом проекте, со всем блеском высокой производительности и нищетой отказоустойчивости.
Вопросы геотаргетинга, использования PostGIS и кэширования результатов поиска региона по координатам будут затронуты вскользь, как неоднократно обсуждавшиеся на этой и подобных конференциях.
А вот анатомия производительности приложения на Go будет рассмотрена подробнейшим образом - с графиками и числами.
Также подробно будут рассмотрены наши победы и поражения в борьбе со статис
This document discusses using machine learning in Magento 2 for customer retention and behavior analytics. It proposes using machine learning to provide personalized recommendations, predict customer preferences, and detect opportunities for targeted discounts. The approach involves collecting customer activity data, running machine learning models, and integrating predictions back into the Magento sales process in real-time to improve personalization.
На примере системы управления ретаргетинговой рекламой в Facebook для онлайн туристических агентств
Alexander Makeev
makeev.alex@gmail.com
https://ua.linkedin.com/in/alexandermakeev
Антон Пискунов. Независимый разработчик.
«BeeGo для веб-приложений, API и демонов»
- Почему BeeGo? vs Revel and another guys.
- Что мы пишем на BeeGo? Наш личный опыт.
- Как написать облачный стартап и инфраструктурные сервисы на BeeGo за две недели.
- Sweet API, нэймспейсы и автодокументация.
- Демонизация BeeGo, к чему мы пришли?
- Разработчики, мэйнтейнинг, существующие проблемы
http://go-meetup-spb.timepad.ru/event/169777/
RTB и его проблематика должны быть знакомы участникам конференции - мало кто сегодня не слышал об этом способе получить много krps с жесткими ограничениями на время генерации ответа.
Вот и компания Qmobi решила поучаствовать в этой гонке и отхватить свой кусок пирога под названием “рынок мобильной рекламы”.
При первом подходе к снаряду задача выглядит довольно простой: вот запрос с критериями, вот база данных с ответами - выбирай по индексу и отвечай.
На самом деле все несколько сложнее. Начать с того, что некоторые критерии отбора - негативные. Затем мы имеем дело с выборкой по десятку индексов, каждый из которых обладает низкой cardinality. И, наконец, мы имеем дело с большими объемами: около 10М строк в исходных данных, около 10К строк в финальной выборке. Ах, нет, еще финальная выборка должна быть отсортирована по приоритету! И надо не забыть про атомарные блокировку и списание средств...
От идеи прототипа на perl пришлось отказаться еще на этапе постановки задачи :)
Итак, мы имеем задачу с интенсивным IO, высокой нагрузкой, высокими скоростями, сложными структурами данных и эвристическими алгоритмами.
Анализ имеющихся вариантов показал, что Go должен прекрасно подойти для этой задачи. О том, на основании каких соображений мы сделали такой вывод, и какие из этих соображений прошли проверку практикой, а какие - нет, будет рассказано в докладе.
Также в докладе будет рассказано о том, как сортировка была заменена случайной выборкой, и чем пришлось заплатить за то, чтобы эта замена оказалась равноценной.
Будет показано, почему мы наплевательски отнеслись к гипотетической потере 20% возможностей поучаствовать в аукционе, и почему реальный процент потерь много ниже.
Будет раскрыта роль СУБД MySQL в этом проекте, со всем блеском высокой производительности и нищетой отказоустойчивости.
Вопросы геотаргетинга, использования PostGIS и кэширования результатов поиска региона по координатам будут затронуты вскользь, как неоднократно обсуждавшиеся на этой и подобных конференциях.
А вот анатомия производительности приложения на Go будет рассмотрена подробнейшим образом - с графиками и числами.
Также подробно будут рассмотрены наши победы и поражения в борьбе со статис
This document discusses using machine learning in Magento 2 for customer retention and behavior analytics. It proposes using machine learning to provide personalized recommendations, predict customer preferences, and detect opportunities for targeted discounts. The approach involves collecting customer activity data, running machine learning models, and integrating predictions back into the Magento sales process in real-time to improve personalization.
На примере системы управления ретаргетинговой рекламой в Facebook для онлайн туристических агентств
Alexander Makeev
makeev.alex@gmail.com
https://ua.linkedin.com/in/alexandermakeev
2. Go -- объектно-ориентированный?
Нет. Но если сильно хочеться, то да:
● Есть типы и методы
● Нет иерархии типов (наследования)
● Зато есть интерфейсы (полиморфизм)
● Инкапсуляция (приватность, публичность)
● Композиция вместо наследования
3. Packages
Пакет -- это каталог с файлами, которые
начинаются с одной и той же
строки:package package_name
Близкий аналог -- namespace
4. Packages
Один пакет может содержать много кода:
определений типов, методов, функций.
Пакет -- это область видимости для
объявленных в нем типов, переменных,
функций, и т.д.
5. Packages
Все что определено как приватное в пакете -
- остается в пакете:
package my_secret_stuff
var (
myHiddenSecret string // Только мой пакет знает, что внутри
)
Код в пакете удобно структурировать по
файлам.
6. Structs
Структуры -- типы, похожие на структуры C.
Структура состоит из полей.
Может включать в себя другие структуры.
7. Structs
Структура, которая содержит в себе другую
структуру (или даже несколько), получает
всю ее силу! (Mwa-ha-ha!)
Так получается композиция.
8. Interfaces
Интерфейс это… интерфейс. Описание того,
что умеет делать тип.
Тип не обязан декларировать, что он
реализует какой-то интерфейс. Он его
просто реализует. Дела важнее слов!
9. Interfaces
А зачем интерфейсы?
А для полиморфизма!
Моему коду не нужно знать, как устроен
объект, достаточно того, что у него есть
нужные мне методы.
10. Как это сделать в Go?
package main
import “fmt”
type Sayer interface { Say() }
type Hello struct { Name string }
func (h Hello) Say() {
fmt.Println(h.Name)
}
type Bye struct { Hello }
func (b Bye) Say() {
fmt.Print(“Прощай, ”)
b.Hello.Say()
}
var (
h Hello
b Bye
)
func tell(s Sayer) {
s.Say()
}
func main () {
h.Name = “Как всегда...”
b.Name = “зарплата”
tell(h)
tell(b)
}
$ go run example.go
Как всегда...
Прощай, зарплата