ときどきの雑記帖 倒行逆施編

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

一つ前へ 2015年1月(中旬)
一つ後へ 2015年2月(上旬)

ホームへ

2015年01月31日

■_

図書館のwebサイトなんですけどね。わたしが住んでいるところの公立図書館の。 あそこが使いづらいここがイマイチといくつか挙げられるんですが、 PC 用とi-mode 用がある(それしかない)ってのは時代を感じさせるというか なんというか……

はてなブックマーク - 理科の実験で「アルコールランプ」が使われなくなった理由 (週刊SPA!) - Yahoo!ニュース わしが小学生の頃(昭和n0年代)からほぼガスバーナーだったがなあ。 実際に小学校で使用しているのはガスバーナーではなくガスコンロ。 ってコメントがあったけど ガスバーナー - Google 検索 ガスコンロ - Google 検索 理科の実験ではたしかにこの「ガスバーナー」だった。

■_

■_

日の出/日の入り時刻の変化のチャートを LibreOfiice の calc で (Excel での操作をやろうとしてできずにむきーとなること度々w)。 今回は日の出日の入りの時刻そのものではなくて、 それぞれの最も遅い/早い時間との差でプロットしています。 y軸の値は1日(24時間)を1.0としての時間です (これ分かりやすい時間表記に戻せないかなあ。それと冬至のところに縦線入れたい)。 あ、あと期間が2014年10月1日から2015年3月31日までになってます。

2015年01月30日

■_

Reinventing software for security; or: The woodpeckers are coming. : Caffeinated Bitstream

最近 ~ for Kids とかタイトルのついた本が多いような> No Starch Press Teach Your Kids to Code | No Starch Press

SRGM で、ちょっと面白そうな論文を見つけたのだけど 例によって試せないんだよなあ。 どこかに良いデータないものか。

de facto standard。を「デファクト」と書かれるとこうむずがゆさがですね (話し言葉でならまあなんとか)…… デファクトスタンダード - Wikipedia

アワーズ。 ドリフターズはお休み。 皇帝陛下の先行きに暗雲が…

■_

■_

Zed の Learn C the Hard Way に噛みついてる? A critique of Zed Shaw's "Learn C The Hard Way" : programming Tim Hentenaar's Blog

Tim Hentenaar's Blog

Don't Learn C the Wrong Way

(略)

Recently, I came across an e-book written by Zed A. Shaw entitled Learn C The Hard Way, and while I can commend the author for spending the time and energy to write it, I would NOT recomend it to anyone seriously interested in learning the C programming language. In fact, if you were one of the unlucky souls who happened to have purchased it. Go right now and at least try to get your money back! (略)

The whole point of this article is this: Don't learn C the wrong way. Do your own research, learn as much as you can, read K&R C, dig around and read other people's code, ask questions on IRC, etc. Don't just take anyone's word for it, not even mine.
以下略

元気があれば訳すところなんだけど任せた(誰に?『)

2015年01月29日

■_

お、新しいのが(ちょっと前からでてたけどPDFはなかった) Technology Radar Digital Edition | ThoughtWorks

sh なんかの、"'` の使い分けがああなった経緯ってのはどこ調べればわかるだろうか。

■_

2015年01月28日

■_

今日はこれに尽きますか glibc の脆弱性 CVE-2015-0235(通称:GHOST)についてまとめてみた - piyolog 解説はここが一番詳しいかな oss-security - Qualys Security Advisory CVE-2015-0235 - GHOST: glibc gethostbyname buffer overflow

The Problem Hound Solves のところをみると中々面白そうな? Announcing Hound: A Lightning Fast Code Search Tool - Code as Craft

■_

■_

なんかまた話題になってた NASA's 10 rules for safety critical C code : programmingNASA’s 10 rules for developing safety-critical code - SD Times

NASA's 10 rules for safety critical C code : programming

No function pointers? Ouch.

In these safety-critical embedded systems its usual to forbid the use of recursive functions because of the danger of using up all the available stack space. One of the problems with function pointers is that they can "mask" some kinds of recursive code in a way that is not detected by static analysis tools.

The problem with function pointers is that they're basically impossible to verify for correctness at compile time.
Using an object-oriented language (like a highly reduced subset of C++) actually helps here, because vtables are created statically. You can statically analyze polymorphic function calls.

