ときどきの雑記帖 転石編

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

一つ前へ 2011年8月(上旬)
一つ後へ 2011年8月(下旬)

ホームへ

2011年08月20日

■_

行ってきました。 Lightweight Language Planets

実は会場は写真のこの建物ではなく

Lightweight Language Planets : 基調講演
講演者の撮影はご遠慮くださいということで。 基調講演らしくない内容じゃないか? という声も見かけましたが、 これはこれでよい講演だったと思います。 プログラマー(エンジニア)としての心構えとか。

Lightweight Language Planets : メタプログラミングの光と闇
~の光と とくれば「陰」といいたくなってしまうアタクシ。

各言語の流儀を見るに、同じようなところ違うところがあって面白いですね。

Lightweight Language Planets : Node.jsとは何だったのか
callback地獄のところで出てきたコードを見て、WindowsのCOMを扱うコードで似たようなものを見るようなと思ったり思わなかったり。

アライドテレシスさんのネットワーク機器が大活躍でした。

Lightweight Language Planets : JavaScript八面六臂

Lightweight Language Planets : IPv6ハッカソン
しまった写真が…

Lightweight Language Planets : Lightning Talk

大抽選

■_

■_

ガンダム見にいけるかなあ(今日まで)。 夏休みが一週間前にずれなければ…! ○| ̄|_

■_

2011年08月19日

■_

明日は Lightweight Language Planets なのでとっとと寝る(た)。

■_

あー、こりゃ(すでに修正済みの)バグだわ。 どーすっかね。

awkについて語るスレ $2

625 デフォルトの名無しさん [sage] 2011/08/16(火) 22:48:21.64 ID: Be:
    ここって生きてますか? 

626 デフォルトの名無しさん [sage] 2011/08/18(木) 01:56:26.63 ID: Be:
    生きてますん 

627 デフォルトの名無しさん [sage] 2011/08/19(金) 00:53:44.39 ID: Be:
    生きていることを願って質問を。
    WIN32のEXE一つで、下のTEST.AWKがマトモに動くAWKを探しています。
    これら以外にありますか?

    http://hinadori.atnifty.com/~wills/program/gawkm115.zip
    http://my.vector.co.jp/servlet/System.FileDownload/download/http/0/376460/pack/win95/util/text/awk/gawk-mbcs-win32-20051223.zip?ds
    http://my.vector.co.jp/servlet/System.FileDownload/download/http/0/80308/pack/win95/util/text/awk/mw32r27.lzh?ds

    Cygwin版も試したのですがダメでした。

    TEST.AWK
    { gsub("[0-9]","x",$0) ; gsub("ソ","ソ",$0) ; gsub("T","T",$0) ; print }

    TEST.DAT
    アイウエオカキクケコサシスセソ
    ココココサフサコココココ
    ココココサフサココココ
    ココココサフサコココココ
    ココココサフサコココココ
    サフサフサフサフサフサ
    ココココサフサコココココ
    ココココサフサココココ
    ココココサフサコココココ
    ココココサフサコココココ
    サフサフサフサフサフサ 

628 627 [sage] 2011/08/19(金) 01:00:20.60 ID: Be:
    TEST.DATは、空白が入っています。
    専ブラのポップアップをコピペして下さい。 

629 デフォルトの名無しさん [sage] 2011/08/19(金) 06:26:54.92 ID: Be:
    ウチに帰ってから調べてみるよ 

630 デフォルトの名無しさん [sage] 2011/08/19(金) 11:02:41.54 ID: Be:
    >>627-628
    cygwinのawk(GNU Awk 3.1.8)で動くけど、どうなるはずがどう動かないと言っている?
    >627のtest.datなら、当然「ソ」だけが変換されるけど。 

631 デフォルトの名無しさん [sage] 2011/08/19(金) 11:55:06.25 ID: Be:
    (CygwinならUTF8じゃないとうまく動かないけど)Shift JISで動作させたいってことかな?
    事前にTEST.DATをnkf -wに通したら駄目かな。 

632 629 [sage] 2011/08/19(金) 21:59:57.43 ID: Be:
    >>627
    スクリプトもDATもSJISで試したけど、上記3つのうち、gawk-mbcs-win32-20051223.zipはダメだったよ。
    1行目がこんなんなる。

    アxxエオカキクxコサxxxソ

    手持ちの
    GNU Awk 3.1.7(windows special Nov 24 2009)
    で、--ctype=SJISやっても同じ結果になるね。

    スクリプト、DATをUTF-8にして、--ctype=UTF8やってリダイレクトしたファイルは正常な結果が出るよ。
    リダイレクトしないでコマンドプロンプトに表示させると化けるけど。 

633 デフォルトの名無しさん [sage] 2011/08/19(金) 23:18:25.14 ID: Be:
    EUCなら半角カナもうまくやってくれるんだが… 

このバグは、ShiftJIS でしかでません。 また、上の例で言うと、[0-9] を [0123456789] にすると正しい出力となります。

ShiftJISでの半角カナが、1バイトなんだけど wchar_t にしたときの値が 255 (0xff) を超えちゃうのをきちんと扱ってないからなんですよね。 変更済みのコードはこんなの↓ (折角だから関数丸ごと)

/* Helper function for re_compile_fastmap.
   Compile fastmap for the initial_state INIT_STATE.  */

static void
re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
			 char *fastmap)
{
  volatile re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
  int node_cnt;
  int icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE));
  for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt)
    {
      int node = init_state->nodes.elems[node_cnt];
      re_token_type_t type = dfa->nodes[node].type;

      if (type == CHARACTER)
	{
	  re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c);
#ifdef RE_ENABLE_I18N
	  if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
	    {
	      unsigned char *buf = re_malloc (unsigned char, dfa->mb_cur_max), *p;
	      wchar_t wc;
	      mbstate_t state;

	      p = buf;
	      *p++ = dfa->nodes[node].opr.c;
	      while (++node < dfa->nodes_len
		     &&	dfa->nodes[node].type == CHARACTER
		     && dfa->nodes[node].mb_partial)
		*p++ = dfa->nodes[node].opr.c;
	      memset (&state, '\0', sizeof (state));
	      if (__mbrtowc (&wc, (const char *) buf, p - buf,
			     &state) == p - buf
		  && (__wcrtomb ((char *) buf, towlower (wc), &state)
		      != (size_t) -1))
		re_set_fastmap (fastmap, 0, buf[0]);
	      re_free (buf);
	    }
#endif
	}
      else if (type == SIMPLE_BRACKET)
	{
	  int i, ch;
	  for (i = 0, ch = 0; i < BITSET_WORDS; ++i)
	    {
	      int j;
	      bitset_word_t w = dfa->nodes[node].opr.sbcset[i];
	      for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
		if (w & ((bitset_word_t) 1 << j))
		  re_set_fastmap (fastmap, icase, ch);
	    }
	}
