Pull to refresh

Development

Show first
  • New
  • Top
Rating limit
  • All
  • ≥0
  • ≥10
  • ≥25
  • ≥50
  • ≥100

Exceptional situations: part 1 of 4

Seminars by Stanislav Sidristy corporate blog Programming *.NET *C# *


Introduction


It’s time to talk about exceptions or, rather, exceptional situations. Before we start, let’s look at the definition. What is an exceptional situation?


This is a situation that makes the execution of current or subsequent code incorrect. I mean different from how it was designed or intended. Such a situation compromises the integrity of an application or its part, e.g. an object. It brings the application into an extraordinary or exceptional state.


But why do we need to define this terminology? Because it will keep us in some boundaries. If we don’t follow the terminology, we can get too far from a designed concept which may result in many ambiguous situations. Let’s see some practical examples:


 struct Number
 {
     public static Number Parse(string source)
     {
         // ...
         if(!parsed)
         {
             throw new ParsingException();
         }
         // ...
     }

     public static bool TryParse(string source, out Number result)
     {
        // ..
        return parsed;
     }
 }

This example seems a little strange, and it is for a reason. I made this code slightly artificial to show the importance of problems appearing in it. First, let’s look at the Parse method. Why should it throw an exception?

Read more →
Total votes 27: ↑26 and ↓1 +25
Views 1.8K
Comments 2

Indexes in PostgreSQL — 9 (BRIN)

Postgres Professional corporate blog PostgreSQL *SQL *
Translation
In the previous articles we discussed PostgreSQL indexing engine, the interface of access methods, and the following methods: hash indexes, B-trees, GiST, SP-GiST, GIN, and RUM. The topic of this article is BRIN indexes.

BRIN


General concept


Unlike indexes with which we've already got acquainted, the idea of BRIN is to avoid looking through definitely unsuited rows rather than quickly find the matching ones. This is always an inaccurate index: it does not contain TIDs of table rows at all.

Simplistically, BRIN works fine for columns where values correlate with their physical location in the table. In other words, if a query without ORDER BY clause returns the column values virtually in the increasing or decreasing order (and there are no indexes on that column).

This access method was created in scope of Axle, the European project for extremely large analytical databases, with an eye on tables that are several terabyte or dozens of terabytes large. An important feature of BRIN that enables us to create indexes on such tables is a small size and minimal overhead costs of maintenance.

This works as follows. The table is split into ranges that are several pages large (or several blocks large, which is the same) — hence the name: Block Range Index, BRIN. The index stores summary information on the data in each range. As a rule, this is the minimal and maximal values, but it happens to be different, as shown further. Assume that a query is performed that contains the condition for a column; if the sought values do not get into the interval, the whole range can be skipped; but if they do get, all rows in all blocks will have to be looked through to choose the matching ones among them.

It will not be a mistake to treat BRIN not as an index, but as an accelerator of sequential scan. We can regard BRIN as an alternative to partitioning if we consider each range as a «virtual» partition.

Now let's discuss the structure of the index in more detail.
Read more →
Total votes 14: ↑14 and ↓0 +14
Views 6.2K
Comments 0

Should array length be stored into a local variable in C#?

.NET *C# *
Translation
I notice that people often use construction like this:

var length = array.Length;
for (int i = 0; i < length; i++) {
    //do smth
}

They think that having a call to the Array.Length on each iteration will make CLR to take more time to execute the code. To avoid it they store the length value in a local variable.
Let’s find out (once and for all !) if this is a viable thing or using a temporary variable is a waste of time.
Read more →
Total votes 13: ↑13 and ↓0 +13
Views 16K
Comments 0

Artificial neural networks explained in simple words

Machine learning *Popular science Artificial Intelligence Brain
image

When I used to start a conversation about neural networks over a bottle of beer, people were casting glances at me of what seemed to be fear; they grew sad, sometimes with their eyelid twitching. In rare cases, they were even eager to take refuge under the table. Why? These networks are simple and instinctive, actually. Yes, believe me, they are! Just let me prove this is true!


Suppose there are two things I’m aware of about the girl: she looks pretty to my taste or not, and I have lots to talk about with her or I haven’t. True and false will be one and zero respectively. We’ll take similar principle for appearance. The question is: “What girl I’ll fall in love with, and why?”


