ときどきの雑記帖'

最新ページへのリンク
目次ページへのリンク

一つ前へ 2013年1月(上旬)
一つ後へ 2013年1月(下旬)

ホームへ

2013年01月20日

■_

街灯がなかったり、あっても明るくないようなところで 聴いている音楽がウルトラQのテーマ曲になったりするとちょっと怖い。

複式簿記は大学でやりました。そういう学部・学科だったので。

rss

■_ めも

世界一受けたい授業|日本テレビ

■_ めも(そのに)

■_

Google's JavaScript assassin: Web languages are harder than VMs ? The Register

■_ 和製

twitter のTLに見慣れないカタカナ用語が流れてきたので調べてみたら

マーケティング用語集 プロダクトアウト、マーケットイン - J-marketing.net produced by JMR生活総合研究所

プロダクトアウト(product out、product oriented)とは、企業が商品開発や生産を行う上で、作り手の理論を
優先させる方法のことです。「作り手がいいと思うものを作る」「作ったものを売る」という考え方で、たとえ
ば、従来の大量生産がこのやり方に当たります。

 一方、マーケットイン(market in、market oriented)とは、ニーズを優先し、顧客視点で商品の企画・開発
を行い、提供していくことです。プロダクトアウトの対義語であり、「顧客が望むものを作る」「売れるものだ
けを作り、提供する」方法を指します。 

market inの意味 - 英和辞典 Weblio辞書 ※market in(マーケットイン)は和製英語。 造語?プロダクトアウト product-out - Yahoo!知恵袋

なんというか、「イートイン」とかもそうなんですが無理矢理意味不明な英語もどきで造語せんでもという気が。

■_

19 Eponymous Laws Of Software Development : programming 19 Eponymous Laws Of Software Development 興味を持って見に行ったら「Jul 16, 2007」って。 いやまあ知らない記事だったんで良いっちゃ良いんですが。

■_

■_

ああ、アレとかアレとかアレとか今日の分で書こうと思ってたのに

2013年01月19日

■_

行きたかったでござる Golangの寄り合い(タイトル仮) - Google+

なんか妙に勢いがあると思ったらダイオウイカのせいだった。 星野之宣を語れ Part15

■_ BASIC

ちょっと前についったでBASICネタを見かけましたが。 Why did Dijkstra Hate Basic? : programming

Why did Dijkstra Hate Basic?—programming is terrible

2013-01-10

Why did Dijkstra Hate Basic?

Dijkstra is an emminently quotable computer scientst, mostly for his famous lists of uncomfortable
truths. Oft repeated is his rallying call against BASIC, most of the time without context–

    It is practically impossible to teach good programming to students that have had a prior exposure
    to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

The essay itself was arguing “How do we tell truths that might hurt?”, when commonly accepted
problems are shrugged off or avoided. The answer turns out to be rather inflamatory. Dijskstra was
so effective at raising his arguments this way that we're still arguing about them now.


The thing people forget is that programming was substantially different in 1975. Dijkstra railed
against Dartmouth Basic—a glorified assembler language. It isn't the BASIC used today–

1975年と今ではプログラミングといったものがかなり違ったものであることを皆忘れてしまっています。
Dijkstra は Dartmouth Basic?a glorified assembler language に対していったのであり、
それは今日使われている BASIC とは違ったものなのです。

    Variables names were one letter long with an optional digit
    変数名は英字一文字か、それに数字ひとつをつけたもの

    Although FOR was present - while loops, break and other niceties were implemented with unrestricted goto.
    FOR はあったが、while ループや breakその他の niceties は unrestricted な goto で実装した

    Whitespace was optional between expressions.
    式の間の空白は省略可能だった

    Subroutines were available. GOSUB line number and RETURN.
    サブルーチンは使えた。

    All parameter passing had to be done with the existing global variables.
    すべてのパラメーター渡しはグローバル変数を使って行わなければならなかった

    26 user defined functions could exist FNA-FNZ, which could contain one line of code.
    FNAからFNZまでのユーザー定義関数を26個定義できたがコード一行しか書けなかった

    IF statements were also limited to one line of code.
    IF文もコード一行に制限されていた

I could go on about the limitations, but the consequecnes are pretty obvious: It was hard to write
readable and understandable code in. The features we take for granted now just weren't present. It
wasn't until after the article that BASIC began to grow up, into the language people know today.

この制限について書き続けることもできますが、結論は明らかです。
(このような制限は) readable な code や understandable な code を書くのを難しくします。


When you learn your first language, you continue to write programs in that style in other languages
(“You can write FORTRAN in any language”). The hardest part of growing as a programmer is not
accquiring new knowledge, but unlearning old habits in light of it.

Learning to carefully assembled a large ball of mud didn't help you to write structured programs.
Even today, it would be easier to teach someone a modern variant of basic if they'd had little or
no exposure to its grotesque ancestor. Although some sucessors still have a lot to answer for.

Programming is hard. Making it harder doesn't help beginners, or experts alike. Dijkstra hated
basic, but you would probably hate it too. It is a shame that Dijkstra is most remembered for his
vocal criticism rather than his vast contributions to programming, but that is another issue altogether.


でこういうのが

Why did Dijkstra Hate Basic? : programming

Dijkstra may have had good reason to hate early non-structured BASIC, but it is still in use today:

http://en.wikipedia.org/wiki/True_basic

http://en.wikipedia.org/wiki/DarkBASIC_Professional

http://channel9.msdn.com/Series/Visual-Basic-Development-for-Absolute-Beginners

whilst his own language has all but vanished into the mists of history:

http://www.cs.grinnell.edu/~stone/courses/compilers/introduction-to-Dijkstra.pdf

vanished into the mists of history 歴史の「闇」じゃないのね。

HOPL でも作者がいろいろ書いていたような > BASIC んで、こういう本もあるらしいです Amazon.co.jp: バック・トゥ・BASIC―開発者が語る言語の歴史と設計思想: ジョン・G. ケメニー, トーマス・E. カーツ, 松田 健生: 本 Amazon.co.jp: Back to Basic: The History, Corruption, and Future of the Language: John G. Kemeny, Thomas E. Kurtz: 洋書

番外。

Why did Dijkstra Hate Basic? : programming

How do you pronounce his name?


dike-stra

it's actually pronounced "dee yk stra" but most CS people say dike-stra.

ets-kher

「でぃーくすとら」?

■_

読んでる途中、積んでる間に翻訳本が出てしまったって何冊あるだろう ○| ̄|_

■_ 略称が多すぎる

どれがなにやら

OOPLA - What Does OOPLA Stand For? - Acronym Database PLDI 2013 :: Programming Language Design and Implementation PPoPP 2013 Home Page POPL 2013: 40th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages

■_ DLL hell?

大変だなあ。

msvcrt.dllのバージョンが違うiconv.dllが使えない · Issue #277 · vim-jp/issues

これか。 win-iconv - iconv implementation using Win32 API to convert. - Google Project Hosting

■_ 今日の丸投げ

統計ソフトRの問題(条件分岐、繰り返し構文) | その他(プログラミング)のQ&A【OKWave】

統計ソフトRの問題(条件分岐、繰り返し構文)
統計ソフトRを使って解く以下の問題の解法がわかりません。
「変数yは変数xの関数である。
 Y=y₁-y₂
ここで、y₁=5sin(2x),y₂=(x-1)²-x+1
-3<x<3の範囲では、dy/dx=0となる部分が4箇所存在する。
x=seq(-3,3,by=0.05)
としたとき、yが極大値をとる停留点(-3<x<3においては2箇所)の座標を条件分岐と繰り返し構文を用いて求めなさい。」

ということで


R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-w64-mingw32/i386 (32-bit)

