Pull to refresh

Development

Show first
Rating limit
Level of difficulty

How to Get Nice Error Reports Using SARIF in GitHub

Reading time 7 min
Views 1.5K

Let's say you use GitHub, write code, and do other fun stuff. You also use a static analyzer to enhance your work quality and optimize the timing. Once you come up with an idea - why not view the errors that the analyzer gave right in GitHub? Yeah, and also it would be great if it looked nice. So, what should you do? The answer is very simple. SARIF is right for you. This article will cover what SARIF is and how to set it up. Enjoy the reading!

Читать далее
Total votes 3: ↑3 and ↓0 +3
Comments 0

Top 7 Best Secure Video Streaming Platforms of 2022

Reading time 8 min
Views 4.4K

In this modern era of technological advancements, it is important to connect with people who matter the most to your business i.e. customers. Are you searching for a secure online video platform for your business?

Do you know what is secure streaming!

Well, various online video platforms can help you in providing seamless videos to your customers. But what we need is a secure online video platform that can also protect our digital content from various e-hazards. Read on to know more about some of the most secure online video platforms in the market.

Read more
Rating 0
Comments 0

Algorithms in Go: Dutch National Flag

Reading time 3 min
Views 2.7K

The flag of the Netherlands consists of three colors: red, white and blue. Given balls of these three colors arranged randomly in a line (it does not matter how many balls there are), the task is to arrange them such that all balls of the same color are together and their collective color groups are in the correct order.

For simplicity instead of colors red, white, and blue we will be dealing with ones, twos and zeroes.

Let's start with our intuition. We have an array of zeroth, ones, and twos. How would we sort it? Well, we could put aside all zeroes into some bucket, all ones into another bucket, and all twos into the third. Then we can fetch all items from the first bucket, then from the second, and from the last bucket, and restore all the items. This approach is perfectly fine and has a great performance. We touch all the elements when we iterate through the array, and then we iterate through all the elements once more when we "reassamble" the array. So, the overall time complexity is O(n) + O(n) ~= O(n). The space complexity is also O(n) as we need to store all items in the buckets.

Can we do better than that? There is no way to improve our time complexity. However, we can think of a more efficient algorithm in regard to space complexity. How would we solve the problem without the additional buckets?

Let's make a leap of faith and pretend that somehow we were able to process a part of the array. We iterate through part of the array and put encountered zeroes and ones at the beginning of the array, and twos at the end of the array. Now, we switched to the next index i with some unprocessed value x. What should we do there?

Read more
Total votes 8: ↑8 and ↓0 +8
Comments 4

A bit about our currently nameless game company, and what we’re working on at the moment

Reading time 4 min
Views 1.4K

Hey everyone! I represent a game studio without a name, and the project we’re working on goes by the technical name of "CGDrone". I started writing this article earlier today, having tortured myself for ages with sketches, colours, algorithms and correcting bugs in rotations based on quaternions (the last one just about finished me off). You can probably understand I needed a break.

I’ve often come across stories people have posted online about how they made their game, the difficulties they faced, and the result they achieved at the end. Likewise, our team has its own story, and I’d like to share a bit about it.

Read more
Total votes 2: ↑2 and ↓0 +2
Comments 0

COVID-19 Research and Uninitialized Variable

Reading time 2 min
Views 1.2K

0796_covid_sim/image1.png
There is an open project COVID-19 CovidSim Model, written in C++. There is also a PVS-Studio static code analyzer that detects errors very well. One day they met. Embrace the fragility of mathematical modeling algorithms and why you need to make every effort to enhance the code quality.

Read more →
Total votes 2: ↑2 and ↓0 +2
Comments 5

A Spy Undercover: PVS-Studio to Check ILSpy Source Code

Reading time 15 min
Views 808

In PVS-Studio, we often check various compilers' code and post the results in our blog. Decompiler programs, however, seem to be a bit neglected. To restore justice in this world, we analyzed the ILSpy decompiler's source code. Let's take a look at the peculiar things PVS-Studio found.

Читать далее
Rating 0
Comments 0

