day 004-5-6-7
Rapid firing of days
Rapid fire
I know I know, supposedly doing this every day but I’m bundling the days together, but yeah I got nothing to defend myself.
Four
Four, aka 17th da July, I worked on BDNS a bit, I’ve been reading this guide, it’s quite informative, though I do know alot of it already, it’s really filling in the gaps.
Five
Friday baby, I believe I got home and died on the bed, I’ve never slept so well, I created a good nights sleep, though I’m not so sure I can count that.
Six
Boring, tedious stuff, but still creation of sorts, shopify stuff. God help .liquid files and Neovim, I didn’t even attempt to figure out if there was an LSP for them.
Seven !
More BDNS stuff, I now have DoT, DoH, and “normal” dns working !! Though it is forwarding packets, but that’s all I need :)
Eight !!!!!
Today, I partook in the leetcode of the daily, a simple grid-shift, here’s my solution:
func shiftGrid(grid [][]int, k int) [][]int {
m := len(grid)
if m == 0 {
return grid
}
n := len(grid[0])
total := m * n
k %= total
result := make([][]int, m)
for i := range result {
result[i] = make([]int, n)
}
for i := 0; i < m; i++ {
for j := 0; j < n; j++ {
idx := (i*n + j + k) % total
result[idx/n][idx%n] = grid[i][j]
}
}
return result
}
Is it the best, not really. Golang is my leetcode language of choice, I’m sure there’s a python one-liner, or a rust version with 17 chained func calls, but I still cannot wrap my head around .map
That’s all for today folks, I’ll be back tomorrow for more excuses as to how creating a good nights sleep counts.
Json link - with the full history
A video recording of me writing this entire page, using wmwt.