Pull to refresh

Development

Show first
Rating limit
Level of difficulty

LeetCode 2612 (Hard). Minimum Reverse Operations. Swift. BFS. O(n+k). O(n)

Level of difficultyHard
Reading time3 min
Views1.5K

LeetCode 2612 (Hard). Minimum Reverse Operations.

The algorithm follows a breadth-first search (BFS) approach to determine the minimum number of reverse operations needed to bring the 1 to each position in the array.

To speed up the algorithm, we mark banned positions with -2 instead of using set lookups. This optimization reduces the constant coefficient and improves the speed of the algorithm, but it may still result in a time limit exceeded (TLE) error.

For each visited position, there are potentially O(k) target positions that can be reached through reverse operations. To avoid the multiplicative cost of iterating over all these potential positions, we update the nextNode2s array. This array initially points forward by 2, but we update it dynamically to point beyond all the target positions considered for each visited position. This optimization helps improve the efficiency of the algorithm and avoids unnecessary computations.

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

AI for Software Business Analysis

Level of difficultyEasy
Reading time5 min
Views17K

Generative AI is creating waves in the way we work, significantly revolutionizing the software development process. AI tools are appearing in various phases of software development, such as design, development, and testing. However, there aren't many tools specifically focused on software business analysis tasks.

But with a little creative thinking, we can put "one-size-fits-all" applications like ChatGPT to good use. It can definitely speed up execution of many typical tasks and free up analysts to focus on the more challenging, strategic aspects of the job.

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

ChatGPT to Help You Become a 10x Programmer

Level of difficultyEasy
Reading time2 min
Views7.1K

I believe that every programmer has at least once heard about ChatGPT and its marvelous abilities to process, calculate and create huge amounts of data; if not, go check out this Wikipedia article - https://en.wikipedia.org/wiki/ChatGPT.

Can you imagine that some 50 years ago people could not even believe that there may be something artificial surpassing humans in so many areas? Nowadays, we have this marvel at the distance of a few tabs on a phone screen or a keyboard; however, there is still a sadly large number of people who do not fully—if at all— utilize all the perks of ChatGPT in their lines of work. This is mostly related either to people's reluctance to learn new technologies or the fear of losing coding skills they have previously gained—which is not the case with using ChatGPT properly.

In this article I want to give you some of the most useful uses of ChatGPT for your coding work. Remember, there is nothing shameful in using the AI, since this the development and further implementation of it in our day-to-day life is inevitable, so we should start adapting to it as early as we can to take the full advantage of this "magical" technology. Let's get started.

Read more
Rating0
Comments5

Validation WebHook troubleshooting, how low can you go?

Level of difficultyMedium
Reading time11 min
Views1.2K

I'm Alex Movergan, DevOps team lead at Altenar. I focus on automation in general and on improving troubleshooting skills within my team. In this article, I'll share a captivating tale that revolves around Kubernetes, validation webhooks, kubespray, and Calico.

Join me on this DevOps journey as we explore real-world scenarios unraveling the intricacies of troubleshooting in a Kubernetes environment.

Read more
Total votes 4: ↑4 and ↓0+4
Comments2

Your own Duolingo without overengineering

Reading time14 min
Views1.2K

Hi, my name is Mikhail Emelyanov, I’m a Python programmer and I would like to show you my pet project — Flywheel, a micro-platform for learning foreign languages, a mixture of Duolingo and Anki, an application that can teach you to properly write in Spanish (or any other language you’re studying). Flywheel’s source code is available on GitHub.


Flywheel


As you may know, generalized knowledge of a foreign language can be broken down into four relatively independent components: reading, writing, listening, and speaking. Unfortunately, training one of these abilities has no direct effect on the other components, so, for example, by developing our reading skills, the effect on our writing skills is quite indirect. Flywheel is a ‘sharpener’ specifically for written Spanish.


If you’ve ever used Duolingo, you should have some idea of the format in which you’ll be studying. The formula is simple: here’s a phrase, translate it into the other language; the app will remember the last time you translated a phrase and how successful you were at it; and depending on the accuracy of your answer, it will determine when you should do the same phrase again. In my opinion, Duolingo and its approach are brilliant. However… There are certain aspects that somewhat spoil the learning experience, and Flywheel was specifically designed to address them.

