/explore

Click through on any links that interest you or select the planets on the right to continue exploring the Outer Web.
You are here

blog.nuculabs.de
| | livesys.se
3.6 parsecs away

Travel
| |
| | hjr265.me
2.4 parsecs away

Travel
| | I have been meaning to do a few short-form blog posts lately. This blog post is going to be one of them. In Go, on Linux, if you want to know when the terminal window is resized, you can listen for the SIGWINCH signal using the signal.Notify (or the signal.NotifyContext) function. The code will look something like this: 1 2 3 4 5 ch := make(chan os.Signal) signal.Notify(ch, syscall.SIGWINCH) for range ch { // The terminal has been resized.
| | www.integralist.co.uk
3.2 parsecs away

Travel
| | The following code doesn't do what you might expect: package main import "fmt" func main() { var i *impl fmt.Println("i == nil:", i == nil) what(i) } type impl struct{} func (i *impl) do() {} func what(i interface{ do() }) { fmt.Println("i == nil:", i == nil) } If you expected the what function to print i == nil: true, then keep reading... Typed Nils The behavior observed is due to the way interfaces and nil values interact in Go.
| | blog.carlana.net
29.3 parsecs away

Travel
| The other day, I was reading a website about some historical documents, when I saw that it had an error message on top: Screenshot from the site Some quick searching online for the error message revealed that it was caused by a mismatch between the site's versions of PHP and WordPress. Older versions of WordPress had a bug in the switch statement of a certain localization component, and later versions of PHP dump a warning about this bug out to the end user HTML. When I came back to the site a few days later, it had been fixed. The ultimate reason for my seeing for the error message as a random reader is that PHP has too many ways to deal with errors: Builtin PHP functions, and therefore any PHP project, have a whole range of error handling mechanisms - erro...