Pull to refresh
777.29

Programming *

The art of creating computer programs

Show first
Rating limit
Level of difficulty

Cross-Platform System Programming Guide for UNIX & Windows: Level 1

Reading time 61 min
Views 671
Programming *System Programming *
Tutorial

In this tutorial we'll learn how to write cross-platform code in C using the system functions on popular OS (Windows, Linux/Android, macOS & FreeBSD): file management functions and file I/O, console I/O, pipes (unnamed), execution of the new processes. We're going to write our own small helper functions on top of low-level userspace system API and use them so that our main code can run on any OS without modifications. This tutorial is Level 1, the easiest. I split the difficult stuff into parts so the code samples here shouldn't be overwhelming for those who has just started to program in C. We'll discuss the differences between the system API and how to create a cross-platform programming interface that hides all those differences from the user.

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

Writing The Matrix in Python: easy guide

Reading time 6 min
Views 1.1K
Python *Programming *Studying in IT

Programming textbooks usually do not indulge us with variety of examples. In most manuals, exercises are similar to each other and not particularly interesting: create another address book, draw a circle using turtle, develop a website for a store selling some kind of "necessary" advertising nonsense. Too far from the authentic imitation of "The Matrix". Although…

How about taking over the control and starting to invent exercises yourself?

Would you like to write your own personal little "Matrix"? Of course, not the one with skyscrapers, stylish phones of the time, and the ubiquitous invincible Agent Smiths. We will need a couple of more months of learning for that. But any beginner programmer can write a model of the cult splash screensaver with the green streams of digits flowing down the screen. Let's try to creat it in the "great and mighty" Python.

Read more
Total votes 11: ↑10 and ↓1 +9
Comments 0

DSL (domain-specific language) implementation with macros

Level of difficulty Medium
Reading time 8 min
Views 532
Abnormal programming *Programming *Perfect code *Compilers *
Opinion

image
This is a translation of my own article


The release of NewLang language with a brand new "feature" is coming, a remodeled version of the preprocessor that allows you to extend the language syntax to create different DSL dialects using macros.


What is it about?


DSL (Subject Oriented Language) is a programming language specialized for a specific application area. It is believed that the use of DSL significantly increases the level of abstractness of the code, and this allows to develop more quickly and efficiently and greatly simplifies the solution of many problems.

Conditionally, we can distinguish two approaches to DSL implementation:


  • Development of independent syntax translators using lexer and parser generators to define the grammar of the target language through BNF (Backus–Naur form) and regular expressions (Lex, Yacc, ANTLR, etc.) and then compiling the resulting grammar into machine code.
  • Development or integration of the DSL dialect into a general-purpose language (metalanguage), including the use of various libraries or special parsers / preprocessors.

We will talk about the second option, namely the implementation of DSL on the basis of general-purpose languages (metalanguages) and the new implementation of macros in NewLang as the basis for DSL development.

Read more →
Total votes 2: ↑2 and ↓0 +2
Comments 2

Will transport planners lose their jobs as AI becomes smarter?

Level of difficulty Medium
Reading time 11 min
Views 418
Programming *Algorithms *
Opinion

As a Product Manager who has worked on the development of delivery route optimisation software for 10+ years, I see that modern technologies can significantly improve the optimisation process and deliver better solutions. AI, machine learning, and other modern technologies have the potential to revolutionise the way delivery routes are optimised in the future.

With the increasing availability of data and the advancement of AI and machine learning algorithms, it is becoming possible to develop more sophisticated prediction models that can be integrated into optimisation algorithms to make more accurate and informed decisions about route planning and scheduling. Machine learning algorithms can be trained to predict customer demand based on historical sales data and other market trends, allowing businesses to optimise their delivery schedules and routes accordingly. AI can also be used to optimise delivery schedules based on customer preferences and other relevant factors.

Blockchain technology could be used to create a secure, decentralised database of information about deliveries, including information about the products being shipped, the route they are taking, and the status of the delivery. This could help increase transparency and accountability in the delivery process as well as reduce the risk of fraud and theft.

Internet of Things (IoT) devices, such as sensors and GPS trackers, may collect real-time data about delivery vehicles and their surroundings. This data could be analysed and used to optimise delivery routes in real time, as well as to track the location of deliveries and monitor the condition of the products being shipped.

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

State Management for processes flow

Reading time 12 min
Views 596
Programming *System Analysis and Design *C# *
Sandbox

Most of the processes that people use in their work lives can be represented as some object that goes through some flow. Each flow contains many stages, in each one of them the object can be manipulated by certain group of users.

In this article I want to suggest an approaches to effectively handle such flow based systems. 

Read more
Rating 0
Comments 1

Building your own CLI with Swift Programming Language

Level of difficulty Easy
Reading time 5 min
Views 1.2K
Programming *Development for iOS *Development of mobile applications *Swift *Development for MacOS *
Tutorial

Command-line interfaces (CLI) are a common way to use applications. In iOS, we usually use scripting languages like Bash or Ruby to build those CLIs and automate mundane tasks. The most popular CLI for app signing and build automation is, without a doubt, Fastlane, which was initially written in Ruby. Fastlane is a great tool, convenient and fairly easy to use, and a lot of effort came into building it.