> y1 <- function (x) { return(5 * sin(2 * x)) }
> y1(seq(-3,3,by=0.05))
  [1]  1.3970775  1.8693833  2.3230109  2.7534277  3.1563332  3.5277016
  [7]  3.8638224  4.1613372  4.4172733  4.6290734  4.7946214  4.9122631
 [13]  4.9808230  4.9996163  4.9684550  4.8876506  4.7580104  4.5808297
 [19]  4.3578789  4.0913856  3.7840125  3.4388308  3.0592895  2.6491807
 [25]  2.2126022  1.7539161  1.2777055  0.7887285  0.2918707 -0.2079033
 [31] -0.7056000 -1.1962466 -1.6749408 -2.1368994 -2.5775069 -2.9923607
 [37] -3.3773159 -3.7285261 -4.0424820 -4.3160468 -4.5464871 -4.7315004
 [43] -4.8692382 -4.9583241 -4.9978680 -4.9874749 -4.9272486 -4.8177909
 [49] -4.6601954 -4.4560368 -4.2073549 -3.9166345 -3.5867805 -3.2210884
 [55] -2.8232124 -2.3971277 -1.9470917 -1.4776010 -0.9933467 -0.4991671
 [61]  0.0000000  0.4991671  0.9933467  1.4776010  1.9470917  2.3971277
 [67]  2.8232124  3.2210884  3.5867805  3.9166345  4.2073549  4.4560368
 [73]  4.6601954  4.8177909  4.9272486  4.9874749  4.9978680  4.9583241
 [79]  4.8692382  4.7315004  4.5464871  4.3160468  4.0424820  3.7285261
 [85]  3.3773159  2.9923607  2.5775069  2.1368994  1.6749408  1.1962466
 [91]  0.7056000  0.2079033 -0.2918707 -0.7887285 -1.2777055 -1.7539161
 [97] -2.2126022 -2.6491807 -3.0592895 -3.4388308 -3.7840125 -4.0913856
[103] -4.3578789 -4.5808297 -4.7580104 -4.8876506 -4.9684550 -4.9996163
[109] -4.9808230 -4.9122631 -4.7946214 -4.6290734 -4.4172733 -4.1613372
[115] -3.8638224 -3.5277016 -3.1563332 -2.7534277 -2.3230109 -1.8693833
[121] -1.3970775
> y2 <- function (x) { return((x-1)**2 - x + 1) }
> y2(seq(-3,3,by=0.05))
  [1] 20.0000 19.5525 19.1100 18.6725 18.2400 17.8125 17.3900 16.9725
  [9] 16.5600 16.1525 15.7500 15.3525 14.9600 14.5725 14.1900 13.8125
 [17] 13.4400 13.0725 12.7100 12.3525 12.0000 11.6525 11.3100 10.9725
 [25] 10.6400 10.3125  9.9900  9.6725  9.3600  9.0525  8.7500  8.4525
 [33]  8.1600  7.8725  7.5900  7.3125  7.0400  6.7725  6.5100  6.2525
 [41]  6.0000  5.7525  5.5100  5.2725  5.0400  4.8125  4.5900  4.3725
 [49]  4.1600  3.9525  3.7500  3.5525  3.3600  3.1725  2.9900  2.8125
 [57]  2.6400  2.4725  2.3100  2.1525  2.0000  1.8525  1.7100  1.5725
 [65]  1.4400  1.3125  1.1900  1.0725  0.9600  0.8525  0.7500  0.6525
 [73]  0.5600  0.4725  0.3900  0.3125  0.2400  0.1725  0.1100  0.0525
 [81]  0.0000 -0.0475 -0.0900 -0.1275 -0.1600 -0.1875 -0.2100 -0.2275
 [89] -0.2400 -0.2475 -0.2500 -0.2475 -0.2400 -0.2275 -0.2100 -0.1875
 [97] -0.1600 -0.1275 -0.0900 -0.0475  0.0000  0.0525  0.1100  0.1725
[105]  0.2400  0.3125  0.3900  0.4725  0.5600  0.6525  0.7500  0.8525
[113]  0.9600  1.0725  1.1900  1.3125  1.4400  1.5725  1.7100  1.8525
[121]  2.0000
> Y <- function(x) { return( y1(x) - y2(x)) }
> Y(seq(-3,3,by=0.05))
  [1] -18.60292251 -17.68311668 -16.78698910 -15.91907229 -15.08366681
  [6] -14.28479837 -13.52617756 -12.81116279 -12.14272672 -11.52342659
 [11] -10.95537863 -10.44023694  -9.97917696  -9.57288371  -9.22154498
 [16]  -8.92484941  -8.68198963  -8.49167032  -8.35212114  -8.26111444
 [21]  -8.21598752  -8.21366920  -8.25071055  -8.32331930  -8.42739778
 [26]  -8.55858386  -8.71229449  -8.88377153  -9.06812928  -9.26040331
 [31]  -9.45560004  -9.64874665  -9.83494075 -10.00939940 -10.16750686
 [36] -10.30486072 -10.41731590 -10.50102606 -10.55248202 -10.56854683
 [41] -10.54648713 -10.48400044 -10.37923815 -10.23082405 -10.03786802
 [46]  -9.79997493  -9.51724865  -9.19029093  -8.82019543  -8.40853680
 [51]  -7.95735492  -7.46913455  -6.94678045  -6.39358844  -5.81321237
 [56]  -5.20962769  -4.58709171  -3.95010103  -3.30334665  -2.65166708
 [61]  -2.00000000  -1.35333292  -0.71665335  -0.09489897   0.50709171
 [66]   1.08462769   1.63321237   2.14858844   2.62678045   3.06413455
 [71]   3.45735492   3.80353680   4.10019543   4.34529093   4.53724865
 [76]   4.67497493   4.75786802   4.78582405   4.75923815   4.67900044
 [81]   4.54648713   4.36354683   4.13248202   3.85602606   3.53731590
 [86]   3.17986072   2.78750686   2.36439940   1.91494075   1.44374665
 [91]   0.95560004   0.45540331  -0.05187072  -0.56122847  -1.06770551
 [96]  -1.56641614  -2.05260222  -2.52168070  -2.96928945  -3.39133080
[101]  -3.78401248  -4.14388556  -4.46787886  -4.75332968  -4.99801037
[106]  -5.20015059  -5.35845502  -5.47211629  -5.54082304  -5.56476306
[111]  -5.54462137  -5.48157341  -5.37727328  -5.23383721  -5.05382244
[116]  -4.84020163  -4.59633319  -4.32592771  -4.03301090  -3.72188332
[121]  -3.39707749
> 

それっぽい数字がでてきたのでプロットしてみる

> plot(y1(seq(-3,3,by=0.05)))
> plot(y2(seq(-3,3,by=0.05)))
> plot(Y(seq(-3,3,by=0.05)))

出力結果はこちら。

みっつのプロットを一枚に合成したいなあと思って調べてみるとこんな感じでやるらしい (ちょっと失敗してるけど)

> plot(y1(seq(-3,3,by=0.05)),ann=F)
> par(new=T)
> plot(y2(seq(-3,3,by=0.05)),ann=F)
> par(new=T)
> plot(Y(seq(-3,3,by=0.05)))
> 

で、肝心の答えはどう求めるのがお手軽なんだろう。

■_ Google+

Google+ はいつ更新されたかわからんので、bkノートはご無沙汰なのだった (そりゃあ自分も Google+ に登録すれば。ということなんでしょうが、今のメールアドレスで 登録する気にはなれないんですよねえ)。 Island Life - メッセージキューの設計 bkノート - Google+ - パイプがなぜか詰まってしまう問題 #43 …

この辺も読んでなかった。 bkノート - Google+ - まぎらわしい仲間たち #42テストを書くときに使えるテクニックのひとつに...

■_

2013年01月18日

■_

アレとかアレを書き直そうかと思ってるんですが、今なら Markdown 辺り使うのがよいのかな。

社員食堂
某社社員の食事時の振る舞いが以下略

