Tagged articles
slice
20 articles · Page 1 of 1
The article analyzes Spring Data JPA's Page and Slice pagination options, explains the hidden COUNT(*) overhead of Page, demonstrates both approaches with code examples, compares performance and UX impacts, and provides guidance on when to choose Slice for large‑scale or infinite‑scroll scenarios.
BackendPaginationSpring Boot
0 likes · 11 min read

Go provides two distinct constructors—new, a generic memory allocator returning a zero‑initialized pointer, and make, a specialized initializer that allocates and prepares slices, maps, and channels—explaining why both exist, how they differ, common pitfalls, and the language’s design philosophy of explicit, ready‑to‑use values.
GoReference Typeschannel
0 likes · 8 min read

This guide explains how to reliably export over a billion Elasticsearch documents within a few hours by using Point‑In‑Time (PIT) snapshots combined with parallel Slice processing, covering diagnostics, performance modeling, consistency levels, failure recovery, and resource isolation.
ElasticsearchPITbig data
0 likes · 7 min read

This article demystifies Go's slice implementation by revealing its underlying struct, shared‑array hazards, the runtime's append expansion algorithm, common pitfalls with concrete code examples, and practical best‑practice guidelines for writing safe and high‑performance slice code.
appendcapacitygolang
0 likes · 8 min read

This article explains the three JavaScript string extraction methods—substr(), substring() and slice()—highlighting why slice() is now preferred, detailing deprecation reasons for substr(), comparing behavior, parameter handling, and consistency, and summarizing its advantages over the other methods.
JavaScriptString MethodsSubstring
0 likes · 4 min read

This article explains Go’s empty interface, showing how it can hold values of any type, how to declare and use it in functions and data structures, and why copying between concrete slices and empty‑interface slices requires element‑wise assignment due to its two‑word memory layout.
GoMemory LayoutType System
0 likes · 5 min read

This article explains the shared behavior of Go's new and make functions, highlights their key differences—including supported types, return values, and initialization details—and provides concrete code examples to show how each should be used in practice.
Gochannelmake
0 likes · 7 min read

This guide explains Go's empty interface, how any value can be stored in it, demonstrates declaring variables and functions with interface{}, shows practical slice examples, discusses memory layout, and provides the correct way to copy data into an empty‑interface slice.
Type Conversionempty interfacegolang
0 likes · 5 min read

Go slices are dynamic, flexible data structures built on arrays, offering automatic growth, efficient memory use, and powerful operations such as creation via make or literals, slicing, appending, copying, iteration, and passing to functions, with detailed examples and visualizations illustrating their internal mechanics.
COPYGoMemory
0 likes · 17 min read

This article walks through a step‑by‑step Go implementation of Liu Qian’s 2024 Spring Festival Gala magic trick, explaining how to model the card‑handling algorithm with slices, shuffle, cuts, and loops, and provides complete source code and execution logs for readers to try.
AlgorithmGoMagic Trick
0 likes · 10 min read

This article explores the various ways to compare structs, slices, maps, and other Go types, explaining when the == operator is applicable, why it fails for certain types, and how alternatives like reflect.DeepEqual, cmp.Equal, and testify can be used effectively.
CMPGoStruct
0 likes · 11 min read

Go 1.20 RC1 introduces experimental RISC‑V/FreeBSD support, expands slice‑to‑array conversion, adds three new unsafe package functions, updates comparable type constraints, and changes struct value comparison order, while being the final version compatible with macOS 10.13/10.14, with download details provided.
ComparableProgramming LanguageRISC-V
0 likes · 4 min read

The article explains that Go maps and slices are not safe for concurrent reads or writes, describes how the runtime detects map violations, and recommends using sync.Mutex, sync.RWMutex, or sync.Map for maps and external synchronization for slices, while also clarifying that passing these reference types to functions shares underlying data unless explicitly copied.
ConcurrencyGolocking
0 likes · 12 min read

This article explains how Go's sort package internally uses four algorithms, how to implement sort.Interface with Len, Less, and Swap methods, and provides code examples for sorting int slices and custom structs by different fields.
Algorithmsinterfaceslice
0 likes · 5 min read

This article explains the internal representation of Go slices, how they are created and initialized, the mechanics of append and capacity growth, slicing behavior, deep‑copy using the copy function, and whether slices are passed by value or reference, all illustrated with source code and assembly excerpts.
COPYGoMemory
0 likes · 24 min read

Python’s slice syntax new = old[:] appears to copy a list, but it actually creates a reference to the same object, leading to subtle bugs; this article explains Python’s object model, demonstrates the pitfalls, and presents clearer alternatives such as list(), copy.copy(), and deepcopy.
Deep CopyShallow Copybest-practices
0 likes · 6 min read
![Why Python’s [:] List Copy Is Misleading and Better Alternatives](https://wsrv.nl/?url=http%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FQjsK6KAK6QytEfcDx81lCDf0zZTSHv5KeGngJtlNF66B1icE1SNjhicOxibxUAhbIRs4geM8ocXOBfcrcOhBFKmvA%2F0%3Fwx_fmt%3Djpeg)
The article explains Go slices as three‑field descriptors pointing to an underlying array, details creation methods, shows the low‑level runtime representation and assembly for make, describes how append triggers growslice with capacity‑doubling or ~25 % growth and alignment, and clarifies sharing, nil slices, and passing semantics.
Goappendassembly
0 likes · 28 min read

This article explains the fundamental differences between Go arrays and slices, describes their memory layout and value semantics, illustrates various slice declaration forms, and details the rules governing slice capacity growth with example code and visual diagrams.
GoMemory Layoutarray
0 likes · 6 min read

This guide explains Python's slice() function, its syntax and parameters, and demonstrates how to use simple and advanced slicing techniques on lists, tuples, strings, and Unicode sequences with clear code examples.
Pythonlist slicingprogramming fundamentals
0 likes · 5 min read

This article explains Go's slice data structure, how slices are represented in memory, common pitfalls with value passing, slicing, expanding, and provides practical examples of functions like copy, append, and differences between make and new for slices.
BackendGoMemory
0 likes · 10 min read
