「swift」を含む日記 RSS

はてなキーワード: swiftとは

2014-06-05

なんでそんなにC言語を嫌うのか

Swift発表されてC言語またdisられてるけどさ、

結局メモリパフォーマンスに手を入れるならGCの上でアロケータとか作ったりしちゃうんでしょ?

そんなの要らないって言ってスクリプト言語やったって、それが結局Cで実装されてるから快適な環境が構築されてるわけでしょ?

メモリ管理安全に出来ない、詰まる所Cを効率的安全に書けないなんちゃってプログラマが量産されて自分達の価値を貶めてるでしょ?

平凡なプログラマーがCをやらずにフレームワークスポイルされてくれればこっちも仕事に困らないから別にいいんだけどさ。

なんかCを悪く言ってるのって単に自分の腕が無いってアピールしてるだけに聞こえるんだよね。

2014-06-04

プログラミング言語字面だけで理解してる人たち

swiftJavascriptとかLLみたいに言ってる人沢山いたけど、あれって変数宣言がvarだとか、見た目がスッキリしてるとかそういう印象だけで言ってるんだよね。

以前、C#型推論が導入されたときも(っていうか今でも)動的型やバリアント型と区別がつかなくて「使うな」「バグの元」みたいに言ってる人よくいたし。

あと、C++, Perl, Java, C#, Javascriptあたりをまとめて「C系の言語」と言ってPythonやらRubyみたいな言語比較する文脈で「似てるから」おぼえやすいとかいう人とか。

VB6をやっていてVB.NETなら移行しやすいと思っていて「ぜんぜん違う言語だよ」って言われて驚く人とか。

共通のキーワードを使ってるとかぱっと見た目が似てたら、同じような言語と思ってしまう層がけっこうな量で存在するみたいで、そういう人たちも一応コードを書けてるんだよね。

そういう人たちの脳内ではプログラミングってどう認識されているんだろうか。永遠にからないと思うけど疑問に思ってしまう。

2014-06-03

SwiftiOS向け開発がVB化すれば

iOS向け開発者の単価が下がるよ!

やったねたえちゃん

2011-03-14

福島原子力発電所CNNコメント欄 MIT科学者科学者見解1【東日本巨大地震

結論:大丈夫

MvK2010

I'm going to copy paste a full blog post of a research scientist at MIT here, who explains the situation at Fukushima much better than anyone else has, his message: no worries.

This post is by Dr Josef Oehmen, a research scientist at MIT, in Boston.

He is a PhD Scientist, whose father has extensive experience in Germany’s nuclear industry. I asked him to write this information to my family in Australia, who were being made sick with worry by the media reports coming from Japan. I am republishing it with his permission.

It is a few hours old, so if any information is out of date, blame me for the delay in getting it published.

This is his text in full and unedited. It is very long, so get comfy.

I am writing this text (Mar 12) to give you some peace of mind regarding some of the troubles in Japan, that is the safety of Japan’s nuclear reactors. Up front, the situation is serious, but under control. And this text is long! But you will know more about nuclear power plants after reading it than all journalists on this planet put together.

There was and will *not* be any significant release of radioactivity.

By “significant” I mean a level of radiation of more than what you would receive on – say – a long distance flight, or drinking a glass of beer that comes from certain areas with high levels of natural background radiation.

I have been reading every news release on the incident since the earthquake. There has not been one single (!) report that was accurate and free of errors (and part of that problem is also a weakness in the Japanese crisis communication). By “not free of errors” I do not refer to tendentious anti-nuclear journalism – that is quite normal these days. By “not free of errors” I mean blatant errors regarding physics and natural law, as well as gross misinterpretation of facts, due to an obvious lack of fundamental and basic understanding of the way nuclear reactors are build and operated. I have read a 3 page report on CNN where every single paragraph contained an error.

We will have to cover some fundamentals, before we get into what is going on.

Construction of the Fukushima nuclear power plants