[ruby-core:51482] Helping Japanese-speaking Ruby hackers with English [ruby-core:51486] Re: Helping Japanese-speaking Ruby hackers with English [ruby-core:51492] Re: Helping Japanese-speaking Ruby hackers with English

■_ Powerなんとか

PowerShell でいんたらくちぶに PowerPoint のスライドをいぢる。


> $powerPoint = New-Object -ComObject PowerPoint.Application
> $presentation = $powerPoint.Presentations.Add($true)
> $slide = $presentation.Slides.Add(1, 12)
> $picture =$Slide.Shapes.AddPicture("C:\map-1st-001.jpg", $false, $true, 0, 0, 800, 600)
> $slide = $presentation.Slides.Add(2, 12)
> $slide.slideindex
2
> $picture =$Slide.Shapes.AddPicture("C:\map-1st-002.jpg", $false, $true, 0, 0, 800, 600)
> $slide = $presentation.Slides.Add(3, 12)
> $picture =$Slide.Shapes.AddPicture("C:\map-1st-003.jpg", $false, $true, 0, 0, 800, 600)
> $slide = $presentation.Slides.Add(4, 12)
> $picture =$Slide.Shapes.AddPicture("C:\map-1st-004.jpg", $false, $true, 0, 0, 800, 600)
> $presentation | gm