#ifdef RE_ENABLE_I18N
      else if (type == COMPLEX_BRACKET)
	{
	  re_charset_t *cset = dfa->nodes[node].opr.mbcset;
	  int i;

# ifdef _LIBC
	  /* See if we have to try all bytes which start multiple collation
	     elements.
	     e.g. In da_DK, we want to catch 'a' since "aa" is a valid
		  collation element, and don't catch 'b' since 'b' is
		  the only collation element which starts from 'b' (and
		  it is caught by SIMPLE_BRACKET).  */
	      if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0
		  && (cset->ncoll_syms || cset->nranges))
		{
		  const int32_t *table = (const int32_t *)
		    _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
		  for (i = 0; i < SBC_MAX; ++i)
		    if (table[i] < 0)
		      re_set_fastmap (fastmap, icase, i);
		}
# endif /* _LIBC */

	  /* See if we have to start the match at all multibyte characters,
	     i.e. where we would not find an invalid sequence.  This only
	     applies to multibyte character sets; for single byte character
	     sets, the SIMPLE_BRACKET again suffices.  */
	  if (dfa->mb_cur_max > 1
	      && (cset->nchar_classes || cset->non_match || cset->nranges
# ifdef _LIBC
		  || cset->nequiv_classes
# endif /* _LIBC */
		 ))
	    {
	      unsigned char c = 0;
 	      do
 		{
 		  mbstate_t mbs;
                  wchar_t wc;
 		  memset (&mbs, 0, sizeof (mbs));
		  if (__mbrtowc (&wc, (char *) &c, 1, &mbs) == (size_t) -2)
 		    re_set_fastmap (fastmap, false, (int) c);
                  else if (0xff61 <= wc && wc <= 0xff9f) // half-width kana
                    re_set_fastmap (fastmap, false, (int) c);
 		}
 	      while (++c != 0);
	    }

	  else
	    {
	      /* ... Else catch all bytes which can start the mbchars.  */
	      for (i = 0; i < cset->nmbchars; ++i)
		{
		  char buf[256];
		  mbstate_t state;
		  memset (&state, '\0', sizeof (state));
		  if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
		    re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
		  if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
		    {
		      if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
			  != (size_t) -1)
			re_set_fastmap (fastmap, false, *(unsigned char *) buf);
		    }
		}
	    }
	}
#endif /* RE_ENABLE_I18N */
      else if (type == OP_PERIOD
#ifdef RE_ENABLE_I18N
	       || type == OP_UTF8_PERIOD
#endif /* RE_ENABLE_I18N */
	       || type == END_OF_RE)
	{
	  memset (fastmap, '\1', sizeof (char) * SBC_MAX);
	  if (type == END_OF_RE)
	    bufp->can_be_null = 1;
	  return;
	}
    }
}

/* Initialize DFA.  We use the length of the regular expression PAT_LEN
   as the initial length of some arrays.  */

static reg_errcode_t
init_dfa (re_dfa_t *dfa, size_t pat_len)
{
  unsigned int table_size;
#ifndef _LIBC
  char *codeset_name;
#endif

  memset (dfa, '\0', sizeof (re_dfa_t));

  /* Force allocation of str_tree_storage the first time.  */
  dfa->str_tree_storage_idx = BIN_TREE_STORAGE_SIZE;

  /* Avoid overflows.  */
  if (pat_len == SIZE_MAX)
    return REG_ESPACE;

  dfa->nodes_alloc = pat_len + 1;
  dfa->nodes = re_malloc (re_token_t, dfa->nodes_alloc);

  /*  table_size = 2 ^ ceil(log pat_len) */
  for (table_size = 1; ; table_size <<= 1)
    if (table_size > pat_len)
      break;

  dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size);
  dfa->state_hash_mask = table_size - 1;

  dfa->mb_cur_max = MB_CUR_MAX;
#ifdef _LIBC
  if (dfa->mb_cur_max == 6
      && strcmp (_NL_CURRENT (LC_CTYPE, _NL_CTYPE_CODESET_NAME), "UTF-8") == 0)
    dfa->is_utf8 = 1;
  dfa->map_notascii = (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_TO_NONASCII)
		       != 0);
#else
# ifdef HAVE_LANGINFO_CODESET
  codeset_name = nl_langinfo (CODESET);
# else
  codeset_name = getenv ("LC_ALL");
  if (codeset_name == NULL || codeset_name[0] == '\0')
    codeset_name = getenv ("LC_CTYPE");
  if (codeset_name == NULL || codeset_name[0] == '\0')
    codeset_name = getenv ("LANG");
  if (codeset_name == NULL)
    codeset_name = "";
  else if (strchr (codeset_name, '.') !=  NULL)
    codeset_name = strchr (codeset_name, '.') + 1;
# endif

  /* strcasecmp isn't a standard interface. brute force check */
#if 0
  if (strcasecmp (codeset_name, "UTF-8") == 0
      || strcasecmp (codeset_name, "UTF8") == 0)
    dfa->is_utf8 = 1;
#else
  if (   (codeset_name[0] == 'U' || codeset_name[0] == 'u')
      && (codeset_name[1] == 'T' || codeset_name[1] == 't')
      && (codeset_name[2] == 'F' || codeset_name[2] == 'f')
      && (codeset_name[3] == '-'
          ? codeset_name[4] == '8' && codeset_name[5] == '\0'
          : codeset_name[3] == '8' && codeset_name[4] == '\0'))
    dfa->is_utf8 = 1;
#endif

  /* We check exhaustively in the loop below if this charset is a
     superset of ASCII.  */
  dfa->map_notascii = 0;
#endif

#ifdef RE_ENABLE_I18N
  if (dfa->mb_cur_max > 1)
    {
      if (dfa->is_utf8)
        {
#if !defined(__GNUC__) || __GNUC__ < 3
	  static short utf8_sb_map_inited = 0;

	  if (! utf8_sb_map_inited)
	    {
		int i;

	  	utf8_sb_map_inited = 0;
		for (i = 0; i <= 0x80 / BITSET_WORD_BITS - 1; i++)
		  utf8_sb_map[i] = BITSET_WORD_MAX;
	    }
#endif
	  dfa->sb_char = (re_bitset_ptr_t) utf8_sb_map;
	}
      else
	{
	  int i, j, ch;

	  dfa->sb_char = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
	  if (BE (dfa->sb_char == NULL, 0))
	    return REG_ESPACE;

	  /* Set the bits corresponding to single byte chars.  */
	  for (i = 0, ch = 0; i < BITSET_WORDS; ++i)
	    for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
	      {
		wint_t wch = __btowc (ch);
		if (wch != WEOF && !(0xff61<=wch && wch<=0xff9f))
		  dfa->sb_char[i] |= (bitset_word_t) 1 << j;
# ifndef _LIBC
		if ((unsigned char)ch < 0x100 && wch != ch)
		  dfa->map_notascii = 1;
# endif
	      }
	}
    }