The plants at Fukushima are so called Boiling Water Reactors, or BWR for short. Boiling Water Reactors are similar to a pressure cooker. The nuclear fuel heats water, the water boils and creates steam, the steam then drives turbines that create the electricity, and the steam is then cooled and condensed back to water, and the water send back to be heated by the nuclear fuel. The pressure cooker operates at about 250 °C.

The nuclear fuel is uranium oxide. Uranium oxide is a ceramic with a very high melting point of about 3000 °C. The fuel is manufactured in pellets (think little cylinders the size of Lego bricks). Those pieces are then put into a long tube made of Zircaloy with a melting point of 2200 °C, and sealed tight. The assembly is called a fuel rod. These fuel rods are then put together to form larger packages, and a number of these packages are then put into the reactor. All these packages together are referred to as “the core”.

The Zircaloy casing is the first containment. It separates the radioactive fuel from the rest of the world.

The core is then placed in the “pressure vessels”. That is the pressure cooker we talked about before. The pressure vessels is the second containment. This is one sturdy piece of a pot, designed to safely contain the core for temperatures several hundred °C. That covers the scenarios where cooling can be restored at some point.

The entire “hardware” of the nuclear reactor – the pressure vessel and all pipes, pumps, coolant (water) reserves, are then encased in the third containment. The third containment is a hermetically (air tight) sealed, very thick bubble of the strongest steel. The third containment is designed, built and tested for one single purpose: To contain, indefinitely, a complete core meltdown. For that purpose, a large and thick concrete basin is cast under the pressure vessel (the second containment), which is filled with graphite, all inside the third containment. This is the so-called “core catcher”. If the core melts and the pressure vessel bursts (and eventually melts), it will catch the molten fuel and everything else. It is built in such a way that the nuclear fuel will be spread out, so it can cool down.

This third containment is then surrounded by the reactor building. The reactor building is an outer shell that is supposed to keep the weather out, but nothing in. (this is the part that was damaged in the explosion, but more to that later).

Fundamentals of nuclear reactions

The uranium fuel generates heat by nuclear fission. Big uranium atoms are split into smaller atoms. That generates heat plus neutrons (one of the particles that forms an atom). When the neutron hits another uranium atom, that splits, generating more neutrons and so on. That is called the nuclear chain reaction.

Now, just packing a lot of fuel rods next to each other would quickly lead to overheating and after about 45 minutes to a melting of the fuel rods. It is worth mentioning at this point that the nuclear fuel in a reactor can *never* cause a nuclear explosion the type of a nuclear bomb. Building a nuclear bomb is actually quite difficult (ask Iran). In Chernobyl, the explosion was caused by excessive pressure buildup, hydrogen explosion and rupture of all containments, propelling molten core material into the environment (a “dirty bomb”). Why that did not and will not happen in Japan, further below.

In order to control the nuclear chain reaction, the reactor operators use so-called “moderator rods”. The moderator rods absorb the neutrons and kill the chain reaction instantaneously. A nuclear reactor is built in such a way, that when operating normally, you take out all the moderator rods. The coolant water then takes away the heat (and converts it into steam and electricity) at the same rate as the core produces it. And you have a lot of leeway around the standard operating point of 250°C.

The challenge is that after inserting the rods and stopping the chain reaction, the core still keeps producing heat. The uranium “stopped” the chain reaction. But a number of intermediate radioactive elements are created by the uranium during its fission process, most notably Cesium and Iodine isotopes, i.e. radioactive versions of these elements that will eventually split up into smaller atoms and not be radioactive anymore. Those elements keep decaying and producing heat. Because they are not regenerated any longer from the uranium (the uranium stopped decaying after the moderator rods were put in), they get less and less, and so the core cools down over a matter of days, until those intermediate radioactive elements are used up.

This residual heat is causing the headaches right now.

So the first “type” of radioactive material is the uranium in the fuel rods, plus the intermediate radioactive elements that the uranium splits into, also inside the fuel rod (Cesium and Iodine).