(略)
PageSetup                        Property   PageSetup PageSetup () {get}
Parent                           Property   IDispatch Parent () {get}
Password                         Property   string Password () {get} {set}
PasswordEncryptionAlgorithm      Property   string PasswordEncryptionAlgorit...
PasswordEncryptionFileProperties Property   bool PasswordEncryptionFilePrope...
PasswordEncryptionKeyLength      Property   int PasswordEncryptionKeyLength ...
PasswordEncryptionProvider       Property   string PasswordEncryptionProvide...
Path                             Property   string Path () {get}
Permission                       Property   Permission Permission () {get}
PrintOptions                     Property   PrintOptions PrintOptions () {get}
PublishObjects                   Property   PublishObjects PublishObjects ()...
ReadOnly                         Property   MsoTriState ReadOnly () {get}
RemovePersonalInformation        Property   MsoTriState RemovePersonalInform...
Research                         Property   Research Research () {get}
Saved                            Property   MsoTriState Saved () {get} {set}
SectionCount                     Property   int SectionCount () {get}
ServerPolicy                     Property   ServerPolicy ServerPolicy () {get}
SharedWorkspace                  Property   SharedWorkspace SharedWorkspace ...
Signatures                       Property   SignatureSet Signatures () {get}
SlideMaster                      Property   _Master SlideMaster () {get}
Slides                           Property   Slides Slides () {get}
SlideShowSettings                Property   SlideShowSettings SlideShowSetti...
SlideShowWindow                  Property   SlideShowWindow SlideShowWindow ...
SnapToGrid                       Property   MsoTriState SnapToGrid () {get} ...
Sync                             Property   Sync Sync () {get}
Tags                             Property   Tags Tags () {get}
TemplateName                     Property   string TemplateName () {get}
TitleMaster                      Property   _Master TitleMaster () {get}
VBASigned                        Property   MsoTriState VBASigned () {get}
VBProject                        Property   VBProject VBProject () {get}
WebOptions                       Property   WebOptions WebOptions () {get}
Windows                          Property   DocumentWindows Windows () {get}
WritePassword                    Property   string WritePassword () {get} {s...


> $presentation.PageSetup|gm


   TypeName: System.__ComObject#{91493466-5a91-11cf-8700-00aa0060263b}

Name             MemberType Definition
----             ---------- ----------
Application      Property   Application Application () {get}
FirstSlideNumber Property   int FirstSlideNumber () {get} {set}
NotesOrientation Property   MsoOrientation NotesOrientation () {get} {set}
Parent           Property   IDispatch Parent () {get}
SlideHeight      Property   float SlideHeight () {get} {set}
SlideOrientation Property   MsoOrientation SlideOrientation () {get} {set}
SlideSize        Property   PpSlideSizeType SlideSize () {get} {set}
SlideWidth       Property   float SlideWidth () {get} {set}

> $presentation.PageSetup.SlideOrientation
1
> $presentation.PageSetup.SlideOrientation
2

とこれだけではほとんどの人には通じないのであった。

■_ C

reddit と Hacker news で大層盛り上がっているこの話題 Damien Katz: The Unreasonable Effectiveness of CThe Unreasonable Effectiveness of C : programming The Unreasonable Effectiveness of C | Hacker News

Damien Katz: The Unreasonable Effectiveness of C

For years I've tried my damnedest to get away from C. Too simple, too many details to manage, too
old and crufty, too low level. I've had intense and torrid love affairs with Java, C++, and Erlang.
I've built things I'm proud of with all of them, and yet each has broken my heart. They've made
promises they couldn't keep, created cultures that focus on the wrong things, and made devastating
tradeoffs that eventually make you suffer painfully. And I keep crawling back to C.

C is the total package. It is the only language that's highly productive, extremely fast, has great
tooling everywhere, a large community, a highly professional culture, and is truly honest about its
tradeoffs.

Other languages can get you to a working state faster, but in the long run, when performance and
reliability are important, C will save you time and headaches. I'm painfully learning that lesson
once again.

以下略

そして続編とそれに対する反応。 Damien Katz: Follow up to "The Unreasonable Effectiveness of C"Damien Katz: Follow up to "The Unreasonable Effectiveness of C" : programming Follow up to "The Unreasonable Effectiveness of C" | Hacker News

Damien Katz: Follow up to "The Unreasonable Effectiveness of C"

My post The Unreasonable Effectiveness of C generated a ton discussion on Reddit and Hacker News,
nearly 1200 comments combined as people got in to all sorts of heated arguments. I also got a bunch
of private correspondence about it.

So I'm going to answer some of the most common questions, feedback and misunderstandings it's gotten.

Is C the best language for everything?

Hell no! Higher level languages, like Python and Ruby, are extremely useful and should definitely be
used where appropriate. Java has a lot of advantages, C++ does too. Erlang is amazing. Most every
popular language has uses where it's a better choice.

But when both raw performance and reliability are critical, C is very very hard to beat. At Couchbase
we need industrial grade reliability without compromising performance.

以下略

もうちょっと詳しく追いかけようと思ったんだけど ↓

■_

InfoQ の記事にもnari。 Is C Still A Suitable Language Today?

Is C Still A Suitable Language Today?

Is C Still A Suitable Language Today?

Posted by Abel Avram on Jan 18, 2013

Damien Katz, Couchbase, believes that C is still a great language for back-end programming, while
other developers argue that C has too many flaws, supporting C++ or Java, while others like neither.

In a recent blog post entitled The Unreasonable Effectiveness of C, Damien Katz, the Creator of
CouchDB, affirms that C is a great language for the back-end, supporting it in spite of more modern
languages such as C++ , Java, or even Erlang or Ruby. Katz does not think C is simply better than
any other language out there, but when “raw performance and reliability are critical, C is very,
very hard to beat,” - quote taken from a subsequent post meant to clarify his position.

While initially doing much of CouchDB in Erlang, Katz became unhappy with it after spending
“2+ man/months dealing with a crash in the Erlang VM”:

    We wasted a ton of time tracking down something that was in the core Erlang implementation,
    never sure what was happening or why, thinking perhaps the flaw was something in our own
    plug-in C code, hoping it was something we could find and fix. It wasn't, it was a race
    condition bug in core Erlang. We only found the problem via code inspection of Erlang. This is
    a fundamental problem in any language that abstracts away too much of the computer.

(以下略)

これは翻訳記事出るだろうしねえ

■_

ざっと見たところこの辺はちょっと面白かったかな

fakehalo comments on Damien Katz: Follow up to "The Unreasonable Effectiveness of C"

People complain about C by comparing it to other languages. Do you have to deal with memory
corruption problems in Ruby like you do in C? No. Do Java or C# have better debug tools? Yes. But,
in my opinion, there is no better language to get closer to the metal and give full control to a
programmer than C. I don't know anyone that thinks everything, or even most things, should be written
in C. But, certain things should only be written in C and you can't say that for many languages.

おまけ。 C2 Programming Language - refreshed C (packages, no headers,...) : programming http://www.c2lang.org http://github.com/c2lang/c2compiler

■_

2013年01月17日

■_

三月発売予定だそうで。 2013年3月新刊予定:型システム入門 プログラミング言語と型の理論 - オーム社開発部

そりゃあ落選するよねえ、わし ○| ̄|_

型システム入門 プログラミング言語と型の理論 発売ニュースに沸き立つTL - Togetter

■_ 関数型言語

関数型言語を独学で勉強している学生です への答 - Oh, you `re no (fun _ → more) はてなブックマーク - 関数型言語を独学で勉強している学生です への答 - Oh, you `re no (fun _ → more) 関数型言語を独学で勉強している学生です に対する私的考え - pocketberserkerの爆走 関数型言語を独学で勉強している学生です - その他([技術者向] コンピューター) - 教えて!goo

■_ 地獄

地獄への道は善意で舗装されているとは - はてなキーワード が、わたしのついったのTLで良く流れてきたんですが (DHH のアレが発端。 Rails Hub情報局: プログラミング地獄への道は“ベストプラクティス”で敷き詰められている でもあのエントリわたしの方が先に…いや云うまい)、 いったのマキャベリじゃなかったっけと思ったら これと混同していた模様 マキャベリ(ニッコロ・マキャヴェッリ) - 天国に行くのに最も有効な方法は、地獄へ行...

マキアヴェッリ語録 (新潮文庫)
マキアヴェッリ語録 (新潮文庫)

■_

■_

ヤマト2199観に行く時間がががが

2013年01月16日

■_

今朝も凍った路面でこける自転車を数台目撃。

まだ最初の辺りをちょっと読んだところなんですが、こいつは「当たり」じゃないかという感触 エレメンタルデザインパターン―パターンの基礎を学び、より有効に活用する くわしくはまた。

■_ Javaのアレ

翻訳記事が出ましたが It's time to rewrite Java from scratch, security expert says | PCWorld セキュリティ専門家「Javaはスクラッチで作り直す時期に来ている」 | セキュリティ・マネジメント | トピックス | Computerworld - エンタープライズITの総合ニュースサイト 「スクラッチで作り直す」とか「スクラッチで(ゼロから)書き直す」 ってどうしてこうなるの。 原文はこう It's time to rewrite Java from scratch, security expert says Oracle needs to take some core components of Java and write them from scratch 原文も「from scratch」を何回使ってるんだw

Now is a good time to rewrite some core components from scratch and insure that they're bug-free, rather than patching the application from one version to another, Botezatu said. ボテザツ氏は、「古いバージョンのJavaに繰り返しパッチを当てて対処するよりも、幾つかのコア・コンポーネントを完全に作り直して、バグを確実にゼロにするべき時が来ている」と主張する。 なんかニュアンスが違うような? 全面的な書き直しが必要だとして、書き直せば満足できるものができるかどうかはわからんわけで (設計を見直す。ってことならまあそうなんだろうけど「Bug-Free」が「保証」できるかは 微妙ですよね)。 元記事にしてからが説明不足な感が。

「Java 7 Update 11でも脆弱性は残っているから引き続きJava無効化を」という話について | 情報科学屋さんを目指す人のメモ セキュリティ専門家曰く「Javaは作り直す時期に来ている」 | スラッシュドット・ジャパン セキュリティ

■_

なんだってこんなに盛り上がってるんだろう Taking over programming position from a grad student going to IBM... found this code - Imgur : programming Taking over programming position from a grad student going to IBM... found this code - Imgur - Imgur

■_

■_

どよーん

2013年01月15日

■_

テレ玉でやってるガンダムも「光る宇宙」まで来た。後2話。

次はZ かー テレ玉 -アニメ

■_ 寄付

まだ半分行ってないのか Redline Smalltalk V1.0 | Indiegogo

■_

2013年01月14日

■_

MIT 白熱教室第二回
今回も面白く見たんですが、今回やったのと同じようなことを高校の物理で やったような記憶があるんですが(実験はああいうものではありませんでしたけどw そういや一回目の講義の内容も…)、 あの講義ってどういう位置づけのものなんでしょうか? 本を読めば分かるのかな。 研究者やエンジニアを目指す優秀な学生が世界中から集まるこのMITで46年にわたって物理学の基礎講義を教えるのがウォルター・ルーウィン教授。 (NHK MIT白熱教室 番組概要) ふむ。

オライリーの新刊見てたら気になるタイトルが View Updating and Relational Theory - O'Reilly Media んーどうしよう。

Pragprog で電書二冊購入。どっちもまだβだし、 すぐに翻訳されそうな気もするんだけど…w The Pragmatic Bookshelf | Explore It! The Pragmatic Bookshelf | The Healthy Programmer

翻訳と云えばこの本はされないんですかねえ。 良い本だと思うんだけど。翻訳する人がいないなら自分が(それは無理 The Pragmatic Bookshelf | Driving Technical Change

amazonさんから「お前にこれをお勧めしてやる」なメールが来たんですが、 どなたかどんな感じの本かご存じではないですか? Mathematical Logic for Computer Science: Mordechai Ben-Ari: 9781447141280: Amazon.com: Books

■_ なれる!SE

名古屋の方にはむりやり同僚に読ませてる人がいるらしいすね (こっちはむしろ良いのか?)

【なれる!SE】夏海公司スレ16【葉桜が来た夏】

354 イラストに騙された名無しさん [sage] 2013/01/14(月) 08:07:19.45 ID:aEqTz24s Be:
    今年高校卒業する友人の息子がコンピュータ関係の専門学校志望してるんだが、なれるSE貸してやるべきだろうか。 

■_ Java

ブラウザ設定変更で無効化を推奨:Java 7に未パッチの脆弱性、すでに攻撃も発生 - @IT で、 Twitter / crazybob: Oracle should have deprecated ... とか Straight from Joel's "Things Not To Do" series: A "security expert" says it's time to rewrite Java : programming とか It's time to rewrite Java from scratch, security expert says | PCWorld

■_ 同僚にコードがひどいと言われたら

Ask Slashdot: How To React To Coworker Who Says My Code Is Bad? - Slashdot 同僚にコードがひどいと言われたら、どう反応すればいい? | スラッシュドット・ジャパン Slashdotに聞け

同僚にコードがひどいと言われたら、どう反応すればいい? | スラッシュドット・ジャパン Slashdotに聞け

私は今の会社で10年以上働いており、いくつもの製品開発サイクルにかかわってきた。しかし、最近チームに
加わった見習いの開発者が、私のコードの出来がひどいと言い出した。わが社のコードベースにはおよそ5万行
のコードがある。私のコードに対する苦情は、彼の経験が浅く、コードが何をしているのかを理解していない
のが原因だ。彼は頭がよく非常に有望であり、良い質問をしていると思う。しかし、どうすれば彼自身が誰よ
りも優れているという考えを捨て、時間をかけて内容を学ぶように説得できるだろうか。

ざっと見た感じ、一番良いと思った回答はこれかなあ。

Ask Slashdot: How To React To Coworker Who Says My Code Is Bad? - Slashdot

This is an ancient problem, with 10 years experience I'm amazed you haven't run into this constantly
throughout your entire career. New guys (even old guys) perceive everything they didn't write as shit.

How you deal with it is dependent on a lot of things.

First: is he right? Maybe your code does suck. Hell maybe you suck! At minimum. code that has been
around for a while, has been written by multiple people over a long period of time, been adjusted
and re-worked to meet changing requirements, and been done under a deadline usually does suck at
least a little. Admitting this is hard.

New guys want to re-write everything and don't understand the value of code maturity... most of the
time a re-write isn't practical, and even the shittiest code usually attains remarkable stability
by virtue of having all the bugs pounded out through years of use. Reminding him that this isn't a
university project and a certain level of ugliness should be expected might help.

If you don't think he's right, learn how to properly describe why you do things the way you did,
and conversely expect him to explain why they are wrong. This is the biggest thing to learn when
doing code reviews, and applies here. If you can't objectively describe what is wrong using with
references to either standard or internal best practices or conventions, arguing code ugliness just
becomes subjective. If you want to defend your code, learn how to describe how it doesn't suck.

Having some company guidelines will really help, because it gives you something to point at in
defending a decision. Ultimately what one guy considers good code may be considered bad by another.
You are always going to have cases where someone thinks your code is too abstract, or not abstract
enough, or sacrifices too much performance for maintainability, or too much maintainability for
performance. At least with standards, the new devs will rail against the standards rather than
personally attack you, and a standards document is a lot easier to defend (and yet still allows
good changes without too much politics of hurt feelings).

質問者の提示している情報が少なくて、軽々には回答を言えないような気はするのよね。

■_

The future of programming - O'Reilly Radar

■_

■_

うーむ。アレとかアレとかやっつけるつもりだったんだけどなあ。

2013年01月13日

■_

season2 の円盤どうしようか。 DVD & Blu-ray 情報 | 孤独のグルメ Season2:テレビ東京 同じタイミングで season1 のBlu-ray も出るのね。 孤独のグルメ Blu-ray BOX |テレビ東京「テレ東本舗。WEB」

■_ 都電荒川線

早稲田(駅? 停留所?)の変わりっぷりにびっくりした MOMO's Diary:明日は電車ライブ♪

いつ頃こうなったのか知りたかったんだけどよくわからんかった。 早稲田駅 (東京都交通局) - Wikipedia 新目白通りが拡張されるまでは家並みに囲まれた専用軌道上にあったが、道路拡張時に家屋の移転と共に、 都電の線路も道路中央に軌道が位置するように移設されて現在の位置になっている。かつての軌道は高戸橋方面に向かう車道に変わった。 都電荒川線の停車場所は「停留場」であるが、最寄の交差点の名前は「都電早稲田駅」である。

都電32系統1974・2早稲田 都電荒川線★早稲田電停★今昔 オフ会記念 1

世田谷線三軒茶屋駅の変わりっぷりも結構なもんか。 世田谷線三軒茶屋駅今昔物語。|鉄道に駅があるように道路にも駅があっていいじゃないか♪|ブログ|スーパー道の駅探索人|みんカラ - 車・自動車SNS(ブログ・パーツ・整備・燃費) 世田谷線 三軒茶屋駅 - Wikipedia

■_

haskell-ja > Archives > 2013/01/11 から。 Amazon.co.jp: Pearls of Functional Algorithm Design: Richard Bird: 洋書 って積んでる本かと思ったけど、何年何月何日に注文していますな表示がないから買ってないはずだなw

haskell-ja > Archives > 2013/01/11

ikegami__
Richard Bird 先生の "Pearls of Functional Algorithm Design", 2010 って日本語訳になっていたり、
あるいは、これからなる予定ありますか? : http://www.amazon.co.jp/dp/0521513383

ikegami__

「すごい Haskell 読書会 in 大阪 #3 」に、PFDS (en) FoP (ja) IFPH (ja) を持参します。
PFAD は読んだ記憶があるのですが僕の書庫に見当たらない…

もう一回探したら PFAD (en) 見つかりました。計 4 冊を持っていきます。
理由は次に読んでみたい本はこれらかなあという気がするので。異論は認めます、お聞かせください

nobsun
現在翻訳作業中でございます.> ikegami__さん

ikegami__

やっぱり(ガッテンガッテン) > nobsun

いけがみさんがこう言ってる本なら悪い本ではないはずだ。 とはいえ原著をぽちる勇気が…

■_ Perl 6

Perl 6 changes - 2013W02 | π ** 6

Perl 6 changes - 2013W02
2013-01-12

I'm going to show another Perl 6 changes article. I'm so lazy, that I really don't know what to put
here, so I guess I'll now show the list of new features.

New features

Perl 6 specification

    --> (return type) acts more like a normal subroutine parameter.

    Added squish method, working like uniq utility in UNIX - it only removes elements if it is duplicate of previous element.

    Adjusted precedence of set operators.

squish メソッドは面白そう。わざわざ作るものだろうかという気もするんだけど。 squishの意味 - 英和辞典 Weblio辞書

--> はどこかで見たような… C++11 - Wikipedia 尻尾が短かった!

■_ 今日の丸投げ

プログラミングに自信のある方是非解答をお願いします | C・C++のQ&A【OKWave】

プログラミングに自信のある方是非解答をお願いします | C・C++のQ&A【OKWave】

プログラミングに自信のある方是非解答をお願いします
問題は以下です。
以下のプログラムは、整数の数式を入力して、式の値を求めて表示するプログラムである。
このプログラムを発展させて、さらに高機能にせよ。(何をする機能を加えたかについての解説もお願いします。)

  #include <stdio.h>
  #include <stdlib.h>
  #include <ctype.h>

  static int ch;

  void error(char *s)
  {
      fprintf(stderr, "%s\n", s);
      exit(EXIT_FAILURE);
  }

  void nextch()
  {
      do {
          if ((ch = getchar()) == EOF) return;
      }while (ch == ' ' || ch == '\t');
  }

  double number()
  {
      double x, a;
      int sign = '+';

      if (ch == '+' || ch == '-') {
          sign = ch; nextch();
      }
      if (! isdigit(ch)) error("Not a number or '(' is required.");
      x = ch - '0'; nextch();
      while (isdigit(ch)) {
          x = 10 * x + ch - '0';
          nextch();
      }
      if (ch == '.') {
          a = 1; nextch();
          while (isdigit(ch)) {
              x += (a /= 10) * (ch - '0');
              nextch();
          }
      }
      return sign == '-' ? -x : x;
  }

  double expression();

  double factor()
  {
      double x;

      if (ch != '(') return number();
      nextch(); x = expression();
      if (ch != ')') error("')' is required,");
      nextch(); return x;
  }

  double term() {
      double x, y;

      x = factor();
      while (1) {
          if (ch == '*') {
              nextch(); x *= factor();
          } else if (ch == '/') {
              nextch(); y = factor();
              if (y == 0) error("Zero division");
              x /= y;
          } else break;
       }
       return x;
  }

  double expression()
  {
      double x;

      x = term();
      while (1) {
          if (ch == '+') {
              nextch(); x += term();
          } else if (ch == '-') {
              nextch(); x -= term();
          } else break;
      }
      return x;
  }

  int main()
  {
      double x;

      nextch(); x = expression();
      if (ch != '\n') error("Syntax error");
      printf("%g\n", x);
      return EXIT_SUCCESS;
  }

どうみても number は小数も扱ってるように見えるんだが… 回答者にもわけわからんこと書いてるのがいるし。

■_ Code Interview Reading List

面接の際のあれこれから Coding for Interviews Code Interview Reading List | Hacker News

いますよねー、なにかというと「この休暇中に読んでおくべき n 冊」とかやる人。 んでこのご意見。

Code Interview Reading List | Hacker News

The problem with any book list like this is the scope. Software is turning into a very diverse
culture, a very heterogeneous ecosystem. Subjects that are very important to one area might not be
as important to other areas. Design patterns are essential for enterprise development, not so much
for AI and low level systems programming. Algorithms are essential for the latest but not for the
former.

Given this, there are some books you might add or remove depending on the area you are interested
(e.g.: Knuth's "Art of Computer Programming", Martin Fowler's "Patterns of Enterprise
Application Architecture", ...)

To finish, 2 books people recommend a lot for beginning programmers:

"The Pragmatic Programmer"- Hunt, Thomas: a very good book, with sound advice and very
easy to read. The only bad side is that it became so influential that its ideas became vulgarized in
thousands of blogs.

"Code Complete" - Steve McConnel : A very dangerous book. It does give have a lot of sound
advice. But, IMO, it has some big problems. First is that it gives the false impression that there
is a lot of empirical evidence on what works on software engineering. Second, it perpetuates some
myths that don't have such evidence: the "orders of magnitude programmer's productivity"
and "the cone of uncertainty" (see: https://leanpub.com/leprechauns).

■_ (Python の)辞書

Python: The Dictionary Playbook - Amir Rachum から。 あまり使い込んでないから、↓のようなのとかいざってときに出てこなかった(思い出せなかった)りするのよねん。

Python: The Dictionary Playbook - Amir Rachum

4. The “Make It Happen”

Sometimes your dictionary contains mutable objects, and you want to initialize and modify them.
Let's say you're sorting out some data into a dictionary where the values are lists (examples
courtesy of this answer in Stack Overflow)

Spelling It Out

  dct = {} 
  for (key, value) in data: 
      if key in dct: 
          dct[key].append(value) 
      else: 
          dct[key] = [value]

Getting Down with the Python

  dct = {} 
  for (key, value) in data:
      group = dct.setdefault(key, []) # key might exist already 
      group.append(value)

What setdefault(key, default) does is returns dct[key] if it exists, and if it doesn't - sets it
to default and returns it. Compared to get, it's useful when the default value is an object you
can modify, so you don't have to manually reinsert its modified version to the dictionary.

Rocking it Out

  dct = defaultdict(list) 
  for (key, value) in data: 
      dct[key].append(value) # all keys have a default already

defaultdict is pretty awesome. It's pretty self-explanatory - it's a dict with default values.
This means that every access to a key in dct that doesn't exist in the dictionary (that would
usually raise a KeyError) creates it with the default value. It's as if every access to dct is
done with setdefault.

One interesting use I've found for defaultdict is when implementing sparse data structures. You set
defaultdict to the default value and use coordinates (or whatever is applicable) as the key. I've
used this to represents multi-dimensional grids and it's definitely easier than using intricately
wrapped lists. 

An even more interesting example of its use is the one-line tree definition.

削った方にあった Counter とかも覚えとかなきゃだわ。

■_ Moe

Scala で Perl を実装しようとかなんとか Perl is not Dead, it is a Dead End (forking Perl 5) : perl Perl is not Dead, it is a Dead End // Speaker Deck

stevan/moe · GitHub

Moe

An -OFun prototype of an Ultra Modern Perl 5 written in Scala.
Wait, what are you talking about?

Over time there will be more and more information in this README, but for the time being I will
start by sharing an email discussion I had with Nicolas Clark about what it is that I am trying
to do here.

>> On Jan 12, 2013, at 1:10 PM, Nicholas Clark <nick@ccl4.org> wrote:
> Quite possibly I'm telling you things you already know,

Honestly, anything you tell me will almost certainly contain a lot of 
things I don't know. I have never attempted to write a language outside of
a few simple lambda calculus interpreters I wrote a few years back. With 
my project, I hope to attract others (both inside and outside the perl 
community) to hack on this.

I do not in any way believe that what I release this afternoon will be the 
final product, my primary goal right now is to spur innovation and bring 
the discussion of a "new core" out from the dark corners and into the full 
light of day. 

> 
> but strikes me that there is at least some level of distinction between 
> parser/codegen, VM, and runtime libraries.

Right now I have the following:

- a runtime, which I am fairly happy with (still needs some work, but I 
  think the core is where I would like it to be)
- an AST, which I know is still missing a lot of stuff, but again I have 
  a foundation
- an Interpreter, this just evaluates the AST and is only like 20% of the 
  AST at the moment, but is a start (and an easy place for people to 
  start hacking)
- no parser at all to speak of

I know that an AST interpreter is slow as dirt, but I also know that having 
an AST makes it easier to write a true compiler as well (possibly to target 
multiple VMs etc). I also know that a stable AST is very important for good 
tooling support (IDE autocompletes, etc). 

I originally started to write this in Java, after looking over a few different 
languages, but after two rough implementations I kept finding myself running 
into Java's annoying type system. So I have settled now on Scala, for a few 
of reasons:

1) It can interoperate with Java and that entire ecosystem
2) It is enough of a functional programming language to be really nice for 
   writing compilers in, and enough of an OOP language to be easy for those 
   not as familiar with FP
3) The language actually feels Perl-ish 
4) It is a useful skill, so if Perl is really dead, then we can all learn 
   a new skill and move on ;)

