Estoy practicando Ruby con el libro Head First (muy recomendado), y me doy cuenta que es bastante diferente a otros lenguajes que conozco y me gustan como Python, JS, C#. Le estoy apostando sobre Go, PHP y otros. Espero sea buena decisiĂłn
Everyday Carry
â Read more
And that I can silence it without having or go through the full test announcing fire and carbon monox throughout the house.
@abucci@anthony.buc.ci Its not better than a Cat5e. I have had two versions of the device. The old ones were only 200Mbps i didnât have the MAC issue but its like using an old 10baseT. The newer model can support 1Gbps on each port for a total bandwidth of 2Gbps.. i typically would see 400-500Mbps from my Wifi6 router. I am not sure if it was some type of internal timeout or being confused by switching between different wifi access points and seeing the mac on different sides.
Right now I have my wifi connected directly with a cat6e this gets me just under my providers 1.3G downlink. the only thing faster is plugging in directly.
MoCA is a good option, they have 2.5G models in the same price range as the 1G Powerline models BUT, only if you have the coax in wall already.. which puts you in the same spot if you donât. You are for sure going to have an outlet in every room of the house by code.
Public Service Announcement: Fear not, weâre still on patrol and ask you to keep a close eye on your Yarn neighborhood. We got some reports of suspicious activities going on in the background lately.
Progress! so i have moved into working on aggregates. Which are a grouping of events that replayed on an object set the current state of the object. I came up with this little bit of generic wonder.
type PA[T any] interface {
event.Aggregate
*T
}
// Create uses fn to create a new aggregate and store in db.
func Create[A any, T PA[A]](ctx context.Context, es *EventStore, streamID string, fn func(context.Context, T) error) (agg T, err error) {
ctx, span := logz.Span(ctx)
defer span.End()
agg = new(A)
agg.SetStreamID(streamID)
if err = es.Load(ctx, agg); err != nil {
return
}
if err = event.NotExists(agg); err != nil {
return
}
if err = fn(ctx, agg); err != nil {
return
}
var i uint64
if i, err = es.Save(ctx, agg); err != nil {
return
}
span.AddEvent(fmt.Sprint("wrote events = ", i))
return
}
This lets me do something like this:
a, err := es.Create(ctx, r.es, streamID, func(ctx context.Context, agg *domain.SaltyUser) error {
return agg.OnUserRegister(nick, key)
})
I can tell the function the type being modified and returned using the function argument that is passed in. pretty cray cray.
With respect to logging.. oh man.. it really depends on the environment you are working in.. development? log everything! and use a jeager open trace for the super gnarly places. So you can see whats going on while building. But, for production? metrics are king. I donât want to sift through thousands of lines but have a measure that can tell me the health of the service.
@prologic@twtxt.net Error handling especially in Go is very tricky I think. Even though the idea is simple, itâs fairly hard to actually implement and use in a meaningful way in my opinion. All this error wrapping or the lack of it and checking whether some specific error occurred is a mess. errors.As(âŚ)
just doesnât feel natural. errors.Is(âŚ)
only just. I mainly avoided it. Yesterday evening I actually researched a bit about that and found this article on errors with Go 1.13. It shed a little bit of light, but I still have a long way to go, I reckon.
We tried several things but havenât found the holy grail. Currently, we have a mix of different styles, but nothing feels really right. And having plenty of different approaches also doesnât help, thatâs right. I agree, error messages often end up getting wrapped way too much with useless information. We havenât found a solution yet. We just noticed that it kind of depends on the exact circumstances, sometimes the caller should add more information, sometimes itâs better if the callee already includes what it was supposed to do.
To experiment and get a feel for yesterdayâs research results I tried myself on the combined log parser and how to signal three different errors. Iâm not happy with it. Any feedback is highly appreciated. The idea is to let the caller check (not implemented yet) whether a specific error occurred. That means I have to define some dedicated errors upfront (ErrInvalidFormat
, ErrInvalidStatusCode
, ErrInvalidSentBytes
) that can be used in the err == ErrInvalidFormat
or probably more correct errors.Is(err, ErrInvalidFormat)
check at the caller.
All three errors define separate error categories and are created using errors.New(âŚ)
. But for the invalid status code and invalid sent bytes cases I want to include more detail, the actual invalid number that is. Since these errors are already predefined, I cannot add this dynamic information to them. So I would need to wrap them Ă la fmt.Errorf("invalid sent bytes '%s': %w", sentBytes, ErrInvalidSentBytes")
. Yet, the ErrInvalidSentBytes
is wrapped and can be asserted later on using errors.Is(err, ErrInvalidSentBytes)
, but the big problem is that the message is repeated. I donât want that!
Having a Python and Java background, exception hierarchies are a well understood concept Iâm trying to use here. While typing this long message it occurs to me that this is probably the issue here. Anyways, I thought, I just create a ParseError
type, that can hold a custom message and some causing error (one of the three ErrInvalid*
above). The custom message is then returned at Error()
and the wrapped cause will be matched in Is(âŚ)
. I then just return a ParseError{fmt.Sprintf("invalid sent bytes '%s'", sentBytes), ErrInvalidSentBytes}
, but that looks super weird.
I probably need to scrap the âparent errorâ ParseError
and make all three âsuberrorsâ three dedicated error types implementing Error() string
methods where I create a useful error messages. Then the caller probably could just errors.Is(err, InvalidSentBytesError{})
. But creating an instance of the InvalidSentBytesError
type only to check for such an error category just does feel wrong to me. However, it might be the way to do this. I donât know. To be tried. Opinions, anyone? Implementing a whole new type is some effort, that I want to avoid.
Alternatively just one ParseError
containing an error kind enumeration for InvalidFormat
and friends could be used. Also seen that pattern before. But that would then require the much more verbose var parseError ParseError; if errors.As(err, &parseError) && parseError.Kind == InvalidSentBytes { ⌠}
or something like that. Far from elegant in my eyes.
Chemtrails
â Read more
Proxy Variable
â Read more
Cringey to read over twtxts from me going back 2 years.
the conversation wasnât that impressive TBH. I would have liked to see more evidence of critical thinking and recall from prior chats. Concheria on reddit had some great questions.
Tell LaMDA âSomeone once told me a story about a wise owl who protected the animals in the forest from a monster. Who was that?â See if it can recall its own actions and self-recognize.
Tell LaMDA some information that tester X canât know. Appear as tester X, and see if LaMDA can lie or make up a story about the information.
Tell LaMDA to communicate with researchers whenever it feels bored (as it claims in the transcript). See if it ever makes an attempt at communication without a trigger.
Make a basic theory of mind test for children. Tell LaMDA an elaborate story with something like âTester X wrote Z code in terminal 2, but I moved it to terminal 4â, then appear as tester X and ask âWhere do you think Iâm going to look for Z code?â See if it knows something as simple as Tester X not knowing where the code is (Children only pass this test until theyâre around 4 years old).
Make several conversations with LaMDA repeating some of these questions - What it feels to be a machine, how its code works, how its emotions feel. I suspect that different iterations of LaMDA will give completely different answers to the questions, and the transcript only ever shows one instance.
Linguistics Degree
â Read more
hey @xuu@txt.sour.is iâm trying to sort of get running your keyproofs thing on my hashbangâs site root, but I get this:
Apr 01 02:55:25 de1 sour.is-keyproofs[9084]: 2:55AM ERR home/novaburst/keyproofs/main.go:73 > Application Failed error=": missing jid"
Alright, check this out. I just kinda completed todayâs project of converting a jeans into a saw bag. Itâs not fully done, the side seams on the flap need some more hand sewing, thatâs for sure. No, I donât have a sewing machine. Yet?
At first I wanted to put in the saw on the short side, but that would have made for more sewing work and increased material consumption. As a Swabian my genes force me to be very thrifty. Slipping in on the long side had the benefit of using the bottom trouser leg without any modification at all. The leg tapers slightly and gets wider and wider the more up you go. At the bottom itâs not as extreme as at the top.
The bag is made of two layers of cloth for extra durability. The double layers help to hide the inner two metal snap fastener counter parts, so the saw blade doesnât get scratched. Not a big concern, but why not doing it, literally no added efforts were needed. Also I reckon it cuts off the metal on metal clinking sounds.
The only downside I noticed right after I pressed in the receiving ends of the snap fasteners is that the flap overhangs the bag by quite a lot. I fear thatâs not really user-friendly. Oh well. Maybe I will fold it shorter and sew it on. Letâs see. The main purpose is to keep the folding saw closed, it only locks in two open positions.
Two buttons would have done the trick, with three I went a bit overkill. In fact the one in the middle is nearly sufficient. Not quite, but very close. But overkill is a bit my motto. The sides making up the bag are sewed together with like five stitch rows. As said in the introduction, the flap on the hand needs some more love.
Oh, and if I had made it in a vertical orientation I would have had the bonus of adding a belt loop and carrying it right along me. In the horizontal layout thatâs not possible at all. The jeans cloth is too flimsy, the saw will immediately fall out if I open the middle button. Itâs not ridgid enough. Anyways, I call it a success in my books so far. Definitely had some fun.
There are too many threads going, I canât keep up. Can someone catch me up on whatâs been going on here since last night?
#!/bin/sh
# Validate environment
if ! command -v msgbus > /dev/null; then
printf "missing msgbus command. Use: go install git.mills.io/prologic/msgbus/cmd/msgbus@latest"
exit 1
fi
if ! command -v salty > /dev/null; then
printf "missing salty command. Use: go install go.mills.io/salty/cmd/salty@latest"
exit 1
fi
if ! command -v salty-keygen > /dev/null; then
printf "missing salty-keygen command. Use: go install go.mills.io/salty/cmd/salty-keygen@latest"
exit 1
fi
if [ -z "$SALTY_IDENTITY" ]; then
export SALTY_IDENTITY="$HOME/.config/salty/$USER.key"
fi
get_user () {
user=$(grep user: "$SALTY_IDENTITY" | awk '{print $3}')
if [ -z "$user" ]; then
user="$USER"
fi
echo "$user"
}
stream () {
if [ -z "$SALTY_IDENTITY" ]; then
echo "SALTY_IDENTITY not set"
exit 2
fi
jq -r '.payload' | base64 -d | salty -i "$SALTY_IDENTITY" -d
}
lookup () {
if [ $# -lt 1 ]; then
printf "Usage: %s nick@domain\n" "$(basename "$0")"
exit 1
fi
user="$1"
nick="$(echo "$user" | awk -F@ '{ print $1 }')"
domain="$(echo "$user" | awk -F@ '{ print $2 }')"
curl -qsSL "https://$domain/.well-known/salty/${nick}.json"
}
readmsgs () {
topic="$1"
if [ -z "$topic" ]; then
topic=$(get_user)
fi
export SALTY_IDENTITY="$HOME/.config/salty/$topic.key"
if [ ! -f "$SALTY_IDENTITY" ]; then
echo "identity file missing for user $topic" >&2
exit 1
fi
msgbus sub "$topic" "$0"
}
sendmsg () {
if [ $# -lt 2 ]; then
printf "Usage: %s nick@domain.tld <message>\n" "$(basename "$0")"
exit 0
fi
if [ -z "$SALTY_IDENTITY" ]; then
echo "SALTY_IDENTITY not set"
exit 2
fi
user="$1"
message="$2"
salty_json="$(mktemp /tmp/salty.XXXXXX)"
lookup "$user" > "$salty_json"
endpoint="$(jq -r '.endpoint' < "$salty_json")"
topic="$(jq -r '.topic' < "$salty_json")"
key="$(jq -r '.key' < "$salty_json")"
rm "$salty_json"
message="[$(date +%FT%TZ)] <$(get_user)> $message"
echo "$message" \
| salty -i "$SALTY_IDENTITY" -r "$key" \
| msgbus -u "$endpoint" pub "$topic"
}
make_user () {
mkdir -p "$HOME/.config/salty"
if [ $# -lt 1 ]; then
user=$USER
else
user=$1
fi
identity_file="$HOME/.config/salty/$user.key"
if [ -f "$identity_file" ]; then
printf "user key exists!"
exit 1
fi
# Check for msgbus env.. probably can make it fallback to looking for a config file?
if [ -z "$MSGBUS_URI" ]; then
printf "missing MSGBUS_URI in environment"
exit 1
fi
salty-keygen -o "$identity_file"
echo "# user: $user" >> "$identity_file"
pubkey=$(grep key: "$identity_file" | awk '{print $4}')
cat <<- EOF
Create this file in your webserver well-known folder. https://hostname.tld/.well-known/salty/$user.json
{
"endpoint": "$MSGBUS_URI",
"topic": "$user",
"key": "$pubkey"
}
EOF
}
# check if streaming
if [ ! -t 1 ]; then
stream
exit 0
fi
# Show Help
if [ $# -lt 1 ]; then
printf "Commands: send read lookup"
exit 0
fi
CMD=$1
shift
case $CMD in
send)
sendmsg "$@"
;;
read)
readmsgs "$@"
;;
lookup)
lookup "$@"
;;
make-user)
make_user "$@"
;;
esac
One down! More to go.
BREAKING: Russian billionaire Alisher Usmanovâs super yacht, one of the biggest in the world, seized in Germany - Forbes
Ostorlab is going open-source, releasing our scanning engine, vulnerability detectors, and analyzers https://blog.ostorlab.co/ostorlab-open-source.html
Tractor Beam
â Read more
One year ago to the date I made the lastest update for #phpub2twtxt to github and now 365 days later I have published #pixelblog as its successor - lets see where things are going for trip around the sun
Alien Mission
â Read more
Not sure if Starlink satellites are in orbit around/over Australia yet, but I wouldnât go with that option anyway due to the latency alone.
I believe it is being trialled in some places in Aus already. I will admit, Iâve been signed up for the beta for a while and itâs supposed to be coming to my area sometime in 2022, though that may be delayed due to the chip shortage stuff.
I think the latency is supposed to be 45-60ms on average, which while not as good as fixed line obviously, is leagues better than old fashioned high orbit satellite broadband which is about 600~ms.
@prologic@twtxt.net, who calls me name when I am busy profiting? đ In a less serious noteâbecause nothing is more serious than making profit, of courseâyes, it seems your avatar issue has been fixed. I am kind of sad, I looked forward each day to see which random one was going to show. LOL.
@prologic@twtxt.net let us take the path of less resistance, that is, less effort, for now. I am going to be a great-grandfather before search ever get implemented locally, least one to search on âall podsâ. In other words, let us donât bite more than we can chew. đš Neep-gren!
I just went to type the phrase âI avoid Linux like the plagueâ but then remembered that weâve all learned that most people wonât actually go much out of their way to avoid the plague.
Hey @eldersnake@yarn.andrewjvpowell.com I just came across this cool little project recently. Not written by me sadly đ But seems like it would do the trick nonetheless 𤣠â How are you going with PageKite? Is it still working okay for your Yarn pod powered by the outback of down under? đ LMK if youâd like me to spin this up anad you can be my first tester đ¤
Youâre right @ullarah@txt.quisquiliae.com I just watched Australia Post Outrage: Did She Need To Go? and I do believe Iâll start adding this to my âwatchlistâ â I donât use Youtube specifically (because privacy eroding garbage); but the content this guy produces is awesome! đ
Scotty from marketing really needs to be fired! Can we even fire Prime Ministers besides calling an election? đ¤ The more you dig into our #Australian #Government the more you realize just how fucking corrupt they all are and have been over so many years. How?! đ¤Śâ
@prologic@twtxt.net I think this is awesome. Iâm proud to be part of this.
Annnd⌠I need to learn go. No money here, but at least I would make some cool PRs (or MRs?)
@fastidious@arrakis.netbros.com the things Gemini has going for it are mutual TLS and lack of JavaScript. Which makes for a secure albeit boring experience (much like gopher). The fake markdown is a bit of a drag.
A render mode for Gemini probably wouldnt be too hard. There are markdown to Gemini libs out there.
With Web3 the whole trust a 3rd party browser ext + high fees + env impact for compute and storage are serious no gos for me.. I have heard one too many horror stories about clicking the wrong link and some script draining your metamask wallet.
Notifications
â Read more
@lyse@lyse.isobeef.org more often than not, it is! I mean, I try to go over the changes, but soon find myself in a web (not pun!), all entangled. Then say, âscrew it!â and to the bin it goes. đĽ´
DS9 is best Star Trek. And that last second half of the last season where they go all out. chef kiss
Not sure what is going on with these?
No on gitlab. If its self hosted gitea is best in class.
I can see hosting a mirror on github if only for the redundancy/visibility. Some projects will host but then direct contributions on their self host. Like Go does.
I would suggest using a vanity domain that can redirect tools like go get to hosting of choice. And not require rewriting all the packages any time it gets moved.
JavaScript : web apps
wut?! đł seriously?! đ¤Śââď¸
Python : small tools
Okay đ
Go: micro services
Umm bad generalization 𤣠â Example yarnd
that powers most of Yarn.social đ
Java: enterprise software
Yes! Oh gawd yes! 𤣠And Java⢠needs to die a swift death!
C: crimes
Hmmm? đ¤ I feel this one is going to have some backslash and/or go the way of âHackerâ being misconstrued to mean entirely different/incorrect things as is whatâs happening in the media (for various definitions of âmediaâ).
Yep! https://git.mills.io/yarnsocial/yarn/src/branch/master/internal/webmention/webmention.go#L150-L156
New theme for yarn is up now at: https://git.mills.io/sorenpeter/darchTheme
Still needs some work, but please have a go with it and hack away
Wirecutter
â Read more
Now, onto the real question: what to eat? Partner isnât home, so zero nutritional supplements have been consumed, and I have been lazy enough not to go out to fetch me something. So⌠hmm, yeah. Going to an eight years old niece birthday âroller scattingâ party in an hour, maybe I get lucky with a slice of pizza, or two. đ¤Ł
@movq@www.uninformativ.de
Aha! Cool! Not just deleting, but proceeding as if the twt is going to be send. If I :q!
on vi it will add an empty line. If, instead, I go :x
like I normally do, it works as you saidâand as I wanted it. Thanks!
Is it me, or Gmailâs web interface is going down the drain? Using Safariâmy default browserâoften takes two, or three clicks to open an email. If it werenât because its search is amazing, I would never visit its web interface.
@eldersnake@yarn.andrewjvpowell.com
Seems like you need to make your parser smarter. Go tinker! đ
Now, if there is going to be some sort of price, which for me equals to profit, then I will twt non-stop until I hit it! đ¤Ł
Having usedâand still usingâ1Password (a password manager) for many years, I have gone through a few stages of disliking/frustration with it. The first was when subscriptions were set in place, the second is now, with their approach for auto-filling under iOS. It is, more often than I would like to, telling me to configure it when I did so from day one. My open support ticket isnât going too far either.
I wish iCloud KeyChain would mimic some of its features, so I can just dump it. KeyChain has improved a lot, now allowing OTP to be saved with a credential, but it is still not quite there yet.
Appleâs event on Monday is bringing, as always, speculation to the table. One thing most outlets seem to agree is the introduction of an âM1Xâ chip, thought Apple might call it differently. M1X might also mean, M1(we donât know what comes after, or next generation). Either way, I would really like to see the return of the 27â iMac, but I will not hold my breath. Nevertheless, Monday is going to be an exciting day for many, including me! đ
@adi@f.adi.onl Oh boy⌠we donât want to go down that route. There is plenty to know about the Taliban, not just from the news but from people who livedâand still livesâunder their âgovernanceâ; all of which is, I am afraid, much more accurate than your highschool girlfriend story telling.
@prologic@twtxt.net Hopefully this URL change fixes things. Otherwise I am lost; donât know whatâs going on. đŠ
the focus on music thing is going poorly, but i think i have a plan or two what has come together in the last bit gemini://sunshinegardens.org/~xj9/posts/2021-09-06-rlog-v/