10+ Biggest Remote Tech Jobs Aggregators Comparison

Reading time 7 min
Views 3.8K

There is a myriad of articles about where to find remote jobs, particularly in tech. Some of them are outdated and most of them don't provide detailed reviews. So that's why I decided to do my own research. I did a basic search by "React" skill (where possible) and expected to see mostly "Frontend Developer" vacancies.

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 0

Finding Typos in the GTK 4 Project by PVS-Studio

Reading time 16 min
Views 620

0793_GTK_4_continue/image1.png


You may have already read a recent article about the first PVS-Studio run and filtration of warnings. We used the GTK 4 project as an example. It's about time we worked with the received report in more detail. Our regular readers may have already guessed that this article will be a description of errors found in the code.

Read more →
Total votes 6: ↑5 and ↓1 +4
Comments 0

C# Programmer, It's Time to Test Yourself and Find Error

Reading time 2 min
Views 1.2K

The PVS-Studio analyzer is regularly updated with new diagnostic rules. Curiously enough, diagnostics often detect suspicious code fragments before the end of the work. For example, such a situation may happen while testing on open-source projects. So, let's take a look at one of these interesting finding.

Read more
Rating 0
Comments 0

How I create browser applications inside browsers

Reading time 3 min
Views 1.6K

GitJS


In 2013 Canonical tried to crowdfund Ubuntu Edge smartphone. Its main feature could be the ability to use the smartphone as a full-fledged PС. Unfortunatly, the crowdfunding campaign did not accumulate enough money, so a dream of having a universal device remained to be the dream.


I've been searching for universality, too, on the software side, not the hardware one. Today I can confidently say I found the necessary combination: Git and JavaScript.


As you know, I have already described the benefits of browser applications (nCKOB static site generator) and the benefits of using Git instead of yet another back-end with API (GitBudget to track personal spendings). Once GitBudget was out, I spent the remaining 2020 to build a system allowing one to create browser applications right inside browsers. GitJS is the name of that system.

Read more →
Rating 0
Comments 0

Coins classifier Neural Network: Head or Tail?

Reading time 14 min
Views 1.3K

Home of this article: https://robotics.snowcron.com/coins/02_head_or_tail.htm