(略)

Discussion of this

I have created no formal communications channel for discussing this project, that will come over the
next few days/weeks as needs dictate.

Moe?

Modern Perl (Moose) - OS dependency (the JVM) = Moose - OS = Moe

What about Perl 6

I need to come up with a clear position statement on how this interfaces with the Perl 6 effort, but
for now I will say this.

I believe that Perl 6 is the future, but I believe that it will only benefit Perl 6 to have a more
modern Perl 5 that it can interface with. And one of the key goals of this effort is exactly that,
to move Perl 5 closer to Perl 6 on all levels (syntax, runtime, etc.).

■_

2013年01月12日

■_

意図的に空白にしています

■_

年初恒例のこれにいってまいりました。
こちらに背を向けている方はどこの出版社だったかしら(聴き逃した)。 他は手前から技術評論社、ソフトバンク、奥から二人目がオーム社、一番奥がオライリー。 だったかと。 ジュンク堂書店 池袋本店トークセッション情報

年間総合、月別のランキングを見て感じたことなど。

追記 "『このコンピュータ書がすごい! 2013年版』"に参加してきた #compbook - 角谷HTML化計画(2013-01-12)「新春座談会 このコンピュータ書がすごい! 2013年版」に行ってきました! - Take A Party 3位パターン認識と機械学習の学習―ベイズ理論に挫折しないための数学 現地で見たときは黄色い表紙の本だったと思うのですが、、、amazonにはこれしかなかったです。 黄色い表紙カバーを取り外すと書影の表紙が現れます。最初は黄色いカバーなしで売ってたんですよね。 中身はたぶん同じじゃないかな(誤字等の修正はあるかもしれないけど)。 しかし全部アフィリエイトつきかこれw

