Developers Club geek daily blog

The recurrent neural network estimated responses of the audience of a new episode of "Star wars" at 10 lines of a code

1 year, 7 months ago
Hello, Habr! Recently we received from "News" the order for carrying out research of public opinion on a movie occasion "Zvezdny voina: Awakening of Force" which premiere took place on December 17. For this purpose we decided to carry out the analysis of a tonality of the Russian Twitter segment on several relevant hashtags. Result from us waited for everything in 3 days (and it in the end of the year!) therefore we needed very fast method. We found several similar online services (among which there is sentiment140 and tweet_viz) in the Internet, but it turned out that they do not work with Russian and for some reason analyze only small percent of tweets. We would be helped by the AlchemyAPI service, but restriction in 1000 requests a day also did not suit us. Then we decided to make the analyzer of a tonality with a blackjack and all the rest, having created unpretentious recurrent neural network with memory. Results of our research were used in article of "News" published on January 3.



In this article I will a little tell about such networks and I will acquaint with pair of cool tools for house experiments which will allow to build neural networks of any complexity in several code lines even to school students. Welcome under kat.

Read more »


Use of the LSM engine from SQLite 4 as separate NoSQL of the database with use of Python

1 year, 7 months ago
image

Today two of my most favourite subjects — SQLite and key-value of the database. And this time I write about both at once: this post is devoted to a Python-wrapper for the storage used in SQLite 4 key-value on the basis of LSM.

I not too attentively trace SQLite releases, but version 3.8.11 drew my attention as in its description serious increase in performance in comparison with 3.8.0 is declared. In accompanying information I came across mentioning of new experimental expansion for full-text search (about which wrote once) and therefore it became interesting to me what develops a situation with SQLite 4.

Having studied available information, I paid attention that one of tasks of developers was to provide in new versions the interface for the connected engines of databases. At the time of writing of this post in SQLite 4 there were already two built-in backends, one of which — key-value storage on the basis of LSM. Few months I happened to be played the last with Cython while I wrote a Python-wrapper for the built-in k-v of UnQLite and Vedis storages. And I thought that it would be quite good to apply Cython to creation of the interface of the DB engine on the basis of LSM used in SQLite 4.

Having dealt with the source code SQLite 4 and the tiny heading LSM file, I wrote python-lsm-db (documentation).

Read more »


Automatic start of Libre/OpenOffice in a listen mode from Python

1 year, 7 months ago
Libre/Open Office give an opportunity of work with office through UNO API. In order that it was possible to address office it is necessary to start it in a listen mode.

For example:
soffice --accept="socket,host=localhost,port=2002;urp;"

This approach is quite logical and clear from the point of view of developers of office, but bears a number of inconveniences. In particular, it is necessary to start independently Libre/Open Office in a listen mode. Personally it is not clear to me why developers were too lazy and did not provide function of start of office. Well it is fine, everything would be made, programmers would not be necessary. Let's solve therefore a problem by own efforts.

Read more »


Solution of a puzzle of Galakub on the Python

1 year, 7 months ago
For new year purchased to the nephew a puzzle of Galakub. A task to collect a cube of 4х4х4 in size from different parts. Total amount of parts, just, 4х4х4. Before to give it was necessary to collect a puzzle. The beautiful symmetric solution was found quickly enough. But there was interestingly only this solution or not. The intuition prompted that the only thing, but there was a wish to check.


I decided to notch quickly a script for search of all options. It was ideally necessary to be in time before the New Year's speech of Putin. The situation was aggravated with the fact that the code was written on Makbuk my parents. To put on it some libraries is a task more abruptly, than to write the program.

The code turned out surprisingly beautiful and clear. It is convenient to explain it. Perhaps, the text will be useful, for example, studying the Python.

Read more »


Numpy and multiprocessor

1 year, 7 months ago
Already many use numpy library in the python-programs as it considerably accelerates work with data and execution of mathematical operations. However in many cases of numpy works many times more slowly, than she can … because uses only one processor though she could use everything that you have.

Read more »


Kaggle and Titanic — one more solution of a task by means of Python

1 year, 7 months ago
I want to share experience with a problem of the known tender of machine learning from Kaggle. This tender is positioned as tender for beginners, and I just had no practical experience in this area. I knew the theory a little, but almost did not deal with real data and densely did not work with a python. As a result, having spent couple of New Year's Eve evenings, gathered 0.80383 (the first quarter of a rating).



Generally this article for still beginners from already begun.

Read more »


Asterisk + Huawei E1550 or as you should not save on telephony

1 year, 7 months ago
When I one and a half years ago, being a student 4 courses of telecommunications, came to work to the company for the system administrator's position, I understood what works I will have much, and it is necessary to teach all new even more. I pushed study the background, and then began to appear on couples of times at all a month because there is a lot of work, and it was precisely more interesting than what tried to teach in University to.

The company was engaged in sales, and naturally there were many such little men who are called sales managers, and they needed to call much!

In the first day showed me the existing system of telephony. 5 gateways VoIP Audiocodes MP-202B and ten DECT of phones + separate SIP a trunk on each phone. With these phones 30 people also juggled all day. That for..., I thought and decided to deliver to Asterisk.

Read more »


Moscow Python Meetup No. 31

1 year, 8 months ago
On December 22nd on a site of IIDF City Hall the 31st New Year's MoscowPython-mitap will take place. At a meeting it will be declared some "surprises" which we prepare next year, well and of course, as usual we will hear interesting and useful reports, including the report of one of evangelists of community.



Read more »


Multiplication by a method of the Russian peasants

1 year, 8 months ago
Sometimes this method call "country multiplication", sometimes "Ancient Egyptian", sometimes "Ethiopian", sometimes "multiplication through doubling and halving". Some it is well-known, some – is unclear, but at the same time it is rather useful and can be used not only for multiplication, but also for exponentiation and calculations of matrixes.

Algorithm


  13  x  19 ->     0
   6     38       19
   3     76 ->
   1    152 ->    95
   0    304      247
                 ^^^

Let's write two multiplied numbers nearby – they will become headings of two columns. The third column will contain the increasing sum.

If number in the left column odd, we add number from the right column to the increasing sum. Initially it will be equal to zero.

Then in the left column below we write number from heading, divided in half (with discarding of a remaining balance). 13 / 2 = 6. And in the second column we write the number equal to doubling of column heading, 19*2 = 38.

As number in the left column even, we do not increase the increasing sum.

Read more »


Python-> Cython-> C ++ and COM in addition: writing of a framework for autotests

1 year, 8 months ago
I think everything it is aware about advantage of autotests. They help to keep a code in operating state even at essential changes. Also it can relieve testers of tiresome handwork and allows to concentrate on more interesting types of testing.

In spite of the fact that to separate parts of our project more than 25 years, we only at the very beginning of a way of implementation of automatic testing. Nevertheless, we already have some progress of which I want to tell in this article.

How to write good autotests – a subject of separate article. And probably not one. I will tell you as we implemented testing of separate components. Components are written on With ++ and very similar to SOM have interfaces. As language for tests we selected python and we use very powerful test framework of PyTest. In article I will tell about difficulties of a linking of C++/COM and a python, reefs which we came across and as solved these problems.

Read more »