Pull to refresh

Abnormal programming *

Perversions with code

Show first
  • New
  • Top
Rating limit
  • All
  • ≥0
  • ≥10
  • ≥25
  • ≥50
  • ≥100

Go Rant: Highly Opionated View About Reaches and Gotchas of Goland

Abnormal programming *Programming *Go *Design

In this series, I would like to discuss some reaches of Go programming language. There is no shortage of Go-Language-Of-Cloud style articles in which you can explore the great benefits that Go indeed provides. However, there are lees to every wine, and Go does not go without blemish. In this highly opinionated series, we cover some controversies and, dare I say, pitfalls of the original Go design.

We start tough and begin with the essence of Go — it's inbuild data types. In this article, we put slice to the test. Let's move a step further from the Go Tour and use slice more extensively. For example, there is no separate data type as stack in Go, because slice type is intended to cover all its usage scenarios.

Let's briefly recap the usage of the stack. We can create a stack in two seconds using a couple of paper stickers. You write "buy milk" on the first sticker and put at the desk, and then "make the dishes" on the second and pile it on the first sticker. Now, you have a stack: the dishes sticker came last but will be served first, as it is on the top of the stack. Thus, there is an alternative name for stack — LIFO, Last-In-First-Out. To compare, there is the "opposite" data structure queue or FILO — first in, first out. In programming, stacks are everywhere, either in the explicit form or in the implicit as stack trace of the execution of a recursive function.

Ok, let's put slice into use and implement stack.

Read more →
Rating 0
Views 838
Comments 0

Go Quiz

Abnormal programming *Programming *Go *

In this series, we will be discussing interesting aspects and corner cases of Golang. Some questions will be obvious, and some will require a closer look even from an experienced Go developer. These question will help to deeper the understanding of the programming language, and its underlying philosophy. Without much ado, let's start with the first part.

Value assignment

What value y will have at the end of the execution?