#endif

  if (BE (dfa->nodes == NULL || dfa->state_table == NULL, 0))
    return REG_ESPACE;
  return REG_NOERROR;
}

実に美しくない○| ̄|_ > else if (0xff61 <= wc && wc <= 0xff9f) // half-width kana

■_ POSIXは

以下略

sedコマンドで全ての2バイト文字を指定するには? | OKWave

こんにちは。

LinuxやWindows用のsedコマンドには、[・・・]という演算子によって、
特定の範囲の文字集合が指定できます。
例えば
sed "s/[a-zA-Z]//g" test.txt
というコマンドによって、test.txtから、アルファベットを削除する事ができます。

では、シフトJISコードにおいて、全ての2バイト文字を指定するにはどうすればよいのでしょうか?
シフトJISコードでは、最初の漢字が「亜」であり、最後の漢字が「黑」らしいので、
sed "s/[あ-んア-ン亜-黑]//g"
といったコマンドを試しましたが、これでは
「ー」「、」「。」「ぁぃぅぇぉ」といった文字が残ってしまいます。

結局は、シフトJISコードの2バイト文字の範囲を知りたいのですが、
調べてみても分かりませんでした。

ご存知の方がいらっしゃれば、情報提供をお願い致します。


そのsedがShift-JISの「1文字」を「1文字」として処理できるものである必要があります。
「マルチバイト文字に対応」と明記していないものでは、
[あ-んア-ン亜-黑]
は
「あ」の1バイト目
「あ」の2バイト目から「ん」の1バイト目
「ん」の1バイト目
...
とばらばらに解釈されている可能性があります。

あとは、Shift-JISのコード表を見れば、「あ-ん」には「ぁ」は入ってないし、句読点は別のところにあるのがわかると思います。
http://charset.7jp.net/sjis.html

> [・・・]という演算子
演算子ではないですが...

どの sed 使っているかわからないけど、亜-黑 という範囲指定で期待通りに動くかどうかはちと疑問。 最近の GNU sed なんかだと wchar_t に変換した後のコードポイントで指定されるから。

十六進記述ができて、マルチバイト文字をきちんと認識するのなら [^\x00-\xff] あたり?

■_

■_

よんだ。

A couple Python-like features in C++11 ? The Endeavour
A couple Python-like features in C++11

by John on August 17, 2011

The new C++ standard includes a couple Python-like features that I ran across recently. 
There are other Python-like features in the new standard, but here I'll discuss 
range-based for-loops and raw strings.

In Python you loop over lists rather than rather than incrementing a loop counter 
variable. For example,
Interview: SciRuby Team
F4S: What is SciRuby?

John Woods:  The SciRuby Project is two things: a community and a set of libraries. We 
think Ruby is a great language, and so do a lot of other people. We liked what had 
been done with SciPy and NumPy, as far as opening up Python to those who had been 
stuck in Matlab and R, and decided Ruby needed something similar.

2011年08月18日

■_

暑い。

Software Design、今月号を買ったのですがオススメ本で挙げられたものに 重複ないってのは(ですよね?)、何か調整したんでしょか。

■_ A-Z

まだ続いてたんですねこのシリーズ。 だいぶ間が開いているみたいですけど。

a-z of programming languages - Computerworld で、最近のを見ると


    * The A-Z of programming languages: From Pizza to Scala

    * The A-Z of Programming Languages: Shakespeare

    * The A to Z of programming languages: Objective-C

    * The A-Z of Programming Languages: MATLAB

Shakespeare は見ていないと思うけど、 Objective-C や MATLABはどうだったかなあ

■_

で、最新回はScala。

The A-Z of programming languages: From Pizza to Scala - scala, programming languages, pizza, Martin Odersky, a-z of programming languages - Computerworld


The A-Z of programming languages: From Pizza to Scala

How Martin Odersky created the programming language behind Twitter

    * 18 August, 2011 11:00

(略)

What led you to develop Scala?

I was in programming languages almost all of my professional life. Since I was always 
fond of writing compilers, I did my PhD in Zurich with Niklaus Wirth, the designer of 
Pascal and Modula-2, in the 80s. I then got very interested in functional programming 
and thought it was the way forward.

(略)

What was the biggest challenge when you developed it?

To come up with a statically-typed programming language that provided a fusion of 
object-oriented and functional programming. This turned out to be unknown terrain, 
certainly for me and also for other people in the industry. Then, having a language 
that's different to Java but at the same time can work well with Java was also a big 
challenge that we faced.

(略)

What's coming up next for you?

There are a couple of big challenges. The obvious next challenge is to work out what 
to do with all of these cores in modern processors. We need to make concurrent and 
parallel programming accessible to many more people. That's a big big challenge and 
something the whole industry will need to work at.

Another thing is to work out how to make a programs more reliable than they are now. 
And that's very much an ongoing process, but we make steady advances and it will take 
a while to crack it — if we can ever crack it completely.

