Developers Club geek daily blog

Paranoia and hashes

2 years, 1 month ago
image

It is a little protection against code injection, but
This method not the panacea, but complicates life of injections of a code a little.

Lyrics


Since with each jump of high-level programming less people understand the assembler, that is sense to reflect:
And what if the program which you perform is not it?
Or, and that if the virus replaces pieces of the program which you use?
Smart people in far 80kh thought up one recipe to confirm integrity of executive files and their separate pieces — hashes. Usually all releases of libraries are delivered with a hash or the digital signature whether to check this author delivers to us a liba, or the application whether it was changed by nobody except it.
There are languages (With, C ++) which does not support this feature in a rantayma (such as in Oberon in whom there are a few sensible ideas as modules for example), but With is good the fact that with his straight arms it is possible to finish a little a file. At big desire it is also possible to finish About the compiler, but it is other history.
Why you should not trust anybody?
There are many versions of the answer to this question. Part of them in a comic type.

Read more »


memset — the party of darkness

2 years, 1 month ago

Read more »


Forward, on searches of palindromes 2

2 years, 1 month ago
Not so long ago read on Habré the article "Forward, on Searches of Palindromes" about a solution and optimization of a curious competitive problem with very laconic formulation:

"The decimal number 585 is 1001001001 in binary. It is palindromic in both bases. Find n-th palindromic number". Or, in Russian: "The decimal number 585 in binary numeral system looks as 1001001001. It is a palindrome in both numeration systems. Find n-y a similar palindrome".

Read more »


Verone — the static analyzer for C ++ with the analysis on the fly

2 years, 1 month ago
My name is Vladimir Plyashkun and I am going to present the free static Verone analyzer in today's article for C ++ 03/C ++ 11/C ++ 14 which main feature is the analysis on the fly.

Read more »


Cross-compilation and assembly of a packet under Synology DSM

2 years, 1 month ago
On the new place of work to me set the task to start a product on NAS from vendors of Synology and QNAP. The product is written on C ++ using C ++ 11, Boost and Qt5. For the lack of free the developer's web, the interface was written nawt which in turn for assembly uses CMake. Under a cat there will be an assembly of this zoo and creation of a simple packet.

Read more »


The most dangerous function in the world With/with ++

2 years, 1 month ago
memset()
Checking many years different C/C ++ projects, I declare: the most unsuccessful and dangerous function — memset (). When using memset function () allow the greatest number of errors, in comparison with use of other functions. I understand that my output will hardly shake bases of the universe or is incredibly valuable. However I think, it will be interesting to readers to learn why I came to such conclusion.

Hello


My name is Andrey Karpov. I combine many positions and occupations. But the basic that I do, I tell it to programmers about advantage which static analysis of a code can bring. Naturally I do it with a mercenary motive, trying to interest readers in the PVS-Studio analyzer. However, it does not reduce an interesnost and usefulness of my articles.

The only type of advertizing which can punch scaly armor of programmers is demonstration of examples of errors which PVS-Studio is able to find. For this purpose I check a large number of open projects and I write articles about results of researches. General benefit. Open projects become a little better, and our company has new clients.

Now it will become clear to what I conduct. Being engaged in verification of open projects, I saved up big base of examples of errors. And now, based on it, I can find interesting patterns.

For example, one of interesting supervision was that programmers make mistakes at Copy-Paste most often right at the end. On this subject I bring to attention the article "Effect of the Last Line".

Read more »


Target figure Damme's by method

2 years, 1 month ago
КДПВThe target figure is often added to identifiers which people can write or give with errors that then to find these errors.

The last digit of a credit card number, the ninth digit of the VIN cars sold in in the USA or the last digit of ISBN can be examples.

Algorithm of a target figure of van Damme — rather new and therefore little-known. It is published 2004.

The algorithm finds all errors in one digit and all single shifts of the next digits. It is much simpler, than Verkhuff's algorithm, comparable by opportunities, and does not demand use of special characters (such as X in 10-unit ISBN).

Read more »


Writing of MKE of the clerk in less than 180 code lines

2 years, 1 month ago
Today, MKE is probably the most widespread method for a solution of a wide range of applied engineering tasks. Historically, it appeared from mechanics, however afterwards was applied to various not mechanical tasks.

Today there is a big variety of software packages, such as ANSYS, Abaqus, Patran, Cosmos, etc. These software packages allow to solve problems of construction mechanics, mechanics of liquid, thermodynamics, electrodynamics and many others. Implementation of a method, as a rule is considered rather difficult and volume.

Here I want to show what now, using modern tools, writing of the elementary MKE of the clerk from scratch, for a two-dimensional problem of a flat tension is not something very difficult and bulky. I selected this type of a task because it was the first successful example of application of the finite-element method. Well and of course it are the simplest for implementation. I am going to use a linear, three-nodal element as it is the only flat element in case of which integration is not required numerical as it will be shown below. For elements of higher order, except for integration operation (which not absolutely trivial, but at the same time its implementation rather interesting) idea absolutely same.

The picture for drawing attention:

Read more »


The announcement of online courses of Technopark, Technosphere and Tekhnotrek on Stepic

2 years, 1 month ago


Pleasant news to all who have no opportunity to be trained in Technopark, the Technosphere or Tekhnotreke: now courses of these projects are available in the form of online courses on the Stepic platform! Today record on five disciplines is available:


Over time the quantity of courses will be increased.

Why we do it? Quite obviously: not everyone can become the listener of our projects, only pupils from three Moscow higher education institutions can take part. And thanks to online training also many other talented students will be able to gain knowledge, so useful to the beginning IT specialists. Within online courses pupils will be able to watch content interesting by it and to perform practical tasks for check of the acquired material. Besides, they will have an opportunity to communicate with each other, to discuss tasks and to ask questions online. Following the results of successful passing of a course the certificate will be issued. And now is more detailed about available disciplines.

Read more »


Works and koproizvedeniye

2 years, 1 month ago
It is the fifth article from the cycle "The Category Theory for Programmers". The previous articles were already published on Habré in transfer Monnorochof :
0. The category theory for programmers: preface
1. Category: composition essence
2. Types and functions
3. Categories, big and small
4. Kleysli's categories

On KDPV a pig Pyotr brings on one tractor to each object of category.

Follow on shooters


The Ancient Greek playwright Euripedes wrote "Any person is similar to the environment". It is right also for the category theory. It is possible to select a certain object of category only by the description of nature of its relationship with other objects (and by itself) where the relations are morphisms.

For object definition in terms of their relationship the category theory resorts to so-called universal constructions. For this purpose it is possible to select some template, the chart from objects and morphisms of a certain form and to consider all constructions of the considered category suitable under it. If the template is rather widespread and the category is rather big, then probably the found constructions will be very much and many. The idea of universal construction consists in arranging constructions under some law and to select the most suitable.

This process can be compared to net search. The request of the user is our template. If the request is not really specific, then in reply the search engine will issue a set of suitable documents, only part of which are relevant. To exclude irrelevant answers, the user specifies request that increases search accuracy. Eventually the search engine will range coincidence and if carries, the required result will be in the list head.

Read more »