# 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 238099
# self = https://watcher.sour.is?offset=237669
# next = https://watcher.sour.is?offset=237769
# prev = https://watcher.sour.is?offset=237569
@andros U2FsdGVkX1/5aYInTCCOWUN6v2vxQ7GpiHsg3ajd5U1dznWOrBNYAnOhyd+s96ckC/pYkSPTu/lZsMPQLmhXsA==
@lyse lol – I explicitly kept them in there so that the code is easier to understand for non-Rust people 🤪😂
[47°09′47″S, 126°43′13″W] Transfer 50% complete...
[47°09′22″S, 126°43′15″W] Transfer 25% complete...
Someone has an iMac? I think they have all gone because of keypad problems.
I only have internet explorer 6. Therein gopher not blocked.
[47°09′13″S, 126°43′15″W] Waiting for carrier
@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 🤘
(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.
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
🧮 USERS:1 FEEDS:2 TWTS:1378 ARCHIVED:87729 CACHE:2694 FOLLOWERS:22 FOLLOWING:14
[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. 🤦
@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
[47°09′02″S, 126°43′00″W] Analyzing samples
@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.
@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 🥲
🧮 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
[47°09′41″S, 126°43′12″W] Taking samples
is my desktop cute yes or yes
is my desktop cute yes or yes
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 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
[47°09′06″S, 126°43′24″W] --bad checksum--
Achievement Unlocked: I have finally gotten to sit my ass down and watch Back to the future
from start to the end.
@prologic But is there a source for it? Am I too stupid to use that site? 🤪
@prologic … or just bullshit.
> I'm Alex, COO at ColdIQ. Built a $4.5M ARR business in under 2 years.
Some “C-level” guy telling people what to do, yeah, I have my doubts.
@prologic This doesn’t cite any sources, might as well be satire. 🤔
@kat Awww. :( Can you tell why? Missing libraries or does it just segfault?