Developers Club geek daily blog

Forward, on searches of palindromes 2

2 years, 9 months 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 »


As we again wrote ourselves or how to lose source codes and not to give a sign

2 years, 9 months ago


There was a fine May day. My look accidentally fell to a chat of children from the extreme server. They had not such May day fine: during the relayout of minor service authorization service, related so far as fell. Situation tsimmes that nobody supports the falling part of service of authorization it devolved to us and never especially failed. I was carried away by reading the detective of search of the reasons, and till a certain moment I was a passive reader — yet did not see the phrase of our administrator filled with the purchased gray hair of his hair: "For an hour 800+ flows accumulate".

Read more »


Dizaynim prototypes of cells in one XIB-e with UITableView

2 years, 9 months ago
And at the same time once and for all we solve a problem of automatic calculation of height of cells.

Disclaimer:
Possibly, this method does not provide the best performance, can have a quantity of reefs, make dizziness, sick and a devil, a request not to read to old men and pregnant children.

Creation Overcoming of difficulties — probably the best motivation of the programmer. Not the secret, Xcode contains a great lot of defects, opaque solutions and bugs. Today I will try to find a solution of one of them


Read more »


Writing of the elementary program under Linux in machine codes

2 years, 10 months ago
All hi. I wanted to touch this subject long ago and to write something similar, but hands did not reach in any way. Today I decided, and we will sort structure of the ELF file (the performed file on * nix-like systems), and we will write the simple program under x86 Linux in machine codes which will display the message. But here not everything is so unambiguous, believe me.

I wanted to begin with the end. Namely from what will be done by our program. Our program — no other than a heap of machine code which, afterwards, will be performed by system. As the deputy of numeration system of Hex I will use "Wct" because it is much more convenient because there is online the compiler and an opportunity to insert lines on the run and to use decimal numbers. At us it will display one line of the text.

image

Read more »


The game "Life" on logical elements

2 years, 10 months ago
In advance I will warn: it is a lot of pictures.

In this article it will be a question of implementation of the game "Life" on logical elements in the Atanua simulator.

Read more »


Typical rake on the way of the programmer from Junior'a to Senior'U

2 years, 10 months ago
The young programmer who hardly finished or still even not finished VUZ, is ready to pull up trees, to study, to learn and to study once again and the nearby future seems to it it:


But more experienced companions know that actually a rake and a way from Junior'a to Senior'U are spread carefully out to its ways for a long time looks somehow so:


Let's remember some typical rake on which all of us (well or the majority) stepped that without noticing. Of course, for experienced developers a lot of things will seem obvious captaincy, however such traps can easily take away young specialists on a dark side of force.

Read more »


Regular expressions and mathematical parser

2 years, 10 months ago
Once long ago, me the parser of mathematical expressions on C# was necessary. Of course, to download ready implementation — not a problem. But here only I those years had no Internet. As a result it is absolute without thoughts and without theoretical bases of parsers, finite state machines and other it was written through regular expressions. Minutes for 10. It should be noted that actions and brackets were necessary only arithmetic. Support of trigonometric functions and other was not required.

Read more »


NSNJSON. 道 (Final article)

2 years, 10 months ago
道 — a way. In this final article about the NSNJSON format I want to tell about my way which led me to the invention of this format.

In comments to my last articles ("The complicated simplified JSON" and "JSON for fans skobochek") questions of sense, complexity, an udobnost and applicability of this format repeatedly sounded. So, I hurry to congratulate all not indifferent — you waited!


Read more »


How to draw curve diagrams in XKCD style

2 years, 10 months ago
Recently I published article on Habré about the guitar tuner, and the animated diagrams which I used for an illustration of sound waves, including technology of creation of such diagrams interested many. Therefore in this article I will share the approach and a bibliotechka on Node.js which will help to build similar diagrams.



Read more »


Automatic generation of a program code of the microcontroller on a basis it is event - the oriented model

2 years, 10 months ago
Problem definition:
Creation of a complex automated system on the basis of the controller for management of the different periphery (electronic locks, the engine, LED tapes and other electronics).

Creation of this system was required for a room quest, similar this, but in the city of Khabarovsk.
Our quest in other setting, but in general has approximately the same set of executive mechanisms: relay, locks, tapes, sealed-contacts, etc.

Main requirements to system:
  • Reliability — when developing complex systems is high probability to make difficult audible mistakes, the more a code the chance to pass an error is more and the more time is necessary on debugging, it is necessary to minimize probability of incorrect work.
  • Flexibility — an opportunity with the minimum time expenditure to change logic of work
  • Functionality — management of any equipment and connection of any sensors

image

Read more »