この本と同じパターンで、LLVM本置いたら結構売れるんじゃあなかろうか (外野の無責任な意見です きつねさんとおぼえるLLVM の訂正個所 - 餅ちゃんの備忘録)。

■_ 2199

あーいつ観に行けるやら。

佐藤大輔 86

289 名無し三等兵 [sage] 2013/01/11(金) 22:29:19.09 ID:??? Be:
    朝日で連載中のプロメテウスの罠の今シリーズは佐藤節に変換して読むと色々と妄想できる。

    そういや夕方5時台にヤマトのリメイクが始まるんだってな。 

290 名無し三等兵 [sage] 2013/01/11(金) 23:15:57.98 ID:??? Be:
    >>289
    イベント上映とか映像ソフト販売は一昨年から始まってる。
    明日から第四章の上映だから見に行って限定Blu-ray買ってくる 

291 名無し三等兵 [sage] 2013/01/12(土) 07:50:54.95 ID:??? Be:
    ヤマト、今映画館だが見事にオッサンばっかりだな。
    いや、若い子もいるけどさ… 

292 名無し三等兵 [sage] 2013/01/12(土) 20:40:30.38 ID:??? Be:
    今日はアーカードにアンデルセンの二人が揃って舞台挨拶してたぞ
    >ヤマト第4章上映 

