#test from p2 phone ૮ ˶ᵔ ᵕ ᵔ˶ ა
@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.
I did a take home software engineering test for a company recently, unfortunately I was really sick (have finally recovered) at the time 😢 I was also at the same time interviewing for an SRE position (as well as Software Engineering).
Got the results of my take-home today and whilst there was some good feedback, man the criticisms of my work were harsh. I’m strictly not allowed to share the work I did for this take-home test, and I really can only agree with the “no unit tests” piece of the feedback, I could have done better there, but I was time pressured, sick and ran out of steam. I was using a lot of libraires to do the work so in the end found it difficult to actually think about a proper set of “Unit Tests”. I did write one (in shell) but I guess it wasn’t seen?
The other points were on my report and future work. Not detailed enough I guess? Hmmm 🤔
Am I really this bad? Does my code suck? 🤔 Have I completely lost touch with software engineering? 🤦♂️
Thursday morning, test to see if my twtxt works
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.
Spent the last few days debugging network issues at work.
Exhausting. You never get a full picture. You poke a little here, poke a little there, … Form a hypothesis and test it. Eventually, maybe, you can narrow it down a bit to some segment or even some component.
A very time consuming process. Even more so if you try not to cause downtimes for your users.
I want a magical device that allows me to look inside a cable/fibre.
But hey, at least we got rid of a bunch of Cisco switches in the process. So there’s that.
lolol actually, I’m now building a quick’n’dirty repl in C to test some mechanics, ended up implementing a small VM, adding sound asap, let’s see where that leads me #crow #raven #lang #coding #sound #livecoding #nyx
Wow. I’m paying about 100 USD for my cable internet. Hard to estimate since its part of a tvd bundle. But it is 1.2Gbit down and 40Mbit up. And speed tests at that on the regular. The new house will have FTTH gigabit for 80ish.
Do they have Starlink beta down there yet?
testing public path copy/pasted from code: 
ftp://test.com
Rapid Test Results
⌘ Read more
I made a gpio button on my raspberry pi which opens a new window running ed. I screwed up while testing it and launched maaaaany ed windows.
@prologic@twtxt.net lol. just testing some Unicode.
@lyse@lyse.isobeef.org awesome! i love failing test cases. Do you have them pushed up on a branch to check out?
Slope Hypothesis Testing
⌘ Read more
Testing one, two, three.
@quark@ferengi.one How about code? (this is mostly to configure mutt?)
Testing this here now
Testing, will delete.
Test
Testing… breaking things?
- One - Two - Three
Test to generate more logging.
So, first multi-line test, because I coudn’t wait. 😄
- One line - Two lines - Three lines
And:
- One line 2. Two lines 3. Three lines
@prologic@twtxt.net, please reply to this, to test something.
@movq@www.uninformativ.de @movq@www.uninformativ.de, if you want/can I can send you a Zoom link to test it interactively!
@movq@www.uninformativ.de I will re-enable the cron job, test again, and provide the information. The twts that were showing duplicated are those I have sent. When it occurred, I noticed the Message-Ids were different.
Another small test.
This is a test from jenny.
You need better pen test scripts. :-) Seriously, the protocol is absurdly simple. Turn it on! Don’t trust any of the implementations? Write your own!
Whole lot of false statements here. The vaccines are well-tested & well-studied, and are safe and effective. Breakthrough cases exist with every vaccine. If you are able and the vaccine is approved for you, choosing not to get it puts everyone around you at risk, including risk of additional variants developing.
And yes, I was able to reproduce the “test” input. It wasn’t a complicated test, she just beat me to it.
TEST hello twtxt xxx
Entirely sensible, & no reason for file storage to match the wire format. I’m just really curious what’s going on on macOS! I can test on hfs+ later.
macOS doesn’t care, at least on apfs; just tested. How are you hitting this?
@prologic@twtxt.net test. Running new parser on txt.sour.is. :D
@prologic@twtxt.net sounds about right. I tend to try to build my own before pulling in libs. learn more that way. I was looking at using it as a way to build my twt mirroring idea. and testing the lex parser with a wide ranging corpus to find edge cases. (the pgp signed feeds for one)
I just built a poc search engine / crawler for Twtxt. I managed to crawl this pod (twtxt.net) and a couple of others (sorry @etux@twt.u53.us and @xuu@txt.sour.is I used your pods in the tests too!). So far so good. I might keep going with this and see what happens 😀
@prologic@twtxt.net as promised! https://github.com/JonLundy/twtxt/blob/xuu/integrate-lextwt/types/lextwt/lextwt_test.go#
the lexer is nearing completion.. the tough part left is rooting out all the formatting code.
@prologic@twtxt.netdd ooh I am adding that to my test suite
@xuu@txt.sour.is @adi@twtxt.net Private Messaging is finally done in the messages_poc_2 branch. If you have time to have a look and play with it locally and test it out that would be great. The plan is to release this as the first version which only supports “on-pod messaging” right now (cross-pod to come later).
@prologic@twtxt.net 😁 that is me testing locally. does it notify you somehow when I follow?
New Blog Post Test Blog by @xuu@txt.sour.is 📝
Did some work on WKD handling. Can update keys with HKP posts :) Ugh need to work on docs and unit tests. Boooorrring.
txtnish test !
Testing pre-tweet and post-tweet hooks - crosses fingers
A peek into something I spend way too much time and money on: http://www.tested.com/tech/606152-everything-you-need-know-about-custom-mechanical-keyboards/
testing my post-tweet hook
test!