The global objective of these articles is to build a coin classifier, capable of scanning your pocket change and find rare / valuable coins. This is a second article in a series, so let me remind you what happened earlier (https://habr.com/ru/post/538958/).

During previous step we got a rather large dataset composed of pairs of images, loaded from an online coins site meshok.ru. Those images were uploaded to the Internet by people we do not know, and though they are supposed to contain coin's head in one image and tail in the other, we can not rule out a situation when we have two heads and no tail and vice versa. Also at the moment we have no idea which image contains head and which contains tail: this might be important when we feed data to our final classifier.

So let's write a program to distinguish heads from tails. It is a rather simple task, involving a convolutional neural network that is using transfer learning.

Same way as before, we are going to use Google Colab environment, taking the advantage of a free video card they grant us an access to. We will store data on a Google Drive, so first thing we need is to allow Colab to access the Drive:

Читать далее
Rating 0
Comments 0

Implementing Offline traceroute Tool Using Python

Reading time 30 min
Views 3.9K

Hey everyone! This post was born from a question asked by an IT forum member. The summary of the question looked as follows:


  • There is a set of text files containing routing tables collected from various network devices.
  • Each file represents one device.
  • Device platforms and routing table formats may vary.
  • It is required to analyze a routing path from any device to an arbitrary subnet or host on-demand.
  • Resulting output should contain a list of routing table entries that are used for the routing to the given destination on each hop.

The one who asked a question worked as a TAC engineer. It is often that they collect or receive from the customers some text 'snapshots' of the network state for further offline analysis while troubleshooting the issues. Some automation could really save a lot of time.


I found this task interesting and also applicable to my own needs, so I decided to write a Proof-of-Concept implementation in Python 3 for Cisco IOS, IOS-XE, and ASA routing table format.


In this article, I’ll try to reconstruct the resulting script development process and my considerations behind each step.


Let’s get started.

Read more →
Rating 0
Comments 0

Prometheus in Action: from default counters to SLO-related queries

Reading time 8 min
Views 7K

All Prometheus metrics are based on time series - streams of timestamped values belonging to the same metric. Each time series is uniquely identified by its metric name and optional key-value pairs called labels. The metric name specifies some characteristics of the measured system, such as http_requests_total - the total number of received HTTP requests. In practice, you often will be interested in some subset of the values of a metric, for example, in the number of requests received by a particular endpoint; and here is where the labels come in handy. We can partition a metric by adding endpoint label and see the statics for a particular endpoint: http_requests_total{endpoint="api/status"}. Every metric has two automatically created labels: job_name and instance. We see their roles in the next section.

Prometheus provides a functional query language called PromQL. The result of the query might be evaluated to one of four types:

Scalar (aka float)

String (currently unused)

Instant Vector - a set of time series that have exactly one value per timestamp.

Range Vector - a set of time series that have a range of values between two timestamps.

At first glance, Instant Vector might look like an array, and Range Vector as a matrix.

If that would be the case, then a Range Vector for a single time series "downgrades" to an Instant Vector. However, that's not the case:

Read more
Rating 0
Comments 2

Distributed Tracing for Microservice Architecture

Reading time 8 min
Views 5K

What is distributed tracing? Distributed tracing is a method used to profile and monitor applications, especially those built using a microservices architecture. Distributed tracing helps pinpoint where failures occur and what causes poor performance.

Let’s have a look at a simple prototype. A user fetches information about a shipment from `logistic` service. logistic service does some computation and fetches the data from a database. logistic service doesn’t know the actual status of the shipment, so it has to fetch the updated status from another service `tracking`. `tracking` service also needs to fetch the data from a database and to do some computation.

In the screenshot below, we see a whole life cycle of the request issued to `logistics` service:

Read more
Rating 0
Comments 0

NTFS Reparse Points

Reading time 8 min
Views 2K
Hi, Habr. Here I have prepared for you a small guide about NTFS Reparse points (hereinafter RP). This article is for those who are just starting to dive into the Windows kernel drivers development. In the beginning, I will explain the theory with examples, then I will give an interesting task to solve.


Read more →
Total votes 11: ↑11 and ↓0 +11
Comments 0

Algorithms in Go: Merge Intervals

Reading time 4 min
Views 3.5K

This is the third part of a series covering the implementation of algorithms in Go. In this article, we discuss the Merge Interval algorithm. Usually, when you start learning algorithms you have to deal with some problems like finding the least common denominator or finding the next Fibonacci number. While these are indeed important problems, it is not something that we solve every day. What I like about the Merge Interval algorithm is that we apply it in our everyday life, usually without even noticing that we are solving an algorithmic problem.

Let's say that we need to organize a meeting for our team. We have three colleagues Jay, May, and Ray and their time schedule look as follows (a colored line represents an occupied timeslot):

Read more
Total votes 2: ↑2 and ↓0 +2
Comments 0

Revealed: 7 Top Web Development Companies & Trends for 2021

Reading time 5 min
Views 7.5K
image

As we enter a new decade, the IT industry has also encountered many loopholes that we must work on. Seeing this, hundreds of motivated young minds have decided to become entrepreneurs. But is it so easy to succeed in a world where competition is already so high?

Bluntly, the answer is NO. It is not easy to be successful, and the reason for these startups' failure is the lack of digital presence or inadequate technical support. Another major reason that has been seen is the wrong choice of the web development company.

Hiring dedicated web developers may seem like an easy task at first, but it is not. It is one of the most challenging tasks. And to prevent you from falling into the pits of failure, I have created a list of the 7 best web development companies in India and abroad.
Read more →
Rating 0
Comments 0

Architectural approaches to authorization in server applications: Activity-Based Access Control Framework

Reading time 10 min
Views 1.4K

This article is about security. I’ll focus on this in the context of web applications, but I’ll also touch on other types of applications. Before I describe approaches and frameworks, I want to tell you a story.


Background


Throughout my years working in the IT sphere, I’ve had the opportunity to work on projects in a variety of fields. Even though the process of authenticating requirements remained relatively consistent, methods of implementing the authorization mechanism tended to be quite different from project to project. Authorization had to be written practically from scratch for the specific goals of each project; we had to develop an architectural solution, then modify it with changing requirements, test it, etc. All this was considered a common process that developers could not avoid. Every time someone implemented a new architectural approach, we felt more and more that we should come up with a general approach that would cover the main authorization tasks and (most importantly) could be reused on other applications. This article takes a look at a generalized architectural approach to authorization based on an example of a developed framework.


Approaches to Creating a Framework


As usual, before developing something new, we need to decide what problems we’re trying to solve, how the framework will help us solve them, and whether or not there is already a solution to these issues. I’ll walk you through each step, starting with identifying issues and describing our desired solution.


We’re focusing on two styles of coding: imperative and declarative. Imperative style is about how to get a result; declarative is about what you want to get as a result.

Read more →
Rating 0
Comments 0

Coins Classification using Neural Networks

Reading time 19 min
Views 2.8K

See more at robotics.snowcron.comThis is the first article in a serie dedicated to coins classification.Having countless "dogs vs cats" or "find a pedestrian on the street" classifiers all over the Internet, coins classification doesn't look like a difficult task. At first. Unfortunately, it is degree of magnitude harder - a formidable challenge indeed. You can easily tell heads of tails? Great. Can you figure out if the number is 1 mm shifted to the left? See, from classifier's view it is still the same head... while it can make a difference between a common coin priced according to the number on it and a rare one, 1000 times more expensive.Of course, we can do what we usually do in image classification: provide 10,000 sample images... No, wait, we can not. Some types of coins are rare indeed - you need to sort through a BASKET (10 liters) of coins to find one. Easy arithmetics suggests that to get 10000 images of DIFFERENT coins you will need 10,000 baskets of coins to start with. Well, and unlimited time.So it is not that easy.Anyway, we are going to begin with getting large number of images and work from there. We will use Russian coins as an example, as Russia had money reform in 1994 and so the number of coins one can expect to find in the pocket is limited. Unlike USA with its 200 years of monetary history. And yes, we are ONLY going to focus on current coins: the ultimate goal of our work is to write a program for smartphone to classify coins you have received in a grocery store as a change.Which makes things even worse, as we can not count on good lighting and quality cameras anymore. But we'll still try.In addition to "only Russian coins, beginning from 1994", we are going to add an extra limitation: no special occasion coins. Those coins look distinctive, so anyone can figure that this coin is special. We focus on REGULAR coins. Which limits their number severely.Don't take me wrong: if we need to apply the same approach to a full list of coins... it will work. But I got 15 GB of images for that limited set, can you imagine how large the complete set will be?!To get images, I am going to scan one of the largest Russian coins site "meshok.ru".This site allows buyers and sellers to find each other; sellers can upload images... just what we need. Unfortunately, a business-oriented seller can easily upload his 1 rouble image to 1, 2, 5, 10 roubles topics, just to increase the exposure.

So we can not count on the topic name, we have to determine what coin is on the photo ourselves.To scan the site, a simple scanner was written, based on the Python's Beautiful Soup library. In just few hours I got over 50,000 photos. Not a lot by Machine Learning standards, but definitely a start.After we got the images, we have to - unfortunately - revisit them by hand, looking for images we do not want in our training set, or for images that should be edited somehow. For example, someone could have uploaded a photo of his cat. We don't need a cat in our dataset.First, we delete all images, that can not be split to head/hail.

Читать далее
Rating 0
Comments 0

How PVS-Studio Checked ELKI in January

Reading time 9 min
Views 710

If you feel like the New Year just came, and you missed the first half of January, then all this time you've been busy looking for tricky bugs in the code you maintain. It also means that our article is what you need. PVS-Studio has checked the ELKI open source project to show you errors that may occur in the code, how cunningly they can hide there, and how you can deal with them.


ELKI/image1.png

Read more →
Total votes 3: ↑3 and ↓0 +3
Comments 1