Hey. My name is Dima, and I'm a Avito backend developer. I happened to participate in a handful of hackathons: small and large, Russian and foreign, foreign and within companies, remote, distributed and classical. I want to tell you how they helped to get acquainted with Omsk grandfather, to get infected with cryptobacteria, to launch a virtual spacecraft into the erlang-universe and save humanity from extinction.

I started participating in hackathons, being a php-backend developer and having some experience in front-end development. It is quite obvious that I wrote on hakathons on anything other than php: on python, rasto, go, erlange, and other javascripts with the reactor neytivam. I was very lucky with the team: the guys were quite strong techies and really wanted to do something non-standard. Starting from the first hackathon, we developed the main criterion for evaluating an idea. She is steep just as much as a turn. Practicality, applicability in real life, the possibility of monetization - this is all not for us.
The use of rare or non-standard tools, for example, adds to the project’s shortness. Or use of standard tools in an unexpected way. Discussing the project, we tried to bring the level of perverse to one hundred percent. Evaluation was given by team members, which were based on the madness of the proposed components and solutions.
')
Years passed, work changed, city, hackathon complex. But the uproar still occupies an important place in the choice of ideas. I'll tell you about some of the projects over which we managed to work on external hackathons.
Projects
ndrctl
The name is pronounced “indirectly”. Multiplayer 2D game in an open universe. Space ships can fly, attack each other and space objects. In the future - to trade and other delights. But all this is not enough stubborn. And what if you make the management of the ship indirect (hence the name of the project)? Suppose you can't just send a ship to fly left. But you can put two engines on the left and right and allow you to install traction for each of them. Want to fly left? Turn the ship in the right direction, driving both engines, then gas to the floor. Plus ten flips. How to make it even more fun? You can control the ship using the code. Ordinary such, pkhp or pitonyachy. Plus ten more. Approximately a scale of upward movement was arranged. As you can see, in the current form, the idea has not yet been worthy of implementation.
At that moment, they sawed the work environment at work. The times were wild, the docker was not old enough, the guys from Google had not had a dream yet, there were no ready solutions. The issues of virtualization and containerization, isolation, rapid deployment of snepshots have become acute. Obviously, all this infrastructure appeared in the game.
Each spacecraft was an lxc-container protected by a set of apparmor-rules. Engines, radar and other devices were mounted as virtual block devices. The code loaded by the player into the ship could interact with these devices, and this was the only way to interact with the universe. Want to know where you are - read data from the sensors. If you want to send a ship to a certain point, you assign traction to engines. Since the ships were containers, the player could write code in any language.
And the universe was on an erlang. Generated tics, asked physics, calculated the position of the ships, taking into account the thrust indicators of the engines, handed out readings to the sensors. Erlang - because the leader of our gang was interested in functional programming languages ​​at that moment.
Visualized in html5, svg. At the demonstration they tried to download a snippet of the code that made the boat fly in circles. But he stubbornly rotated around his axis and flew in a spiral into open space. So we wrote the first game in our life in which we lost.
Photo: FB HackdayRussiacryptobact
On the user's device (laptop, phone, tablet) live bacteria. They know how to eat, multiply, attack enemies. Multiplayer game in an almost real world.
Photo: hackaphone.ruWhen you start the game from the device is going to unique fingerprint. DNA is formed on its basis. During reproduction, an evolutionary algorithm with random mutations is activated. New generations of bacteria can turn out faster or slower, more lustful or chaste, more voracious or more modest in food, more resistant to external influences or with reduced immunity.
Users who are on the same Wi-Fi network can exchange their bacterial strains with some probability. At the same time, a colony of bacteria that has settled in someone else's device may begin to attack enemy bacteria. Or assimilate with them. Or die from their paws.
At that time, bitcoin was walking on the planet, everyone was interested in the blockchain. We decided to use a similar algorithm to sign the evolution steps. This prevented the potential opportunity to quickly scroll through the evolution on their device, getting bacteria superplugs.
Visualized on OpenGL. And there are triangles. Midnight triangulated the pictures of the bacteria to get the coordinates of the vertices. I missed one peak, a corner stuck at the bacterium. They made an application for android, put it on the devices of all willing participants of the hackathon, they infected them with cryptobacteria.
go-android-rpc
At one of the distributed foreign hakatons, they decided to create the world's first android application, written entirely in go. At that time, it was already possible to create OpenGL applications on go. But there are triangles. And we wanted to use the SDK with all these buttons and text fields, so as not to draw ourselves. SDK in Java. We write on go. It seems nothing stops.
They picked up an RPC server in Java and acted as a client sending commands that were translated to Java. Parse the SDK documentation and create mirror calls for them. The team flew from go to Java, the result flew back. It was possible to create those buttons by calling the appropriate methods of the SDK.
The trouble is that the SDK methods often take objects. Find a way to link goshnye structures with java objects could not. It was necessary to be content only with those methods which were accepted by scalars. This was enough to create a text quest in the spirit of the eighties about a catastrophe on a spaceship.
apisal
Participated in thematic hackathon: services that are useful for the city. We made a service that takes a GPS track looking for interesting things, located near the route, and showing them in the form of an HTML page. A kind of creator of walk reports for lazy bloggers.
Inside they decided to implement a pipe a la unix. One part of the Wikimapia parsit, the other parses gpx tracks, the third smooths the corners along the route, the fourth draws the report. Parts are replaced, combined. Can be written in any language, so long as the specified interface is supported.
Photo: pvsm.rumoov
Continued to develop the idea of ​​routes and interesting. I wanted to get information in real time about what you can see nearby. And to touch the reactant. Made an application with a map of interesting, located nearby. The idea is rich: you can add a travel planner, travel social elements (one of which friends saw where he was traveling), build a report on the recorded track using apisal. But the reactor was important to us.
resurrect-the-evolution
We decided to conduct a mental experiment. The earth perished, but mankind managed to outfit a ship with colonists and genetic material and send it to a distant galaxy on a liveable planet. Technically, everything went well. They landed, unpacked the suitcases, thawed the genetic material, new generations recreated. But there is no cultural diversity, because people have lived on a spaceship for hundreds of years. They are very similar: one language, one cultural background. And they bring up people of new generations in the same way, they cannot give them enough breadth of mindset to solve the growing problems of the new world.
People found a solution: to settle colonists around the new planet by independent groups, almost completely prevent communication between groups for several centuries, create new customs and traditions, give each group its own language. Later, you can open the border and plunge into the wondrous diverse world.
We concentrated on one of the tasks: the need to give each group of people its own language. They wrote a generator of human languages, which takes the name of the language as input, and gives the output language ready for use. You can slip a piece of English text and get a rough translation into the generated language. My thoughts also included the creation of materials for learning the language: spelling, grammatical and explanatory dictionaries, a textbook.
Situations
On hakatony everything happens. For example, you may find yourself in a snowdrift in winter in slippers. Or with the Finns in the hole. Or even in Omsk. But first things first.
***
Once the hackathon took place in Omsk, and they were not allowed to spend the night on the landing. I had to urgently look for a hostel and check in to continue coding. Found a house, dialed an apartment number on the intercom, some grandfather answered. He spoke very politely and correctly for Omsk:
- Who's there?
- We are in the hostel.
- What other hostel? I don't know you, I won't let you in.
- ... oh, it seems we were wrong in the body.
- Yes? Well, then I went to FIG!
***
In the Novosibirsk Academgorodok there is a remarkable technopark building. They love to arrange hackathons. My first hackathon was there, arranged by a modest American search engine, who had a conference with very tasty kebabs in the next room. Do not ask how I know.
***
As it turned out on another hackathon, toilets are sometimes clogged in the technopark. A transition to another building inside the building is closed at night. In Novosibirsk it is cold. And snow. The guard of the neighboring building was very surprised when, at night, through a snowdrift in slippers, a gaggle of sleepy IT people rode up to ask for a toilet.
***
I arrived on one of the hakatons twenty kilometers away by bike. After two almost sleepless days I had to go back in the middle of the night. A couple of kilometers of the road were not covered at all; there was no lantern on the bicycle. Fortunately, there are no cars there at night. During the ride he closed his eyes. It turned out that there is no difference: you still can not see anything, but to feel that you have pulled over to the side of the road is quite simple and not looking.
***
Cold and snow do not scare frost-resistant Finns. Once on the hackathon in Helsinki, we went to the city to cheer up and take a walk. Nearby was a pier with an improvised hole, where Finns swam quietly. It was winter and cold. We could barely resist not to join them.
***
At one of the hackathons, the jury member really liked our project, and he advised his friend, who bought our team tickets for the hackathon to the capital.
***
On the other hackathon there was overcrowding. When we were looking for a place where we could work quietly and quietly, it turned out that everything had been occupied for a long time, and we could only be offered half of the table for three. Then we asked if they had any room. To which we received a confident answer that no. We did not lose our head and asked if they had a free floor. Free floor found. As a result, we spent two days on the almost empty floor of the wonderful Armagh, running after the sun, hunting for sunrises and sunsets.
Tactics
On hackathons, I like to do something strange, unnecessary, but interesting inside. Try to combine incompatible, use tools in a strange way. Quite an option. But there may be others. You can concentrate on solving a problem that does not allow living: write a plugin for your favorite editor to remove annoying operations, automate the routine process at work, organize photos or documents.
It seems promising to search for new approaches to familiar things. A good example is Tinder. Dating services have existed for decades, and these guys managed to find a new mechanic that many people liked.
You can make self-development the main value and set tasks for the hackathon based on the tools you want to explore. If you always dreamed of exploring growth - it's time to do it Have a positive experience with colleagues.
On the set of hackathons there is a mentor line. They invite experts who evaluate the potential of the idea in terms of monetization and scalability. For those who want to try their hand at a startup or accelerator, a hackathon can be a good format to try to make a prototype and “sell” it to sponsors.
Benefit
Each programmer lives with a set of cold and hot skills. Hot skills are the technologies and tools that are used in work. The cold ones are those about which the programmer has some idea, but it takes time to use them directly: read the documentation, play around with the prototype. Hackatons allow you to quickly transfer part of the skills from cold to hot.
Technologies tested on hackathones often come in handy at work. There are examples of the introduction of tools developed in the framework of the hackathon.
The hackathon format is very convenient for testing the hypothesis of a working product. In existing large systems there is a load of old code, business processes that need to be considered if you want to make serious changes. Hackathon allows you to implement some part of the project quite differently, without looking at this legacy.
An excellent bonus is the opportunity to spend several sleepless nights in the offices of various IT companies: many of them spend hackathons at their place, which allows them to look at the situation from the inside. You can travel to different cities and even countries: some hakatons pass in several stages, and the winners of the stages have the opportunity to take part in the final somewhere in the capital or abroad.
Training
The main thing in hackathons is slippers. Two days of hard work require concentration. Nothing should distract you. Create yourself the most comfortable conditions.
Think beforehand how you will sleep. Hardcore: do not sleep at all. Tried, good. But with age it is more difficult. If you decide to sleep, make sure that other participants can continue to work without you, and you will easily get into the work when you wake up. This is solved by parallelizing tasks and fixing interfaces at key points.
Photo: hackaphone.ruIt is best to regulate the duration of sleep can soda. With enough drunk there was not a single slept more than an hour. Alcohol categorically does not fit: you really want to sleep, but it seems to be much more difficult. On the distributed hackathon, they worked at home with a friend. There was an opportunity to brew coffee. Great stuff to fight sleep. And find out the issue with feeding. Food shopping can take a lot of time. Bring soda and food if necessary.
Think over the idea in advance. This is the most time consuming process. After choosing an idea, decide on the technologies used, search the githab and the Internet for suitable tools. Read the documentation, find articles, examples.
Create a work plan with prototypes ready for demonstration. The first prototype should be ready in minutes. This is a hard-core hardcode inside, but it can already explain what you are trying to do. The second and subsequent prototypes should be done in a short time (a couple of hours) and be a demonstration-ready system where less and less hardcode remains and more and more real working code appears.
Photo: hackaphone.ruAfterword
Hackatons are useful. This conclusion is simple, because they have a lot of advantages and there is not a single minus at all. Hackathon is worth it to postpone their business and spend a few dozen hours in the company of comrades and code.
It makes sense to organize such events within medium and large companies. In smaller companies, you can find like-minded people and go to an external hackathon with one or more teams. And since the hackathons are a complete benefit, and Avito is a big company, we decided to conduct internal hackathons. Already this Saturday the fourth hackathon will be held in Avito.
In the next post I will talk about how we conduct hackathons inside Avito. A little about the organization, technical work with one and a half, about where the Kodokatitsa is heading, and a lot about the projects that have been developed: usefulness for the internal kitchen and open source community.