Category Archives: Programming (en)

Disable Go language telemetry

It turns out, Go (specifically gopls aka the local language server) collects telemetry, the scoundrel. Gathering some kind of anonymous data on how we code. How to disable it: C:\Users<user>\AppData\Roaming\go\telemetry create a file there named mode (without an extension!) inside … Continue reading

Posted in Go (en) | Leave a comment

Architecture in programming

In programming, as in construction (and everywhere else – from shearing sheeps to hammering nails), the foundation of everything is architecture. It determines the stability and functionality of the final product. Let’s consider this process through an analogy with building a … Continue reading

Posted in Programming (en) | Leave a comment

Prototypes – key to success in programming

If you are developing a complex (solo) project with many components, do not try to fully implement all these components at once. Make stub prototypes. This will save your stamina and prevent you from burning out on the project early. … Continue reading

Posted in Programming (en) | Leave a comment

Go language. About runes (data type), PostgreSQL and JS

If you are making a Go network application that works with databases and/or javascript, you need to be careful when using the rune data type. For example, PostgreSQL does not have a data type that matches rune; There are options … Continue reading

Posted in Go (en) | Leave a comment

Feedback on the CS50 programming course

Learning programming from scratch can be a challenging but rewarding experience, and taking CS50 is a great way to get started. CS50 is a popular introductory computer science course offered by Harvard University that covers a wide range of programming … Continue reading

Posted in Programming (en) | Leave a comment

Golang. Sum of consecutive numbers

The problem is to find in an array of integers a sequence of consecutive numbers whose sum is equal to n. Our program will read a list of integers (e.g., 5 2 3 4 6 1 4 10 1), followed … Continue reading

Posted in Go (en) | Leave a comment

Go Language. Map Exercise

Based on the list of dungeon raids, find the top player in the guild 🙂  Example of input:

Posted in Go (en) | Leave a comment

Golang. Exercises for slices

Let’s look at some examples of slice programs in Go. First one… The user enters two rows of numbers. Our task is to collect them in one slice, removing duplicates. As an exercise, we will not use cards, but ordinary … Continue reading

Posted in Go (en) | Leave a comment

Golang. Selection Sort

Selection sort is a simple sorting algorithm that repeatedly selects the minimum item from the unsorted part of the list and swaps it with the first unsorted item. Example code in Go:

Posted in Go (en) | Leave a comment

Golang. Bubble sorting

О… how much is in this “Chink”-sound!.. We learned to sort by “bubble” back in school (hello, Mr.Obama!). Why not make a code for this sorting in Go? 😀 Even if it is seldom useful, it’s a good exercise for … Continue reading

Posted in Go (en) | Leave a comment

Golang. Fisher-Yates algorithm

The user enters any number, letter, word, or whatever he wants, separated by a space. Let’s say he even enters card values (poker hand), such as A 3 J Q 10. Our job is to shuffle these cards. To do … Continue reading

Posted in Go (en) | Leave a comment

Golang. Console calculator

Let’s write a simple console calculator that performs basic arithmetic operations. First, we give it the numbers with which we want to perform operations using the add <number> command (we can give several numbers). Then we can use the commands … Continue reading

Posted in Go (en) | Leave a comment

Golang. Interfaces

The most cumbersome for newcomers to golang are the interfaces. Here are some examples of code I took apart to “smoke” them, I hope they will help you too. The idea is to look at the code, then close it … Continue reading

Posted in Go (en) | Leave a comment

Golang. Closures and Fibonacci Numbers

Assignment number 26 in the Go Tour. Implement a Fibonacci function that returns a function (closure) that returns consecutive Fibonacci numbers (0, 1, 1, 1, 2, 3, 5, …). Solution:

Posted in Go (en) | Leave a comment

Golang. Exercise: Maps

So, there we have exercise 23 from Go Tour. Implement the WordCount function. It should return a map (data type map) of the counts of each “word” in the string s. The function wc.Test runs a set of tests against … Continue reading

Posted in Go (en) | Leave a comment

Golang. Two-dimensional slices (2D)

From chapter 18 of Go tour.. In general, the tasks in this ‘tour’ are quite itchy B) So… Implement the Pic function. It should return a fragment of length dy, each element of which is a fragment of dx 8-bit … Continue reading

Posted in Go (en) | Leave a comment

Golang. Point belong to the circle?

The last example on Pythagoras’ theorem is quite simple. Let’s take a problem from the same topic, but more complicated. Suppose we have a circle in the center of x-axis and y-axis (i.e. center at coordinates 0,0). Let’s write a … Continue reading

Posted in Go (en) | Leave a comment