HackerTrans
TopNewTrendsCommentsPastAskShowJobs

fishywang

no profile record

comments

fishywang
·2 месяца назад·discuss
A lot of years ago, while living in Beijing, I once bought ticket to a morning (9:30 or so) show in a theatre. Then came that day, it rained unexpectedly, so I ended up getting there 10min late. When I get into the theatre, I found out that it's completely dark. I asked a staff, they told me that they only sold that one ticket and since I didn't show up within 5min, they cancelled the show and returned the film. They refunded me in the end.
fishywang
·6 месяцев назад·discuss
I was flying out of LHR yesterday (Monday). I read the news before so asked the agent at security check "I don't need to empty my water bottle now right?" and she was like "nah that's only for up to 2 litres in a clear/plastic bottle, not a metal flask bottle" or something along those lines. I was using a Stanley metal water bottle. So I still had to empty my bottle.
fishywang
·7 месяцев назад·discuss
lol I have another story regarding Apple gift cards.

Many years ago we had an iMac at the house as the shared desktop computer. After a few years, it started to have the signs that the harddisk is going to fail, and also we were mostly moved away from Apple's ecosystem, so we decided to trade it in and replace it with something else that's not from Apple.

Since we don't have anything immediate to buy from Apple, we traded it in with Apple gift cards.

Later, my partner needed to trade in an old iPad for a new one, so we used that gift card with credit card for the trade in. For that trade in, you first pay the full price with gift card+credit card, then they refund you the trade-in value after the trade-in is finalized.

The trade-in value of the old iPad is less than the value we paid via credit card, so we would reasonably assume that they would refund the total trade-in value to our credit card. But nope. They actually calculated the original gift card vs. credit card split ratio, and refunded according to that ratio.

A simplified example is say we paid $200 via gift card plus $300 via credit card for an $500 iPad, with trade-in value of $200 for the old iPad. Instead of refunding $200 to our credit card (so it's eventually $200 via gift card and $100 via credit card), they refunded us $120 to credit card and gave us another $80 gift card. So we have to find ways to spend that gift card again, and it cannot involve any trade-in (otherwise we're not going to be able to use it fully).
fishywang
·9 месяцев назад·discuss
I'm not sure it works that way. _In general_ before the recent announcement you are supposed to sign the debug build (what you feed into adb to install) with your debug key that's different from the release nor upload key, and the debug key is never submitted to google.

Of course _maybe_ at some point google will also force you to submit your debug key to them. But I don't believe that's the case now.
fishywang
·9 месяцев назад·discuss
I have a magnet that's a mosquito with text "Alaska state bird".
fishywang
·10 месяцев назад·discuss
I don't understand how this got so many upvotes. Embedded struct fields are never "promoted", you always need to access them via the embedded type's name, so there's nothing to conflict.

The only thing "promoted" are the functions associated with the embedded types, and when those actually conflicts, the compiler will tell you, as expected.
fishywang
·3 года назад·discuss
>its creators explicitly said their goal was to replace C++

so nowadays when we say "c++" we mostly mean the works should be replaced by rust, but back then, it's not like that.

I would argue that go successfully replaced c++ in specific domains (network, etc.), and changed your perspective on what "c++" means.
fishywang
·5 лет назад·discuss
This blog is quite all over the place.

>Here we start to see some sources of real bugs. Writing to and reading from a nil channel blocks forever.

Of course they block forever. If you read from a channel that nothing is writing to it, you block forever. If you write to a channel that nothing reads from it, you block forever. There's nothing special related to the channel being nil.

Trying to assigning to a nil map is also perfectly understandable: a nil map is read only. This is the same as nil slices. "But `a = append(a, 1)` works when a is nil", you might be asking. Yes. That's because `append(a, 1)` is not (always) writing to a.

Then it talks about typed nils. Yes typed nils can be a footgun, but I've been writing go code professionally for almost 5 years now and I've been bitten by that exactly once (I've written about it here: https://wang.yuxuan.org/blog/item/2020/09/typed-nil-in-go). In most cases, typed nils are more useful than being a footgun. See https://pkg.go.dev/github.com/reddit/baseplate.go/log#Wrappe... and https://pkg.go.dev/github.com/apache/thrift/lib/go/thrift#TC... for a few examples of typed nils are being useful and providing useful zero values.
fishywang
·5 лет назад·discuss
Doesn't the word "mouse" include trackpads in most context?
fishywang
·5 лет назад·discuss
And then deal with all the Mac nonsense? No thanks.
fishywang
·5 лет назад·discuss
>One specific keyboard shortcut has a mouse-based workaround

Except for that particular action (select some text on terminal then copy) you have to use mouse to do the "select" part anyways.
fishywang
·5 лет назад·discuss
>than getting every single person and company to adjust its schedule

but by using DST we are just pretending that we didn't ask people/companies to adjust their schedules. in reality they did, just the "clock" stayed the same.
fishywang
·6 лет назад·discuss
If you are talking about apps, recent versions of Android and iOS both deny apps to use unencrypted connections, with only a few exceptions (like browsers)
fishywang
·6 лет назад·discuss
it's 2020. if you're still relying on vpn connection to provide encryption, you are doing it wrong. (I understand there are certain cases you have to deal with unencrypted traffic, but those should be really rare now).