There is a second type of radioactive material created, outside the fuel rods. The big main difference up front: Those radioactive materials have a very short half-life, that means that they decay very fast and split into non-radioactive materials. By fast I mean seconds. So if these radioactive materials are released into the environment, yes, radioactivity was released, but no, it is not dangerous, at all. Why? By the time you spelled “R-A-D-I-O-N-U-C-L-I-D-E”, they will be harmless, because they will have split up into non radioactive elements. Those radioactive elements are N-16, the radioactive isotope (or version) of nitrogen (air). The others are noble gases such as Xenon. But where do they come from? When the uranium splits, it generates a neutron (see above). Most of these neutrons will hit other uranium atoms and keep the nuclear chain reaction going. But some will leave the fuel rod and hit the water molecules, or the air that is in the water. Then, a non-radioactive element can “capture” the neutron. It becomes radioactive. As described above, it will quickly (seconds) get rid again of the neutron to return to its former beautiful self.

This second “type” of radiation is very important when we talk about the radioactivity being released into the environment later on.

What happened at Fukushima

I will try to summarize the main facts. The earthquake that hit Japan was 7 times more powerful than the worst earthquake the nuclear power plant was built for (the Richter scale works logarithmically; the difference between the 8.2 that the plants were built for and the 8.9 that happened is 7 times, not 0.7). So the first hooray for Japanese engineering, everything held up.

When the earthquake hit with 8.9, the nuclear reactors all went into automatic shutdown. Within seconds after the earthquake started, the moderator rods had been inserted into the core and nuclear chain reaction of the uranium stopped. Now, the cooling system has to carry away the residual heat. The residual heat load is about 3% of the heat load under normal operating conditions.

The earthquake destroyed the external power supply of the nuclear reactor. That is one of the most serious accidents for a nuclear power plant, and accordingly, a “plant black out” receives a lot of attention when designing backup systems. The power is needed to keep the coolant pumps working. Since the power plant had been shut down, it cannot produce any electricity by itself any more.

Things were going well for an hour. One set of multiple sets of emergency Diesel power generators kicked in and provided the electricity that was needed. Then the Tsunami came, much bigger than people had expected when building the power plant (see above, factor 7). The tsunami took out all multiple sets of backup Diesel generators.

When designing a nuclear power plant, engineers follow a philosophy called “Defense of Depth”. That means that you first build everything to withstand the worst catastrophe you can imagine, and then design the plant in such a way that it can still handle one system failure (that you thought could never happen) after the other. A tsunami taking out all backup power in one swift strike is such a scenario. The last line of defense is putting everything into the third containment (see above), that will keep everything, whatever the mess, moderator rods in our out, core molten or not, inside the reactor.

http://anond.hatelabo.jp/20110314030613

へ続く

2009-01-21

毎朝読対訳:就任演説(5)

http://anond.hatelabo.jp/20090121125115

 For everywhere we look, there is work to be done.

(M)どこを見回してもすべき仕事がある。

(A)あらゆるところに、なすべき仕事がある。

(Y)なすべき仕事は至る所にある。

 The state of the economy calls for action, bold and swift, and we will act - not only to create new jobs, but to lay a new foundation for growth.

(M)経済状況は、大胆で迅速な行動を求めている。我々は新しい職場創造だけでなく、成長のため新しい基盤を作らねばならない。

(A)経済状況は、力強く迅速な行動を求めている。私たちは行動する。新たな雇用を創出するだけではなく、成長への新たな基盤を築くためにだ。

(Y)米国経済は、大胆かつ迅速な行動を求めている。そして我々は新規の雇用創出のみならず、新たな成長の礎を整えることができる。

 We will build the roads and bridges, the electric grids and digital lines that feed our commerce and bind us together.

(M)我々は道路や橋、電線やデジタル通信網をつくり、我々の商業を支え、我々の結びつきを強めなければならない。

(A)商業の糧となり、人々を結びつけるように、道路や橋、配電網やデジタル回線を築く。

(Y)道路や橋を造り、電線やデジタル通信網を敷き、商業を支え、我々を一つに結び付ける。

 We will restore science to its rightful place, and wield technology's wonders to raise health care's quality and lower its cost.

