等幅フォントのほうが、どう考えてもいい。
デザイン>デザイン一覧>下のほうに出てくる一覧から、使用しているデザインをクリックで、スタイルシートの編集画面になる。
そこから、blockquoteクラスの属性に、font-family: monotype; を追加した。
ぐぐると、ソースコード中のキーワードを、色付けしたりするJavaScriptなどが、存在するみたいだ。
今のところは、これは保留。
デザイン>デザイン一覧>下のほうに出てくる一覧から、使用しているデザインをクリックで、スタイルシートの編集画面になる。
=COUNTIF(範囲,検索条件)
計算の対象となるセルを定義する条件を数値、式、セル参照、または文字列で指定します。
たとえば、検索条件は 32、"32"、">32"、"Windows"、または B4 のようになります
(式および文字列を指定する場合は半角の二重引用符 (") で囲む必要があります)。
[Microsoft Excel ヘルプより]
=COUNTIF(範囲1, 検索条件1)+COUNTIF(範囲2, 検索条件2)
'name: insert_titles
'date: May 28th, 2008
'author: http://voidptr.seesaa.net/
'desc: 各シートにタイトルを設定する
'
'
Public Sub insert_titles()
Dim ii As Integer
For ii = 1 To ThisWorkbook.Sheets.Count
ThisWorkbook.Sheets(ii).Range("A1").Value _
= "=RIGHT(CELL(" & """" _
& "filename" & """" _
& ",A1), LEN(CELL(" & """" _
& "filename" & """" _
& ",A1))-FIND(" & """" _
& "]" & """" _
& ", CELL(" & """" _
& "filename" & """" _
& ",A1)))"
Next ii
End Sub
cell()から得ています。フルパス+[xlsファイル名]+シート名
'name: make_contents
'date: May 28th, 2008
'author: http://voidptr.seesaa.net/
'desc: 目次をつくる
'
Public Sub make_contents()
'
Const PAGE_TITLE = "A1"
Const START_LISTING = "TITLE_LISTING"
'
Dim is_after_contents As Boolean
Dim num_sheets As Integer
Dim num_skips As Integer
Dim ii As Integer
is_after_contents = False
num_sheets = ThisWorkbook.Sheets.Count
num_skips = 1
''' list the title pages.
For ii = 1 To num_sheets
'clear old list item.
Range(START_LISTING).Offset(ii).Value = ""
'count the pages before contents.
If is_after_contents = False Then
num_skips = num_skips + 1
End If
'list a item.
If ThisWorkbook.Sheets(ii).Name = "目次" _
Or ThisWorkbook.Sheets(ii).Name = "Contents" _
Then
is_after_contents = True
Else
If is_after_contents Then
Range(START_LISTING).Offset(ii - num_skips).Value _
= "=hyperlink(" _
& """" & "#" _
& "'" _
& ThisWorkbook.Sheets(ii).Range(PAGE_TITLE).Value _
& "'" _
& "!A1" _
& """" _
& "," _
& """" _
& ThisWorkbook.Sheets(ii).Range(PAGE_TITLE).Value _
& """" _
& ")"
End If
End If
Next ii
End Sub
から、組み込めるよ。ツール>アドイン...>参照...
から、インポートできる。ファイル>インポート...
表示>イミディエイト・ウィンドウで表示できるよ。
+-------+-------+-------+
|あ 左d|ぁ 左r|
|い 無k|ぃ 左u|
|う 無d|ぅ 左t|
|え 左e|ぇ 左y|
|お 右s|ぉ 左g|
+-------+-------+-------
|か 無l|が 左m|
|き 無a|ぎ 無g|
|く 右j|ぐ 右x|
|け 無:|げ 左:|
|こ 右o|ご 右@|
+-------+-------+-------
|さ 左s|ざ 左q|
|し 無s|じ 無e|
|す 左k|ず 左h|
|せ 無x|ぜ 左z|
|そ 右i|ぞ 右p|
+-------+-------+-------
|た 無;| |だ 左a
|ち 左c| |ぢ 右y
|つ 右l|っ 無m|づ 右v
|て 無f| |で 左;
|と 無i| |ど 右,
+-------+-------+-------
|な 右d|
|に 右;|
|ぬ 右g|
|ね 左w|
|の 右k|
+-------+-------+-------+
|は 無o|ぱ 右c|ば 左v
|ひ 左x|ぴ 無r|び 無b
|ふ 左o|ぷ 右z|ぶ 無v
|へ 無p|ぺ 右r|べ 右w
|ほ 無z|ぽ 右/|ぼ 右h
+-------+-------+-------+
|ま 左l
|み 無c
|む 右n
|め 無/
|も 右.
+-------+-------+-------+
|や 左n|ゃ 無n
|ゆ 無h|ゅ 無.
|よ 左i|ょ 無,
+-------+-------+-------+
|ら 右f
|り 左f
|る 左j
|れ 右e
|ろ 右:
+-------+-------+-------+
|わ 右a
|を 右m
|ん 無j
+-------+-------+-------+
|「 無q
|」 無@
|( 右q
|) 左@
|{ 左1
|} 左4
|[ 左2
|] 左3
|< 右0
|> 右9
+-------+-------+-------+
|+ 左-
|* 左8
|& 右t
|& 左6
|/ 左0
|/ 右\
|= 右-
|% 無t
|¥ 無[
+-------+-------+-------+
|・ 無u
|. 無-
|, 無^
|’ 左7
|* 無\
|、 左,
|。 左.
|! 左p
|! 右1
|? 左/
|ー 無w
|| 左\
|- 無y
|~ 右u
|_ 左[
|
+----
11. Safariがサポートしているプラグインの種類を教えてください。
Safariのすべてのバージョンで、Netscapeスタイルのプラグインをサポートしています。Safari 1.3以降では、NetscapeスタイルのプラグインとCocoaプラグインをサポートしています。クロスプラットフォームではありませんが、Cocoaプラグインは簡単に作成でき、お使いのプラグインはCocoaのフレームワークのすべてを活用できます。Cocoaプラグインの作成に関する詳細については、「Web Kit Plug-In Programming Topic」を参照し、Xcodeに含まれているWeb Kitサンプルのディレクトリにあるサンプルプラグインを試してみてください。
#include <iostream>
#include <string>
#include <sstream>
string f (string& incoming) // incoming は "foo N"
{
istringstream incoming_stream(incoming);
string the_word;
int the_number;
incoming_stream >> the_word // "foo" を抽出
>> the_number; // "N" を抽出
ostringstream output_stream;
output_stream << "The word was " << the_word
<< " and 3*N was " << (3*the_number);
return output_stream.str();
}
CString suffers from a common programming error that results in
poor performance. Consider the following code:
CString は、プアなパフォーマンスとなる一般的なプログラミング・エラー
の影響をうける。以下のコード例をかんがえよう:
CString n_copies_of (const CString& foo, unsigned n)
{
CString tmp;
for (unsigned i = 0; i < n; i++)
tmp += foo;
return tmp;
}
This function is O(n^2), not O(n). The reason is that each +=
causes a reallocation and copy of the existing string. Microsoft
applications are full of this kind of thing (quadratic performance
on tasks that can be done in linear time) -- on the other hand,
we should be thankful, as it's created such a big market for high-end
ix86 hardware. :-)
この関数は O(n^2)であって、O(n)ではない。理由は、ループ中毎回+=演算子が
メモリの再アロケーションと既存の文字列のコピーをおこなうからだ。Microsoftの
アプリケーションはこの類の問題に満ちている(線形時間で解ける問題が
��乗オーダの性能)--ただ一方でこれは感謝すべきなんだ。ハイ・エンドのix86
ハードウェアの巨大市場を創出しているんだからね(笑)。
If you replace CString with string in the above function, the
performance is O(n).
上記関数で CString を string に置き換えれば、パフォーマンスは O(n) だ。
#include <string>
#include <algorithm>
#include <cctype> // 古い <ctype.h>
struct ToLower
{
char operator() (char c) const { return std::tolower(c); }
};
struct ToUpper
{
char operator() (char c) const { return std::toupper(c); }
};
int main()
{
std::string s ("Some Kind Of Initial Input Goes Here");
// すべてを大文字に変える
std::transform (s.begin(), s.end(), s.begin(), ToUpper());
// すべてを小文字に変える
std::transform (s.begin(), s.end(), s.begin(), ToLower());
// すべてを大文字に変えるが、変換結果を
// 別の文字列変数に格納
std::string capital_s;
capital_s.resize(s.size());
std::transform (s.begin(), s.end(), capital_s.begin(), ToUpper());
}
char toLower (char c)
{
return std::tolower(c);
}
std::string str (" \t blah blah blah \n ");
// 先頭のホワイト・スペースをトリム
string::size_type notwhite = str.find_first_not_of(" \t\n");
str.erase(0,notwhite);
// 末尾のホワイト・スペースをトリム
notwhite = str.find_last_not_of(" \t\n");
str.erase(notwhite+1);
Path: GUIDE.txt Last Update: Tue Dec 04 19:36:28 -0800 2007
require 'rubygems' require 'mechanize' agent = WWW::Mechanize.new
page = agent.get('http://google.com/')
page.links.each do |link| puts link.text end
page = agent.click page.links.find { |l| l.text == 'News' }
page = agent.click page.links.text('News')
agent.click page.links.text('News')[1]
page.links.href('/something')
page.links.text('News').href('/something')
require 'rubygems'
require 'mechanize'
agent = WWW::Mechanize.new
page = agent.get('http://google.com/')
pp page
google_form = page.form('f')
google_form.q = 'ruby mechanize'
#<WWW::Mechanize::Field:0x1403488 @name="q", @value="ruby mechanize">
page = agent.submit(google_form, google_form.buttons.first) pp page
require 'rubygems'
require 'mechanize'
agent = WWW::Mechanize.new
page = agent.get('http://google.com/')
google_form = page.form('f')
google_form.q = 'ruby mechanize'
page = agent.submit(google_form)
pp page
form.fields.name('list').options[0].select
form.checkboxes.name('box').check
form.radiobuttons.name('box')[1].check
form.file_uploads.file_name = "somefile.jpg"
agent.get('http://someurl.com/').search("//p[@class='posted']")
2014-05-13追記: 最新の OptionParser の網羅的機能については、「Ruby OptionParser クラスのリファレンス」 を参照してください。
#! /usr/bin/ruby
#filename: test-optparse.rb
#author: http://voidptr.seesaa.net
#date: Mar. 11th, 2008
#desc:
#ref.: http://stdlib.rubyonrails.org
#
####
require 'optparse';
require 'ostruct';
require 'pp';
#### Option Parse Method.
def option_parse( args )
#Prepare.
ost         = OpenStruct.new;
#default option values.
#
#
ost.help    = "";
ost.file    = "";
ost.kind    = "";
ost.logfile = "test.log";
ost.verbose = false;
ost.arr     = [];
#
op = OptionParser.new do |opars|
opars.banner = "NAME "+" #{$0} [options]";
opars.separator "";
opars.separator "";
#display -h description at tail of the help message.
#
#
#on_headだと、help表示のとき他のオプションとの間に改行される。
#お好みで。
#opars.on_head( "--version", "show the version." ) do
opars.on( "--version", "show the version." ) do
puts "green 1.0.0";
exit 1;
end
#オペランドありオプション(基本形; オペランドFILEは、必須)
#
#
opars.on( "-f FILE", "specify a file" ) do |f|
ost.file = f;
end
#オペランドありオプション(基本形+; オペランドKINDは必須で、値は選択式・短縮形も可)
#-k a で、-k afterと同じ。-k b で、-k before と同じ意味。
#
#
opars.on( "-k KIND", [:before, :after], "select a kind {before, after}" ) do |k|
ost.kind = k;
end
#オペランドありオプション(基本形++; オペランドは、省略可)
#
#
#
opars.on( "-l [LOGFILE]", "specify the logfile." ) do |l|
if ( l != nil ) then
ost.logfile = l;
end
end
#フラグタイプのオプション (オプションは長い形式もあり; offの形式も同時に定義)
#
#
opars.on( "-v", "--[no-]verbose", "verbose mode switch." ) do |v|
ost.verbose = v;
end
#フラグタイプのオプション
#  on_tail で、オプション定義の〆
#
opars.on_tail( "-t", "--tasukete", "show this message." ) do
puts opars;
exit 1;
end
end  #endof do |opars|.
####
#オプションなしの場合.
#
#
if ( args == [] ) then
#ヘルプを表示。
puts op;
exit 1;
end
#
op.parse!( args );
#必須オプションのチェック
#
#
if ( ost.file == "" ) then
e = OptionParser::ParseError.new;
e.reason = "file was NOT specified (#{ost.file}).";
throw e;
exit 1;
end
#
ost;
end  #endof option_parse
#### Do.
options = option_parse(ARGV)
#### Result.
pp ARGV;
puts "";
pp "Dumper #{options}"
puts "name: #{$0}";
####endof filename: test-optparse.rb
(1) コントロールパネル>地域と言語のオプション>テキストサービスと入力言語
で、Natural Input を選択。
(2) プロパティ>詳細設定>「詳細なテキストサービスをオフにする」を、チェック
IME の詳細設定>システムの構成ペイン内>「詳細なテキストサービスをオフにする」を、チェック
iMacrosはFirefoxの操作を記録し自動再実行するツールだ。Firefoxのエンジンを利用してFirefox上で行った操作を追跡しスクスクリプトをみんなで共有する仕組みもあるらしい(Social Scripting)。
リプトとして記録する。このスクリプトを保存しておけば、あとでロードして実行したり、コピーして別のコンピューター上で実行したりすることができる。(http://opentechpress.jp/developer/article.pl?sid=08/01/16/019223&tid=194
)
Select "Share Macro" on the Edit tab to embed the complete iMacro in a link that you can share with others.PerlのCPANみたいなものか?
Price に、コンストラクタと比較演算メソッドを、追加しよう。Price.new の引数として、文字列、または、整数をとるものとする。class Price
  public
  include Comparable
  #Constructer
  #
  def initialize( p_ )
    @val_orig = p_.to_s;
    @val_s_wo_d = del_digit_delimiter( "#{@val_orig}" );
    @val_s_w_d = add_digit_delimiter( @val_s_wo_d );
    @val_i = @val_s_wo_d.to_i;
  end
  def <=>(other)
    self.val_i <=> other.val_i;
  end
end
initialize では、4種類のインスタンス変数: val_orig, val_s_wo_d, val_s_w_d, val_i; が生成される。<=> は、クラス Price のオブジェクト同士の大小比較を行うために、定義した[1]。class Price
protected
def add_digit_delimiter( v_ )
#remove comma from v_.
v_.gsub(/[,]/){ |c| "" };
#adding commas from lower, each 3-digits.
v_.reverse.gsub(/[[:digit:]]{3}(?=\d)/){|d| "#{d},"}.reverse;
end
def del_digit_delimiter( v_ )これで、メインとなる処理はできた。
v_.gsub(/,/){|d| ""};
end
��
��
ページのリダイレクト設定が正しくありませんなどとでて、ページが表示されなくなってしまった。
このアドレスへのリクエストに対するサーバのリダイレクト設定がループしています。
Cookie を無効化したり拒否していることにより、この問題が発生している可能性もあります。
NoScriptのアイコン右クリ>オプション...>Whitelistタブを選択そして、問題の生じているドメイン名を、いったん削除。