Read more →
Rating0
Comments1

Business Continuity and Operation Resilience on paper vs. for real

Level of difficultyEasy
Reading time7 min
Views549

Hello, my reading friends!

My previous post (rus) on Habr was about how the Business Continuity Management function started, as well as about its relations with other corporate functions. In fact, it was quite theoretical.

This time, I’d like to tell you about some practical vectors of procedures and tools implementation as regards to Business Continuity Management, or BCM, along with Operational Resilience, or OpRes. Plus some real initiatives that can follow the BCM & OpRes implementation in a company and the associated with it investigation of the corporate landscape and procedures.

More about initiatives for integration
Rating0
Comments1

Android MapView with clustering and dynamic images in markers

Level of difficultyMedium
Reading time11 min
Views2.1K

In this article, I will cover basic work with MapView (and MapFragment) markers, learn how to implement marker clustering, i.e. group markers located close to each other, and display dynamic icons in the markers, i.e. load by url and display remote images. Ultimately, we will create such map with clusters and dynamic image loading (in background).

Read more
Rating0
Comments1

LeetCode 956 (Hard). Solution of the day. Tallest Billboard. Swift. DP

Level of difficultyHard
Reading time2 min
Views2.3K

Solution of the day.
LeetCode 956 (Hard). Tallest Billboard.

The code uses dynamic programming to solve the problem. It maintains a dictionary dp, where the keys represent the possible height differences between the two billboards, and the values represent the maximum sum of heights achieved for each height difference.

Read more
Total votes 4: ↑3 and ↓1+2
Comments0

BCM & Operational resilience: yesterday, today, and tomorrow. Where has it come from and what comes next?

Level of difficultyEasy
Reading time11 min
Views572

Recently, The BCI, one of the leading institutes working in the field of organizational resilience and business continuity, issued its regular report BCI Operational Resilience Report 2023 in collaboration with Riskonnect, who work with risk management solutions.

One of the questions they asked the respondents was if there was a difference between organizational resilience and operational resilience. As the answers demonstrated, for most respondents (and in most companies) these terms were used as synonyms. Having studied the report, the colleagues brought up another matter – The BCI introduced the new term of "organizational resilience" in addition to "business continuity" and "operational resilience".

If we search Habr for "Business Continuity", "DRP", "BCP", or "BIA", we’ll find quite enough posts by my colleagues (I’ve met some of them face to face and worked with the others) about data system recovery, data system testing, fault-tolerant infrastructure, and some other things. Yet, hardly any of them explain where all of it has come from, how it is changing, where it is heading – and why.

I thought the time has come to change the situation for the better and answer some of the questions like where business continuity provisions and operational resilience has come from, how they are changing, and where this trend is heading and why. To share my thoughts about development of the industry and its current de-facto state in case of a mature (or not too mature) introduction level – some things I’ve stated for my own use.

Intersections BCM & corporate functions
Rating0
Comments0

Hashing and its C++ applications

Level of difficultyMedium
Reading time6 min
Views4.2K

Hash, salt, SHA-1, SHA-2, std::hash.. To a non-programming person that may come up as some kind of a recipe that just does not seem to add up. In a sense, this is indeed supposed to be a gibberish to any third party and a strong, helpful mechanism for us, programmers. 

At the start of writing this article, I had one clear idea to get across the table: to finally unveil this mystery of hashing in C++ for beginners. I, a beginner myself, also wanted to solidify my knowledge in this area; so let’s get started.

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

Alpha Go && Alpha Go Zero

Reading time3 min
Views1.6K

Today I would like to discuss the games Chess and Go, the world's champions, algorithms and Al.

In 1997, a computer program developed by IBM Deep Blue defeated the world Chess champion Garry Kasparov. Go remained the last board game in which humans were still better than machines.

Why is that?

Chess is primarily distinguished from Go by the number of variations for each move. Chess, the game is more predictable with more structured rules: we have value for each figure (e.g bishop = 3 pawns, rook = 5 pawns -> rook > bishop), some kind of openings and strategies. Go, in turn, has incredibly simple rules, which creates the complexity of the game for the machine. Go is one of the oldest board games. Until recently, it was assumed that a machine was not capable of playing on an equal footing with a professional player due to the high level of abstraction and the inability to sort through all possible scenarios - exactly as many valid combinations in a game on a standard 19×19 go-ban are 10180 (greater than the number of atoms in the visible universe).

