# I am the Watcher. I am your guide through this vast new twtiverse.
#
# Usage:
# https://watcher.sour.is/api/plain/users View list of users and latest twt date.
# https://watcher.sour.is/api/plain/twt View all twts.
# https://watcher.sour.is/api/plain/mentions?uri=:uri View all mentions for uri.
# https://watcher.sour.is/api/plain/conv/:hash View all twts for a conversation subject.
#
# Options:
# uri Filter to show a specific users twts.
# offset Start index for quey.
# limit Count of items to return (going back in time).
#
# twt range = 1 194150
# self = https://watcher.sour.is?offset=191909
# next = https://watcher.sour.is?offset=192009
# prev = https://watcher.sour.is?offset=191809
@prologic I’d say: Yes, because in Go it’s easier to ignore errors.
We’re talking about this pattern, right?
f, err := os.Open("filename.ext")
if err != nil {
log.Fatal(err)
}
Nothing stops you from leaving out the if
, right? 🤔
@prologic I’d say: Yes, because in Go it’s easier to ignore errors.
We’re talking about this pattern, right?
f, err := os.Open("filename.ext")
if err != nil {
log.Fatal(err)
}
Nothing stops you from leaving out the if
, right? 🤔
@movq I'm feeling SO dumb right now 😅 I used to think !!
was a sudo
argument and never used it out of that context! Thanks for the $(!!)
tip 🤘
@movq Is this much different to Go's error handling as values though really? 🧐🤣😈
(Of course, if we’re talking about a project you’re doing for a customer and the customer keeps asking for new stuff, then you’re never done, and you have to think ahead and expect changes. Is that what they mean? 🤔)
(Of course, if we’re talking about a project you’re doing for a customer and the customer keeps asking for new stuff, then you’re never done, and you have to think ahead and expect changes. Is that what they mean? 🤔)
Saw this on Mastodon:
https://racingbunny.com/@mookie/114718466149264471
> 18 rules of Software Engineering
>
> 0. You will regret complexity when on-call
> 1. Stop falling in love with your own code
> 2. Everything is a trade-off. There's no "best" 3. Every line of code you write is a liability 4. Document your decisions and designs
> 5. Everyone hates code they didn’t write
> 6. Don't use unnecessary dependencies
> 7. Coding standards prevent arguments
> 8. Write meaningful commit messages
> 9. Don't ever stop learning new things
> 10. Code reviews spread knowledge
> 11. Always build for maintainability
> 12. Ask for help when you’re stuck
> 13. Fix root causes, not symptoms
> 14. Software is never completed
> 15. Estimates are not promises
> 16. Ship early, iterate often
> 17. Keep. It. Simple.
Solid list, even though 14 is up for debate in my opinion: Software can be completed. You have a use case / problem, you solve that problem, done. Your software is completed now. There might still be bugs and they should be fixed – but this doesn’t “add” to the program. Don’t use “software is never done” as an excuse to keep adding and adding stuff to your code.
Saw this on Mastodon:
https://racingbunny.com/@mookie/114718466149264471
> 18 rules of Software Engineering
>
> 0. You will regret complexity when on-call
> 1. Stop falling in love with your own code
> 2. Everything is a trade-off. There's no "best" 3. Every line of code you write is a liability 4. Document your decisions and designs
> 5. Everyone hates code they didn’t write
> 6. Don't use unnecessary dependencies
> 7. Coding standards prevent arguments
> 8. Write meaningful commit messages
> 9. Don't ever stop learning new things
> 10. Code reviews spread knowledge
> 11. Always build for maintainability
> 12. Ask for help when you’re stuck
> 13. Fix root causes, not symptoms
> 14. Software is never completed
> 15. Estimates are not promises
> 16. Ship early, iterate often
> 17. Keep. It. Simple.
Solid list, even though 14 is up for debate in my opinion: Software can be completed. You have a use case / problem, you solve that problem, done. Your software is completed now. There might still be bugs and they should be fixed – but this doesn’t “add” to the program. Don’t use “software is never done” as an excuse to keep adding and adding stuff to your code.
Okay, here’s a thing I like about Rust: Returning things as Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
fn mydiv(num: f64, denom: f64) -> Option {
// (Let’s ignore precision issues for a second.)
if denom 0.0 {
return None;
} else {
return Some(num / denom);
}
}
fn main() {
// Explicit, verbose version:
let num: f64 = 123.0;
let denom: f64 = 456.0;
let wrapped_res = mydiv(num, denom);
if wrapped_res.is_some() {
println!("Unwrapped result: {}", wrapped_res.unwrap());
}
// Shorter version using "if let":
if let Some(res) = mydiv(123.0, 456.0) {
println!("Here’s a result: {}", res);
}
if let Some(res) = mydiv(123.0, 0.0) {
println!("Huh, we divided by zero? This never happens. {}", res);
}
}
You can’t divide by zero, so the function returns an “error” in that case. (Option
isn’t really used for errors, IIUC, but the basic idea is the same for Result
.)
`Option` is an enum. It can have the value Some
or None
. In the case of Some
, *you can attach additional data* to the enum. In this case, we are attaching a floating point value.
The caller then has to decide: Is the value None
or Some
? Did the function succeed or not? If it is Some
, the caller can do .unwrap()
on this enum to get the inner value (the floating point value). If you do .unwrap()
on a None
value, the program will panic and die.
The if let
version using destructuring is much shorter and, once you got used to it, actually quite nice.
Now the trick is that you *must* somehow handle these two cases. You *must* either call something like .unwrap()
or do destructuring or something, otherwise you can’t access the attached value at all. As I understand it, it is impossible to just completely ignore error cases. And *the compiler enforces it*.
(In case of Result
, the compiler would warn you if you ignore the return value entirely. So something like doing write()
and then ignoring the return value would be caught as well.)=
Okay, here’s a thing I like about Rust: Returning things as Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
fn mydiv(num: f64, denom: f64) -> Option {
// (Let’s ignore precision issues for a second.)
if denom 0.0 {
return None;
} else {
return Some(num / denom);
}
}
fn main() {
// Explicit, verbose version:
let num: f64 = 123.0;
let denom: f64 = 456.0;
let wrapped_res = mydiv(num, denom);
if wrapped_res.is_some() {
println!("Unwrapped result: {}", wrapped_res.unwrap());
}
// Shorter version using "if let":
if let Some(res) = mydiv(123.0, 456.0) {
println!("Here’s a result: {}", res);
}
if let Some(res) = mydiv(123.0, 0.0) {
println!("Huh, we divided by zero? This never happens. {}", res);
}
}
You can’t divide by zero, so the function returns an “error” in that case. (Option
isn’t really used for errors, IIUC, but the basic idea is the same for Result
.)
`Option` is an enum. It can have the value Some
or None
. In the case of Some
, *you can attach additional data* to the enum. In this case, we are attaching a floating point value.
The caller then has to decide: Is the value None
or Some
? Did the function succeed or not? If it is Some
, the caller can do .unwrap()
on this enum to get the inner value (the floating point value). If you do .unwrap()
on a None
value, the program will panic and die.
The if let
version using destructuring is much shorter and, once you got used to it, actually quite nice.
Now the trick is that you *must* somehow handle these two cases. You *must* either call something like .unwrap()
or do destructuring or something, otherwise you can’t access the attached value at all. As I understand it, it is impossible to just completely ignore error cases. And *the compiler enforces it*.
(In case of Result
, the compiler would warn you if you ignore the return value entirely. So something like doing write()
and then ignoring the return value would be caught as well.)=
[47°09′23″S, 126°43′06″W] Sample analyzing complete -- starting transfer
[47°09′21″S, 126°43′33″W] Not enough data -- sampling finished
Gone on a road trip. Be back in a week 👋
Now I could. A few minutes ago I posted one, and it went to the void. I can’t delete, though. I get a lovely 403.
🧮 USERS:1 FEEDS:2 TWTS:1378 ARCHIVED:87729 CACHE:2694 FOLLOWERS:22 FOLLOWING:14
@bender Ahh I see hmmm I don't know this either 🤣
[47°09′15″S, 126°43′51″W] Re-taking samples
@kat I might give it a shot. 😃
Skimming through the manual: I had no idea that keeping the “up” cursor pressed actually slows you down at some point. 🤦
@kat I might give it a shot. 😃
Skimming through the manual: I had no idea that keeping the “up” cursor pressed actually slows you down at some point. 🤦
@aelaraji I use Alt+.
all the time, it’s great. 👌
FWIW, another thing I often use is !!
to recall the entire previous command line:
$ find -iname '*foo*'
./This is a foo file.txt
$ cat "$(!!)"
cat "$(find -iname '*foo*')"
This is just a test.
Yep!
Or:
$ ls -al subdir
ls: cannot open directory 'subdir': Permission denied
$ sudo !!
sudo ls -al subdir
total 0
drwx------ 2 root root 60 Jun 20 19:39 .
drwx------ 7 jess jess 360 Jun 20 19:39 ..
-rw-r--r-- 1 root root 0 Jun 20 19:39 nothing-to-see
@aelaraji I use Alt+.
all the time, it’s great. 👌
FWIW, another thing I often use is !!
to recall the entire previous command line:
$ find -iname '*foo*'
./This is a foo file.txt
$ cat "$(!!)"
cat "$(find -iname '*foo*')"
This is just a test.
Yep!
Or:
$ ls -al subdir
ls: cannot open directory 'subdir': Permission denied
$ sudo !!
sudo ls -al subdir
total 0
drwx------ 2 root root 60 Jun 20 19:39 .
drwx------ 7 jess jess 360 Jun 20 19:39 ..
-rw-r--r-- 1 root root 0 Jun 20 19:39 nothing-to-see
@thecanine With the teeth this looks like a vampire dog. :-D And I don't get the reference either.
@aelaraji Oh, that's great! I haven't heard about any of them before either. There's also a caveat though, that I ran right into the very first time I tried this in zsh:
$ ls > /dev/null
$ echo $_
--color=tty
Yeah, exactly what you think:
$ which ls
ls: aliased to ls --color=tty
Alt+.
is going to be my favorite one! In the above, it would also give me /dev/null
, which might be probably more what I would expect.
[47°09′02″S, 126°43′00″W] Analyzing samples
@prologic no, good man. Follow the link, follow eet! :-)
@movq omg yeah! this one looks cute too (i'm weak to anything tux related!) but the commercial release has so much unpolished charm i love it! btw it's on [internet archive(https://archive.org/details/TuxRacerCD) if you wanna download & play it :]
@movq omg yeah! this one looks cute too (i'm weak to anything tux related!) but the commercial release has so much unpolished charm i love it! btw it's on [internet archive(https://archive.org/details/TuxRacerCD) if you wanna download & play it :]
@bender I SANG ALONG IN MY HEAD LMAOOO
@bender I SANG ALONG IN MY HEAD LMAOOO
[47°09′51″S, 126°43′02″W] 4446 days without news from Herve
@andros U2FsdGVkX1+smE42W302N1gyZ7DWTfB4DFdg/XRGYuuyNQLD0LaRuefMEULJOVjawGviUOSrypabRdS7ZabiQQ==
I also just noticed that the performance issue doesn’t affect all games. 🤔 Sigh, I’ll just downgrade for the time being. Not in the mood to fiddle with this.
I also just noticed that the performance issue doesn’t affect all games. 🤔 Sigh, I’ll just downgrade for the time being. Not in the mood to fiddle with this.
@kat I guess that qualifies as an “Arch moment”, albeit the first one I encountered. I’m running this since 2008 and it’s usually very smooth sailing. 😅
@lyse Yeah, YMMV. Some games work(ed) great in Wine, others not at all. I just use it because it’s easier than firing up my WinXP box. (I don’t use Wine for regular applications, just games.)
@kat I guess that qualifies as an “Arch moment”, albeit the first one I encountered. I’m running this since 2008 and it’s usually very smooth sailing. 😅
@lyse Yeah, YMMV. Some games work(ed) great in Wine, others not at all. I just use it because it’s easier than firing up my WinXP box. (I don’t use Wine for regular applications, just games.)
[47°09′05″S, 126°43′03″W] --interrupted--
[47°09′24″S, 126°43′33″W] Non-significative results -- sampling finished
@bender Now I AM curious! What rabbit-hole? what am I missing here? 😆
Just discovered how easy it is to recall my last arg in shell and my brain went 🤯 How come I've never learned about this before!? I wonder how many other QOL shortcuts I'm missing on 🥲
@kat 🎵 Grafana ana bo bana fifo bo bana gra fana!🎶 Don’t mind me, I am nuts.
@kat I recommend you to remain curious without crossing the threshold. Unless, of course, you truly want to follow a never-ending rabbit hole. 😂
🧮 USERS:1 FEEDS:2 TWTS:1377 ARCHIVED:87719 CACHE:2687 FOLLOWERS:22 FOLLOWING:14
GRAFANA IS DRIVING ME NUTSSSSSSS
GRAFANA IS DRIVING ME NUTSSSSSSS
@lyse as long as i get to see silly little tux sliding around in a silly game older than me it's ok <3 even if i committed windows/wine crimes to see it <33
@lyse as long as i get to see silly little tux sliding around in a silly game older than me it's ok <3 even if i committed windows/wine crimes to see it <33
I probably should implement some editing feature in tt
. Sure, I can easily edit my feed in vim to fix typos. But then I still have to manually remove the old message from the cache so that the new message is inserted on next reload and I don't end up with "duplicates" in the message tree.
[47°09′41″S, 126°43′12″W] Taking samples
@movq Must be a decode ago that I last used Wine. I wanted to play GTA2, but that didn't go as planned.
@movq And there the air raid siren goes off.
is my desktop cute yes or yes
is my desktop cute yes or yes
@kat Oh no, how unpenguinly! But at least it runs, even races. :-)
@movq That sounds great! (Well, they actually must have recorded the audio with a potato or so.) You talked about pledge(…)
and unveil(…)
before, right? I somewhere ran across them once before. Never tried them out, but these syscalls seem to be really useful. They also have the potential to make one really rethink about software architecture. I should probably give this a try and see how I can improve my own programs.
Wet t-shirt contest time! After our forest stroll I just wrung out the damn thing. Fuck me!
Speaking of Wine, Arch Linux completely fucked up Wine for me with the latest update.
- 16-bit support is gone.
- Performance of 3D games is horrible and unplayable.
Arch is shipping a WoW64 build now, which is not yet ready for prime time.
And *then* I realized that there’s actually only one stable Wine release per year but Arch has been shipping development releases all the time. That’s quite unusual. I’m used to Arch only shipping stable packages … huh.
Hopefully things will improve again. I’m not eager to build Wine from source. I’d rather ditch it and resort to my real Windows XP box for the little (retro)gaming that I do … 🫤
Speaking of Wine, Arch Linux completely fucked up Wine for me with the latest update.
- 16-bit support is gone.
- Performance of 3D games is horrible and unplayable.
Arch is shipping a WoW64 build now, which is not yet ready for prime time.
And *then* I realized that there’s actually only one stable Wine release per year but Arch has been shipping development releases all the time. That’s quite unusual. I’m used to Arch only shipping stable packages … huh.
Hopefully things will improve again. I’m not eager to build Wine from source. I’d rather ditch it and resort to my real Windows XP box for the little (retro)gaming that I do … 🫤
@movq i'm grateful that this works at least!
@movq i'm grateful that this works at least!
@kat lol, oof, well, better than nothing. 🥴 It appears to run quite well. 🤔
@kat lol, oof, well, better than nothing. 🥴 It appears to run quite well. 🤔
@kat UPDATE: getting it to run natively through a VM and other means all failed! so i did the cursed thing and tried the windows installer in wine.....
GUESS WHAT WORKED
@kat UPDATE: getting it to run natively through a VM and other means all failed! so i did the cursed thing and tried the windows installer in wine.....
GUESS WHAT WORKED
@thecanine i do not get the reference but this is very cute!
@thecanine i do not get the reference but this is very cute!
@movq missing libraries :( i expected it though
@movq missing libraries :( i expected it though
@movq Yup 👍 Super interesting sruff 👌