本当、このシリーズ訳してくれないかなあ。 権利云々を除けば(ry

■_

■_ 後知恵で云々

は止めましょう(謎)

Consistency: how to defeat the purpose of IEEE floating point

October 31st, 2008 | hardware, numerical, software

I don't know much about the design of IEEE floating point, except for the fact that a
lot of knowledge and what they call “intellectual effort” went into it. I don't
even know the requirements, and I suspect those were pretty detailed and complex (for
example, the benefits of having a separate representation for +0 and -0 seem hard to
grasp unless you know about the very specific and hairy examples in the complex plane).
So I don't trust my own summary of the requirements very much. That said, here's the
summary: the basic purpose of IEEE floating point is to give you results of the
highest practically possible precision at each step of your computation.

 a lot of knowledge であるとか、彼らが  “intellectual effort”と呼ぶようになったことを
除けば、わたしは IEEE の浮動小数点数の設計についてそれほど知っているわけではありません。
その要求項目 (requirements) すらも知りませんし、そういった諸々が非常に精細 (pretty detailed)
で複雑なものであると思っています (たとえば +0 と -0 とを別々の表現とすることの利点は、
あなたが複素平面における very specific and hairy (非常に特殊で複雑) な例についての知識を
持っていない限りはそれと認識することは難しいことでしょう)。ですからわたしは自分自身の
summary of the requirements をほとんど信じていません。それはつまり、こういうことです:
IEEE 浮動小数点数の基本的な目的 (basic purpose) とは、あなたの行っている計算 (computation)
の各ステップにおいて highest practically possible precision な結果をあなたに提供する
ということなのです。
c - HELP - IEEE - 754 - extract, normalized, NAN, etc - Stack Overflow
~ Please forgive me -

   I had a previous post called IEEE - 754 - find signbit, exponent, frac, normalized, etc..

However, i had not registered my nic and i cant edit it. ( so the post is basically 
dead to me) Can someone delete it? My question is unanswered also. So i am posting 
this with different code.

   i still need lots of help... so please dont treat this post as a duplicate...

I have found sign bit, exponent bit and mantissa..

What do i test to find normalized? if exp == 0?

what do i test for infinity? exp == 0xff and mantiassa == 0? does the sign have 
anything to do with it?

what do i test to find Zero? exp == 0 and mantissa == 0? does the sign have anything 
to do with it?

What do i test to find NAN? can someone please explain as simple as you can since i am 
just a beginner! Do i have to apply any more masks?

   Is there a order in which i am suppose to accomplish what i want?

This is what i have so far.

■_

unicode - Should UTF-16 be considered harmful? - Stack Overflow
http://stackoverflow.com/questions/1049947/should-utf-16-be-considered-harmful

BNF and EBNF: What are they and how do they work?
http://www.garshol.priv.no/download/text/bnf.html

2011年08月17日

■_

最近、「救急戦隊ゴーゴーファイブ」の主題歌がお気に入り。

■_ いろろ

A Treasure Chest of Rubyisms: Taking A Byte Out of Ruby

Friday, August 5, 2011

Taking A Byte Out of Ruby

Many developers don't think too much about what's going on behind the scenes when they 
run their Ruby code. That's the beauty of it, easy to write code that's given to Ruby 
and run for the developer. At some point the developer may wonder, what's REALLY going 
on behind the scenes. How is it that something meant to run Ruby can host so many 
other languages? The answer lies in what's known as a VM, or Virtual Machine.

The VM reads in generated bytecode created by the Ruby implementation in question, and 
in turn converts it to native code that can be utilized by the operating system. We'll 
look at 3 different implementations, MRI, Rubinius, and JRuby, and what the resulting 
bytecode looks like. The following code will be used to demonstrate:

def mymethod(name)
  puts "Hello " << name
end

mymethod "John"


It's a very simple method being called. This simple code is used so that the resulting 
bytecode isn't too overwhelming. So then time to take a look at the bytecode world!

(略)

Conclusion

This concludes a look into the bytecode form of Ruby code provided by the MRI, Rubinius,
and JRuby implementations. It's important to note that this is a very simple example meant
to show what bytecode looks like without overwhelming the reader too much. I encourage the
curious to see what bytecode results from more complex applications (you'll probably want
to redirect to a file!) to get an idea of how different pieces of code translate.

Update 1

Added AST dump from JRuby as per @headius 's tweet

Update 2

The Rubinius VM also has a bytecode verification similar to the JVM (also per @headius's tweet)

Posted by Chris at 9:29 AM

いろいろあるのねえ

■_ C++の

one of the dusty corners とか。

This is one of the dusty corners of C++ that can drive you crazy. When constructing an object, sometimes you want/need the parens, sometimes you absolutely cannot have them, and sometimes it doesn't matter. : programming

This is one of the dusty corners of C++ that can drive you crazy. When constructing an 
object, sometimes you want/need the parens, sometimes you absolutely cannot have them, 
and sometimes it doesn't matter. (stackoverflow.com)


It's not that bad -- just ensure that you always initialise your memory.

If you are relying on an A() initialised POD type, then you already know this flaw. If 
you rely on it by mistake, I bet you have tons of other errors related to initialising 
POD types.

Does anyone know why this is the case though? It seems inconsistent that C++ would 
make A() zero-initialise. Does C++ create a default c-tor that initialises all the 
values to their default c-tors for POD types?


Why not: Object myObject = Object();

(there is no copy made here, I think, the two are semantically equivalent).


    Object myObject()

I think this is a function declaration.


It is, but I provided an alternate syntax for what one typically would expect from that syntax.


Semantically, a copy is in fact made.

While a compiler may use copy elision as an optimization, if the copy constructor is 
private then that code will result in an error.


"there is no copy made here"

Heh. Depends on your compiler and the optimization level. And, even if it does 
optimize to avoid calling operator=, you still need to have one declared for this to 
work (I am not positive whether it needs to actually be defined though).


    Object myObject = Object();

    even if it does optimize to avoid calling operator=

The code above does not involve operator=. (Try it!) What actually happens is that 
"Object()" invokes Object's default ctor to initialize a temporary object, 
and then that temporary object is passed to Object's copy constructor to initialize 
myObject. Object::operator=() is used only for assignment expressions, never for 
initializations.

↑はほんの一部で、なんであんなに盛り上がるんだろう。

■_

↑の火元。

c++ - Do the parentheses after the type name make a difference with new? - Stack Overflow

Do the parentheses after the type name make a difference with new?

If 'Test' is an ordinary class, is there any difference between:

Test* test = new Test;
//and
Test* test = new Test();

c++ constructor initialization new c++-faq
Let's get pedantic, because there are differences that can actually affect your code's 
behavior. Much of the following is taken from comments made to an "Old New 
Thing" article ( http://blogs.msdn.com/oldnewthing/archive/2006/12/14/1285437.aspx ).

Sometimes the memory returned by the new operator will be initialized, and sometimes 
it won't depending on whether the type you're newing up is a POD (plain old data), or 
if it's a class that contains POD members and is using a compiler-generated default 
constructor.

    * In C++1998 there are 2 types of initialization: zero and default
    * In C++2003 a 3rd type of initialization, value initialization was added.

Assume:

struct A { int m; }; // POD
struct B { ~B(); int m; }; // non-POD, compiler generated default ctor
struct C { C() : m() {}; ~C(); int m; }; // non-POD, default-initialising m

In a C++98 compiler, the following should occur:

    * new A - indeterminate value
    * new A() - zero-initialize
    * new B - default construct (B::m is uninitialized)
    * new B() - default construct (B::m is uninitialized)
    * new C - default construct (C::m is zero-initialized)
    * new C() - default construct (C::m is zero-initialized)

In a C++03 conformant compiler, things should work like so:

    * new A - indeterminate value
    * new A() - value-initialize A, which is zero-initialization since it's a POD.
    * new B - default-initializes (leaves B::m uninitialized)
    * new B() - value-initializes B which zero-initializes all fields since its
              default ctor is compiler generated as opposed to user-defined.
    * new C - default-initializes C, which calls the default ctor.
    * new C() - value-initializes C, which calls the default ctor.

So in all versions of C++ there's a difference between "new A" and "new A()"
because A is a POD.

And there's a difference in behavior between C++98 and C++03 for the case "new B()".

This is one of the dusty corners of C++ that can drive you crazy. When constructing an 
object, sometimes you want/need the parens, sometimes you absolutely cannot have them, 
and sometimes it doesn't matter.

site design / logo © 2011 stack exchange inc; user contributions licensed under cc-wiki with attribution required

■_

■_

2011年08月16日

■_

C magazine 1999年11月号を引っ張り出してごにょごにょ。

実は電人ザボーガーの映画公開を結構楽しみにしている

■_

■_ Perlis Languages

前回紹介したブログではつい最近書かれた記事でしたが -= Perlis Languages =- Aug 14, 2011 → リンク先にあったこっちは2009年。 Perlis Languages | Lambda the Ultimate By Robb Nebbe at 2009-06-18 10:59 で、もうひとつこっちは :jasonrudolph => :blog >> Programming Achievements: How to Level Up as a Developer Published on Tuesday, August 09, 2011 in better

で、Lambda the ultimate から。

Perlis Languages | Lambda the Ultimate

Perlis Languages

I was wondering what people would consider Perlis languages, i.e. languages worth 
knowing because they should change how you think about programming. Obviously there is 
a lot of overlap between languages so what I'm looking for is a minimal set of 
established languages (by that I mean 10 years or older) that still provides a 
reasonably complete overview of different approaches to programming. My first try at a 
list would look something like:

Ada, C, Haskell, Java, Lisp, Smalltalk, Perl


A few more

As well as the ones you've already listed, I'd add:

    * Python, for reintroducing me to simplicity and expressiveness in code after years
      spent writing Enterprise Java.
    * C++, for template metaprogramming.
    * Assembly language, because it requires a very different mindset to higher level programming.
    * Aldor, where I first encountered dependent types (and a lot of mathematics that was
      new to me too, thanks to the libraries!).
    * Oz, for showing an easier approach to concurrency (from what I've seen of it so far).


Coq

Haskell/C ~ Coq/Haskell ;-)


APL, ALGOL67 & Alan Perlis - (& Objective C)

From a historical perspective, Alan Perlis used APL to teach the introductory computer 
science course, CPSC 221, at Yale around 1976-1984, covering much the same material as 
in Structure and Interpretation of Computer Programming. APL could be used in an 
interactive or compiled fashion, allowing one to build idioms and programs in a 
stepwise fashion. By the end of the course, one could write a full parser in APL. It 
had strong capabilities for mathematrics, including multidimensional matrices. It also 
a font set, which included latin and greek letters, and more symbols than you shake a 
stick at. An APL program could rival any PERL program for its opaqueness and terseness.

I mention ALGOL-67, since Perlis was involved along with Dijystra in developing one of 
the first modern structured computer language, which eventually lead to the C-family 
of languages.

Today, I would consider Objective-C a revolutionary language, since Apple has been 
developing it into a power systems programming language, with recent additions 
including blocks to allow for management of concurrency. Along with the Open CL spec, 
with its C-like language, it provides extensive tools for concurrent programming on 
multi-core systems.
Language behind Language

Probably confusing with Simula-67 - an Object Oriented extension of Algol 60.

Speaking of Algol 68, I picked up a couple of discounted books on the language a while 
back. Althouch I've been meaning to play with the language (Algol 68 Genie looks 
interesting), the main thing that struck me is that the explanation of Algol 68 uses a 
lot of vocabulary and terminology that is different from most other languages (e.g., 
mode, mode-indicant, denotation, collateral-clause, formulas, generators, stowed, 
etc...). Coming from the outside it can be hard to tell when they are using different 
words for the same idea; or when the idea is different - subtle or innovative.

Anyhow, register me as one that thinks that some languages are interesting simply 
because they are described in a very different fashion - the language behind the 
language.

Is Objective-C revolutionary?

my impression was it was pretty much Smalltalk's vision of OO integrated in a 
reasonably clean way with C rather than the conceptually much different approach taken 
by C++. I didn't include C++ because I figured most innovations from C++ were done as 
well or better in Java. Similarly I figured if you know C and Smalltalk there isn't 
much that is going to suprise you as new in Objective-C.

■_

2011年08月15日

■_

さかのぼり日本史
とりあえず一巻目だけ買って読んでみたけど、結構いいと思う。 やっぱり大昔から現代に向かっていくより、 遡っていったほうがわかりやすいんじゃないかなあ。 近現代史をやる時間に余裕もできるだろうし
NHK さかのぼり日本史(1)―戦後 経済大国の“漂流”

船の科学館
閉館前に行っておかないと。

カラカラ帝のアントニヌス勅令についてつらつらと考えてみたり。

■_ わたしはPHPが好きだ

くらい?

I like PHP « Otaku, Cedric's blog

I like PHP

There, I said it.

I know it's fashionable to mock PHP for its antiquated syntax and semantic quirks, but 
I just like it. Here is why.

PHP is like C

(略)

PHP never let me down

(略)

PHP is robust

(略)

PHP's documentation is great

(略)

Universal support

(略)

High reward

(略)

Conclusion

Even though writing in PHP always feels like going back in time, I'm never reluctant 
to doing it because I know that it will be rewarding and relatively easy. PHP has by 
far the highest “Get in, code, get out” factor that I have found in a language, and 
until another language comes around that can do better on this scale, I will be using 
PHP for many more years to come.

Update: Discussion on Hacker News, reddit and Google+

universal support とかドキュメントが great ってのはそうだろうなあ。

■_ Perlis Languages

聞き覚えはあるけど、どんな人だったかほとんど覚えていなかった(^^; >Alan Perlis

Alan Perlis - Wikiquote

-= Perlis Languages =-

Perlis Languages

Aug 14, 2011

    A language that doesn't affect the way you think about programming is not worth knowing.

    (あなたのプログラミングの思考に影響を及ぼさないような言語は知る価値のないものである)

                                                                               — Alan Perlis

inspired by a LtU thread and the great post Programming Achievements: How to Level Up 
as a Developer by Jason Rudolph1. most code samples from Rosetta Code.

(略)

A Perlis Language is a programming language that I believe will shake one's views on 
software development to the core.

Below I will enumerate4 some of my Perlis Languages and give an all-too-brief overview 
and just a sip of code for each.
Joy

Joy is an example of a concatenative programming language or more simply put, a 
stack-based language. That is, functions are never explicitly passed arguments, but 
instead take an implicit stack that is maintained by the programmer.
(略)

possible substitutes: Factor, Forth, Cat, PostScript

Eiffel

Eiffel is an extremely opinionated object-oriented programming language. Like myself, 
many programmers today have a majority-share of “real-world” experience in one OO 
language or another. However, you haven't used anything like Eiffel.
(略)

possible substitutes: D, Cobra

Qi

Qi is a Lisp — big deal right? Wrong. Qi is a Lisp with skinnable types, a built-in 
logic engine, rewrite rules, back-tracking dispatch, built-in lexer and parser 
generators, and pattern matching that compiles down to highly-performant Common Lisp.
(略)

possible substitutes: Pure

Clojure

Clojure is a fantastic language, but let's just say that I have some skin in this game. 
Take this entry with a grain of salt. So instead…

Kernel

Kernel is also a Lisp, but it differs in that it completely eliminates the line 
separating compile-time and runtime via fexprs.
(略)

possible substitutes: newLISP

Mozart/Oz

Oz is truly a “my language has more paradigms than yours” kind of language.6 Oz 
(like many hyper-multi-paradigm languages) is unfortunately relegated to the “
educational language” category, but regardless its influence pervades a lot of the 
thinking in distributed and dataflow computation (Akka for instance is deeply 
influenced by Oz). As an added bonus, the canonical book on Oz, Concepts, Techniques, 
and Models of Computer Programming is in my top ten must read list for developers. 
It's apt that a mind-bending language should couple with a likewise mind-bending book.

(略)

possible substitutes: Erlang, Prolog, Mercury, Alice

RCA COSMAC 1802 Assembly

RCA's 8-bit Cosmac processor was shot into space as a main component7 of the Galileo 
spacecraft, but it's novelty lies in its bizarro architecture. For example, while the 
processor did not support a CALL instruction, it did support subroutines through the 
fact that any of its 16 16-bit registers could serve as the program-counter.
(略)

possible substitutes: MIX, The Art of Assembly Language Programming

Frink

Frink is a programming language that is generally known for its ability to handle and 
convert between a bevy of units of measure consistently throughout calculations.
(略)

APL

I will be honest. I have never used APL and as a result find it impenetrable. However, 
my inclusion in this list is entirely predicated on the strength of the amazing book A 
Programming Language by Kenneth Iverson.
(略)

possible substitutes: J, K

Haskell

Haskell is my mind-bending language of choice at the moment, but if you're not 
prepared to be humbled you may not find it as agreeable. That is, before learning 
Haskell you will think that you know a lot about:

   1. Static typing
   2. Laziness
   3. Purity

But Haskell will laugh at your knowledge and show you otherwise. It's that simple — 
and to learn more about these topics when you think you've learned all there is to 
know is a slap in the face — but the good kind — the kind that wakes you from your 
dogmatic slumber.

(略)

possible substitutions: ML, OCaml, Agda, Scala

I hope that this list9 will motivate you to explore one or more (or all) of the 
languages herein. I think you'll find the effort worthwhile should you approach the 
task with an open mind.

What are your Perlis Languages?

Copyright © 2002 - 2009 by Fogus (license information)

■_

俺の××言語がねえ~という叫びが。

Perlis Languages : programming

Missing Prolog...


I kinda miss Erlang too.


Personally, I think Mercury is better than Prolog.


Prolog is an awful language.

But one that definitely belongs on that list.


    Prolog is an awful language.

It really doesn't lend itself to general purpose programming, but there are 
applications where it's really easier to express your problem solution using Prolog.

Exactly. Prolog is an awful programming language.


I'd recommend anyone wanting to learn APL to learn J instead. J is the successor to 
APL, also created by Kenneth Iverson, and has a free compiler and developer tools. It 
also only uses the ASCII character set instead of the ten million special characters 
APL uses, while retaining APL's ridiculous level of undecipherable terseness. Iverson 
basically lived by the saying "Perfection is when there's nothing left to take 
away," and it shines through in everything he did.

I'd also like to add that, although it's basically a footnote in the article, nobody 
should try to learn Agda without at least a moderate understanding of Haskell. Agda is 
dependently typed, which is a whole new can of worms even for someone with experience 
in pure, functional languages like Haskell.

■_

2011年08月14日

■_

燻りちう

■_

明日から会社(夏休みは先週)で、しかもイカサマータイム。

■_

■_

Did someone just patent The Linked List? : programming http://www.reddit.com/r/programming/comments/jfz22/did_someone_just_patent_the_linked_list/

■_ Common Lisp...

Common Lisp Compilers Internals: [Caps & Mugs] Some of my CL aliens designs

2011年08月13日

■_

燃え尽きました

■_

ぶっく@C80 - 参照透明な海を守る会 ↑布教用に一部だけ確保しました

2011年08月12日

■_

歴史群像ムックで「八八艦隊」を扱ったのが出ていてとても気になる。 すぐに買わないと入手困難になりそうだしなあ。歴史群像といえば 歴史群像アーカイブで「第一次世界大戦」が出てたな(上巻だけど)。

■_ variable interpolation

Perl から Borne Shell に遡れると思うんだけど、 さらにそこから先があるんだろうか? > variable interpolation

Ruby 初心者スレッド Part 45 

156 デフォルトの名無しさん [sage] 2011/08/11(木) 16:16:53.23 ID: Be:
    require 'rubygems'
    require 'mysql'

    doc = Mysql::new('localhost', 'root', 'pass','test')
    doc.query("insert into table_d values ('2006-12-13')")

    上のようなファイルでmysqlに書き込んでいるのですが、下記のように日付を変数として扱いたいのですが、
    下のようにするとエラーがでます。どうやって変数にできますでしょうか?

    require 'rubygems'
    require 'mysql'

    y = '2006-12-13'

    doc = Mysql::new('localhost', 'root', 'pass','test')
    doc.query("insert into table_d values (y)")

    よろしくおねがいします。 

157 デフォルトの名無しさん [sage] 2011/08/11(木) 16:26:12.19 ID: Be:
    Rubyに関する基本的な解説を何かでまとめて学ぶことをお勧めする
    それに回答したとしても、間違いなく、5分後にまた別の質問が来るだろう 

158 デフォルトの名無しさん [sage] 2011/08/11(木) 16:37:33.14 ID: Be:
    いくらRubyを学んだところで、拡張ライブラリの使い方はわからんだろう 

159 デフォルトの名無しさん [sage] 2011/08/11(木) 17:06:14.39 ID: Be:
    >>158
    mysql関係ないぞ 

160 デフォルトの名無しさん [sage] 2011/08/11(木) 17:52:53.90 ID: Be:
    他の言語でも同じだと思うが
    文字列の中に変数名を書いてもただの文字列だ
    文字列中に展開したいなら#{}でくくればよい

    というかまずはググレ
    文字列 変数 Ruby とでもググればでてくるだろ 

161 デフォルトの名無しさん [sage] 2011/08/11(木) 17:54:36.18 ID: Be:
    ただ問題は文字列がクエリ文字列だということだ 

162 デフォルトの名無しさん [sage] 2011/08/11(木) 17:57:16.45 ID: Be:
    ここまでなにがなんでもプレースホルダを教えてやらないおまえら最高。 

163 デフォルトの名無しさん [sage] 2011/08/11(木) 18:16:56.68 ID: Be:
    >>161
    んなこと言ったら query メソッドなんて使うなという話になるぞ 

164 デフォルトの名無しさん [sage] 2011/08/11(木) 18:19:27.40 ID: Be:
    ならんがな 

165 デフォルトの名無しさん [sage] 2011/08/11(木) 18:29:24.71 ID: Be:
    #{}とか言っちゃう人はもっと勉強しましょう 

166 デフォルトの名無しさん [sage] 2011/08/11(木) 18:30:47.62 ID: Be:
    すまんかった
    SQLなんて使ったことないもんで 

176 デフォルトの名無しさん [sage] 2011/08/12(金) 06:15:24.43 ID: Be:
    >>160
    今さらだが、PerlやPHPだとそのまま変数名を書いても展開される。

    $var = "Variable";
    print "\$var: $var";

    で $var: Variable と出力される。 

177 デフォルトの名無しさん [sage] 2011/08/12(金) 06:21:46.48 ID: Be:
    そのまま書くというか、変数表記自体がプレフィックスつきだからなあ

    この理屈だとRubyもインスタンス変数あたりは埋め込みなしで書けてもいいことになるが 

178 デフォルトの名無しさん [sage] 2011/08/12(金) 06:29:28.36 ID: Be:
    変数に普段付けるプレフィックスと、文字列リテラル中のエスケープの
    プレフィックスを一致させてるという謎設計、って解釈すればいいんですかね? 

179 デフォルトの名無しさん [sage] 2011/08/12(金) 06:35:00.95 ID: Be:
    トークンとして変数であることがかなりの確度で保証されているから、そのまま書くだけで置換されるようにしたのだろう
    便利でいいことだ
    利便性をどこに置くかの話で、特段、謎仕様でもない

    厳密言うんだったら、文字列の生成と連結しか許さなくしてもよかったわけだし 

180 デフォルトの名無しさん [sage] 2011/08/12(金) 07:40:47.40 ID: Be:
    よく考えてあるんだな、角度とか 

そいや、「式」の interpolaion が(ほぼ自由に)書けるのって Ruby以前にあったんだろうか。 Perl でも書けるけど、かなり無理やり感があるというか 実装の隙を突いたんじゃないかという印象があるんですよね。

■_ vim

昨日もリンク貼り付けてましたが。

Vim昔語/昇華編 — KaoriYa

(さくっと略)

ともあれ幾らかの議論はあったが、こうしてVimスクリプト+ネイティブコードによる拡張はVim
本家を動かすものとなった。いま改めてこの事例から学べることはなんだろう。目的のためプロ
グラミング言語の境界を超えるのに躊躇しないこと、日本特有のニーズを世界的なニーズに昇華
させること、読むだけでその意味・意図が伝わるコードを書くこと、自分のアイデアや技術が必
要とされる時期を逃さないこと…

以下、続くかもしれない。

ちなみつい先日もlibiconvを使うコードを書いたがエンバグしてた。いろいろとややこしいやつだ。

Copyright (C) 2011 MURAOKA Taro (KoRoN)

わっふるわっふる。とすればいいんでしょうか?>続き

Vim昔語/遭遇編 — KaoriYa

(略)

TeXファイルに日本語が混ざるとハイライトが崩れていたのだ。原因はVimの正規表現エンジンが
日本語(マルチバイト文字)に対応していなかったこと。卒論をTeXで書いていた私には致命的と
も言える問題だったため、期限の迫りつつある卒論そっちのけで正規表現エンジンの改良にのめ
り込んだのだ。regexp.cを印刷&製本し、短くない通学時間の大半を解読と修正方法の検討
に費やした。そうして正規表現エンジンのマルチバイト文字対応化は完成した。またソレ以外に
も多くの修正を完成させ、普段の使い方では困らないようになっていた。

私はこの成果を誇らしく思い、共有&公開しようと考えBram氏(説明するまでもないと思うが
Vimの原作者である)にメールで連絡をとった。思えば明確な意図をもって英語でメールを書いた
のはこのときが最初だった。ほどなくBramからの快諾を受けコンパイル済みバイナリを配布する
ようになった。当時の香り屋はまだ独自ドメインkaoriya.net取得前で研究室のサーバを使って
の配布だった。配布にあたってのコンセプトは「ダウンロードしてすぐに無設定で便利に使える」。
当時の私の技術・知識・思慮不足はあったものの、今もそこは揺らいでいない。

この時、一緒に考えていたことがある。日本独自のモノになってはいけない。成果は可能な限り
Officialに還元し、世界全体に貢献するべきである。厨二病のソレである。逆に言えば、変更を
行う場合にはそれが(自分・日本人だけではなく)世界的に見てどういう意味を持ち、どうすれば
その有用性を理解してもらえるかを考えながら、具体的な作業に落としこむ必要がある。この作
業には最終的にどういう文面でvim-devに送ればすんなり受け入れられるか考える工程も含まれ
る。特にこれは英語力に(今も)不安のある私にとっては重要で、議論になればまず勝てない。だ
ったら議論の余地が無いほど、ぐぅの音もでないほど説得力のある変更内容とパッチを作れば良
いのだ。この時の訓練は、仕事をするようになった今でも、相手が日本人であっても役に立って
いる。

(略)

Copyright (C) 2011 MURAOKA Taro (KoRoN)

vim のソースコードは読んでないんだよなあ。 いや、正規表現調べるときにその辺だけは見た?

regexp.cを印刷&製本し、短くない通学時間の大半を解読と修正方法の検討に費やした。 そうして正規表現エンジンのマルチバイト文字対応化は完成した。 わたしは他人の成果に乗っかっただけだから(バグ報告やパッチは送ったけども)、 この辺は素直に尊敬しますです。

■_ 転載

Haskell で解くとどうなるのかなあと悩みんぐ。

お題:文字列を先頭から見て同じところまで除去 - No Programming, No Life

お題

プログラミングお題の一覧はこちら

※みなさんもこのお題をお気に入りの言語で解いてみて下さい。解いたらこの記事にトラックバックをお願いします。

説明

複数の文字列を受け取り、受け取った文字列をそれぞれ先頭から見てゆき、すべてが同じ内容で
あれば除去した内容の文字列を返却する関数を書いて下さい。

※関数の引数と戻り値については複数の文字列が受け渡しできれば型や方法は問いません*1。

例1)hoge("abcdef", "abc123")
戻り値 => "def" と "123" ("abc" が除去される)

例2)hoge("あいうえお", "あいさんさん", "あいどる")
戻り値 => "うえお", "さんさん", "どる" ("あい" が除去される)