(M)我々は科学を本来あるべき場所に引き戻し、技術活用医療の質を引き上げると共にコストを下げる。

(A)科学を本来の姿に再建し、技術の驚異的な力を使って、医療の質を高め、コストを下げる。

(Y)科学を本来あるべき地位に戻し、医療の質を引き上げながら、そのコストは減らす。

 We will harness the sun and the winds and the soil to fuel our cars and run our factories.

(M)太陽、風や土壌を使って我々の自動車の燃料とし、工場を動かす。

(A)そして太陽や風、大地のエネルギーを利用し、車や工場の稼働に用いる。

(Y)太陽、風や土壌を利用して自動車を動かし、工場を動かす。

 And we will transform our schools and colleges and universities to meet the demands of a new age.

(M)我々の学校や単科大、大学を新たな時代の要請にあわせるようにする。

(A)新しい時代要請に応えるように学校大学を変革する。

(Y)新時代の要請に合うよう学校や単科大、大学を変えていく。

 All this we can do.

(M)これらすべてが我々には可能だ。

(A)これらすべては可能だ。

(Y)我々はすべてのことを成し遂げられる

 And all this we will do.

(M)これらすべてを我々は実行するのだ。

(A)そしてこれらすべてを、私たちは実行する

(Y)し、行っていく。

 Now, there are some who question the scale of our ambitions -

(M)我々の志の大きさに疑問をはさむ人もいる。

(A)私たちの志の大きさに疑念を抱く人がいる。

(Y)我々の野望の大きさについて疑念を抱く人がいる。

  - who suggest that our system cannot tolerate too many big plans.

(M)我々のシステムでは大きすぎる計画は達成できないという人々だ。

(A)我々のシステムではそんなに多くの大きな計画は無理だ、と言うのだ。

(Y)我々のシステムは多くの大きな計画に耐えられないと指摘する人もいる。

 Their memories are short.

(M)彼らは覚えていないのだ。

(A)だが、そうした人たちは忘れるのが早い。

(Y)だが、彼らは忘れている。

 For they have forgotten what this country has already done; what free men and women can achieve when imagination is joined to common purpose, and necessity to courage.

(M)彼らはすでにこの国が成し遂げたことを忘れているのだ。想像力が共通の目的に出会った時、必要が勇気と出会った時、自由な男女に達成できることを忘れているのだ。

(A)これまで我が国が成し遂げてきたこと、そして、共通の目的勇気の必要性に想像力が及んだとき、自由な人々がどんなことを成し遂げられるかを、忘れているのだ。

(Y)彼らはこの国が何を成し遂げたかを忘れている。想像力が共通の目的と出合った時、必要が勇気と結びついた時、自由な男女が何を達成できるかを忘れているのだ。

 What the cynics fail to understand is that the ground has shifted beneath them -

(M)皮肉屋が理解できないのは、彼らの下で大地が動いたということだ。

(A)皮肉屋たちは、彼らの足元の地面が動いていることを知らない。

(Y)皮肉屋が理解できないのは、彼らがよって立つ地面が動いたということだ。

 - that the stale political arguments that have consumed us for so long no longer apply.

(M)我々を余りに長期間、消耗させた使い古しの政治論議はもはや適用されない。

(A)つまり、これまで私たちを消耗させてきた陳腐な政争はもはや当てはまらない。

(Y)長い間、我々を疲れさせてきた陳腐な政治議論はもはや通用しない。

 The question we ask today is not whether our government is too big or too small, but whether it works -

(M)今日、我々が問うのは、政府が大きすぎるか小さすぎるかではなく、機能しているかどうかだ。

(A)私たちが今日問わなくてはならないことは、政府が大きすぎるか小さすぎるか、ではなく、それが機能するかどうかだ。

(Y)我々が今日問うべきなのは、政府の大小ではなく、政府が機能するか否かだ。

 - whether it helps families find jobs at a decent wage, care they can afford, a retirement that is dignified.

