Testing posting for my new http://darch.dk/timeline/
Messed up the configuration of the nut UPS monitor so bad it actually initialised an UPS test where the device switched itself off on the reboot of the PC. No idea how that happened. So uninstalled it again.
@prologic@twtxt.net nice. i can see this being used for testing scenarios as well at work.
GPT-4 wins chatbot lawyer contest – but is still not as good as humans
Several AI chatbots were tested to see how well they could perform legal reasoning and tasks used by human lawyers in everyday practice – GPT-4 performed the best, but still wasn’t great ⌘ Read more
I’m playing around with snac2
, which I think @stigatle@yarn.stigatle.no mentioned on here, and I have to say it’s extremely easy to set up and it’s been pretty straightforward so far. I wanted to experiment with having a presence on the Fediverse without going through the process of picking Mastodon vs. Gnu Social vs. Friendica vs. …, and I wanted to self-host instead of picking an instance of one of those. For now I’m abucci@buc.ci, but no guarantees that will remain stable; I’m just testing for the time being.
Question to all you Gophers out there: How do you deal with custom errors that include more information and different kinds of matching them?
I started with a simple var ErrPermissionNotAllowed = errors.New("permission not allowed")
. In my function I then wrap that using fmt.Errorf("%w: %v", ErrPermissionNotAllowed, failedPermissions)
. I can match this error using errors.Is(err, ErrPermissionNotAllowed)
. So far so good.
Now for display purposes I’d also like to access the individual permissions that could not be assigned. Parsing the error message is obviously not an option. So I thought, I create a custom error type, e.g. type PermissionNotAllowedError []Permission
and give it some func (e PermissionNotAllowedError) Error() string { return fmt.Sprintf("permission not allowed: %v", e) }
. My function would then return this error instead: PermissionNotAllowedError{failedPermissions}
At some layers I don’t care about the exact permissions that failed, but at others I do, at least when accessing them. A custom func (e PermissionNotAllowedError) Is(target err) bool
could match both the general ErrPermissionNotAllowed
as well as the PermissionNotAllowedError
. Same with As(…)
. For testing purposes the PermissionNotAllowedError
would then also try to match the included permissions, so assertions in tests would work nicely. But having two different errors for different matching seems not very elegant at all.
Did you ever encounter this scenario before? How did you address this? Is my thinking flawed?
With Youtube testing a “three strikes and you’re out” policy against people who use ad blockers, I’m also wondering whether Web 2.0 is effectively walled off and I should just give up on it entirely and look elsewhere for information and entertainment.
Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions
40% of code produced by GitHub Copilot has at least one well-known security vulnerability, in the test reported in this paper.
@prologic@twtxt.net I know very little about it, but speaking secondhand, it looks like there’s a single centralized server now and they’re still building the ability to federate? Like, the current alpha they’re running is not field testing federation, which makes me think that’s not a top priority for them.
test post to self
@prologic@twtxt.net @movq@www.uninformativ.de this is the default behavior of pass
on my machine:
I add a new password entry named example
and then type pass example
. The password I chose, “test”, is displayed in cleartext. This is very bad default behavior. I don’t know about the other clis you both mentioned but I’ll check them out.
The browser plugin browserpass
does the same kind of thing, though I have already removed it and I’m not going to reinstall it to make a movie. Next to each credential there’s an icon to copy the username to the clipboard, an icon to copy the password to the clipboard, and then an icon to view details, which shows you everything, including the password, in cleartext. The screencap in the Chrome store is out of date; it doesn’t show the offending link to show all details, which I know is there because I literally installed it today and played with it.
@prologic@twtxt.net test
An interesting read about testing code using nullable states instead of mocks.
https://www.jamesshore.com/v2/projects/testing-without-mocks/testing-without-mocks
$name$
and then dispatch the hashing or checking to its specific format.
Hold up now, that example hash doesn’t have a
$
prefix!
Well for this there is the option for a hash type to set itself as a fall through if a matching hash doesn’t exist. This is good for legacy password types that don’t follow the convention.
func (p *plainPasswd) ApplyPasswd(passwd *passwd.Passwd) {
passwd.Register("plain", p)
passwd.SetFallthrough(p)
}
https://github.com/sour-is/go-passwd/blob/main/passwd_test.go#L28-L31
$name$
and then dispatch the hashing or checking to its specific format.
Here is an example of usage:
func Example() {
pass := "my_pass"
hash := "my_pass"
pwd := passwd.New(
&unix.MD5{}, // first is preferred type.
&plainPasswd{},
)
_, err := pwd.Passwd(pass, hash)
if err != nil {
fmt.Println("fail: ", err)
}
// Check if we want to update.
if !pwd.IsPreferred(hash) {
newHash, err := pwd.Passwd(pass, "")
if err != nil {
fmt.Println("fail: ", err)
}
fmt.Println("new hash:", newHash)
}
// Output:
// new hash: $1$81ed91e1131a3a5a50d8a68e8ef85fa0
}
This shows how one would set a preferred hashing type and if the current version of ones password is not the preferred type updates it to enhance the security of the hashed password when someone logs in.
https://github.com/sour-is/go-passwd/blob/main/passwd_test.go#L33-L59
And that I can silence it without having or go through the full test announcing fire and carbon monox throughout the house.
#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-Id
s 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)