Favorite function you've written?
What's a function you've written that you're particularly proud of? Maybe it saved a business, or maybe you just think it's neat.
What's a function you've written that you're particularly proud of? Maybe it saved a business, or maybe you just think it's neat.
Please post your solutions in your own top-level comment. Here's a template you can copy-paste into your comment to format it nicely, with the code collapsed by default inside an expandable section with syntax highlighting (you can replace python
with any of the "short names" listed in this page of supported languages):
<details>
<summary>Part 1</summary>
```python
Your code here.
```
</details>
What food and drinks have you been enjoying (or not enjoying) recently? Have you cooked or created anything interesting? Tell us about it!
As part of a weekly series, these topics are a place for users to casually discuss the things they did — or didn't do — during their weekend. Did you make any plans? Take a trip? Do nothing at all? Tell us about it!
This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?
As part of a weekly series, these topics are a place for users to casually discuss the things they did — or didn't do — during their week. Did you accomplish any goals? Suffer a failure? Do nothing at all? Tell us about it!
This thread is posted weekly, and is intended as a place for more-casual discussion of the coronavirus and questions/updates that may not warrant their own dedicated topics. Tell us about what the situation is like where you live!
Please post your solutions in your own top-level comment. Here's a template you can copy-paste into your comment to format it nicely, with the code collapsed by default inside an expandable section with syntax highlighting (you can replace python
with any of the "short names" listed in this page of supported languages):
<details>
<summary>Part 1</summary>
```python
Your code here.
```
</details>
When I last wrote about money, some people liked it but u/MimicSquad had issues with my simplified explanation. After thinking about it, I'm going to try again. I don't want to make my "casino world" analogy too complicated, but I will make some changes so that we can talk about payments. (Caveat: I'm not a financial expert, but this is how I think it works.)
So let's say there is a town with two casinos. In the Yellow Casino, gamblers use yellow plastic chips, and in the Purple Casino, they use purple plastic chips. Otherwise, they are much alike. Each casino has a teller window where gamblers exchange the national currency (which we might call green money) for its own chips.
So there are three currencies (yellow, purple, and green) and two exchanges (the teller windows). The casinos want their chips to be worth the same amount as green money, so their teller windows always trade them at par. (This makes yellow and purple chips worth the same amount too, even though nobody trades them directly yet.)
Suppose that a gambler who has yellow chips walks into the Purple Casino. "You can't use those chips here," they say, "but for your convenience, we will trade you a purple chip for each of your yellow chips." Which they do. Then they send an employee to the Yellow Casino and trade the yellow chips for green money.
This is a basic payment system. It's implemented as two trades, one visible and one hidden. The Purple Casino's teller visibly trades yellow chips for purple, and behind the scenes there is a settlement process, implemented using a trusted employee who carries chips and money to do another trade. The gambler doesn't need to know about trades between casinos, but they're essential for providing this service.
Notice that, although the gambler carried yellow chips from Yellow Casino to Purple Casino, the second trade (a withdrawal) causes the Yellow Casino to have less money. The money followed the chips and the chips came back home.
It doesn't need to happen quite that way, though. If Yellow and Purple agree, the Yellow casino could trade anything that's worth the same amount in return for getting its chips back. So, more abstractly, some financial asset must follow the chips from Yellow to Purple.
Furthermore, if the casinos trust each other, they can delay settling up. Perhaps at the end of the day, the Purple Casino will have some yellow chips and the Yellow Casino has some purple chips, so they can exchange yellow for purple and they can use green money (or any financial asset) to make up the difference.
Why settle at all? Partly because of risk. The casinos don't want to trust each other too much. If the Yellow Casino gets into financial trouble, the Purple Casino doesn't want to end up holding worthless yellow chips instead of the green money that they have more confidence in. (Also, they probably find green money more useful than yellow chips.)
These casinos are are my thinly-disguised model for banks. To make things a bit less abstract, I'll talk about the US. There around 4,000 banks (and 5,000 credit unions) in the US. Each bank has its own computers that implement money as bank deposits. They have payment systems that tie them all together and hundreds of thousands of ATM's that trade electronic currency for cash.
We could think of US banks as having 4,000 different currencies that all trade at par. While we normally think of the US dollar as a single currency, it could also be thought of as a federated system of many currencies, all tied together with payment systems that do lots of trades. (Nothing really changes; this is just a different way of thinking about it.) There are some currencies with special status, like paper money and coins and federal reserve accounts, but these are in addition to all the others. (You could even think of each kind of coin as its own currency, and making change as a form of currency trade.)
There is a historical basis in early US history for treating each bank as having its own currency. US banks back then issued their own paper money, and although they tried to make them trade at par, these banks sometimes failed and were sometimes frauds, and their paper money often traded at much less than par. These days banks are much better regulated and we normally don't have to worry about such things, but much as a multicellular organism has cell walls as a sort of remnant of earlier times when cells were more independent, the boundaries between banks still matter, despite all the regulated mechanisms that make their currencies practically the same to us.
Since each bank manages its own computer systems, there is a sense in which electronic money never actually moves outside its own bank. When we "move money" electronically, it's done by trading, and there has to be a payment system to bridge the gap. The timing of the trades varies, depending on the details of the settlement process.
What about creating money? In casino world, the Yellow Casino makes yellow chips and the Purple Casino makes purple chips, but they can only make their own chips. Similar, a bank could make money in its own computer system, but they are limited in what they can do in anyone else's computers. They influence other bank's computers via trades.
If a bad bank created a lot of their own money and then spent it (perhaps disguised as making a loan), they would still be on the hook during the settlement process, which essentially requires them to take their money back in return for a financial asset worth the same amount that wasn't created by them, such as money in their central bank account. Payments can be very complicated and there is often short-term debt involved in the settlement process, but ultimately a legitimate bank needs to honor its debts.
It's similar to how anyone with a checkbook could write bad checks, but this will catch up with you during settlement. The physical ability to write large numbers on checks isn't a superpower that lets you buy anything. What a criminal could do with it is somewhat limited and short-term.
Every bank has accounts with the central bank and one thing they are used for is implementing settlement. Having "reserves" with the central bank, even there isn't a legally required balance, is something every other bank needs to handle some kinds of payments. Just as you need money in your bank account to write a check and have it not bounce, banks need a high enough balance with the central bank to handle the payments their customers make. (Though I don't know the details of what sort of overdraft protections there are.)
The only bank that can buy anything it likes without consequences to itself is the central bank, which doesn't participate in settlement like everyone else. The central bank's power to create its own money might look superficially similar to other banks, but it's special because payment is complete after the first trade; there is no further settlement after receiving central bank money. (Though a bank could trade reserves for cash if it needs it for its ATM's.)
The end, for now. Sometimes I've been writing in a definitive way here, but keep in mind that I'm still not a financial expert and I welcome corrections from people who know better.
Please post your solutions in your own top-level comment. Here's a template you can copy-paste into your comment to format it nicely, with the code collapsed by default inside an expandable section with syntax highlighting (you can replace python
with any of the "short names" listed in this page of supported languages):
<details>
<summary>Part 1</summary>
```python
Your code here.
```
</details>
This thread is posted weekly - please try to post all relevant US political content in here, such as news, updates, opinion articles, etc. Extremely significant events may warrant a separate topic, but almost all should be posted in here.
This is an inherently political thread; please try to avoid antagonistic arguments and bickering matches. Comment threads that devolve into unproductive arguments may be removed so that the overall topic is able to continue.
Please post your solutions in your own top-level comment. Here's a template you can copy-paste into your comment to format it nicely, with the code collapsed by default inside an expandable section with syntax highlighting (you can replace python
with any of the "short names" listed in this page of supported languages):
<details>
<summary>Part 1</summary>
```python
Your code here.
```
</details>
What are some VR games where the person in the headset can cast to a TV and the people watching can still participate/have fun?
For example, at a get-together over the summer, my friends and I played a hot seat version of I Expect You to Die 2. The person in the headset played the single-player game themselves, but everyone in the audience was able to watch the cast on the TV and help that person by giving them recommendations to try different things and help them solve the puzzles (or just recommend ridiculous stuff to see if the game will allow it). Even though the game is single-player, it worked really well as a communal experience and was a ton of fun for the whole room.
Any other recommendations for games like this we can try?
Note: we've already played Keep Talking and Nobody Explodes
Target Hardware: Oculus Quest 1