んで元記事から

1: Restrict all code to very simple control flow constructs. Do not use GOTO statements, setjmp or longjmp constructs, or direct or indirect recursion.

2: All loops must have a fixed upper bound. It must be trivially possible for a checking tool to statically prove that a preset upper bound on the number of iterations of a loop cannot be exceeded. If the loop-bound cannot be proven statically, the rule is considered violated.

3: Do not use dynamic memory allocation after initialization.

4: No function should be longer than what can be printed on a single sheet of paper (in a standard reference format with one line per statement and one line per declaration.) Typically, this means no more than about 60 lines of code per function.

5: The assertion density of the code should average a minimum of two assertions per function. Assertions must always be side effect-free and should be defined as Boolean tests.

6: Data objects must be declared at the smallest possible level of scope.

7: Each calling function must check non-void function return values, and the validity of parameters must be checked inside each function.

8: Preprocessor use must be limited to the inclusion of header files and simple macro definitions. Token pasting, variable argument lists (ellipses), and recursive macro calls are not allowed.

9: The use of pointers should be restricted. Specifically, no more than one level of dereferencing is allowed. Pointer dereference operations may not be hidden in macro definitions or inside typedef declarations. Function pointers are not permitted.

10: All code must be compiled, from the first day of development, with all compiler warnings enabled at the compiler’s most pedantic setting. All code must compile with these setting without any warnings. All code must be checked daily with at least one—but preferably more than one—state-of-the-art static source code analyzer, and should pass the analyses with zero warnings.

ふむ。まあそれほど意外でもない?

■_

2015年01月27日

■_

某アニメ番組でカバーしていた曲を聴いて、 カバー元のオリジナルも聴いてみたら気に入ったという事例を見かけてちょっと嬉しかったり。 TVアニメ「ローリング☆ガールズ」主題歌集 「人にやさしく」THE ROLLING GIRLS
TVアニメ「ローリング☆ガールズ」主題歌集 「人にやさしく」THE ROLLING GIRLS ミート・ザ・ブルーハーツ~ベスト・コレクション・イン・USA
ミート・ザ・ブルーハーツ~ベスト・コレクション・イン・USA

あ、なんだこれ。 THE BLUE HEARTS 30th ANNIVERSARY ALL TIME MEMORIALS ~SUPER SELECTED SONGS~【完全初回限定生産盤】(3CD+DVD)
THE BLUE HEARTS 30th ANNIVERSARY ALL TIME MEMORIALS ~SUPER SELECTED SONGS~【完全初回限定生産盤】(3CD+DVD) THE BLUE HEARTS 30th ANNIVERSARY ALL TIME MEMORIALS ~SUPER SELECTED SONGS~【CD2枚組通常盤】
THE BLUE HEARTS 30th ANNIVERSARY ALL TIME MEMORIALS ~SUPER SELECTED SONGS~【CD2枚組通常盤】 THE BLUE HEARTS 30th ANNIVERSARY ALL TIME MEMORIALS ~SUPER SELECTED SONGS~【CD3枚組通常盤】
THE BLUE HEARTS 30th ANNIVERSARY ALL TIME MEMORIALS ~SUPER SELECTED SONGS~【CD3枚組通常盤】

30周年かあ……

■_

■_

あとで読む(んじゃないかな) Bug 1183461 – CVE-2015-0235 glibc: __nss_hostname_digits_dots() heap-based buffer overflow

2015年01月26日

■_

中身を確かめてから買いたい洋書(しかもお高い)が何冊かあって困る。 えいやで買っちゃえるほど余裕ないしねえ。

■_

■_

浮動小数点数のおハナシ。 gd reflections: A story about an angry carrot and a floating point fairy

■_

Python編。 The-Skas/Python-20StringAlgorithms

The-Skas/Python-20StringAlgorithms

Going through Strings Algorithms in python. Please feel free to contribute to any of the questions I haven't done!

http://javarevisited.blogspot.co.uk/2015/01/top-20-string-coding-interview-question-programming-interview.html

■_ R で

はて、何を書こうと思ってたんだっけか。

2015年01月25日

■_

オインゴとボインゴのデュエット アニメ「ジョジョ」27話の特別エンディングテーマを配信 - ねとらぼ 買ってみた:)