However, there's a great chance you considered moving away from Fastlane to avoid learning Ruby and to lower the entry threshold for your developers. Setting up a Ruby environment could be quite tedious and require additional devs' expertise to write and support those scripts.

Explore how to build your own command line tools with Swift in this article.

Read more
Total votes 2: ↑2 and ↓0 +2
Comments 5

Codepast people – programmers’ sunset

Reading time 5 min
Views 1.9K
Programming *Science fiction
Translation

— Glitchy couch! — Anton exclaimed, yet another time crushing down his fingers by heavy coach he and Sergey were pulling for 14 storeys already.
— ‘Glitchy’? — Sergey asked — have you been coder in the past too?
They’ve been working almost a week together, but Sergey would have never suspected he was coder in the past. Lean and muscular Anton did not look the part at all.
— I had to in my student years, — Anton answered, abashed.
— Relax! One of us. Layout, three years and JS for every browser out there, — Sergey perked up, pushed the couch and pressed it a bit forcefully on Anton.

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

How to exchange a secret key over an insecure network (EC-Diffie-Hellman algorithm)

Reading time 6 min
Views 1.3K
Information Security *Cryptography *Programming *

Let’s say you want to send an encrypted message to your friend in order to avoid it being intercepted and read by a third party. You generate a random secret key and encrypt the message with it. Let’s say you use AES. But how do you let your friend know the key to decrypt it?

In this article, we will explore how the Elliptic-Curve Diffie-Hellman algorithm works under the hood. The article includes the implementation of this algorithm from scratch, written in Python.

Read more
Total votes 2: ↑2 and ↓0 +2
Comments 2

Mocking RESP API in 20 minutes via Yakbak

Reading time 6 min
Views 1.3K
JavaScript *Programming *
Tutorial
Translation


Imagine this: you are an ordinary frontend developer. When you open your mailbox you found a message — tomorrow DevOps team will make an optimization with Kubernetes. You are experienced developer and you know that environment operation test might go sideways. Test environment is crucial for your job as frontend developer and you don’t want to miss a whole day on a job, so there are two possible solutions present:


  1. Setup all microservices on your laptop
  2. Prepare mocks for API

I will describe how to mock REST API request via Yakbak.

Read more →
Rating 0
Comments 1

Python Junior Plus, or the beginner's Roadmap to becoming a Python programmer

Reading time 8 min
Views 3.9K
Python *Programming *IT career

image


Hello! My name is Mikhail Emelyanov, I am embedded software engineer, and I was inspired to write this little roadmap on the capabilities of Python language by a certain commonality among the existing Python tutorials found on the web.


The usual suggestions to study, say, “Algorithms and Data Structures” or “Databases” are especially jarring. You can spend years studying these topics, and even after decades you'd still be able to find something you didn't know yet even without ever venturing outside the scope of Algorithms!


Using video game analogies, we can say that novice programmers often stand on the shore of the lake of boiling lava with an island with the ever-coveted jobs in the center, while the islands in between, which you have to jump on, gradually increasing your skills in successive mini-quests, are either missing, or arranged haphazardly, or their fairly smooth sequence breaks off, never having managed to get you any farther from the shore. Let's try to build a path of hint islands, a number of which, although not without effort, will finally allow us to reach our goal.

Read more →
Rating 0
Comments 3

Understanding the Differences Between Kafka and RabbitMQ: in Simple Terms

Reading time 7 min
Views 3.3K
Иннотех corporate blog Programming *IT Infrastructure *Data storage *DevOps *
Translation

Software message brokers became the standard for creating complex systems. However not all IT specialists understand how these instruments work. Pavel Malygin, Lead System Analyst at Innotech, dives into the topic of message brokers and explains how they are used.

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 2

Synchronous Request-Response using REST and Apache Kafka

Reading time 8 min
Views 2.5K
Иннотех corporate blog High performance *Programming *Java *Apache *
Translation

At first glance making REST and Apache Kafka compatible seems quite a challenge. However Innotech team nailed the task. Kirill Voronkin, Lead Developer at Innotech, shared the details on transforming unsynchronized queries into synchronized.

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

How to be an effective engineer?

Reading time 6 min
Views 2.3K
Programming *Product Management *

This question comes up for a lot of us as we trying to advance our career and reach new heights. At the moment when I was challenged by it, I came across a wonderful book by Edmond Lau "Effective Engineer".

As always going through the book, I write new thoughts down. And today I want to share the compilation of things that I have found useful from the book. This is by no means an ad for the book, but I think it has some really interesting approaches for us to explore together.

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 3

PHDays 11: bootkit infection, sanitizers for the Linux kernel, the new face of OSINT, and phishing on official websites

Reading time 3 min
Views 1.1K
Positive Technologies corporate blog Configuring Linux *Information Security *Programming *Conferences

Positive Hack Days 11 will begin in a matter of weeks. This international forum on practical security will be held on May 18–19 in Moscow.

As per tradition, PHDays will have three big tracks dedicated to countering attacks (defensive), protection through attack (offensive), and the impact of cybersecurity on business. It is our pleasure to present the first talks.

Read more
Total votes 1: ↑0 and ↓1 -1
Comments 0

Authors' contribution