293 名無し三等兵 [sage] 2013/01/12(土) 21:00:13.97 ID:??? Be:
    中田譲治の声やっぱカッコええな。 

294 名無し三等兵 [sage] 2013/01/12(土) 22:25:11.42 ID:??? Be:
    夕方5時って小中学生対象だよね。
    今の子供たちはそもそも戦艦大和知らないだろうし、第一話の沈められた大和見てもポカーンじゃないの?
    それとも新ヤマトはその辺から改変されてるの? 

295 名無し三等兵 [sage] 2013/01/12(土) 23:46:08.69 ID:??? Be:
    今回は沈没戦艦大和のリサイクルではなく
    宇宙戦艦ヤマト本体に偽装をかぶせている扱い。
    設定上スケールアップしてるほか、実際の大和がばらばらに
    壊れちゃってるからねぇ…。 

296 名無し三等兵 [sage] 2013/01/12(土) 23:50:59.67 ID:??? Be:
    >295
    そうなのか…
    もはやヤマトの名前を使う意味が無くなってるな。 

295 の設定は知らなかった(読み落としたかな)。 自分が観に行ったときは(これまで上映された分だけど)思った以上に 若い人(特に女性)いるなあという感じだったなあ。 時間帯とかにもよるんだろか。

■_

If anyone knows what COBOL is, and needs a good site to give a breif overview, here you go! : programming コメントの 「An old copypasta」 は訳したいところだけど… しかし copypasta なんつー単語があるですか Copypasta | Know Your Meme

If anyone knows what COBOL is, and needs a good site to give a breif overview, here you go! : programming

If anyone knows what COBOL is, and needs a good site to give a breif overview, here you go! (csis.ul.ie)

An old copypasta:

Jack, a COBOL programmer, after years of being taken for granted and treated as a technological
dinosaur by all the UNIX programmers and Client/Server programmers and website developers, finally
started getting some respect in 1994. He'd become a private consultant specializing in Year 2000
conversions. He was working short-term assignments. He was working 70 and 80 and even 90 hours a
week, but it was worth it.

After a few years of this relentless, mind-numbing work, Jack started having problems sleeping and
began having anxiety dreams about the Year 2000. It had reached a point where even the thought of
the year 2000 made him nearly violent. He must have suffered some sort of breakdown, because all he
could think about was finding a way he could avoid the year 2000 and all that came with it.

Jack made a deal with the company that specialized in cryogenics to have himself frozen until March
15, 2000. This was a very expensive process and totally automated. He was thrilled. The next thing
he would know is he'd wake up in the year 2000; after the New Year celebrations and computer
debacles; after the leap year. Nothing else to worry about except getting on with his life.

He was put into his cryogenic receptacle, the technicians set the revive date, he was given
injections to slow his heartbeat to a bare minimum, and that was that.

The next thing that Jack saw was an enormous and very modern room filled with excited people. They
were all shouting "I can't believe it!" and "It's a miracle" and "He's alive!".
There were cameras (unlike any he'd ever seen) and equipment that looked like it came out of
science fiction movie. Someone who was obviously a spokesperson for the group stepped forward. Jack
couldn't contain his enthusiasm. "Is it over?" he asked "Is 2000 already here? Are the 
millennial parties and promotions and crisis's all over and done with?"

The spokesman explained that there had been a problem with the programming of the timer on Jack's
cryogenic receptacle: it hadn't been year 2000 compliant. It was actually eight thousand years later,
not the year 2000. But the spokeman told Jack that he shouldn't get excited; someone important wanted
to speak to him. A wall-sized projection screen displayed the image of a man that looked very much
like Bill Gates. This man was Prime Minister of Earth. He told Jack not to be upset. That this was a 
wonderful time to be alive. That there was world peace and no more starvation. That the space program
has been reinstated and there were colonies on the moon and on Mars. That technology had advanced to
such a degree that everyone had virtual reality interfaces which allowed them to contact anyone else
on the planet, or to watch any entertainment, or to hear any music recorded anywhere.

"That sounds terrific," said Jack. "But I'm curious. Why is everybody so interested in me?"

"Well," said the Prime Minister. "The year 10000 is just around the corner, and it says
in your files that you know COBOL."


I opted for FORTRAN77.


Hey grandpa.


I took COBOL at University past year. I'm traumatized. :|

traumatize って単語あったのね。

んで Introduction to COBOL

Introduction to COBOL

Since the ellipsis symbol is placed outside the curly brackets we can interpret this to mean that
each result field can have its own ROUNDED phase. In other words we could have a COMPUTE statement
like -

   COMPUTE Result1 ROUNDED, Result2 = ((9*9)+8)/5

where Result1 would be assigned a value of 18 and Result2 would be assigned a value of 17.8.

なにこれ。

■_

■_

TMTで保存していたタブにあったんだけど、なんで入れたんだっけこの本。 Amazon.co.jp: Constructive Logics for Program Correctness: Ito Takayasu: 本 kinaba さんあたりのツイートからキーワード拾ったのかなあ。 Constructive logic - Encyclopedia of Mathematics

2013年01月11日

■_

憂国のラスプーチン 6 (ビッグ コミックス)
憂国のラスプーチン 6 (ビッグ コミックス)
最終巻。 読み始めたのは偶然から(「星を継ぐもの」連載で買い始めた雑誌に載っていた)だけど 面白く読めた(ってこういう表現もどうかと思うけども)。 なんというか、「裏を読もう」と考えることが多くなった気がする。 ひねくれの度が増したとも云うかもしれないけど :)

ヤマト 2199
今回はMXで特番やんないのかしら

■_ 表紙

効果は(良い方悪い方両方で)どうだったんだろうか 建築知識「普通の子に戻ります」(←正気に戻った) : 市況かぶ全力2階建 建築知識の一覧|雑誌・書籍|X-Knowledge(エクスナレッジ)

■_ inplace edit

何の気なしに、gawkのリポジトリの更新情報を見ていましたら 「inprace」なんつーものが。 メンテナーの Arnold がいつもそんなの要らないと蹴っていたのですがこれは一体 [gawk-diffs] [SCM] gawk branch, master, updated. 8a64478e8d953ed249ecd18 [gawk-diffs] [SCM] gawk branch, master, updated. 1abfe5e82822a9e81a3bd1d

[gawk-diffs] [SCM] gawk branch, master, updated. 8a64478e8d953ed249ecd18

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=8a64478e8d953ed249ecd18a8ec7fb19f69c167c

commit 8a64478e8d953ed249ecd18a8ec7fb19f69c167c
Author: Andrew J. Schorr <address@hidden>
Date:   Thu Jan 10 13:12:01 2013 -0500

    Add tests for inplace extension.

diff --git a/extension/ChangeLog b/extension/ChangeLog
index 7fea3bf..33fb645 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-10         Andrew J. Schorr     <address@hidden>
+
+       * inplace.c (do_inplace_begin): No need to get the 2nd suffix argument,
+       since it is not currently used in this function.
+
 2013-01-08         Andrew J. Schorr     <address@hidden>
 
        * inplace.c: New extension to implement in-place editing.