まーたー? NVD - Detail Unspecified vulnerability in Adobe Flash Player through 13.0.0.262 and 14.x, 15.x, and 16.x through 16.0.0.287 on Windows and OS X and through 11.2.202.438 on Linux allows remote attackers to execute arbitrary code via unknown vectors, as exploited in the wild in January 2015.

■_

■_

今日は一歩も外へ出なかった。

2015年01月24日

■_

News|ガンダム Gのレコンギスタ サントラは4月かー 仕様:CD3枚組 え?

今日の重箱の隅。 Ruby開発者・まつもとゆきひろ氏の新言語「Streem」のソースコードを読んでみよう! ~ 文法と構造を規定する「lex.l」と「parse.y」 (3/4):CodeZine flexはlexのGNU版です。 について。gnu,org に flex のページ (Flex) がありますが Flex is a free (but non-GNU) implementation of the original Unix lex program. To download the software, get the documentation, and more, please see the Flex home page. ということで、 flex: The Fast Lexical Analyzer が Flex home page。

■_

■_ 20の質問

Top 20 String Algorithm Questions from Coding Interviews から。

  1. How to Print duplicate characters from String?
  2. How to check if two Strings are anagrams of each other?
  3. How to program to print first non repeated character from String?
  4. How to reverse String in Java using Iteration and Recursion?
  5. How to check if a String contains only digits?
  6. How to find duplicate characters in a String?
  7. How to count number of vowels and consonants in a String?
  8. How to count occurrence of a given character in String?
  9. How to convert numeric String to int?
  10. How to replace each given character to other e.g. blank with %20?
  11. How to find all permutations of String?
  12. How to reverse words in a sentence without using library method?
  13. How to check if String is Palindrome?
  14. How to remove duplicate characters from String?
  15. How to check if a String is valid shuffle of two String?
  16. Write a program to check if a String contains another String e.g. indexOf()?
  17. How to return highest occurred character in a String?
  18. Write a program to remove a given characters from String?
  19. Write a program to find longest palindrome in a string?
  20. How to sort String on their length in Java?

■_

6 Greatest Books on Programming for the 21st century and their Influence on World’s Top Programmers | Gift Ideas

■_

Keep It Simple, i'm Stupid.:2015年1月24日分 にあったパッチに見慣れない関数が。

