Don't use floats if you're trying to represent an exact value, i.e. someones bank account. But in financial modelling you're generally dealing in probabilistic "expected values", it's common and fine to use floats.
Having said that, half the world seems to run on Excel spreadsheets, which are full of money values, and Excel is basically all floats (with some funky precision logic to make it deterministic - would be curious to know more).
If given a question about reversing a string, it lets you ask the interviewer questions like:
* Do you want to do it in-place or as a copy?
* Is it an ASCII or Unicode string? If using Unicode, I assume you want to reverse on grapheme cluster boundaries?
Asking these questions let you as a candidate demonstrate your knowledge.
If the candidate doesn't ask these questions, the interviewer can ask follow up questions like.
* What is the time/space complexity of the algorithm? (Easy answer!)
* How does this work with UTF strings?
I don't particularly like the question, but have been in interviews where this exact question was used. From the discussion with the candidate it did very quickly weed out inexperienced developers. I was amazed at how many people applied for roles and had no knowledge of these concepts.
> Do you actually reverse strings here?
We've also tried doing more in-depth code exercises, which are more applicable to our business domain. That didn't work much better, and required upfront work from the candidate, which isn't always fair on them.
Anyways - happily not involved in the recruiting process any more.
Thanks for taking the time to write these comments.
In my opinion, existing tech is able to solve the climate crisis. Breakthroughs can make the solution cheaper and sooner.
In my view the main problem is the attitude of doom amongst the general population. If people felt there was a solution, and were excited and energised by the challenge, they'd be more willing to support political changes. I.e. pushing back against entrenched obstructionist industries, pricing externalities, and investing in infrastructure.
The cause is a political battle with Putin over gas. Russia has traditionally used gas contracts with individual countries to buy political influence.
Now the EU has a single gas market, and had upgraded pipelines to be used in reverse directions. For example, recently since gas transport from Russia to Poland was reduced, Germany has been exporting gas to Poland.
Putin is testing Germany's new government and the EU leadership.
More renewables, and using gas more efficiently, i.e better insulated buildings throughout the EU will solve this.
New nuclear isn't going to happen much in the EU, and existing nuclear is only a small part of EU wide generation, and becoming increasingly unreliable. France has even higher electricity prices ATM due to nuclear outages.
> Putin is testing Germany's new government and the EU leadership.
To me the current situation seems more self-inflicted than driven by Russia. Also it looks like Gazprom is fulfilling its contract with Poland [1]. If my assessment is inaccurate please point me to some material for reading.
Isn't the issue here that they're declining to sell extra? And energy companies normally contract for about half their customers need and buy the rest on the spot or near spot market?
Why would they sell extra when Germany is selling Russian gas to Poland and Ukraine and turning a profit? I have the same source as this comment from this discussion: https://news.ycombinator.com/item?id=29730855
Well I'm not saying they have to sell any at all. But if they don't they're responsible for higher prices and shortages etc.
Also, the rules are pretty clear. You can't sell to Germany you can only sell to the whole EU or not. If you decide not to then why not say so and admit you're causing shortages and price spikes? Isn't that the whole point of this sort of diplomacy?
> You can't sell to Germany you can only sell to the whole EU or not.
That’s not how it works. Each country has its own contracts. Italian Eni has gas contracts with Gazprom, Hungarian MVM CEEnergy has separate contracts, Poland has individual contracts, Germany has their own. Gazprom delivers to 25 European countries.
Which strategy? The Russian refusal to sell or the European reliance? A big part of European reliance dates back to Obama refusing to sell LNG from fracking.
Again, countries have a right to (not) sell their gas as they see fit. I'm just saying this is all pretty muddy. It's more complex than good guy vs bad guy.
The European reliance of course. Expecting a KGB agent turned warlord to sell key resource for a good price forever without any strings attached is just crazy.
If there's no good [local] source of gas, using gas is not a good idea.
> The European reliance of course. Expecting a KGB agent turned warlord to sell key resource for a good price forever without any strings attached is just crazy.
The moment when Europe got screwed was Russia and China signing the $400B contract in 2014. Until then Russia needed Europe and Europe needed Russia.
Europe alienating Russia and China at the same time is Europe in trouble.
I think US foreign policy has created all of these problems for the EU. There would never have been an expansion in the direction of Crimea without four waves of NATO expansions in the direction of Russia, while after the collapse of the Soviet Union it was promised that NATO would never expand in the direction of Russia.
Without the invasion of Afghanistan, the Taliban crossing the border to China and the massive radicalization in Xinjiang in the early 2000s, there would have been no camps in Xinjiang. Please do not forget that the terrorist militia "East Turkestan independence movement" founded in Xinjiang was led as a terrorist organization by the EU, the USA, Russia and of course China after it was founded. Also do not forget that tens of thousands of these Uyghurs, radicalized by the Afghan Taliban, joined the Islamic State and fought in Iraq and Syria against the US - always openly with the aim of bringing jihad to China. China reacts the way China reacts, but it is wrong and naive to discuss the issue without discussing the trigger.
Thanks to the US, we now have enemies instead of friends. And I ask you - is it easier to fight our common enemy, global warming, with friends or with enemies?
That's great, but it worked fine for decades including under actual communists. And the EU has few other options. And their allies refuse to help. And it's those same allies that have upset Putin.
So maybe not entirely their fault even if it is their problem (I'm a Brit for full disclosure)
That it worked fine for decades is no excuse. Europe should have been building nuclear reactors all day and night long instead of waiting until it inevitably stopped working - and/or allies stop helping. Maybe it's not as economical as renewables but at least it's actually capable to replace the gas.
So Europe should have spent trillions building a massive nuclear capacity and switching to all electric just because? Presumably every other country or trade block that imports energy needs to do the same? Seems a bit extreme no?
But that's the situation everyone is in isn't it? If the Saudis and Iran stop pumping oil then all developed economies will be in the shit. But I don't see any nation radically building vast nuclear facilities... The same goes for China and cheap consumer goods or Taiwan and semiconductors.
The only place that's even close to independent is North Korea...
Saudi cut their pumps last year didn't they? After 40 odd years of OPEC prices they can afford to just pour money out like a fire hose for a long time...
Primary energy consumption isn't a great metric for comparing with renewable electricity, since for conventional plants it includes the unused energy lost as heat.
A fossil power plant wastes ~60% of the energy, a nuclear plant ~75%, a small petrol engine ~75%. Once you take this into account, the stats look a little better.
All of the car companies, dialed down orders at the start of the pandemic. Now they are all trying to stockpile chips, due to not enough supply. I imagine (no data to support) the increased size stockpiles are a large part of what makes the problem worse. Kinda like TP really.
Also, Toyota is now cutting 40 percent of global production due to chip shortage.
Any system with signalling delay will experience this effect. Changes will get amplified across layers. That's also a common way to die from a viral infection: your immune system goes into overdrive from too many signals of infection from different tissue cells. A common treatment is steroids, which dampen immune response.
Is an inherent instability in any system with long/slow information chains. It's more a failure mode of central planning than of free markets. We had a few companies making bad decisions based on bad demand forecasting. This is a problem mitigated by stock exchanges (commodities).
Travel was open with Australia until the recent outbreak there. Using virus genome sequencing, this outbreak has been traced to a New Zealander who caught the virus in Sydney, and spent 2 weeks in a quarantine centre in Auckland.
It's not yet known how the virus escaped the quarantine centre. None of the quarantine centre staff have tested positive, despite being tested multiple times.
It's suspected that the transmission occurred by somebody walking near the hotel while the initial case was arriving, or in a fenced off outdoor exercise area.
6 people walked by on CCTV at this point. 4 have been contacted, but 2 haven't been identified.
Also worth noting, the border isn't completely closed. There is a steady stream of returning New Zealanders, and also exceptions for some workers. Everyone does a 2 week quarantine stay on entering the country. Some of these people test positive for Corona, but so far it hasn't escaped a quarantine centre. Looks like Delta is harder to contain.
What is not well known in the Anglosphere is that the German nuclear phase-out was actually legislated around 2000, and not in 2011 after Fukushima.
In 2011 Merkel extended the phase-out end date by ~10 years, which was democratically very unpopular. 3-months later Fukushima happened, and the phase-out went back to an end-date similar to the original.
It's not a direct increase, but you can see in your chart that the lignite and hard coal stayed stable (and lignite actually increased) before 2015 for hard coal and 2019 for lignite. Meanwhile nuclear has decreased. I'm glad Germany is getting better at renewable after all these years, but all that coal burning had and still has a human cost.
> What is not well known in the Anglosphere is that the German nuclear phase-out was actually legislated around 2000, and not in 2011 after Fukushima.
I'm not in the Angloshpere, I live in France. I'm probably biased for nuclear power, considering our country depends on it a lot. On the other hand, like with the Chernobyl radioactive cloud, our frontiers sadly don't block pollution rejected by the Germans coal plants.
Having said that, half the world seems to run on Excel spreadsheets, which are full of money values, and Excel is basically all floats (with some funky precision logic to make it deterministic - would be curious to know more).
https://stackoverflow.com/questions/2815407/can-someone-conf...