(M)家庭が人並みの収入を得られるよう仕事を見つけ、威厳をもって引退できるよう助けているかどうかだ。

(A)まっとうな賃金仕事や、支払い可能な医療・福祉、尊厳をもった隠退生活を各家庭が見つけられるよう政府が支援するのかどうかだ。

(Y)家族が人並みの給与仕事を見つけたり、負担できる(医療保険や、立派な退職資金を手に入れることの助けに、政府がなるかどうかだ。

 Where the answer is yes, we intend to move forward.

(M)答えが「イエス」の施策継続する。

(A)答えがイエスならば、私たちは前に進もう。

(Y)答えがイエスの場合は、その施策を前進させる。

 Where the answer is no, programs will end.

(M)「ノー」の施策は廃止する。

(A)答えがノーならば、政策はそこで終わりだ。

(Y)ノーならば終わりとなる。

 And those of us who manage the public's dollars will be held to account - to spend wisely, reform bad habits, and do our business in the light of day -

(M)公金を預かる我々は、説明責任を果たさなければならない。適切に支出し、悪い習慣を改め、誰からも見えるように業務を行う。

(A)私たち公金を扱う者は、賢明に支出し、悪弊を改め、外から見える形で仕事をするという、説明責任を求められる。

(Y)公的資金管理する者は適切に支出し、悪弊を改め、誰からも見えるように業務を行う。

 - because only then can we restore the vital trust between a people and their government.

(M)それによって初めて、国民政府の間の重要な信頼を回復できる。

(A)それによってようやく、政府国民との不可欠な信頼関係を再建することができる。

(Y)それによって初めて、国民政府の間に不可欠な信頼を回復できる。

 Nor is the question before us whether the market is a force for good or ill.

(M)市場が正しいか悪いかも、我々にとっての問題ではない。

(A)市場が良い力なのか悪い力なのかも、問われていることではない。

(Y)問うべきなのは、市場の良しあしでもない。

 Its power to generate wealth and expand freedom is unmatched,

(M)富を生み出し、自由を拡大する市場の力は比肩するものがない。

(A)富を生みだし、自由を広めるという市場の力は、比類なきものだ。

(Y)富を作り自由を広げる市場の力に比肩するものはない。

 , but this crisis has reminded us that without a watchful eye, the market can spin out of control - and that a nation cannot prosper long when it favors only the prosperous.

(M)だが、今回の金融危機は、注意深い監視がなされなければ、市場は制御不能になり、豊かな者のみを優遇する国は長く繁栄することはできないことを我々に気付かせた。

(A)しかし、今回の(経済)危機は、市場は注意深く見ていないと、制御不能になるおそれがあることを、私たちに思い起こさせた。また、富者を引き立てるだけでは、国は長く繁栄できない、ということも。

(Y)だが、今回の(経済)危機は、監視がなければ、市場は統制を失い、豊かな者ばかりを優遇する国の繁栄が長続きしないことを我々に気づかせた。

 The success of our economy has always depended not just on the size of our Gross Domestic Product, but on the reach of our prosperity; on our ability to extend opportunity to every willing heart -

(M)我々の経済の成功は国内総生産の規模だけでなく、繁栄が享受される範囲や、望む人すべてに機会を広げる能力にかかってきた。

(A)私たちの経済的な成功は、国内総生産(GDP)の規模だけではなく、繁栄がどこまで到達するかに常に依存してきた、つまり、意欲のある人にどれだけ機会を広げられたかだ。

(Y)我々の経済の成功はいつも、単に国内総生産(GDP)の大きさだけでなく、我々の繁栄が広がる範囲や、機会を求めるすべての人に広げる能力によるものだった。

 - not out of charity, but because it is the surest route to our common good.

(M)慈善としてではなく、公共の利益に通じる最も確実な道としてだ。

(A)慈善心からではなく、それが、私たちの共通の利益への最も確実な道筋であるからだ。

(Y)慈善としてではなく、公共の利益に通じる最も確実な道としてだ。

ログイン ユーザー登録
ようこそ ゲスト さん