+	buf = strndup(p, llen);
+	if (buf == NULL) {
+		*he = NETDB_INTERNAL;
+		return NULL;

これか Man page of STRDUP

Man page of STRDUP

strndup():

    glibc 2.10 以降:
        _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700 
    glibc 2.10 より前:
        _GNU_SOURCE 

strdupa(), strndupa(): _GNU_SOURCE  
準拠

strdup() は SVr4, 4.3BSD, POSIX.1-2001 準拠である。 strndup() は POSIX.1-2008 準拠である。 strdupa(), strndupa() は GNU 拡張である。

ふむふむ。2008はほとんど見てねーや。 strndup.c

2015年01月23日

■_

「世界の艦船」2015年3号目次 お、今月号の特集は 「日米超ド級戦艦比較論」とな。 って、Royal Navy は……?

仕事場の会話で「えーあい」って単語が頻出してて 人工知能 (Artificial Inteligence) なんか使うのかー と思ったら実は Action Item の頭字語をそのまま読んでいたというオチ。 ヤメレw

できるのかーと思いつつ Anonymous programmers can be identified by analyzing coding style reddit の Anonymous programmers can be identified by analyzing coding style : programming can we find out who satoshi is now then? 見て笑ってしまった (Bitcoinの人ね>satoshi)

■_

■_

日の出と日の入りの時刻の変化。 東京(東京都): Tokyoのこよみ月の出入り (東京(東京都): Tokyo - 2014/10-12)日の出入り (東京(東京都): Tokyo - 2015/01-03) からデータをいただいて、ぐぐるさんでプロット。 できれば左側の axis を日の出時刻、右側の axis を日の入り時刻のようにして 一枚のチャートにしたかったんだけど使い方が良くわからんかった。

日の出時刻の変化(2014年12月~2015年3月 日の入り時刻の変化(2014年12月~2015年3月

へー。日の出が最も遅い日や日の入りが最も早い日は冬至とはずれてるとは知ってたけどこんな感じなのね。

■_

まだ読んでない Please do not break our language

This post is addressed to PHP's core developers who are proposing to break our beloved language yet again in the next major version of PHP (version 7) by removing functionality which has worked perfectly for years simply because it does not fit in with their ideas of how it should be done today. I am talking about PHP RFC: Remove PHP 4 Constructors (and this post on php.internals) which proposes that all code with PHP 4 style constructors be made invalid in favour of the "correct" method which was introduced in PHP 5. This is despite the fact that both types of constructor have lived quite happily side by side for over a decade and that large volumes of code, including PEAR libraries, were written in the PHP 4 style.

色んな人がいるんだねえ。 と斜め上に感想を言ってみる。

■_ fgetln

こーゆーのを読んでたんですが Man Page for fgetln (freebsd Section 3) - The UNIX and Linux Forums

Man Page for fgetln (freebsd Section 3) - The UNIX and Linux Forums

SYNOPSIS
     #include <stdio.h>

     char *
     fgetln(FILE *stream, size_t *len);

DESCRIPTION
     The fgetln() function returns a pointer to the next line from the stream referenced by
     stream.  This line is not a C string as it does not end with a terminating NUL character.
     The length of the line, including the final newline, is stored in the memory location to
     which len points.	(Note, however, that if the line is the last in a file that does not end
     in a newline, the returned text will not contain a newline.)

DESCRIPTION の stream referenced by stream. のところでちょっと悩んだんだけど、 後ろの stream はパラメータ(の名前)ってことでいいんだろか。

2015年01月22日

■_

ウィリアムズ、FW37の画像を公開 【 F1-Gate.com 】 37……マンセルが乗ってた頃のは14とかだったっけ。 ウィリアムズ・FW14 - Wikipedia

某社某事業所の昼休みは前半後半に別れてるんですが それのローテーションが一年単位なんですね。 以前は半年単位だったのですが、夏場三ヶ月前後イカサマータイムで 昼休みの時間が変則になるためなのか一年単位になったと。 んが、長いわやっぱり。 「後番」にされると割ばかり食ってしかたがない。

なんだろうこの本 Amazon.co.jp: ハッカーの学校: IPUSIRON: 本 これか。 ロングセラー『ハッカーの教科書』10年ぶりの最新作。 ハッカーとはどのような知識を持ち、どのような手順でサーバーに侵入して情報を盗むのか?サーバー侵入達成までの具体的な流れを知識の浅い方にも実践できるよう、ハッキングの技術を順を追って丁寧に解説します。 なるほど。

■_

2015年01月21日

■_

TVアニメ「ローリング☆ガールズ」主題歌集 「人にやさしく」THE ROLLING GIRLS
TVアニメ「ローリング☆ガールズ」主題歌集 「人にやさしく」THE ROLLING GIRLS 女声のコーラスでブルーハーツのカバーってなんか新鮮(自分が知らなかっただけかもしれないけど)。 んでこれ、LPレコードのジャケットを模した紙パッケージなのも良い。 この他にもカバーするっぽい。 TVアニメ「ローリング☆ガールズ」ソング集 「英雄にあこがれて」THE ROLLING GIRLS
TVアニメ「ローリング☆ガールズ」ソング集 「英雄にあこがれて」THE ROLLING GIRLS

タイタニア:田中芳樹さんの人気小説27年でついに完結 - MANTANWEB(まんたんウェブ) SF小説「タイタニア」(講談社)の完結編となる5巻「凄風篇」(880円、税抜き)が2月4日に発売され、27年の歴史に幕を下ろすことが明らかになった。 2月予定は聞いてたけど4日か。早いな。 んで、 せいふう【凄風】の意味 - 国語辞書 - goo辞書 凄風苦雨(せいふうくう)の意味 | 四字熟語データバンク [一覧] 出 典: 『春秋左氏伝』 へー。

ローテーション

■_

■_

割と良く話題に上るところだけど Retiring Python as a Teaching Language 今回はまた…w Retiring Python as a Teaching Language : programming


一つ前へ 2015年1月(中旬)
一つ後へ 2015年2月(上旬)

ホームへ


リンクはご自由にどうぞ

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