Документация OpenNMT на русском языке!

Всем привет! На этой странице я будут выкладывать частичные переводы документации проекта OpenNMT — нейросети для машинного перевода с языка на язык. Начну с главы Tokenization. Разбиение на лексемы OpenNMT из коробки предоставляет утилиты токенизации для быстрой обработки новых наборов данных для обучения. Цель токенизации — преобразовать необработанные предложения в […]

Отладка вражеского кода

В моей карьере разработчика .net было несколько случаев, когда я хотел отладить чужой код. Код, к которому у меня нет исходников, только DLL. К счастью, Visual Studio позволяет дебажить код без исходинков. Эта статья основана на вопросе на StackOverflow, где я пытался объяснить поведение Unity-контейнера.

Patterns: Specification

Specification pattern is my favorite one! It unites Domain-Driven Design, application architecture modeling, entity framework — all cool things. Specification pattern is designed to order business rules and connect your code to your business terms. In this article I will show an example of implementation and how this pattern is […]

Any vs Count

This post started from discussion on SO: Why LINQ method Any does not check Count? After it I decided to check the most common collections on performance in methods Any and Count.

Sleep well

How many ways to sleep a thread do you know? Usually you need to sleep a thread in a loop when you execute some repeatable operation (checking results every 5 seconds, for example). So, you need to stop this loop for a period of time.

Soft API contract

Working with some API you expect that this API will stay stable and return the same type of result from call to call. But, sometimes it does not work this way. In the article I will tell about integration with SOAP-service and volatile contracts. To describe the problem, I need […]

Useful Constraints

Usually we use constraints to specify the allowable values for the columns in tables. And it works perfect! But beyond that, constraints help query analizer to generate more effective query plans. How it works? Read below. There is an opinion «Give MS SQL Server all information you know about data […]

Replacing Mocks with Spies

Mock objects are useful when verifying that a method was called is more important than verifying the outcome of calling that method. Completing a Reservation For example, I have a Reservation class that represents some concert tickets that are being held for a user until they complete their purchase. When you call the complete method on a Reservation, you pass […]

Вернуть пустой результат запроса из Laravel Query Builder

Весьма специфичный случай. Вернуть пустой результат SQL запроса независимо от остальных условий запроса. Необходимо задать заведомо невыполнимое условие, например идентификатор записи < 0. Естественно лучшим вариантом будет выбирать поле с индексом. Совершенно точно не стоит опираться на LIMIT 0. Постраничная навигация обязательно изменит этот параметр. SELECT * FROM entities WHERE […]