2009/11/05

PHP 5.3のインタラクティブシェルでは補完が効く

今日はじめて気がつきました。



PHP 5.2までは、インタラクティブシェルを起動した後、「<?php」と打ってから命令を実行していく流れになっていましたが、5.3からは最初から対話的に実行できるようになったようです。
本題の補完機能ですが、「ar」と打った後にタブキーを2度打つとズラッと候補が表示されるようになっています。そして候補が一つしかない状態のとき(ここでは「ars」まで打ちました)タブキーを打つと、残りと開始の括弧までが補完されます。これは便利かも。
ちなみに、インタラクティブシェル内で上キーを打つと、直前に実行した命令が表示されるようにもなっています。例えば上の画像の状態で上キーを打つと、直前に実行した「echo "hello world";」が再表示されます。また、一度インタラクティブシェルから抜けて、もう一度入り直した後でも、前回入力した命令の履歴が残るようになっています。
良い感じです。

2009/10/30

Eclipse 3.4 Ganymedeでは「Eclipse XML Editors and Tools」の3.1系が使えない?

「Help」→「Software Updates」からプラグインをアップデートし、Eclipseを再起動。その後いつも通りプロジェクト内からXMLファイルを開こうとしたら、
An error has occurred. See error log for more details.org.eclipse.wst.sse.ui.StructuredTextEditor.isBlockSelectionModeEnabled()Z
というエラーメッセージが表示されてXMLファイルが開けなくなってしまった。これは困った…。
で、このエラーメッセージをコピペしてGoogle先生に聞いてみたら、同じような悩みを持っている人を発見。

問題はどうやら「Eclipse XML Editors and Tools」というプラグインのバージョンにあったようです。アップデートしたとき、3.0系から3.1系になったのがいけなかったみたい。Ganymedeの場合は3.0系のほうが良さそうなので、上のページのアドバイス通りに、
  1. 「Help」→「Software Updates」
  2. 「Installed Software」タブ内の「Eclipse XML Editors and Tools」をクリック
  3. 「Revert Configuration」
  4. 履歴っぽい画面が現れるので、適当に日付をクリックして「Eclipse XML Editors and Tools」が3.0系のものを探す
  5. 「Finish」
このあとEclipseを再起動したら無事XMLが開けるようになりました。めでたしめでたし。

2009/06/21

Bloggerへの投稿テスト

こんにちは。Bloggerへの記事投稿テストです。
はてなダイアリーは最近重くなってきたので、他のブログサービスへの移動を検討しています。Bloggerで記事を書くかWordPress.comで記事を書くかで迷っていましたが、どうやらWordPress.comはCSSを編集するだけで年間1500円も払わないといけないみたいなので止めました。
よくプログラムのコードを書くと思うので、その表示のテストもしてみよう。
テスト
 (define (filter lis)
  (if (pair? lis)
      (if (number? (car lis))
          (cons (car lis) (filter (cdr lis)))
          (filter (cdr lis)))
      lis))
package pac;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import config.AppConfig;

public class Facade {
  
 private Facade() {
 }

 public static String put(String key) {
  AnnotationConfigApplicationContext acac = new AnnotationConfigApplicationContext();
  acac.register(AppConfig.class);
  AppConfig ac = acac.getBean(AppConfig.class);
  Generater gen = ac.generaterBean();
  return gen.generate(Database.find(key));
 }

}

Educators, generals, dieticians, psychologists, and parents program. Armies, students, and some societies are programmed. An assault on large problems employs a succession of programs, most of which spring into existence en route. These programs are rife with issues that appear to be particular to the problem at hand. To appreciate programming as an intellectual activity in its own right you must turn to computer programming; you must read and write computer programs -- many of them. It doesn't matter much what the programs are about or what applications they serve. What does matter is how well they perform and how smoothly they fit with other programs in the creation of still greater programs. The programmer must seek both perfection of part and adequacy of collection. In this book the use of ``program'' is focused on the creation, execution, and study of programs written in a dialect of Lisp for execution on a digital computer. Using Lisp we restrict or limit not what we may program, but only the notation for our program descriptions.
  • リスト1
  • リスト2
  • リスト3
  1. リスト4
  2. リスト5
  3. リスト6
さて、どうしようかな。