Pull to refresh

Development

Show first
Rating limit
Level of difficulty

React Custom Hook: useRenderCount

Level of difficultyMedium
Reading time2 min
Views1.3K

One of the major advantages of using useRenderCount is its simplicity. By abstracting the logic into a reusable hook, you can easily integrate it into any component without cluttering your codebase. Additionally, it provides a clear and concise way to monitor render behavior, which can be crucial for performance optimization and debugging.

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

React Custom Hook: usePrevious

Level of difficultyMedium
Reading time2 min
Views4.6K

This custom hook can be a game-changer in various scenarios. For instance, you can utilize usePrevious to compare and visualize changes in data, track state transitions, or implement undo/redo functionality. Additionally, it can be valuable in form handling, animations, and any situation where having access to the previous value is crucial for your application's logic.

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

LeetCode, Hard++ (Acceptance 24%, Latest): 2867. Count Valid Paths in a Tree. DFS. O(n). Swift

Level of difficultyHard
Reading time2 min
Views1.5K

The intuition is to employ a depth-first search (DFS) approach through the tree.

During each step in the traversal, we perform the following key calculations:

1. Determine the path that ends at the current node.

2. Compute two different subtree paths that traverse the current node.

3. Maintain an array that keeps track of the cases where paths contain either 0 or 1 prime number.

This method allows us to efficiently count the valid paths in the tree while considering the presence of prime numbers.

Read more
Total votes 9: ↑4 and ↓5-1
Comments1

Creating a mini-game with drip effect and moving circles. Part 2. Final

Level of difficultyEasy
Reading time8 min
Views682

Hello, dear users of the IT world!

In modern web development there are many ways to make your website interesting and attractive to users. And even using simple techniques you can achieve great results!

I suggest you to create a mini-game from scratch yourself. And then, you can use it to liven up and add interactivity to any web page.

Read more
Rating0
Comments0

React Custom Hook: useOnScreen

Level of difficultyMedium
Reading time2 min
Views2.9K

One of the key advantages of useOnScreen is its simplicity. With just a few lines of code, you can detect if an element is visible and respond accordingly. This can be immensely useful in scenarios where you want to trigger animations, lazy load images, or load additional content as the user scrolls.

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

Creating a mini-game with a drip effect and moving circles. Part 1

Level of difficultyEasy
Reading time7 min
Views835

Hello, dear users of the IT world!

In modern web development there are many ways to make your website interesting and attractive to users. And even using simple techniques you can achieve great results!

I suggest you to create a mini-game from scratch yourself. And then, you can use it to liven up and add interactivity to any web page.

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

React Custom Hook: useOnlineStatus

Level of difficultyMedium
Reading time2 min
Views1.7K

One of the main advantages of "useOnlineStatus" is its simplicity. By importing and using this hook in your component, you can effortlessly access the online status of the user. The hook internally uses the "navigator.onLine" property to determine the initial online status and dynamically updates it whenever the user's connectivity changes.

Read more
Rating0
Comments0

MSSQL: Table Rebuild and Reorg in highload 24/7 Environments

Level of difficultyMedium
Reading time14 min
Views1.9K

How do you deal with index fragmentation if your SQL server is working in high load environment with 24/7 workload without any maintenance window? What are the best practices for index rebuild and index reorganize? What is better? What is possible if you have only Standard Edition on some servers? But first, let's debunk few myths.

Myth 1. We use SSD (or super duper storage), so we should not care about the fragmentation. False. Index rebuild compactifies a table, with compression it makes it sometimes several times smaller, improving the cache hits ratio and overall performance (this happens even without compression).

Myth 2. Index rebuild shorten SSD lifespan. False. One extra write cycle is nothing for the modern SSDs. If your tempdb is on SSD/NVMe, it is under much harder stress than data disks.

Myth 3. On Enterprise Edition there is a good option: ONLINE=ON, so I just create a script with all tables and go ahead. False. There are tons of potential problems created by INDEX REBUILD even with ONLINE and RESUMABLE ON - so never run index rebuilds without controlling the process.

Finally, we will tackle the REBUILD vs REORGANIZE subject and what is possible to achieve if you have only Standard Edition.

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

Detection of meterpreter sessions in Windows OS

Level of difficultyEasy
Reading time4 min
Views972

Introduction

Hello Habr! This is a translation of my first article, which was born due to the fact that I once played with the types of meterpreter payload from the Metasploit Framework and decided to find a way to detect it in the Windows OS family.

Analysis

I will try to present everything in an accessible and compact way without delving into all the work. To begin with, I decided to create the nth number of useful loads (windows/meterpreter/reverse_tcp, shell/bind_tcp, shell_hidden_bind_tcp, vncinject/reverse_tcp, cmd/windows/reverse_powershell) to analyze what will happen in the system after their injection.

Read more
Rating0
Comments0

Exploring FIFO principles using an HDL training tool

Level of difficultyMedium
Reading time1 min
Views604

Ссылка на русскую версию / link to Russian version

FIFO is a key concept in hardware design. Understanding of FIFO is necessary for understanding the valid/ready protocol, which in turn is necessary for organisation of flow-control within a design.

Unfortunately, there are very few books on this topic, and to be fair, microarchitectural concepts are quite difficult to master from books, since understanding of these concepts are coming with practice. In other words it is more about developing hardware intuition.

The idea of the HDL training tool is that it can help develop a hardware intuition, providing the opportunity to explore ready-made scenarios in a step-by-step interactive way. The tool also provides detailed visualization of a simulated scenario.