例3)hoge("12345", "67890", "12abc")
戻り値 => "12345", "67890", "12abc" (一致なしのため、そのまま返却される)

最初はRubyで解こうと思ったんですが、それじゃあ面白くないかなということで Haskellで、といったんですがむむむ。

■_

■_

(たぶん)準備完了。寝る。

2011年08月11日

■_

あづい。

■_

I don't think C gets enough credit : programming なんか妙に盛り上がってるものが

↓の4番目。

4chan BBS - The C Paradox


The C Paradox

1 Name: Anonymous : 2011-08-06 14:30

    If gets() is so dangerous and should never be used,

    Why was it created in first place and kept in the C standard until now?
2 Name: Anonymous : 2011-08-06 14:40

    To tempt ignorant or lazy fools with its apparent simplicity and get rid of them.

3 Name: Anonymous : 2011-08-06 14:44

    Misdesigned, buggy standard library in a misdesigned, underspecified language.

4 Name: Anonymous : 2011-08-06 14:58

    I don't think C gets enough credit. Sure, C doesn't love you. C isn't about love--C is
    about thrills. C hangs around in the bad part of town. C knows all the gang signs. C
    has a motorcycle, and wears the leathers everywhere, and never wears a helmet, because
    that would mess up C's punked-out hair. C likes to give cops the finger and grin and
    speed away. Mention that you'd like something, and C will pretend to ignore you; the
    next day, C will bring you one, no questions asked, and toss it to you with a
    you-know-you-want-me smirk that makes your heart race. Where did C get it?
    "It fell off a truck," C says, putting away the boltcutters. You start to feel
    like C doesn't know the meaning of "private" or "protected": what C
    wants, C takes. This excites you. C knows how to get you anything but safety. C will
    give you anything but commitment

    In the end, you'll leave C, not because you want something better, but because you can't
    handle the intensity. C says "I'm gonna live fast, die young, and leave a good-looking
    corpse," but you know that C can never die, not so long as C is still the fastest
    thing on the road.
