@thegibson I'm copying some emojis from my old instance, would you mind? 😇

Software dev by day, author by night.
#amwriting my first #scifi novel, donations welcome!
Plz msg b4 following.
MOVING!!!
* @yuki2501
| Traits | MX 🇲🇽, nerd, snarky, playful 😺, jester, Cyberpunk 😎 |
| Interests | #AI, #scifi, #cyberpunk, #synthwave, #foss, #hackerculture, #bdsm, #erotica |
| Pronouns | She/they 🏳️⚧️ |
| New acct | @yuki2501 |
@thegibson I'm copying some emojis from my old instance, would you mind? 😇


The good thing is that today I just rested, watched anime and played videogames.
Now I only have to go to bed to rest for another work week.
Cya!
Furthermore, I found out that java streams allow you to generate with a supplier function, so I can do this:
List processedStuff = Stream.generate(mySupplier::tryFetch)
.takeWhile(list -> !list.isEmpty())
.map( ... stuff ...)
.collect(Collectors::toList);
And I can move some of that into my class:
class MySupplier {
Stream stream() {
return Stream.generate(this::tryFetch).takeWhile(list -> !list.isEmpty());
}
}
So now I can do:
List processedStuff = mySupplier.stream()
.map( ... stuff ...)
.collect(Collectors::toList);
So that saves a lot of complicated nested loops and local variables for flow control.
While I hate myself a little more for working on rest days, this is more knowledge I gained for myself and is yet another skill I gained.
Thinking with streams is like thinking with Portals, except for programming. It's fun 😃
2/
OMG OMG OMG I just had the most interesting revelation this weekend
(for my capitalist chieftains, that is)
So I've been working the weekend to fix a system that was failing (not mission critical, but a pebble in the shoe), and I had this epiphany:
Currently we're doing lots of stuff to scan a sparse database for migration / backup purposes, like dividing the entire index into chunks for... reasons (lack of adequate indexes, etc).
Add to that query pagination because we're dealing with Out of Memory issues, etc.
So I had this idea: If instead having the chunk start and end, and the current offset inside a procedure/function, dealing with loops, etc...
What if I make a stateful supplier class?
[ internal memory: current chunk index, list of chunks left to read, current chunk's offset, etc
tryFetch()
]
So that leaves us with a pretty simple loop:
values = supplier.tryFetch();
while (!values.isEmpty()) {
doStuff();
}
1/
#veloren is FUN AS FUCK and you should totes play it
what's veloren? imagine a FREE AND OPEN SOURCE ONLINE RPG with the minecraft art style
it's great, the music and aesthetic and everything are so amazing
and the game itself is hella fun to play too ofc