Since the tool is a front-end for the HDL simulator, the real, synthesized SystemVerilog is executed on the simulator itself, which can be viewed and even modified.

So, the video of exploring FIFO on the training tool is here:

Watch the video and continue reading
Total votes 4: ↑4 and ↓0+4
Comments0

PostgreSQL 17: Part 1 or Commitfest 2023-07

Level of difficultyMedium
Reading time8 min
Views845
image

We continue to follow the news in the world of PostgreSQL. The PostgreSQL 16 Release Candidate 1 was rolled out on August 31. If all is well, PostgreSQL 16 will officially release on September 14.


What has changed in the upcoming release after the April code freeze? What's getting into PostgreSQL 17 after the first commitfest? Read our latest review to find out!

Read more →
Rating0
Comments0

React Custom Hook: useMediaQuery

Level of difficultyMedium
Reading time2 min
Views2.6K

One of the key advantages of this custom hook is its simplicity and reusability. With just a few lines of code, you can effortlessly implement responsive behavior throughout your application. Whether you need to conditionally render components, apply specific styles, or trigger different functionality based on screen size, useMediaQuery has got you covered.

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

Create a native Kotlin application with Spring Boot Native, Gradle, and GraalVM without Docker for MacOS and Windows

Level of difficultyMedium
Reading time11 min
Views1.6K

In this tutorial, I want to talk about the practical experience of native compilation of a production application written in Kotlin with Spring Boot and Gradle using GraalVM. I’ll start right away with the pros and cons of the native compilation feature itself and where it can be useful, and then I’ll move directly to the build process for MacOS and Windows.

At the end of the article, in the afterword block, I will talk in more detail about the project and why such a need arose, given quite a few limitations and pitfalls of supporting native compilation both from Spring Boot and from GraalVM.

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

React Custom Hook: useLongPress

Level of difficultyMedium
Reading time2 min
Views1.4K

One of the key advantages of useLongPress is its simplicity. By utilizing this hook, developers can easily define a long-press action on any element in their React application. With just a few lines of code, the hook takes care of handling the intricacies of tracking the long-press duration and triggering the associated callback function.

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

Best distributed task scheduling framework — Openjob 1.0.7 released

Reading time5 min
Views1.1K

Openjob is a new  distributed task scheduling framework based on Akka architecture. Supports multiple cronjob, delay task, workflow, lightweight distributed computing, unlimited horizontal scaling, with high scalability and fault tolerance. Also has complete management, powerful alarm monitoring, and support multiple languages

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

React Custom Hook: useGeolocation

Level of difficultyMedium
Reading time2 min
Views2.3K

One of the key advantages of useGeolocation is its simplicity. By encapsulating the complex logic required for geolocation access and handling, this hook provides a clean and reusable solution. The hook automatically handles the loading state, updating it when geolocation data is being fetched, and sets the error state if any issues arise during the process.

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

Writing an interpreter (virtual machine) for a simple byte-code + JIT compilation

Level of difficultyMedium
Reading time10 min
Views1.3K

There are two articles on Russian, the author of which writes a virtual machine (interpreter) for executing a simple bytecode and then applies different optimizations to make this virtual machine faster. Besides that, there is a compiler of a simple C-like language into this bytecode. After reading this article and getting familiar with the compiler, I thought that it would be interesting to try writing a virtual machine for this language that would be able to apply JIT-compilation to this bytecode with the libjit library. This article describes the experience of doing that.

I found several articles online that describe the usage of this library, but those that I saw, describe the compilation of concrete programs with libjit, while I was interested in compiling arbitrary bytecode. For people interested in further reading, there is an official titorial, a series of articles and a series of comparisons (in Russian).

The implementation was done in C++ because we aren`t playing games here. All my code is in my repository. The "main" branch has just the interpreter of the PigletVM bytecode; "labels-with-fallbacks" has a partial JIT compilation implementation (that doesn`t support JUMP instructions), "full-jit" has fully working JIT-compilationl; "making-jit-code-faster" makes code generated by JIT work faster and "universal-base-vm*" branches merge the interpreter and JIT-compilation implementations, by implementing a base generalised executor, which can be used for different implementations of PigletVM (both the interpreter and libjit compilation)

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

How to conduct UX brainstorming sessions effectively: tips and methods that work

Level of difficultyMedium
Reading time6 min
Views1.3K

Brainstorming is a popular working method which is commonly used by UX design teams. It involves a group of designers meeting (whether offline or via video call) and generating as many ideas as possible to find the best solution to a specific problem or come up with creative design ideas. Brainstorming sessions are usually held at the start of a UX project so that designers could use the ideas they think are the best later in the process of product creation. These sessions can vary in duration and form depending on which problems need to be solved, how many people participate and how many ideas need to be generated. 

Read more
Rating0
Comments3

React Custom Hook: useFetch

Level of difficultyMedium
Reading time2 min
Views3.5K

One of the key advantages of useFetch is its simplicity. By abstracting away the fetch logic into a reusable hook, developers can quickly and effortlessly make HTTP requests and handle responses without repetitive boilerplate code. With just a few lines, useFetch handles the network request, parses the JSON response, and provides the resulting data.

Read more
Total votes 3: ↑0 and ↓3-3
Comments0

Handling multidisciplinary project development

Level of difficultyMedium
Reading time4 min
Views723

Multidisciplinary project emerges when multiple teams with different expertise areas join to create a product. Despite the fact the product development is not something happining merely my a wish, product leads often perceive it as an easy walk. Usually this easy walk becomes a crash course. Let's uncover what leads to crash and what is necessary to succeed.

Read more
Rating0
Comments2