We also can think it straight and uncompromisingly: “If she looks pretty and there’s plenty to talk about, then I will fall in love. If neither is true, then I quit”.


But what if I like the lady but there’s nothing to talk about with her? Or vice versa?

Read more →
Total votes 13: ↑11 and ↓2 +9
Views 3.1K
Comments 0

Open source tool for intent-based search quality validation

IT systems testing *Development for e-commerce *Search engine optimization
No matter how cool your search solution is, without a reliable way of testing it you will not be able to do any improvement without breaking something valuable.

Even a tiny increase in overall search result quality might have a noticeable effect on conversion rate. Naturally, you can use exit-rate to judge if your search needs improvements and do required adjustments, but will you be able to make sure those changes are safe? What if improved relevancy for a specific category breaks search for several other categories?

image

Moreover, high exit-rate means no matter what you are going to do, the problem has taken place, so dozens of customers already didn’t manage to find what they were up to. Basically, the only way to proceed is to have a reliable search quality validation approach.
Read more →
Total votes 7: ↑6 and ↓1 +5
Views 543
Comments 0

Microsoft Edge for macOS

Microsoft corporate blog Development for MacOS *Browsers Microsoft Edge

Last month, we announced the first preview builds of the next version of Microsoft Edge for Windows 10. Today, we are pleased to announce the availability of the Microsoft Edge Canary channel for macOS. You can now install preview builds from the Microsoft Edge Insider site for your macOS or Windows 10 PC, with more Windows version support coming soon.


Снимок экрана Microsoft Edge для macOS

Read more →
Total votes 13: ↑11 and ↓2 +9
Views 1.4K
Comments 1

DynamicData: Dynamic Collections, the MVVM Architecture, and Reactive Extensions

Programming *.NET *C# *Development for Windows *
Translation


February 2019 marked the release of ReactiveUI 9 — the cross-platform framework for building GUI applications on the Microsoft .NET platform. ReactiveUI is a tool for tight integration of reactive extensions with the MVVM design pattern. You could familiarize yourself with the framework via a series of videos or the welcome page of the documentation. The ReactiveUI 9 update includes numerous fixes and improvements, but probably the most crucial and interesting one is integration with the DynamicData framework, allowing you to work with dynamic collections in Reactive fashion. Let’s find out what we can use DynamicData for and how this powerful reactive framework works under the hood!

Read more →
Total votes 14: ↑12 and ↓2 +10
Views 11K
Comments 2

Rebuilding an icon: a call for the sharing of open data to help restore Notre-Dame

Microsoft corporate blog Open source *

Since its completion more than 675 years ago, the medieval cathedral of Notre-Dame has captivated millions of people with its incomparable beauty. From its legendary stained glass rose window to its towering spire, it’s widely regarded as one of the most stunning examples of medieval architecture in history.


Read more →
Total votes 10: ↑8 and ↓2 +6
Views 479
Comments 0

Xamarin API Docs: Open Sourced and Available Now

Microsoft corporate blog Development for iOS *Development of mobile applications *API *Xamarin *

Today, we are happy to announce the release of all Xamarin API Documentation as Open Source! API documentation drives the IntelliSense experience while being one of the best ways to help developers achieve their goals.


Xamarin API Docs


Additionally, we have also moved the hosting of the following from their old Xamarin home to docs.microsoft.com:


Read more →
Total votes 8: ↑8 and ↓0 +8
Views 608
Comments 0

Signing into Azure DevOps using your GitHub credentials

Microsoft corporate blog Cloud computing *Microsoft Azure DevOps *Cloud services

Across all of Microsoft, we are focusing on empowering developers to build better apps, faster. One way we are accomplishing that is by providing a range of products and services covering all stages of the software development lifecycle. This includes IDEs and DevOps tools, application and data platforms on the cloud, operating systems, Artificial Intelligence and IoT solutions, and more. All of these are centered around developers, both as individuals working in teams and organizations, and as members of developer communities.


GitHub is one of the largest developer communities, and for millions of developers around the world their GitHub identity has become a critical aspect of their digital life. Recognizing that, we’re excited to announce improvements that will help GitHub users get started more easily with our developer services, including Azure DevOps and Azure.


GitHub sign in button in Microsoft login page
Read more →
Total votes 12: ↑11 and ↓1 +10
Views 464
Comments 0

