Developers Club geek daily blog

"Other" logic and reversible calculations

1 year, 3 months ago
камень-ножницы-бумага (на ауребеш) At the end of last year the Google Translate Aurebesh added support of "Galactic language" to an output of a new episode of "Star wars". The truth it turned out that at the choice of this language just there is transfer into English. If to use Chrome or Firefox, then there is a font in which instead of Latin characters aurebesh are substituted, and in IE without special cunnings the English text is output.

Began to remember other examples of creation of "languages of strangers". For example, language Klingonov from "Star Trek" is based on Latin too, but at the same time is worked rather out, has the syntax and the dictionary. Languages of the people of Sredizemya from "Lord of the Rings" – in general separate history.

And still there are such languages as the Linkos which is specially developed by Hans Freudental for interplanetary communication and based on the assumption that the mathematics is a universal language of communication for any reasonable beings.

Read more »


As in 3 days to create the game engine for short stories

1 year, 3 months ago
In one rainy Petersburg afternoon my project ceased to be loaded into UE4, and because of it I wanted to make the own engine. And one short story pushed me to make the engine for short stories. If you want to learn more and you are not afraid of goto, gosub and other horrors, welcome under kat.
image

Read more »


Webpack ProvidePlugin: how not to write the import/require sheet at the beginning of module javascript

1 year, 3 months ago
If you develop on modern javascript, then almost any your module contains a sheet of such lines:

import React from 'react'
import $ from 'jquery'
...

As it appeared, the majority of these lines can be not written, having entrusted their generation to automatic equipment. Also modern webpack in which as it appears, it is complete of pleasant surprises helps with it. Except all the known require and import for any files and "hot module replacement" which is already described on Habré, webpack can analyze your source code and automatically turn on the necessary modules on the basis of the used literals. Under a cat — the short description as works this magic.

Read more »


How to monitor emergence of questions on toster.ru and ru.stackoverflow.com

1 year, 3 months ago
image
All hi.

So it turned out that for a long time the question torments: "How to monitor forums on subjects interesting to you, but the most important how to learn about emergence of new questions at the time of their publication". Of course, one may say, that there are mailings, RSS, but personally at me it turns out so that I reach mail, as a rule, with mobile during movement. To manually serfit resources not option at all. Here therefore if I could also answer, there is no computer near at hand. And after arrival the head is already stuffed absolutely to others. I can safely formulate the problem. The channel reporting and the most important, drawing my attention at the time of the publication of a new question is necessary.

Until recently it I considered some IM, for work of Telegram I do not use, and with the others all something not absolutely so.

Read more »


Why I recheck the written data, or History of one investigation …

1 year, 3 months ago
Recent habrastatya about distinctions in byte by byte identical files caused from memory depths (and a mailbox) a small piece of my correspondence with one of the engineers who were responsible at that time for the line of the disks MPG in the Fujitsu company. For convenience of English nonspeaking readers, I give transfer from English under a cat.

Read more »


As I looked for (and found) a difference in two byte by byte identical files

1 year, 3 months ago
We have one .NET-application which is able to load and use plug-ins. Plug-ins — business good. It is possible to expand functionality, it is possible to update quickly them from the website, it is possible even to give to users SDK and to allow to write the plug-ins. We also did all this. Our plug-ins represented normal .NET-assemblies which needed to be thrown in a certain folder from where the basic of the application loaded them and used. Well, you, probably represent as — Assembly.Load (), we look for the class implementing the necessary interface further, we create object of this class, etc. All this worked long ago, is stable and nothing portended trouble. But suddenly at some point there was a need to create the plug-in consisting of several files. In this regard was decided to consider as a plug-in not just .NET-assembly (1 file), and zip-archive in which can be as one assembly, and several files. In this regard plug-ins in archives were necessary to teach to pack the bild-server, and the main application — to extract them in the right place. In general a task on 10 code lines. Nothing portended trouble. And here I from the bild-server download collected archive with a plug-in, I will extract it in the necessary folder, I start the application, and … does not work! Stop how does not work? It same plug-in!

Further — more. I ask to do the same procedure my colleague, on its computer. It tries — and everything works for it! But how so? One application version, the same file from the bild-server. Some difference in an environment? I sit down at the colleague's computer, I try once again — does not work! It in it tries time on mine — works! That is it turns out that the file "remembers" who extracted it! We call the third colleague to observe this circus. Consistently, on the same computer, in turn we do the same actions: we download archive with a plug-in, we will extract in the necessary folder, we start the application. When it is done by me — the program does not see a plug-in when it is done by the colleague — everything works. On the third circle of these interesting experiments suddenly we notice a difference in actions: I extracted a plug-in with standard means of Windows, and my colleague — with the help 7-Zip. Both was caused by us from a context menu of archive so in the beginning nobody noticed a difference in click on not that point. Well ok. It turns out, the file retrieved from zip-archive with the help 7-zip differs from the same file from the same archive retrieved by means of the standard Windows archiver?

By the way, until you opened article under a cat, answer for yourself a question whether there can be it that contents of files of valid zip-archive at extraction 7-zip and through the conductor of Windows will be a miscellaneous?

Read more »


Shortcuts in JavaScript

1 year, 4 months ago


Learning any programming language, it is useful to know about its features and to be able to use effectively language constructions. I want to share with you shortcuts for JS. These reductions in certain cases can facilitate reading a code, and also it is essential to reduce its quantity. However it is necessary to remember that they can play a dirty trick with you and if to use them everywhere, your code will stop being read and supported.

Read more »


Advent of Code

1 year, 4 months ago
It is surprised that the link to Advent of Code is still not visible on Habré.



If in brief, then it is a Christmas calendar where every day opens on a small problem on programming. Today Friday, 18 pieces — an excellent occasion to warm up brains, or to be trained in writing of programs in a modern language which studying was not reached by hands in any way are also already opened.

Read more »


We mix colors correctly or we optimize AlphaBlend

1 year, 4 months ago
I write multilegal (but not multiplatform, alas, now only windows) a messenger which meanwhile supports only the TOX protocol. But the speech not about a messenger, and about its interface, and if more precisely, about its basic function — AlphaBlend. Yes, I decided to write the GUI bicycle. And what modern GUI without translucent elements and smooth curves? Therefore sharply there was a need to mix images taking into account translucency, i.e. alpha mixing or alpha blending. Fortunately, in the Windows GDI such function is available — AlphaBlend. Works as it is necessary, does what is necessary. But I that still the builder of bicycles, and it became interesting to me whether I will be able to write the same function, but faster. Result of my works under a cat.

Read more »


The self-modified code

1 year, 4 months ago
In article it is in detail told about self-modified a code (SMK), and about how to use it in the programs. Examples are written on C ++ with use of the built-in assembler. Still I will tell about how to execute a code on a stack that is an essential trump during the writing and execution of SMK.



1. Introduction


Well, went. Article promises to be long as I want to write it such that you had no questions. On SMK there are already one million articles, but my vision of a problem – after hundreds of hours of writing of SMK is provided here … I will try to push all the works here. Everything, be enough tomato juice (or that you prefer to drink there), do music louder and be going to learn how to relieve the application of the beginning crackers! In passing, I will tell you about memory of Windows and some other things about which you even do not suspect.

Read more »