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

Another, less serious issue in the memoization example for JS:

  (cache[key] = cache[key] || fn(...args));
Will not memoize results that equal 0 or an empty string.

I guess it goes to show that copying answers from stack overflow might not be the best idea, whether it's done manually or using ML.


To be fair, they did market it as paired programming with an AI. When pairing, your partner can make mistakes like this as well.


The entire selling point of pair programming is that your copilot would point out errors like this, not introduce them.

Pairing works when you either pair two strong programmers or pair a strong programmer with a weak one. In the latter case, the main advantage is that it's also a mentoring opportunity.

Copilot has invented a pair programming situation in which your partner constantly introduces dubious code you must painstakingly verify, but is itself incapable of being mentored.


Of course it can be “mentored”, it’s machine learning… I expect this will eventually learn from its users.


Haha, I have to remind myself constantly of the now existing ?? operator.


I think really you'd want to use `key in cache`, because ?? wouldn't let you memoize null or undefined.

Although `in` possibly opens you up to prototype issues. JavaScript is a bundle of fun.


Yeah, Map (or WeakMap if keys are objects and you don't need iteration) is much better at this kind of thing.


Good point.

Collection types are prevalent in languages like Java, but JS devs had to use plain objects for years.


Which is why you needed to build an actual data structure to do this kind of work based off checking for against the prototype chain instead of assuming you can use tiny bits of direct JavaScript operators.


There's much more silver owned by investors than there is physical silver in the world.

It's the same idea: you have a synthetic version of an asset trading for the same price of the real asset. If people start demanding the real asset, there isn't enough of it to go around and prices start to rise.

Not saying that's what's going to happen, but it's not absurd.


Typically there's a clause where the investor can be paid the cash equivalent instead of actually providing the physical metal.


You realize this doesn't actually work, right?

If it did, mining companies would be out of business almost instantly - their product being only useful in the market when it's worthless.

Futures contracts involve actual carrying costs - storage, transporation, delivery - with real physical goods; even if you personally aren't involved in the physical aspect (by trading derivatives or the like) someone else (e.g. the people with actual silver demand for their companies) is, and they'll make sure you can't just drive the price of silver up higher by cornering the physical market.


Futures have to be settled physically, if carried to expiration, as far as I know



Retail brokers do not allow the position to be carried all the way to the first delivery date.

For example : https://ibkr.info/node/992


Right ... so if you can't undertake delivery, they sell it out on the spot market.

If everyone in the market can't undertake delivery, the buyers on the other side who can will have their pick of orders, and prices will plummet.

You'll be selling heaters in Hell.


When Russia did it it was reported as "Move Seen as Part of Drive to Curtail Freedom of Information"

https://www.wsj.com/articles/russia-steps-up-new-law-to-cont...


Russia is a dictatorship, the EU isn't. Two can do the same thing for different reasons.


British Columbia also has a similar law which has been reasonably well received.


If I make a Google Doc from British Columbia, it is transferred to and stored on 15 servers in 5 datacenters, all outside British Columbia.

An image in the same document ends up in (kinda, depends how you measure) 4 servers in 3 locations - also none of them in BC.

Is Google breaking the law here, or is there some exception?


It goes both ways. The police unions should be outlawed, and police members should use democracy like everyone else.

If they don't like something about the job conditions, they can vote democratically to change it.

I can't form a tax union and negotiate with the government, why should they be able to?


You can form one. Generically, it's called a political party, but there are special-interest groups like the NRA representing gun-owners, or the PTA, which represents families.

I don't think anyone is arguing there shouldn't be police unions. However, those should be reformed as open and transparent organizations which support for law-and-order, good working conditions for police officers, and similar.

Those should not be secretive organizations which support police violence, racism, protect bad cops, and sometimes engage in organized crime.


Didn't the NFL had an issue with kneeling a while ago? Did they fire the players?


Keep in mind that Stallman maintained that Bushnell stopped answering emails for two years, and that was the reason for firing him.

Seems like he still holds a grudge.


Interesting. Not to entirely doubt what you're saying, but the source for that statement on Wikipedia doesn't have a primary source. Do you happen to have more reading? I would love to have the complete story between them.

(Aside: Now that I look into it, Mr. Bushnell's Wikipedia page has basically been rewritten on September 22nd [1] after his article) [1] https://en.wikipedia.org/w/index.php?title=Thomas_Bushnell&a...


Cryptocurrencies are not a scam. Doubly double End. This is very simple.

But seriously, sure some people just push blockchain stuff to get money from investors. But I can buy drugs using Bitcoin. I can't buy drugs using git. So there's probably a difference between them.


What happens in that scenario when it's just two people living in the same building? Why are colleges different?


I always think of the story on HN about the guy who bought back his startup from the VCs for $1 after it "failed" and he went and ran it without the same expectations, and it is doing just fine.

Agree with the general point, but the guy burned 8 million dollars in investor money to get to the point where the business is "just fine". It's not really a good example IMO.


He bought a falling company from himself and his cousins for almost 3 billion, plus the company had 3 billion in debt. The deal resulted in him getting half a billion more in tsla stock.

Tesla's market cap in June 2016 was 35 billion. It's 43 billion now. That's not that much value created. The S&P went up almost 50 percent in that time.

It's all besides the point anyway, since many shareholders sold their shares because of this fraud. They don't care what he's doing now, they just want their money back.

It's in everyone's best interest to have checks on self dealing CEOs. If people can't trust public companies to behave, the whole system breaks down.


Isn’t that what the board is for?


The Tesla Directors are paid many multiples of the average at other comparable companies so that they will not question or push back against Elon Musk, and they include many personal friends and even his brother, who has no qualifications whatsoever to sit on the Board of a major automaker.


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

Search: