 
  		        jamesallured
Distributed Services with Go: Confusion with relative offsets (pg. 39)
Page 39, Print Edition
The description of how the offset is calculated for the index under the definition of Append() is confusing and I believe it’s the result of a mix up with the wording.
Since index offsets are relative to the base offset, we subtract the segment’s next offset from its base offset (which are both absolute offsets) to get the entry’s relative offset in the segment.
This contradicts what is actually happening in the code where we see:
uint32(s.nextOffset-uint64(s.baseOffset))
I believe that this sentence should probably read:
Since index offsets are relative to the base offset, we subtract the segment’s base offset from its next offset (which are both absolute offsets) to get the entry’s relative offset in the segment.
Popular Pragmatic Bookshelf topics
                         
                      
                       
          
                page 37 
ANTLRInputStream input = new ANTLRInputStream(is); 
as of ANTLR 4 .8 should be: 
CharStream stream = CharStreams.fromStream(i...
              
            
            
          
              New
 
          
                Hi everyone! 
There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
              
            
            
          
              New
 
          
                Title: Hands-On Rust (Chapter 11: prefab) 
Just played a couple of amulet-less games.  With a bit of debugging, I believe that your can_p...
              
            
            
          
              New
 
          
                Hi, 
build fails on: 
bracket-lib = “~0.8.1” 
when running on Mac Mini M1 Rust version 1.5.0: 
Compiling winit v0.22.2 
error[E0308]: mi...
              
            
            
          
              New
 
          
                This isn’t directly about the book contents so maybe not the right forum…but in some of the code apps (e.g. turbo/06) it sends a TURBO_ST...
              
            
            
          
              New
 
          
                Dear Sophie. 
I tried to do the “Authorization” exercise and have two questions: 
When trying to plug in an email-service, I found the ...
              
            
            
          
              New
 
          
                When trying to run tox in parallel as explained on page 151, I got the following error: 
tox: error: argument -p/–parallel: expected one...
              
            
            
          
              New
 
          Modern Front-End Development for Rails - application does not start after run bin/setup (page xviii)
                After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
              
            
            
          
              New
 
          
                @parrt 
In the context of Chapter 4.3, the grammar Java.g4, meant to parse Java 6 compilation units, no longer passes ANTLR (currently 4....
              
            
            
          
              New
 
          
                I am using Android Studio Chipmunk | 2021.2.1 Patch 2 
Build #AI-212.5712.43.2112.8815526, built on July 10, 2022 
Runtime version: 11.0....
              
            
            
          
              New
Other popular topics
                         
                      
                       
          
                I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: 
The Ser...
              
            
            
          
              New
 
          
                I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
              
            
            
          
              New
 
          
                In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: 
asdf plugin-upd...
              
            
            
          
              New
 
          
                Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
              
            
            
          
              New
 
          
                Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
              
            
            
          
              New
 
          
                A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
              
            
            
          
              New
 
          
                Author Spotlight 
Erin Dees 
@undees 
Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
              
            
            
          
              New
 
          
                Author Spotlight: 
Peter Ullrich 
@PJUllrich 
Data is at the core of every business, but it is useless if nobody can access and analyze ...
              
            
            
          
              New
 
          
                zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. 
General-purpose programming language and toolchain for maintaini...
              
            
            
              
          
              New
 
          
                Big O Notation can make your code faster by orders of magnitude. Get the hands-on info you need to master data structures and algorithms ...
              
            
            
              
          
              New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /python
- /rails
- /js
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /elm
- /flutter
- /vscode
- /ash
- /html
- /opensuse
- /centos
- /php
- /zig
- /deepseek
- /scala
- /lisp
- /textmate
- /sublime-text
- /react-native
- /nixos
- /debian
- /agda
- /kubuntu
- /arch-linux
- /django
- /revery
- /deno
- /ubuntu
- /spring
- /manjaro
- /nodejs
- /diversity
- /lua
- /julia
- /slackware
- /c
 
    