func main() {
    var y int
    for y, z := 1, 1; y < 10; y++ {
        _ = y
        _ = z

According to the specification,

Read more →
Total votes 3: ↑3 and ↓0 +3
Views 1.6K
Comments 2

Russian AI Cup 2020 — a new strategy game for developers

Mail.ru Group corporate blog Abnormal programming *Entertaining tasks Programming *Artificial Intelligence

This year, many processes transformed, with traditions and habits being modified. The rhythm of life has changed, and there's more uncertainty and strain. But IT person's soul wants diversity, and many developers have asked us if annual Russian AI Cup will be held this year. Is there going to be an announcement? What is the main theme of the upcoming championship? Should I take a vacation?

Though some changes are expected, it will be held in keeping with the best traditions. In the run-up, we will announce one of today's largest online AI programming championships — Russian AI Cup. We invite you to make history!
Total votes 15: ↑15 and ↓0 +15
Views 1.4K
Comments 0

How to write Palindrome Polyglot Quines

Abnormal programming *Java *C# *

I offer a solution to one beautiful task — writing code that outputs its text is valid for interpreters and compilers of different languages and is correctly executed when reversing its sources.

Not so long ago I learned about code that can be both interpreted in PHP and compiled to Java: PhpJava.java. As it turned out, this idea is not new: code which is valid for several compilers or interpreters is called a polyglot. It is possible to write such code because of the peculiarities of processing strings and comments in different interpreters or compilers.

Read more →
Total votes 3: ↑3 and ↓0 +3
Views 1.5K
Comments 0

Dark code-style academy: line breaks, spacing, and indentation

Abnormal programming *Programming *Perfect code *

Hey guys! Let me walk you through the next part of our dark-style code academy. In this post, we will discover some other ways how to slow down the reading speed of your code. The next approaches will help you to decrease maintenance and increase a chance to get a bug in your code. Ready? Let's get started.

Read more
Total votes 1: ↑1 and ↓0 +1
Views 1.7K
Comments 1

Dark code-style academy: spoil if statement

Abnormal programming *Programming *Perfect code *


Do you want to raise your salary? Do you want always to be in demand? Do you want to have your job as long as you want? It is absolutely real! You just need to change the way you write your code. Basically, you need to increase your job security. You have to write code which will be almost impossible to maintain for everyone except you. And in these series of articles, I will tell you how to achieve it. Welcome under the cut.

Read more →
Total votes 3: ↑3 and ↓0 +3
Views 1.5K
Comments 0

Why I keep track of spendings in a personal app made with Git+JS

Abnormal programming *JavaScript *Programming *HTML *DIY

Hi, folks, let me share my experience of creating an application to keep track of my spendings. Specifically, let me do it by answering the following questions:

  1. Why keep track of spendings in an application?
  2. Why did I create the application as a personal project?
  3. Why does the project use Git+JS?

1. Why keep track of spendings in an application?

I, like many people out there, wanted to become rich and successful. To become rich, one is often advised to run a personal budget, that's what I started to do several years ago. I'd like to point out that running my personal budget hasn't made me rich and successful, and I increased income simply by moving to Moscow.

Rating 0
Views 737
Comments 0

The Silverfish Programming Language

Abnormal programming *Learning languages

They say, each professional developer must have done at least three pet projects: a sophisticated logging utility, a smart json parser, and an amazing programming language. Once we have both logger and parser accomplished, we finally decided to reveal our desperate success in creation one of the most innovative programming languages named Silverfish.

Карасик → На самом деле плотвичка

Read more →
Total votes 9: ↑9 and ↓0 +9
Views 1.9K
Comments 3

Teaching folks to program 2019, a.k.a. in the search of an ideal program: Sequence

Abnormal programming *Programming *Game development *Studying in IT DIY


Hi, my name is Michael Kapelko. I'm a professional software developer. I'm fond of developing games and teaching folks to program.


Autumn 2019 was the third time I participated as one of the teachers in the course to teach 10-15-year-old folks to program. The course took place from mid. September to mid. December. Each Saturday, we were studying from 10 AM to 12 PM. More details about the structure of each class and the game itself can be found in the 2018 article.

I have the following goals for conducting such courses:

  • create a convenient tool to allow the creation of simple games, the tool interested folks of 10 years old or older can master;
  • create a program to teach programming, the program interested folks of 10 years old or older can use themselves to create simple games.
Read more →
Rating 0
Views 472
Comments 0

Making a demo for NES — HEOHdemo

Abnormal programming *Demoscene Old hardware Games and game consoles
There is a lengthy history of computer arts festivals, also known as demo parties, held in Russia over the last quarter century. For decades, once in a while people from all over the country gather together to compete in their ingenuity at getting what was once deemed impossible out of the old or new computer hardware and mere bytes of code. A few leading annual events has been established in the early years. One of them, creatively named CAFe (an acronym for Computer Art FEstival), was held in Kazan from 1999 to 2003. It went under the radar since, making the way for the everlasting Chaos Constructions (1999 — now) and DiHalt (2005 — now). After so long hiatus, the last year CAFe made a loud comeback, returning in full glory — at least by the number of prods released, if not in the scale of the event itself. Presentation of the compo entries went far into the night, with the last demos being shown at 6 AM to the popping eyes of the few hardy ones. There was my demo, too, and this is the story of its making.

Read more →
Total votes 13: ↑12 and ↓1 +11
Views 3.3K
Comments 0

Making a demo for an old phone — AONDEMO

Abnormal programming *Assembler *Demoscene Old hardware
I wanted to make a demo ever since I saw the classic Polish mega demo Lyra II for first time in 1997. I also wanted to do something for the largest Russian demo party Chaos Constructions for a long while, but have never gotten around that, being occupied with other duties. Finally, in 2018 the time has come, and I fulfilled both desires at once, Van Damm's double impact style — made a demo called AONDEMO that entered ZX Spectrum 640K Demo compo at Chaos Constructions.

I bet the red thing you've just seen does not look much a Spectrum to you. Here's the story.

Read more →
Total votes 13: ↑11 and ↓2 +9
Views 2.6K
Comments 0

СodeSide. The new game for Russian AI Cup

Mail.ru Group corporate blog Abnormal programming *Sport programming *Entertaining tasks Artificial Intelligence

The AI Cup community and Mail.ru Group in collaboration with Codeforces.com invite you to the real battle! Get ready for the sleepless nights and calloused hands — take part in Russian AI Cup, which is one of the most challenging and vivid artificial intelligence programming competitions in the world. Believe us, managers of this madness did their best to create the game you'd want to play.

To become part of the competition, you need Internet access, computer, creativity, and enthusiasm for being a part of this extraordinary Cup. By the way, you might need some coffee. Welcome!

Read more →
Total votes 33: ↑33 and ↓0 +33
Views 1.6K
Comments 1

Tests vs. Types — Rust version

Abnormal programming *Programming *Rust *

A few days ago 0xd34df00d has published the translation of the article, describing the possible information about some function if we use it as a "black box", not trying to read its implementation. Of course, this information is quite different from language to language; in the original article, four cases were considered:

  • Python — dynamic typing, almost no information from signature, some hints are gained by the tests;
  • C — weak static typing, a little more information;
  • Haskell — strong static typing, with pure functions by default, a lot more information;
  • Idris — dependent typing, compiler can prove the function correctness.

"Here's C and there's Haskell, and what about Rust?" — this was the first question in the following discussion. The reply is here.

Read more →
Total votes 18: ↑18 and ↓0 +18
Views 1.9K
Comments 0

Family tree inside Git

Abnormal programming *Git *GitHub

Happy programmer's day! I wish you more bright commits, merged pull requests, less merge conflicts, and that your life branches remain relevant as long as possible. As a conceptual gift, I propose the implementation of a family tree by means of the Git version control system. Well… sounds like a plan!

For those who have immediately understood everything, I give links to the source code: GenealogyTreeInGit and family trees: mine and US presidents.

In addition, I implemented a simple social graph. It displays not only the degree of kinship, but also the status of relations between descendants, events such as wedding, divorce, childbirth, as well as contributions to the relations.

More about implementation, details, and pictures
Total votes 4: ↑4 and ↓0 +4
Views 3.1K
Comments 2

On the way to durable applications with PSKOV static site generator as an example

Abnormal programming *JavaScript *Programming *HTML *Browsers

Pskov's veche

Hi, my name is Michael Kapelko. I have been developing software professionally for more than 10 years. I develop games and game development tools in my spare time.

This article describes my first durable application for desktop PCs: PSKOV static site generator.


A durable application is an application that functions without a single change on operating systems released in years 2010-2030. In other words, a durable application has backward compatibility of 10 years and has the stability to run for 10 years. Actually, PSKOV runs even under Windows 2000, so PSKOV has backward compatibility of 19 years.

Read more →
Total votes 11: ↑9 and ↓2 +7
Views 662
Comments 0

How to generate a huge financial graph with money laundering patterns?

Abnormal programming *Python *Big Data *Open data *

Couple of years ago my team (compliance in one of Swiss banks) and I had an interesting task to implement — we had to generate a huge random graph of financial transactions between clients, companies and ATMs. Moreover, we wanted this graph to contain some money-laundering and other financial crime patterns alongside with nodes description such as names, addresses, currencies etc. Obviously, all data should be randomly generated from scratch as long as we could not use any real data for obvious reasons.

As a solution we wrote a generator that I’d love to share with you. This article explains why we needed it and how this generator is working, but if you don’t want to read and want to try it on your own here is the code: https://github.com/MGrin/transactions-graph-generator. I hope that our experience will be helpful to any of you.
Read more →
Total votes 3: ↑3 and ↓0 +3
Views 1.9K
Comments 0

Compilable configuration of a distributed system

Праймтолк corporate blog Abnormal programming *Programming *Scala *DevOps *

In this post we'd like to share an interesting way of dealing with configuration of a distributed system.
The configuration is represented directly in Scala language in a type safe manner. An example implementation is described in details. Various aspects of the proposal are discussed, including influence on the overall development process.

Overall configuration management process

(на русском)

Read more →
Total votes 6: ↑6 and ↓0 +6
Views 987
Comments 0

PC Speaker To Eleven

Abnormal programming *Assembler *Demoscene Old hardware Sound
Known now as a «motherboard speaker», or just «beeper», PC Speaker has been introduced in 1981 along with the first personal IBM computer. Being a successor of the big serious computers for serious business, it has been designed to produce very basic system beeps, so it never really had a chance to shine bright as a music device in numerous entertainment programs of the emerging home market. Overshadowed by much more advanced sound chips of popular home game systems, quickly replaced with powerful sound cards, it mostly served as a fallback option, playing severely downgraded content of better sound hardware.

«System Beeps» is a music album in shape of an MS-DOS program that features original music composed for PC Speaker using the same basic old techniques like ones found in classic PC games. It follows the usual retro computing demoscene formula — take something rusty and obsolete, and push it to eleven — and attempts to reveal the long hidden potential of this humble little sound device. You can hear it in action and form an opinion on how successful this attempt was at Bandcamp, or in the video below. The following article is an in-depth overview of the original PC Speaker capabilities and making of the project, for those who would like to know more.

Total votes 34: ↑32 and ↓2 +30
Views 32K
Comments 3

The Cake is a Lie

Abnormal programming *Studying in IT

Have you ever thought — How to explain programming to the one never faced it before? It could be a problem, as long a new one will not understand you.

So, let's imagine — you have a friend, who is not soiled by computer science, never tried to automate something, never played factorio, never written a single line of code.

So, let's imagine a normal human being.

And let's call him Bill. He is not very good in Maths, just “not good”, but he loves candies!

Your task is to teach Bill some basic(or magic) IT things, you are doing every day. The simplest ones.
So what shall you do first? Basically — FEED HIM!

Read more →
Total votes 17: ↑15 and ↓2 +13
Views 2K
Comments 4

Currying and partial application in C++14

Abnormal programming *Programming *C++ *Functional Programming *

In this article I'm going to tell you about one of the currying options and partial application of the functions in C++ which is my personal favourite. I'm also going to show my own pilot implementation of this thing and explain the point of currying without complex mathematical formula, making it really simple for you. We'll also see what's under the hood of kari.hpp library which we'll be using for currying functions. Anyway, there are lots of fascinating stuff inside, so welcome!

Читать дальше →
Total votes 18: ↑18 and ↓0 +18
Views 4.2K
Comments 0

Authors' contribution