Pull to refresh
90.27

Abnormal programming *

Perversions with code

Show first
Rating limit
Level of difficulty

Tests vs. Types — Rust version

Reading time5 min
Views2.5K

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 →

Family tree inside Git

Reading time6 min
Views4.2K

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

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

Reading time4 min
Views1.4K

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.


Durability


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 →

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

Reading time4 min
Views3K
image

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 →

Compilable configuration of a distributed system

Reading time17 min
Views1.4K

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 →

PC Speaker To Eleven

Reading time12 min
Views35K
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.

The Cake is a Lie

Reading time4 min
Views2.6K

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 →

Currying and partial application in C++14

Reading time10 min
Views7.9K

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!

Читать дальше →

A bot for Starcraft in Rust, C or any other language

Reading time12 min
Views48K

StarCraft: Brood War. This game means so much to me! And to many of you, I guess. So much, that I wonder if I should even give a link to its page on Wikipedia or not.


Once Halt sent me PM and offered to learn Rust. Like any ordinary people, we decided to start with hello world writing a dynamic library for Windows that could be loaded into StarCraft's address space and manage units.


The following article will describe the process of finding solutions and using technologies and techniques that will allow you to learn new things about Rust and its ecosystem. You may also be inspired to implement a bot using your favorite language, whether it be C, C++, Ruby, Python, etc.

Ready to roll out!
2

Authors' contribution