■_
TNG パトレイバー第4章観てきた。
一つ前へ
2014年8月(中旬)
一つ後へ
2014年9月(上旬)
久しぶりの shibuya.lisp、なにも YAPC::Asia にぶつけんでも… とはいえ今年の8月~9月の週末は色々あるからなあ(先週の土曜はLL Diverがあったし)。 Shibuya.lispテクニカル・トーク#8 : ATND
書影がついたのでぺたり
ナポレオン ~覇道進撃~ (7) (ヤングキングコミックス)
ルイ=ニコラ・ダヴー
ルイ=ニコラ・ダヴー - Wikipedia
軍事面で「不敗のダヴー」と呼ばれるほど優秀であったほか、
これはハセガー作品発祥じゃないかなあw>「不敗のダヴー」(という渾名)
Louis-Nicolas Davout - Wikipedia, the free encyclopedia Nickname(s) The Iron Marshal, The Beast
Louis Nicolas Davout — Wikipédia Surnom « Le Maréchal de fer » « La Bête »
GNU grep の変更も一段落したっぽいのですが grep.git - grep fix integer-width bugs in undossify_input etc. なんてのが目についたのでチェック
* src/dosbuf.c (undossify_input): Return size_t, not int. * src/grep.c (fillbuf): Work portably even if safe_read returns a value greater than SSIZE_MAX, e.g., if there's an I/O error. --- diff --git a/src/dosbuf.c b/src/dosbuf.c index 9ac2d13..3b4052a 100644 --- a/src/dosbuf.c +++ b/src/dosbuf.c @@ -90,15 +90,15 @@ guess_type (char *buf, size_t buflen) } /* Convert external DOS file representation to internal. - Return the count of characters left in the buffer. + Return the count of bytes left in the buffer. Build table to map character positions when reporting byte counts. */ -static int +static size_t undossify_input (char *buf, size_t buflen) { if (! O_BINARY) return buflen; - int chars_left = 0; + size_t bytes_left = 0; if (totalcc == 0) { @@ -126,7 +126,7 @@ undossify_input (char *buf, size_t buflen) if (*buf != '\r') { *destp++ = *buf++; - chars_left++; + bytes_left++; } else { @@ -176,7 +176,7 @@ undossify_input (char *buf, size_t buflen) } } - return chars_left; + return bytes_left; } return buflen; diff --git a/src/grep.c b/src/grep.c index 5e6c5c6..6b930dc 100644 --- a/src/grep.c +++ b/src/grep.c @@ -397,7 +397,7 @@ static int grepdesc (int, int); static void dos_binary (void); static void dos_unix_byte_offsets (void); -static int undossify_input (char *, size_t); +static size_t undossify_input (char *, size_t); static int is_device_mode (mode_t m) @@ -583,7 +583,7 @@ reset (int fd, struct stat const *st) static int fillbuf (size_t save, struct stat const *st) { - ssize_t fillsize; + size_t fillsize; int cc = 1; char *readbuf; size_t readsize; @@ -645,7 +645,7 @@ fillbuf (size_t save, struct stat const *st) readsize -= readsize % pagesize; fillsize = safe_read (bufdesc, readbuf, readsize); - if (fillsize < 0) + if (fillsize == SAFE_READ_ERROR) fillsize = cc = 0; bufoffset += fillsize; fillsize = undossify_input (readbuf, fillsize);
ふうむ。
YAPC 行ってきた以下略
Robert C. Seacord (著), 歌代和正 (翻訳), 久保正樹 (翻訳),
1/1000 の成功率で成功するまでの試行回数を求めたいと思った。で、R。
> f <- function() { cnt<-1;while(1==1){v<-runif(1); if(v<0.001) return(cnt); cnt=cnt+1;}} > f() [1] 117 > f() [1] 231 > f() [1] 539 > f() [1] 139 > f() [1] 1307 > f() [1] 5056 > f() [1] 106 > f() [1] 794 > f() [1] 70 > f() [1] 1003 > f() [1] 246 > f() [1] 1683 > f() [1] 1416 > f() [1] 444 > rep(1,10) [1] 1 1 1 1 1 1 1 1 1 1 > rep(1,10)->xx > sapply(xx,f) [1] 1091 1913 1005 1519 889 2072 1591 743 1365 28 > sapply(xx,f) [1] 338 802 104 215 733 60 1011 229 104 649 > ll<-rep(1,1000) > sapply(ll,f) [1] 389 458 350 16 757 2260 868 1566 1181 580 1720 1872 323 [14] 3706 36 754 1046 1940 1150 1240 1558 2412 1676 655 723 684 (略) [976] 274 1796 412 1052 1793 671 265 44 1258 444 1621 47 699 [989] 699 278 1875 1702 585 29 928 1070 339 954 755 558 > sapply(ll,f)->data > max(data) [1] 5537 > min(data) [1] 1 > mean(data) [1] 974.847
などとあーでもないこーでもないとやってしまったが、 実は組み込みのもの一つで済んでしまうという
> rgeom(100000, 0.001)->dd > > max(dd) [1] 14180 > summary(dd) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.0 289.0 694.0 999.9 1385.0 14180.0
で、プロットしてみた。
> plot(1:100000,dd,type="h",lwd=1)
さすがに要素数が大きすぎるので先頭の1000個だけで。
> plot(1:1000,dd[1:1000],type="h",lwd=1)
最大値けっこうでかくなるんだなあ。
「ご意見募集」→「ファイルサーバーに置いてるExecl のファイルに書いていってね」→ 「○○さん(意見募集した人)が編集中なので読み取り専用でオープンします」 → どうしろとw
この辺から Embedded in Academia : Proposal for a Friendly Dialect of C : programming Proposal for a Friendly Dialect of C | Hacker News
Embedded in Academia : Proposal for a Friendly Dialect of C ざっくり略 Here are some features we propose for friendly C: The value of a pointer to an object whose lifetime has ended remains the same as it was when the object was alive. Signed integer overflow results in two’s complement wrapping behavior at the bitwidth of the promoted type. Shift by negative or shift-past-bitwidth produces an unspecified result. Reading from an invalid pointer either traps or produces an unspecified value. In particular, all but the most arcane hardware platforms can produce a trap when dereferencing a null pointer, and the compiler should preserve this behavior. Division-related overflows either produce an unspecified result or else a machine-specific trap occurs. If possible, we want math- and memory-related traps to be treated as externally visible side-effects that must not be reordered with respect to other externally visible side-effects (much less be assumed to be impossible), but we recognize this may result in significant runtime overhead in some cases. The result of any signed left-shift is the same as if the left-hand shift argument was cast to unsigned, the shift performed, and the result cast back to the signed type. A read from uninitialized storage returns an unspecified value. It is permissible to compute out-of-bounds pointer values including performing pointer arithmetic on the null pointer. This works as if the pointers had been cast to uintptr_t. However, the translation from pointer math to integer math is not completely straightforward since incrementing a pointer by one is equivalent to incrementing the integer-typed variable by the size of the pointed-to type. The strict aliasing rules simply do not exist: the representations of integers, floating-point values and pointers can be accessed with different types. A data race results in unspecified behavior. Informally, we expect that the result of a data race is the same as in C99: threads are compiled independently and then data races have a result that is dictated by the details of the underlying scheduler and memory system. Sequentially consistent behavior may not be assumed when data races occur. memcpy() is implemented by memmove(). Additionally, both functions are no-ops when asked to copy zero bytes, regardless of the validity of their pointer arguments. The compiler is granted no additional optimization power when it is able to infer that a pointer is invalid. In other words, the compiler is obligated to assume that any pointer might be valid at any time, and to generate code accordingly. The compiler retains the ability to optimize away pointer dereferences that it can prove are redundant or otherwise useless. When a non-void function returns without returning a value, an unspecified result is returned to the caller.© 2014 John Regehr
小説フランス革命。最終刊も発売してすぐに買ったのだけどなぜかなかなか読み進められず 未だに読み終わってない(今は1/3くらい)。
【関東の天気 2014年8月26日】今日は雲が優勢の空模様で、午後ほどザッと強い雨が降ります。外出の際には折りたたみ傘を持ってください。昼間はあまり気温が上がらず、すごしやすくなりそうです。
— 特務機関NERV (@UN_NERV) 2014, 8月 25
↑のような「ほど」の使い方が気になる今日この頃
出たばかりの文庫版皇国の守護者6巻の巻末を見て、 新書版6巻の発売時期を思い出して軽く目眩が。
wyvernのつづき(波が去ってからネチネチ追いかける)
reddit か HN で話題になってないかなー と思って探したら HN にあった。
The Wyvern Programming Language | Hacker News Compile-time HTML parsing, &c.? Absolutely. This sort of thing is part of why I came to Rust; while it doesn’t make these sorts of things as easy as it looks like Wyvern does, it does make them readily possible (the pragmatic side of me also selected it as it’s ). I will be featuring some of the ideas of these sorts of things in my talk at Strange Loop next month (https://thestrangeloop.com/sessions/fast-secure-safe-the-web...), and a brief look at this suggests that I’ll be mentioning Wyvern.If that is something that you are interested in then you should definitely take a look at Nimrod (if you haven't already; http://nimrod-lang.org). Nimrod's compile-time features are what makes it great, you can essentially run most Nimrod code at compile-time (ffi is limited but you can use staticRead if you wanna read your HTML templates). From a quick look at Wyvern it actually looks surprisingly similar to Nimrod, so much so that i wonder if Wyvern was perhaps a little bit inspired by it. I'm having a hard time figuring out what differentiates Wyvern from Nimrod in fact.
で、GIZMODE(英)よりも前の日付でこういうものも。 Wyvern system allows multiple programming languages within one computer program
つまりは例によってまた珍妙な翻訳記事に脊髄反射(のようなもの)をした御仁が多かったと。
Wyvernプログラミング言語のサイトの論文を眺め読みしてました。
静的型付き言語で売りはユーザ定義リテラルとメタクラスらしく、なかなか面白そうだなあと思いました。
— ななかなn+ε号機 (@n7k7)
2014, 8月 23
というかこれ、Wyvernの開発者側は「すべての言語を統一する」なんて言ってなくて、単にひとつのWebアプリを単一の言語で書けるようにするのを目的にしてるって言ってるだけでは。
ギズモードがミスリードしすぎ。 http://t.co/B7GaYCi97j
— えいとす (a.k.a あちょす) (@athos0220)
2014, 8月 22
「ブレークポイント」けっこう面白い
未来では全てのプログラミング言語が1つになる? : ギズモード・ジャパン はてなブックマーク - 未来では全てのプログラミング言語が1つになる? : ギズモード・ジャパン
例によってこういうものは原文に当たるべき。ということで The NSA Is Funding a Project to Roll All Programming Languages Into One
The NSA Is Funding a Project to Roll All Programming Languages Into One The "polyglot" programming language is called Wyvern—the name comes from a a mythical dragon-like reature with two legs instead of four—and is designed to help unify the way apps and websites are created. The researchers explain:
未来では全てのプログラミング言語が1つになる? : ギズモード・ジャパン 伝説上のドラゴンの名前を取って、その名も「Wyvern」(ワイバーン)と名付けられたこのプロラミング言語は、アプリケー ションやウェブサイト作りにおいて複数の言語が入り乱れている状況を改善するべく、開発が進められているんだとか。
えーと「伝説上のドラゴン」ってどこから来たの? ワイバーン - Wikipedia それはそれとして、原文の mythical dragon-like reature の最後の単語は creature の間違いかなあ。
順番が前後するけど
未来では全てのプログラミング言語が1つになる? : ギズモード・ジャパン HTML5やJavaScript、PHPにCSS、XMLなどなど…挙げだせばキリが無いプログラミング言語。分野ごとに違ったものがスタ ンダードをとっている為、プログラマーは複数の言語を学ばなければならないケースが多いです。そんな問題を解決する ため、アメリカ国家安全保障局(NSA)がカーネギーメロン大学に出資して、1つの統一言語を作るプロジェクトを進めてい るんだそう。
これの原文はこう
The NSA Is Funding a Project to Roll All Programming Languages Into One Why bother having to learn HTML5, JavaScript, PHP, CSS and XML, when you could just learn one? Well, that's exactly what an NSA-funded project at Carnegie Mellon University seeks to achieve. The "polyglot" programming language is called Wyvern (略
翻訳文の「統一言語」って「polyglot programming language」のことなのかなあ。 なんか意味が違っちゃうような気がするんだけど polyglot → 統一
The New NSA-Funded Code Rolls All Programming Languages Into One | Motherboard
タカニ・アートワークス ~鋼(はがね)の超絶技巧画報~ 髙荷義之展
LL Diver 行ってきた。以上。
いやもう、いろんなところできちんとした記事があがるんでそっちまかせでいいかなーと。 Gura はちょっと興味を引かれた Guraプログラミング言語の紹介 #lldiver - by shigemk2
日本初の Swift本、どんなもんだろか(以下略)
8/21新刊:ISBN978-4-7775-1851-7 工学社 『はじめてのSwiftプログラミング』 清水美樹著 15冊入荷 Objectiv-Cの後継となる言語“Swift”の初の解説書です!
— ジュンク堂書店池袋本店/PC書 (@junkudo_ike_pc) 2014, 8月 21
お、なんか面白そうな本が。
新刊好評発売中
『学んでみよう!記号論理』高崎金久著2700円(日本評論社)
「数学の論理」と「論理の数学」
この違いわかりますか? http://t.co/PA8jR991Xg
— 書泉グランデMATH (@rikoushonotana) 2014, 8月 22
んで、数理論理学の近刊にこんなのが 数理論理学 合理的エージェントへの応用に向けて|コロナ社 著者のひとりが新出さんだー
社員食堂の業者が変わったのだけれども(ry
いろいろあるねえ。 1万件を超えるイベントを主催して、学んだ教訓 | Doorkeeper
東横線が多摩川渡るところでニコタマ(二子玉川)で建設中の高いビルが見えるんだよねー。 ビルそのものより建設用クレーンの方に興味があるんだけどw 楽天、2015年8月をめどに二子玉川に移転--新築オフィスへ - CNET Japan
先月今月辺りの発売のオライリー本なんかはイベント会場で買おうかと思ったが、 早速今週の土曜に LL なんちゃらがあった。
一つ前へ
2014年8月(中旬)
一つ後へ
2014年9月(上旬)
リンクはご自由にどうぞ
メールの宛先はこちら