5 Name: Anonymous : 2011-08-06 14:59

    If it ain't C, it's crap.
6 Name: Anonymous : 2011-08-06 16:50

    Its dangerous if you see it written in the middle of ENTERPRISE CODE by some code monkey.
    If you know what you want, C gets() it without any boilerplate code.
7 Name: Anonymous : 2011-08-06 16:53

    >>4
    textual meme saved
8 Name: Anonymous : 2011-08-06 17:51

    >>4
    C, meet Assembly.
9 Name: Anonymous : 2011-08-06 18:13

    >>8
    Assembly, meet NAND gates.

10 Name: Anonymous : 2011-08-07 01:28

    >>9, MEET MY ANUS
11 Name: Anonymous : 2011-08-07 03:24

    >>9
    There wouldn't be any speed increase, moron.
12 Name: Anonymous : 2011-08-07 03:44

    >>11
    Moron, moron.
13 Name: Anonymous : 2011-08-07 04:00

    gets() is fine for development, just not suitable for production code. In fact, none
    of the generic input functions are. If you want bug-proof code it's best to roll your
    own getchar() loop and parser. The generic functions are just for quick hacks.

20 Name: Anonymous : 2011-08-09 10:06

    C is a rope.  You can do something super-useful with it, sometimes better than with any
    other tool, but you can go hang yourself with it, too.  Continuing the analogy, C++ is
    like that swiss-army knife with the 800 tools in it.  You'll never use 80% of them,
    many are for only one purpose, BUT THEY CAN ALL KILL YOU!