Fancy Euclid's “Elements” in TeX

LaTeX *
Translation


In 2016, I came across Oliver Byrne's “The first six books of the Elements of Euclid.” The main feature of this book is that instead of ordinary letter designations such as “triangle ABC,” it employs inclusions of miniature pictures directly in the text, that is, for example, an image of a triangle. As difficult as it probably was in the XIX century, as easy, with the right tools, it should be to make such a book nowadays. And so I decided to find out by myself whether that's the case.
Read more →
Total votes 35: ↑34 and ↓1 +33
Views 25K
Comments 2

Long journey to Tox-rs. Part 1

Decentralized networks Information Security *Instant Messaging *Open source *Rust *
Tox logo

Hi everyone!


I like Tox and respect the participants of this project and their work. In an effort to help Tox developers and users, I looked into the code and noticed potential problems that could lead to a false sense of security. Since I originally published this article in 2016 (in Russian), many improvements have been made to Tox, and I lead a team that re-wrote secure Tox software from scratch using the Rust programming language (check out Tox-rs). I DO recommend using tox in 2019. Let's take a look what actually made us rewrite Tox in Rust.


Original article of 2016


There is an unhealthy tendency to overestimate the security of E2E systems only on the basis that they are E2E. I will present objective facts supplemented with my own comments for you to draw your own conclusions.


Spoiler: The Tox developers agree with my points and my source code pull request was accepted.

Here go facts:
Total votes 25: ↑23 and ↓2 +21
Views 2.8K
Comments 1

Top 10 Chat, Audio & Video Calling API & SDK Providers for Enterprise Business

Instant Messaging *Conferences Social networks and communities
The Worlds Leading Real-time Messaging, Audio & Video Chat Solutions That Made Biggest Impact In 2019

image

With the growing trend of digitalization, most enterprises have transformed their communication methodology from mainstream to digital. In order to keep up with competitors, companies regularly upgrade their services, specially the way they relay information to their customers as well as their employees. Today, seamless real-time networking plays a critical role in engaging with individuals and enterprises, and the best way to implement such a feat is onboarding a Real-Time Chat, Voice & Video Calling SDK/API providers.
Read more →
Total votes 5: ↑5 and ↓0 +5
Views 38K
Comments 4

ANPR using RoR & React Native

Ruby on Rails *ReactJS *
Sandbox
Danny Krastev, Mirabbos Umarov, Ekaterina Menshenina, ITMO University, Info communication Systems, Computer Science. 2019

image

Abstract


Due to the never-ending increase in volume of vehicles surrounding our daily lives, Automatic Number Plate Recognition (ANPR), has become an evolving solution for managing and monitoring vehicles worldwide to enforce rules and prevent criminal activities, such as parking violation, red light violation, speeding, and vehicle theft. Although there is already a variety of public and private methods and libraries that have been developed and are used to achieve the automatic recognition of car license plate numbers around the world, there has not been much focus on making advancements toward a cross platform ANPR solution that supports all vehicle license plates worldwide. This paper introduces the Plate Vision project, a web and mobile application built on Ruby on Rails and React Native, which aims to serve as an alternative ANPR platform that supports detection of all license plates worldwide by utilizing various open source optical character recognition (OCR) libraries and making efficiency optimizations.

Key words and phrases: ruby, rails, react native, license plate recognition, plate region extraction, optical character recognition (OCR), ANPR.
Read more →
Total votes 11: ↑10 and ↓1 +9
Views 2.7K
Comments 0

From High Ceph Latency to Kernel Patch with eBPF/BCC

Selectel corporate blog High performance *Configuring Linux *Server Administration *


There are a lot of tools for debugging kernel and userspace programs in Linux. Most of them have performance impact and cannot easily be run in production environments. A few years ago, eBPF was developed, which provides the ability to trace the kernel and userspace with low overhead, without needing to recompile programs or load kernel modules.

There are now plenty of tools that use eBPF and in this article, we’ll explain how to write your own profiling tool using the PythonBCC library. This article is based on a real issue from the production environment. We’ll walk you through solving the problem and show how existing bcc tools could be used in some cases.
Read more →
Total votes 13: ↑11 and ↓2 +9
Views 3.3K
Comments 0