However, almost 20 years later, in 2015, there was a breakthrough. Google's Deep Mind company enhanced AlphaGo, which was the last step for the computer to defeat the world champions in board games. The AlphaGo program defeated the European champion and then, in March 2016 demonstrated a high level of play by defeating Lee Sedol, one of the strongest go players in the world, with a score of 4:1 in favour of the machine. A year later, Google introduced to the world a new version of AlphaGo - AlphaGoZero.

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

lsFusion: Open-Source Rapid Application Development Platform

Reading time7 min
Views801

lsFusion platform is designed for rapid development of business applications. It is distributed under the terms of a Lesser General Public License (LGPLv3). The source code of the platform is available on Github.

lsFusion is best suited for creating complex systems with large numbers of entities and forms, where users need to input and process large amounts of data. However, the platform can also be used to quickly create simple applications instead of spreadsheets when Excel’s functionality is not enough.

At the same time the use of the platform will not give a great advantage when developing applications aimed at interaction with a large number of “external” users or without the need for any complex calculations. You should also take into account that the web interface is a single page application using JavaScript. Therefore, the lsFusion platform is not well-suited for creating websites, for example.

Read more
Total votes 7: ↑7 and ↓0+7
Comments1

How to Set Up a Custom Domain and Get a Free SSL Certificate on Firebase

Level of difficultyEasy
Reading time2 min
Views1.5K

In my previous article, I showed you how to deploy your project to Firebase and use it for free. Now, let’s explore additional benefits of Firebase. In the upcoming article, I will show you how to set up a custom domain name for your project and utilize a free SSL certificate from Firebase.

Read more
Rating0
Comments1

Affordable as a Bus, Comfortable as a Taxi: A Promising Type of Public Transport for Large and Medium-Sized Cities.Part3

Level of difficultyMedium
Reading time32 min
Views1.3K


Translation provided by ChatGPT, link to the original article in Russian

Link to Part 1: «Preliminary Analysis» (ру / eng )
Link to Part 2: «Experiments on a Torus» (ру / eng )
Link to Part 3: «Practically Significant Solutions» (ру / eng )
Link to «Summary» (ру / eng )

1 Playing Diplomacy


1.1 What this work is about


You're reading the third and final article in a series dedicated to minibus route schemes that would allow you to travel reasonably quickly, inexpensively, and most importantly, without any transfers, from any intersection to any other within a large city. You'll see many graphs, formulas, and figures below, but before we get to the technical part, I'd like to discuss the challenge of implementing this idea and invite you to participate in solving it.

1.2 A puzzle for the talented and brave (Eccentrics are welcome: 🎶)


I propose an adventure,
I propose a game,
I propose that you become part of a positive change in the lifestyle of almost a billion people around the planet,
I can't do this alone.
To start, I need your help with the following:
Read more →
Total votes 4: ↑3 and ↓1+2
Comments4

How to set up Gitlab CI/CD with Fastlane for iOS-project on a Mac mini

Reading time8 min
Views2.1K

Hello, everyone! I’m Yaroslav Fomenko, Doubletapp iOS-developer. Since the end of May, my department colleague and I have been working on implementation, improvement, and scaling of CI/CD for our projects. In this article, we want to share a guide on preparing the Xcode project and setting up runners, scripts, and configs, as well as explain how CI/CD helps us.

To learn how and why we decided to use a Mac mini for CI/CD, click here.

Read more
Total votes 2: ↑1 and ↓10
Comments0

CI/CD for iOS-projects: device or cloud? What’s better, Doubletapp’s take

Level of difficultyMedium
Reading time6 min
Views1.1K

Hey, Habr! I’m Yaroslav Fomenko, Doubletapp iOS-developer. After our IOS department deployed our CI/CD on a Mac Mini, we got an idea of scaling and encapsulating it. So we started researching ways to do it. First we thought of Docker, but there was neither enough info about it nor any other possible ways. In this article, we’ll look at all possible solutions we found for the deployment of Gitlab CI/CD on a device and in the cloud.

Read more
Total votes 2: ↑1 and ↓10
Comments1