21 Name: Anonymous : 2011-08-09 10:20

    >>4
    You are famous

    http://www.reddit.com/r/programming/comments/jdew0/i_dont_think_c_gets_enough_credit/

    DOWNVOTE
22 Name: Anonymous : 2011-08-09 10:22

    Hi reddit! Lol

36 Name: Anonymous : 2011-08-09 11:05

    MrVacBob-sama please redirected referrals from reddit to goatse.
37 Name: Anonymous : 2011-08-09 11:15

    >>1
    Listen I can't be bothered to explain it to you so here's an image macro depicting 
    the explanation: http://bit.ly/lF39pb
38 Name: Anonymous : 2011-08-09 11:22

    If you are not, read it, or become a FAGGOT.
    What if I want both? Doushiyou kana?

39 Name: Anonymous : 2011-08-09 11:22

    /prog/ needs a voting system and rage comics
40 Name: Anonymous : 2011-08-09 11:50

    >>39 NO, FUCK YOU, FAGGOT.  THERE ARE ALREADY RAGE COMICS.  POST THEM ON /B/ AND FUCK THE FUCKING FUCK OFF.

    >>38 人生は大変だなー。

    >>36 I LOVE YOU.

    Everyone else, fuck the fucking fuck off, fucker.  No, really, just fucking kill yourself.

