はてなキーワード: DRYとは
http://anond.hatelabo.jp/20100621194920
Firstly let me congratulate your acquisition of a PhD. You have done something that most of us never can.
Considering how successful you are in academia, I believe some people were jealous and picked on your Japanese accents and unsociable sides. I can't blame them, however, to think how daring your feat seemed to them. Let alone receiving a PhD, a good number of us can't even hope to receive a bachelor's degree, not even in our dreams.
And doing so in a foreign country? In a foreign language? That's beyond our imagination.
You have climbed a peak that many others have failed.
If you are still unsure about your sense of humor and accents, maybe you should spend some time traveling and having fun: Normally dry sober days of studying does not improve your communication skills much.
Just have some fun with friends and you will pick up their accents eventually. The rest will be easy.
現実問題として語学の習得に掛かる時間は相当なものでしょうね。
大体人間が普段使う単語数は25k前後と聞きましたが、教養のある人はこれが40K以上になる筈です。一単語につき意味は一つではありませんから、一つの言語の完璧な習得に必要な時間は、莫大なものとなります。
私の体感では、才能のない人が大人成ってから始めれば、フルタイムで8年から12年でしょうか(音楽なんかやってる人は早いみたいですよ。あと話し好きの方)?
英語は確かに必要なんですが、習得に必要とされるリソースの量に対して、リターンが微妙なのは事実です。私は勉強しなかった方ですが、それでも「今まで英語に使ったリソースを全て他の分野に投資出来ていたら、人生ここまで酷く成ってないかなぁ~」と思うことは多々有ります。
一部の人達の間に英語学習を万能薬のように扱う傾向があるようですが、現実に十分な量のリソースを学習に使えない(金銭的、時間的、環境的、或いは精神的理由から)私達の様な人間にとって「英語は勉強しても(自分の英語力が)リターンが発生する閾値に到達しないので、時間とお金の無駄」なんですよね・・・。
子供は6歳前後から[b]ある一定以上の時間、品質の良い英語教育[/b]を施せば、おそらくは違和感なくバイリンガルになるでしょうが、現実には費用と人材の欠如が深刻で、日本でその様な教育を受けられる子供は殆どいません。またそのような教育制度の導入に必要な金額、現在教職についておられる方々の抵抗を考えるに、公立の学校でのサービスの提供は不可能でしょう。
グローバル化に適応するためには英語は確かに絶対必要なんですが、「明らかに習得が(諸々の事情から)出来ないであろう人達に英語学習を勧めるのは国の長期戦略としては正しくでも、短期的には彼らをWORKING POOR ならぬ LEARNING TO BE POORしてしまう可能性は十分あるので、もっと英語学習を勧めるだけではなく、リスクの説明がなされるべきなのかもしれません。
http://anond.hatelabo.jp/20081026002746
ステートマシン大好きっ子としては書かずにいられない
もう少しがんばればforも無くせるな
fsmの中身ってDRYなの?的な話もあるだろうが,こんなもの他のプログラムで自動生成すればいいんだよ!(開き直り)
#include <stdio.h> static int process(unsigned char *str, int c) { if (str != NULL) puts(str); else printf("%d\n", c); return ++c % (3 * 5); } static int iter(int c) { return process(NULL, c); } static int fizz(int c) { return process("Fizz", c); } static int buzz(int c) { return process("Buzz", c); } static int fizzbuzz(int c) { return process("FizzBuzz", c); } static int (*fsm[])(int) = { fizzbuzz, iter, iter, fizz, iter, buzz, fizz, iter, iter, fizz, buzz, iter, fizz, iter, iter }; int main(void) { int i, state; for (i = state = 1; i <= 100; i++) { state = (*fsm[state])(i); } return 0; }
Thanks. 確かにそうなんだけど、putsだと勝手に改行が出力されてしまうので一ヶ所しか使えなかった。DRY、forなし、ifなし(:?使ってるのでインチキだけど)、main以外に関数なし風味。これで完成ということにして寝ます。
int main() { int fizz_buzz(int i, int limit) { int do_fizz_buzz(int num, int divisor, const char* str, int print) { return num % divisor == 0 ? do_fizz_buzz(num / divisor, divisor, str, 1) : (printf("%s", print ? str : ""), num); } do_fizz_buzz(do_fizz_buzz(i, 3, "Fizz", 0), 5, "Buzz", 0) == i ? printf("%d\n", i) : puts(""); return i++ == limit ? 0 : fizz_buzz(i, limit); } return fizz_buzz(1, 100); }
移植性の話は厳禁でw
じゃぁ再帰で。
int fizz_buzz(int i, int j) { if(i % 3 == 0 && j % 3 != 0) { printf("Fizz"); return 1+ fizz_buzz(i / 3, j * 3); } if(i % 5 == 0 && j % 5 != 0) { printf("Buzz"); return 1 + fizz_buzz(i / 5, j * 5); } return 0; } int main(){ int i; for(i=1; i<=100; i++){ if(fizz_buzz(i, 1)) printf("\n"); else printf("%d\n", i); } return 0; }
変数名適当なのは勘弁。3とか5は適当に定数かマクロで置換すればDRY?
散々考え尽くされているんだろうけど、俺は挑戦するの初めてなので結構楽しいw
全然DRYじゃないけど、
#include <stdio.h> #define FIZZ 3 #define BUZZ 5 int main(void){ int i; for(i=1; i<=100; i++){ if((i % FIZZ == 0) || (i % BUZZ == 0)){ if(i % FIZZ == 0) printf("Fizz"); if(i % BUZZ == 0) printf("Buzz"); printf("\n"); } else printf("%d\n", i); } return 0; }
で簡単な仕様変更には対処できるかと。
でも一度ですむものは一度ですませたいよねぇ。もうちょっと考えてみる。
#include <stdio.h> int main(){ int i, j = 0; for(i=1; i<=100; j = 0, i++){ if(i % 3 == 0) { printf("Fizz"); j = 1; } if(i % 5 == 0) { printf("Buzz"); j = 1; } if (j) { printf("\n"); continue; } /* 以下二行と返り値追記 */ else printf("%d\n", i); } return 0; }
Giro Orita was one of a team of veterinarians who arrived in Syria in October 1964 in response to a request to the Japanese government from the Syrian Ministry of Agriculture. When the Japanese team completed its mission in 1968,
the Syrian government invited Dr. Orita to stay and continue his work, as well as foster collaboration in animal health research between Japan and Syria.
In 1983, when the Syria-based International Center for Agricultural Research in the Dry Areas (ICARDA) asked the Japanese government for help to develop small-ruminant pathology research, Dr. Orita was delegated by JICA to lead the institute’s animal health research as a visiting veterinarian. In 1985, Dr. Orita received the Syrian Medal of Distinction (second rank) from the Minister of Culture.
He left ICARDA in 1990 but continued to promote relationships between ICARDA and Japanese organizations. ICARDA later named a new animal health laboratory after him.
(http://www.cgiar.org/pdf/Japan_CGIAR_English_June2006.pdfより引用)
どうやら、折田獣医師は1964年に農水省-日本獣医師会経由でシリアに渡ったんだな。そのあと、プロジェクトは1968年に終了しちゃうんだけど、彼だけはシリア政府の要請によりシリアに留まった。
それから15年以上あと、1983年から乾燥地の農業プロジェクトが立ち上がったんで、「JICA派遣エキスパート」という肩書きを受けて参加したということか。
やっぱ、あとからJICAと協力したって感じじゃねーか。
CGIAR(国際農業研究協議グループ)ってサイトからだけど、獣医師会の記事とも合ってるし、これでいいんじゃね?
乏しい、とは言ってもある程度の技能や知識は持っていますよ。それに最近じゃ高い技能を持った中堅どころがたくさん応募してくるので競争率が非常に高くなったらしいです。
ある程度の技能や知識があっても、組織がないと大きな事業は興せない。
利権もない(=お金もコネクションも相手行政への影響力もない)では、1kmの舗装道路さえできない。
剣道や柔道の普及なんて、「日本広報活動」以外の何物でもないわな。(もちろん、それは重要な活動です。)
高い技能を持った中堅どころが参加って、、、リストラや途中で会社辞めちゃった人の受け皿か。
なんだか良いことか悪いことかわかんないね。
専門家派遣のほうがメインって書いたけど、専門家派遣だと利権も絡むし、その専門家の所属する団体(企業)の利害もからむ。
ただ、組織の仕事に直結するから、活動の規模はずっと大きくなるし、いろんなコネも使える。
ぜんぜん利権のない海外協力隊がお金を使わず浅井戸を1本あげるのと、日本の企業が金儲けしながら、
専門家派遣で深井戸を10本あげるのでは、どちらが地域貢献になるか?
もちろん、ジャンルによってまったく違うのはわかるんだけど、他でもそうである場合が多いんだ。
文化財を補修するにしても、日本の団体から派遣された専門家が補助金獲得と実績を挙げるためにプロジェクトを立ち上げて、
長く続けるのと、青年協力隊が単発でやるのとどちらが貢献できるか?
ボランティアにできることと、できないこと。
そのへんは、きちんと把握すべきだな。
"ICARDA’s association with Japan dates back to the Center’s establishment in 1977, when Dr Giro Orita, a JICA expert, initiated
research here in sheep and goat diseases and parasites and helped develop effective control measures."
(http://www.icarda.cgiar.org/Publications/Donors/Japan/Japan.pdfより引用)
と、International Center for Agricultural Research in the Dry Areas(国際乾燥地農業研究センター)のサイトにありましたので、日本獣医師会から出向する形でJICAのエキスパートとして行ったんじゃないですかね。
>基本的に、技能や知識に乏しい、組織から離れた若者が青年海外協力隊になる
あと学校の柔道や剣道の先生とかね。乏しい、とは言ってもある程度の技能や知識は持っていますよ。それに最近じゃ高い技能を持った中堅どころがたくさん応募してくるので競争率が非常に高くなったらしいです。
青年協力隊は利権は絡まないと思うな。相手国からの要請ベースの人的派遣だから絡む余地が余りない気がする。
セックス三昧ってのは、あれかしらパプアに派遣された人が酋長の娘を嫁にしろと迫られたりテントの中に押しかけてきたりって話に尾ひれが付いた、とか。協力隊は特に、現地の人と恋に落ちて結婚した人も結構たくさんいますしね。
重複しないように上手く脳内設計するより「コピペ+ちょっと修正」で量産した方が100倍速いんだからしょうがないよね
コピペで作られたコードを修正しようとするとすごく大変でテストも大変で同じことの繰り返しでイヤになるけど難しい作業ではないよね
世界がみんな達人プログラマで頭の良いコードを楽しく書けたらいいけど現実はそうじゃないよね
設計書って基本コピペで作るよね
要するに設計者が全部悪いってことだよね
開発の部隊が複数に分かれてる場合もあるよね
いちいち他チームのソース覗いてDRY遵守しようとしたら手間がかかってしょうがないよね
チーム分けが間違ってるってことかな。
横に分けるから重複が生まれる。縦に分ければいいんだみたいな。
ルーキーに与えられる最初の仕事は「設計書をコードにおこせ」だよね
ある日突然「コピペPGは社会の癌だ」みたいなこと言われたら悲しくなるよ
コピペPGへの非難を repeat yourself し続けるより効率のよいやり方がありそうなんだけど
私は頭がよくないので実現する方法が思いつかない
だから新機能はコピペで作るし、新人にも「とりあえず最初はコピペして作りなよ」って言うしかない
わけのわからない罪悪感を感じながらも
勉強からはじめ10日間ぐらいでひとつのRubyアプリケーションをつくった。
キャッチコピー道場 CatchCopyHacks
ドリコムの運営さんにDBのキャラをLatin1からutf8に変えてもらってようやく日本語が動くようになったので一応公開。
これをつくるまでの詳細な過程は[Ruby]のタグをひいてみてほしい。
http://anond.hatelabo.jp/c/Ruby
RonRに触ってみて思ったことをいくつか書いておきます。
0から作る分には正直それほど生産性は高くないと思う。
ただ、既存プロジェクトの焼き直しやプラグインを活用できるようなケースに限って言えばほぼ設定変更だけで対応できる。10分でつくる***みたいなものは既存のものをナゾルというバッチスクリプティングというような作業。(プログラミングという所作からは遠いかもしれない。)
Ruby on RailsはDRY:繰り返さないことを標榜しているがあれはウソだと思う。
プラグインなどをオーバーライドさせて再帰的に繰り返していくことこそがこの言語の特性だとおもう。
過去のプロジェクトなどの繰り返し。これこそがRailsの本領ではないのだろうか。
プラグインを自作してストックできる体制ができあがったら物凄く生産性をあげることができる。
敷いたレールのうえを突っ走らせるのはものすごく簡単だ。
だが、レールに分岐をつくったり、既存のレールから少しでも外れたことをやろうとすると他の言語よりも苦労をする。
とくにO/Rマッピングは設計から頭を悩ませることになる。
逆にO/Rで何ができるんだという発想から辿らないと設計できなかった。
もし既存のシステムからのリプレイスであったら困難を極めるだろう。
システム会社がRonRを生産性が高いだの、国産だのとの流行で取り入れて、
リプレース案件を請け負ってデスマーチに陥る姿がありありと目にうかんだ。
find_by_sqlを連発せざるをえないシステム。少し想像するだけで怖い。
RailsのMVCは賞賛にあたいすべきものであるが、もしRonRをチームで取り組んだときには担当分担は非常に頭を悩ませることになると思う。Vの部分は分業容易だが、特にCの部分は設計が担当できるレベルのPGが必要になる。
コンシューマ向けサービスのように自らの要件と仕様が近いようであれば回避できるかもしれないが、
客先都合で変更が入った場合RonRのその特性が仇になる可能性が高い。
チームに目的地まできちんとレールをひける人が居ないと間違いなく地獄に落ちる。
その目的地に案内することを客先にきちんとコミットできる人が居ないと間違いなく地獄に落ちる。
まだ1、2年ぐらいはないなという思いを強くした。
コンシューマー向けのサービスをRonRで展開することはできても、人月仕事をRonRでやるにはまだ無謀すぎる。
現状では、やれたとしても単票、マスメン系が限界だ。10人を超える案件にはまだ向かないとおもう。
言語としての難易度は他とそれほどかわらないが、方言というレベルでは収まらないので、
3、4年生レベルのイキのよさそうなところに勉強会にでてもらうとかアンテナ立てておいてもらうより無いのではないか。お金になるのはもういっぽ先だ。
KEREM SHALOM, Israel, July 11 ?? Real life has a way of intruding into the airy absolutes of the Israeli-Palestinian conflict. Each side may deny the other’s historical legitimacy, or plot the other’s demise, but somehow, the gritty business of coexistence marches on.
Skip to next paragraph
Enlarge This Image
Rina Castelnuovo for The New York Times
An Israeli man signaled for a truck to move toward Gaza at Sufa on Wednesday. Commerce continues despite the Hamas takeover.
The New York Times
For the past month, since the Islamic militants of Hamas took over the Gaza Strip, Israel has kept the main commercial crossing point at Karni shuttered, squeezing the life out of the limp Gazan economy. Israel bans contact with Hamas, and Hamas seeks Israel’s destruction, making border crossing etiquette more precarious than elsewhere.
Yet at this small crossing near the Egyptian border on Wednesday, between mortar attacks by Hamas and other militants, about 20 truckloads of milk products, meat, medicines and eggs passed from Israel into Gaza, part of the effort to keep basic commodities reaching the 1.5 million Palestinians of the largely isolated strip. Most of the supplies are not humanitarian relief, but are ordered by Palestinian merchants from Israeli suppliers, relying on contacts built up over years.
The mechanics of the crossover manage to answer Israel’s security needs while avoiding contact with Hamas. At Kerem Shalom, Israeli trucks transfer their goods to what Israeli military officials describe as a “sterile” Palestinian truck. Driven by a carefully vetted Palestinian driver, the truck never leaves the terminal, carrying the goods to the Palestinian side, where they are transferred onto ordinary Palestinian trucks that drive into Gaza.
Kerem Shalom, which means “vineyard of peace,” is surrounded by fences and concrete barriers. It can process only about 20 trucks a day, so it is reserved for products that require refrigeration.
The hardier goods, which make up the bulk of the supplies, go through another crossing, at Sufa, to the north. About 100 Israeli trucks a day come from Israel, swirling up clouds of dust before dumping thousands of tons of dry products, bales of straw and crates of fruit on “the platform,” a fenced-in patch of baked earth. At 3 p.m. the Israeli suppliers leave. Like drug dealers picking up a “drop,” the Gaza merchants send in trucks from a gate on the other side and take the products away.
Other products make their way into Gaza with virtually no human interaction. At the fuel depot at Nahal Oz, Israeli tankers pour diesel, gasoline and cooking gas into Gaza through pipes that run beneath the border. And even at Karni, the main crossing that closed for normal operations on June 12, the Israelis have adapted a 650-foot-long conveyor belt, which was previously used for gravel, to send in grain.
“It is better all around from a security point of view that commodities go in,” said Maj. Peter Lerner of the Coordination and Liaison Administration, the Israeli military agency that deals with the civilian aspects of the Gaza border. “More despair doesn’t serve anyone.”
Israeli officials cite security reasons for having shut Karni, the only crossing equipped to send containers into Gaza, or to handle exports out of the strip. “Karni was based on the concept of two sides operating together,” said Col. Nir Press, the head of the coordination agency.
Colonel Press noted that in April 2006, a vehicle loaded with half a ton of explosives got through three of four checkpoints on the Palestinian side of Karni, and was stopped at the last security position by members of the American-backed Presidential Guard, loyal to the Palestinian president, Mahmoud Abbas of Fatah.
But the Presidential Guard is no longer there, having been routed, along with all other Fatah forces in Gaza, by Hamas.
Instead, the military wing of Hamas and other Palestinian factions have been firing mortar shells at Kerem Shalom. On Tuesday, 10 of them landed in and around the terminal as two trucks of milk were passing. The crossing was closed for the rest of the day. [Another barrage of mortar shells hit areas around Kerem Shalom on Thursday.]
Hamas suspects that Israel wants to use Kerem Shalom to replace the Rafah crossing on the Egypt-Gaza border, which has been closed since June 9. The Palestinians had symbolic control at Rafah. At Kerem Shalom, Israel can better supervise who ?? and what ?? is going in and out of the strip.
“Kerem Shalom is a military post, a place from which Israeli tanks begin their incursions into Gaza,” said Fawzi Barhoum, a Hamas spokesman, justifying the mortar attacks. “How can we consider it a safe and legitimate crossing to replace Rafah?”
But when it comes to food, rather than principle, Hamas is proving itself pragmatic as well. On Sunday, Palestinian merchants, trying to press Israel to reopen Karni, told the Israelis that Hamas had barred the import of Israeli fruit. But by Wednesday, the Israeli fruit was ordered again. “Hamas does not want to lose the private sector,” a Gaza businessman explained.
Tellingly, the exposed Sufa crossing, through which most of the food comes, has not been attacked with mortars so far. Without Karni, however, and with the smaller crossings operating on a one-way basis, Gaza can barely subsist. With hardly any raw materials going in, and no products from Gazan farms, greenhouses and factories so far allowed out, Gaza’s tiny industrial base is on the verge of collapse.
Hamas officials say they want to start negotiations with Israel about reopening the formal crossings. Major Lerner said that Hamas had “a few things to do” first, including recognizing Israel’s right to exist and freeing Gilad Shalit, the Israeli soldier captured and taken to Gaza in a raid more than a year ago.
But the ultimate test of pragmatism may come in September when the Hebrew calendar enters what is known in Jewish law as a “shmita” year. Then the fields of Israel are supposed to lie fallow, and observant Jews seek agricultural products grown elsewhere. Before the Hamas takeover, Israel’s rabbis had reached agreements with Palestinians to import vegetables from Gaza, Major Lerner said. Given the needs of both sides, it may still happen.
http://ex22.2ch.net/test/read.cgi/net/1171365416/
:名無しさん@ゴーゴーゴーゴー!:2007/02/13(火) 20:16:56 ID:R14sNdfa
人力検索サイトはてなの香ばしい方々をまたーりヲチしよう。
詳細は>>2以降で。
2 :名無しさん@ゴーゴーゴーゴー!:2007/02/13(火) 20:21:52 ID:R14sNdfa
はてな質問一覧
はてなからのお知らせ
26 :名無しさん@ゴーゴーゴーゴー!:2007/02/15(木) 16:50:35 ID:aMLNn+o0
死ねtaknt
死ねとか言っちゃいけないんだよ。死ねと言ってホントに死んだら@名無しさんID:aMLNn+o0が殺人罪。痴漢ってのもID:aMLNn+o0の自分の願望の投影だろう。
22 :名無しさん@ゴーゴーゴーゴー!:2007/02/15(木) 12:29:36 ID:8VA17UTM
>>16
>それは真実を鋭く取り上げているだけだろ。
takntは的外れの大馬鹿書き込み多し、って言うか、そんなのばっかり
ハムですらたまにはアホな質問者の阿呆垂れぶりを晒すと言うか、はっきり指摘するのに役立っているのにね
荒し仲間達、例えば
メンヘラ宣言を荒しの免罪符と信じる尿石こTomCatとjyouseki
とかと同様に蛙の面にションベンどころか、面が糞まみれになろうが何が有ろうが、
テメェの悪行のバターンを殆んど変えない
ま、このあたりは古参的で、はてな史上最低最悪荒し専門ユーザーのDRYみたいな比較的新しい荒しと違うとこだね
だから、ここで自演してもすぐバレる
そしてバレバレでも気が付かないんだよね
TomCat氏に対して詐欺師で幼児性愛者という根拠がわからない。本人に確認とったのか?いつも良回答ありがとうTomCatさん。
>偽善を超えた非善者
doriasoさんへの罵倒、どこもそうだけど善悪二極論者自体が珍しい。それからメンヘルを馬鹿にする発言って嫌だね。
@名無しさんの発言見てて思ったのは、罵倒の部分を見ると、過剰な表現がエロい業者のスパムみたいにみえる。
なにをそんなに恨んでいるのかなあ。優越感?そんなんかなあ。ってそういうこと書いてると大抵「お前もだ!」ってツッコミはいるだなあ。私も人の罵倒してる時ってのは、自分の事良く見えてないからねえ。きっと嫌な奴になってるんだろうなあ。