diff --git a/extension/inplace.c b/extension/inplace.c
index 69b188b..31f21b6 100644
--- a/extension/inplace.c
+++ b/extension/inplace.c
@@ -93,7 +93,7 @@ invalid_filename(const awk_string_t *filename)
 static awk_value_t *
 do_inplace_begin(int nargs, awk_value_t *result)
 {
-       awk_value_t filename, suffix;
+       awk_value_t filename;
        struct stat sbuf;
        char *p;
        int fd;
@@ -109,8 +109,10 @@ do_inplace_begin(int nargs, awk_value_t *result)
        if (! get_argument(0, AWK_STRING, &filename))
                fatal(ext_id, _("inplace_begin: cannot retrieve 1st argument as 
a string filename"));
 
-       if (! get_argument(1, AWK_STRING, &suffix))
-               suffix.str_value.str = NULL;
+       /*
+        * N.B. In the current implementation, the 2nd suffix arg is not used
+        * in this function.  It is used only in the inplace_end function.
+        */
 
        if (invalid_filename(&filename.str_value)) {
                warning(ext_id, _("inplace_begin: disabling in-place editing for invalid FILENAME `%s'"),

extension/ の下にあるってことは、実行時にロードする拡張機能として実装したのかな

ここで入ったっぽい

[gawk-diffs] [SCM] gawk branch, master, updated. 1abfe5e82822a9e81a3bd1d
--- a/awklib/ChangeLog
+++ b/awklib/ChangeLog
@@ -1,3 +1,7 @@
+2013-01-08         Andrew J. Schorr     <address@hidden>
+
+       * eg/lib/inplace.awk: Add new file generated from doc/gawk.texi.
+
 2012-12-24         Arnold D. Robbins     <address@hidden>
 
        * 4.0.2: Release tar ball made.
--- a/doc/gawk.info
+++ b/doc/gawk.info
(略)
-16.6.4 Character and Numeric values: `ord()' and `chr()'
+16.6.4 Enabling in-place file editing.
+--------------------------------------
+
+The `inplace' extension emulates the `sed' `-i' option.  It uses the
+bundled `inplace.awk' include file to invoke the extension properly:
+
+     # inplace --- load and invoke the inplace extension.
+
+     @load "inplace"
+
+     # Please set INPLACE_SUFFIX to make a backup copy.  For example,
+     # you may want to set INPLACE_SUFFIX to .bak on the command-line or in a
+     # BEGIN block.
+
+     BEGINFILE {
+       inplace_begin(FILENAME, INPLACE_SUFFIX)
+     }
+     ENDFILE {
+       inplace_end(FILENAME, INPLACE_SUFFIX)
+     }
+
+   For each regular file that is processed, the extension redirects
+stdout to a temporary file configured to have the same owner and
+permissions.  After the file has been processed, stdout is restored to
+its default destination.  If `INPLACE_SUFFIX' is not an empty string,
+the original file will be linked to a backup filename created by
+appending that suffix.  Finally, the temporary file is renamed to the
+original filename.
+
+   If any error is encountered, the extension issues a fatal error to
+terminate processing immediately without damaging the original file.
+
+   Here are a couple of simple examples:
+
+     $ gawk -i inplace '{gsub(/foo/, "bar")} {print}' file1 file2 file3
+
+   To keep a backup copy of the original files, try this:
+
+     $ gawk -i inplace -vINPLACE_SUFFIX=.bak '{gsub(/foo/, "bar")} {print}' 
file1 file2 file3
+
+   It is left as an exercise to write a wrapper script that presents an
+interface similar to the `sed' `-i' option.
+
--- /dev/null
+++ b/extension/inplace.c
@@ -0,0 +1,241 @@
+/*
+ * inplace.c - Provide support for in-place editing.
+ */
+
+/*
+ * Copyright (C) 2013 the Free Software Foundation, Inc.
+ * 
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ * 
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid)  gettext(msgid)
+#define N_(msgid) msgid
+
+static const gawk_api_t *api;  /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "inplace extension: version 1.0";
+
+int plugin_is_GPL_compatible;
+
+static struct {
+       char *tname;
+       int default_stdout;
+       int posrc;      /* return code from fgetpos */
+       fpos_t pos;
+} state = { NULL, -1 };
+
+/*
+ * XXX Known problems:
+ * 1. Should copy ACL.
+ * 2. Not reentrant, so will not work if multiple files are open at
+ *    the same time.  I'm not sure this is a meaningful problem in practice.
+ */
+
+static void
+at_exit(void *data, int exit_status)
+{
+       if (state.tname) {
+               unlink(state.tname);
+               free(state.tname);
+               state.tname = NULL;
+       }
+}
+
+/*
+ * N.B. Almost everything is a fatal error because this feature is typically
+ * used for one-liners where the user is not going to be worrying about
+ * checking errors.  If anything unexpected occurs, we want to abort
+ * immediately!
+ */
+
+static int
+invalid_filename(const awk_string_t *filename)
+{
+       return filename->len == 0 ||
+               (filename->len == 1 && *filename->str == '-');
+}
+
+/* do_inplace_begin --- start in-place editing */
+
+static awk_value_t *
+do_inplace_begin(int nargs, awk_value_t *result)
+{
+       awk_value_t filename, suffix;
+       struct stat sbuf;
+       char *p;
+       int fd;
+
+       assert(result != NULL);
(略)
+       rewind(stdout);
+       return make_number(0, result);
+}
+
+/* do_inplace_end --- finish in-place editing */
+
+static awk_value_t *
+do_inplace_end(int nargs, awk_value_t *result)
+{
+       awk_value_t filename, suffix;
+
+       assert(result != NULL);
+
(略)
+       if (rename(state.tname, filename.str_value.str) < 0)
+               fatal(ext_id, _("inplace_end: rename(`%s', `%s') failed (%s)"),
+                       state.tname, filename.str_value.str, strerror(errno));
+       free(state.tname);
+       state.tname = NULL;
+       return make_number(0, result);
+}
+
+static awk_ext_func_t func_table[] = {
+       { "inplace_begin", do_inplace_begin, 2 },
+       { "inplace_end", do_inplace_end, 2 },
+};
+
+static awk_bool_t init_inplace(void)
+{
+       awk_atexit(at_exit, NULL);
+       return awk_true;
+}
+
+static awk_bool_t (*init_func)(void) = init_inplace;
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, inplace, "")

色々議論があったらしい。 [bug-gawk] in-place edit request

■_ The Unreasonable Effectiveness of C

大変盛り上がっております。 The Unreasonable Effectiveness of C | Hacker News The Unreasonable Effectiveness of C : programming

訳すのはちと面倒そうだな>元記事

Damien Katz: The Unreasonable Effectiveness of C

The Unreasonable Effectiveness of C

For years I've tried my damnedest to get away from C. Too simple, too many details to manage, too
old and crufty, too low level. I've had intense and torrid love affairs with Java, C++, and Erlang.
I've built things I'm proud of with all of them, and yet each has broken my heart. They've made
promises they couldn't keep, created cultures that focus on the wrong things, and made devastating
tradeoffs that eventually make you suffer painfully. And I keep crawling back to C.

C is the total package. It is the only language that's highly productive, extremely fast, has great
tooling everywhere, a large community, a highly professional culture, and is truly honest about its
tradeoffs.

Other languages can get you to a working state faster, but in the long run, when performance and
reliability are important, C will save you time and headaches. I'm painfully learning that lesson
once again.

Simple and Expressive

(略)

Initially for performance reasons, we started increasingly rewriting more of the Couchbase code in C,
and choosing it as the first option for more new features. But amazingly it's proven much more
predictable when we'll hit issues and how to debug and fix them. In the long run, it's more productive.

I always have it in the back of my head that I want to make a slightly better C. Just to clean up
some of the rough edges and fix some of the more egregious problems. But getting everything to fit,
top to bottom, syntax, semantics, tooling, etc., might not be possible or even worth the effort. As
it stands today, C is unreasonably effective, and I don't see that changing any time soon.

■_ 乱数生成

関連付いてないけど回答かなこれ。

…わからん(単純に足し算しちゃいけないのはわかる)。 Perl 6 だと思うけど $0 ってなんだったっけか。 Perl 5 までとは変わったはず。

時間経過

なんとなくわかって来たけど、+0.5 はなんのためなんだろう?

■_


一つ前へ 2013年1月(上旬)
一つ後へ 2013年1月(下旬)

ホームへ


リンクはご自由にどうぞ

メールの宛先はこちらkbk AT kt DOT rim DOT or DOT jp