なんで日本語が

■_

How to Level Up as a Developer : programming

■_ Hustle and Code

えーと、安易な道に逃げず基礎を固めようということでいいんだろか。

Hustle and Code

Hustle and Code

Slow down. Learn the Fundamentals. And Hustle. Because learning to develop good 
software takes ten years. A lot of people will disagree with me on this. A lot of big 
people already have and many of us are still cleaning up that mess.

Hustle and Code - Seventh Octave

In How to Design Programs, the authors said it well, "Bad programming is easy. 
Idiots can learn it in 21 days, even if they are Dummies."

How to Design Programs において、著者はこう言っています
「悪いプログラミングは簡単である。まぬけ (Idiots) でもそれを21日で学べるし、
Dummies であってもそれは可能だ」

But this isn't 1991 and the tragedy that was Visual Basic (VB). This isn't a time when 
the 21 days paradigm turned everyone - from Help Desk Support to Accountants to 
Managers to Lawyers - into overnight programmers. Yet, still this notion of learn to 
program overnight lingers more tragically than even The Bard himself could imagine.

Why is everyone in such a rush?

In Teach Yourself Programming in Ten Years, author Peter Norvig posits the quintessential
question in this knowledge arms race, "Why is everyone in such a rush?"

以下略

Content copyright © 2010-2011 TechOctave, LLC. Powered by Blogcast

■_ 「プログラミング言語 AWK」

樫の木モック: つらつらぐさ

樫の木モック: つらつらぐさ


 そうしてそれも絶版となり、これが現在かなあ? まさかこれも絶版?

プログラミング言語AWK (新紀元社情報工学シリーズ)

はい。現在は↓のようになっています。

USP出版、書籍「プログラミング言語AWK」を復刊 | パソコン | マイコミジャーナル

ユニバーサル・シェル・プログラミング研究所 出版部(USP出版)は、書籍「プログラミング言語
AWK」を復刊し、発売を開始した。価格は3,990円。復刊ドットコム上にて販売されている。

書籍「プログラミング言語AWK」販売ページ

プログラミング言語AWKは、AWK開発者(Alfred Aho、Peter Weinberger、Brian Kernighan)によ
る解説書を翻訳したもの。何度かの絶版および復刊を経て、今回USP出版より改めて販売される
こととなった。判型はA5判、ページ数は320ページ。目次などの詳細は復刊ドットコム上を参照
してほしい。

■_


一つ前へ 2011年8月(上旬)
一つ後へ 2011年8月(下旬)

ホームへ


リンクはご自由にどうぞ

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