Hacker Newsnew | past | comments | ask | show | jobs | submit | ecedeno's commentslogin

Your example produces very distinguishable results. e.g. if Array.first finds a nil value it returns Optional<Type?>.some(.none), and if it doesn't find any value it returns Optional<Type?>.none

The two are not equal, and only the second one evaluates to true when compared to a naked nil.


What language is this? I'd expect a language with a ? -type would not use an Optional type at all.

In languages such as OCaml, Haskell and Rust this of course works as you say.


This is Swift, where Type? is syntax sugar for Optional<Type>. Swift's Optional is a standard sum type, with a lot of syntax sugar and compiler niceties to make common cases easier and nicer to work with.


Right, so it's not like a union type Type | Null. Then naturally it works the same way as in the languages I listed.


Isn't Google Cloud Run a PAAS?


Sorry, I meant things like Render and PythonAnywhere


If this is a concern, you could use a VM without network access to make the backup


I assume they mean the profits in the past couple years are dwarfed by the losses that came before. Looking at the company's entire history, instead of a single FY.


Maybe? But that's not what anyone means when they describe a company as profitable or not.

I was guessing they meant something like the net profit only came from a weird tax thing or something.


Seems like the difference between a profitable investment and a profitable company.

They invested tens of billions of dollars in destroying the competition to be able to recently gain a return on that investment. One could either write off that previous spending or calculate it into the totality of "Uber". I don't know how Silicon Valley economics works but, presumably, a lot of that previous spending is now in the form of debt which must be serviced out of the current profits. Not that I'm stating that taking on debt is wrong or anything.


To the extent that their past spending was debt, interest on that debt that should already be accounted for in calculating their net income.

But the way it usually works for Silicon Valley companies and other startups is that instead of taking on debt they raise money through selling equity. This is money that doesn't have to be paid back, but it means investors own a large portion of this now-profitable company.



Yikes :-(


> They expire in 24 hours

8 hours of work, 8 hours of sleep and 2 hours of regular daily tasks. That leaves 6 usable hours.

> What would you use them for?

Nothing, probably let them expire.

> How would you maximize the return from the AI credits?

Given the time constraints, the expected result is nil with some stress as a bonus. By doing nothing, I achieve a local maximum of nil with no stress.

> Would you use them for charitable uses?

This sounds interesting. Is there any charitable organization that could benefit from receiving some credits that need to be used ASAP?


> node -e "process.stdout.write('@'.repeat(128 * 1024)); process.stdout.write(''); process.exit(0);" | wc -c

That's missing the part where it waits for the last write to flush before exiting.


You might think that would be it?

    $ node -e "process.stdout.write('@'.repeat(128 * 1024)); process.stdout.write(''); setTimeout(()=>{ process.exit(0); }, 0);" | wc -c
    131072
Sure. But not so fast! You're still just racing and have no guarantees. Increase the pressure and it snaps back:

    $ node -e "process.stdout.write('@'.repeat(1280 * 1024)); process.stdout.write(''); setTimeout(()=>{ process.exit(0); }, 0);" | wc -c
    65536
Meanwhile:

    $ node -e "const { Stream } = require('stream'); s = process.stdout; s.write('@'.repeat(1280 * 1024)); Stream.finished(s, () => { process.exit(0); })" | wc -c
    1310720


You're not passing anything into the 2nd parameter of stdout.write()


What would be the usecase for publishing events in a social media protocol (i.e. ActivityPub) with no information?


Only ppl who you allow to follow you gets to access the unencrypted data.


Then you would need to encrypt the data to many public keys, could be difficult but possible.

Also means adding a new follower requires you to rewrite old posts, right?


Yes, these solutions are possible. Or maybe manage followers through an ACL controlled by a smart contract or something similar. That’s why I am asking really, to see if there are easier ways. It feels like this should be a common problem, but we probably got used to everything being public by default.


"Google made me ruin a perfectly good website (2023)"

https://news.ycombinator.com/item?id=40184673


> Walking

This is why


Yes. In America the children are transported in motorized divisions.

The US is a little over double Japan’s population and has 4x the number of 18 year olds.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: