2011年6月20日月曜日

秀丸 水平スクロール

その他 → 動作環境 → ウィンドウ → 横スクロールバー

以上メモまで

2011年6月14日火曜日

Blogger に Syntax Highlighter を導入

ブログ上のソースコードのハイライトテンプレートをSyntax Highlighterに変更しました。

導入方法は、Bloggerの設定画面に入り「デザイン」→「HTMLの編集」から
以下のコードを<head></head>タグ内に追加します。

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js' type='text/javascript'/>
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script type='text/javascript'>
  window.onload = function() {
  SyntaxHighlighter.autoloader(
    'applescript            http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAppleScript.js',
    'actionscript3 as3      http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js',
    'bash shell             http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js',
    'coldfusion cf          http://alexgorbatchev.com/pub/sh/current/scripts/shBrushColdFusion.js',
    'cpp c                  http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js',
    'c# c-sharp csharp      http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js',
    'css                    http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js',
    'delphi pascal          http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDelphi.js',
    'diff patch pas         http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDiff.js',
    'erl erlang             http://alexgorbatchev.com/pub/sh/current/scripts/shBrushErlang.js',
    'groovy                 http://alexgorbatchev.com/pub/sh/current/scripts/shBrushGroovy.js',
    'java                   http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js',
    'jfx javafx             http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJavaFX.js',
    'js jscript javascript  http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js',
    'perl pl                http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js',
    'php                    http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js',
    'text plain             http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js',
    'py python              http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js',
    'ruby rails ror rb      http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js',
    'sass scss              http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSass.js',
    'scala                  http://alexgorbatchev.com/pub/sh/current/scripts/shBrushScala.js',
    'sql                    http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js',
    'vb vbnet               http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js',
    'xml xhtml xslt html    http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js'
  );
  SyntaxHighlighter.all();
};
</script>

上記コードを追加したら、ブログ上でハイライトを適用したいコードを
以下の<pre>タグ内にHTMLエンコードした状態で記述します
<pre class="brush: ####">

</pre>
「####」の部分には適用したい言語の種類を記述します。
適用できる言語の種類は以下をご参考ください。
http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/

また上記のハイライトはデフォルトですが、<head>タグに記述した4行目の
「shThemeDefault.css」 を変更すれば何種類かのスタイルから選択することができます。
スタイルの種類は以下をご参考ください。
http://alexgorbatchev.com/SyntaxHighlighter/manual/themes/

2011年6月11日土曜日

Windows7 XAMPP PEAR MDB2 インストール

XAMPPをWindows7にインストールしPHPの学習を行っています。

データベース接続にPEARを使ってみようと調べていたところ
XAMPPを入れた時点で利用出来るDBパッケージは「deprecate(廃止予定)」
とのことなので、推奨されているMDB2を利用しようとしました。

ところが「not Found」というエラーが返ってき、どうやらMDB2のmysqlパッケージが
インストールされていない。
ネットで検索し、
pear install MDB2_Driver_mysql
をコマンドプロンプトから実行するも、今度は「failed to mkdir」のエラー。

コマンドプロンプトをオープンする際に、「右クリック→管理者として実行」を
行う必要があったようです。。。

これに結構ハマッてしまったのでメモ。

2011年6月8日水曜日

VBScript Subプロシージャの()とCall

VBScript(asp上)でSubプロシージャの呼び出し方を調べました。

Dim a:a="a":
Dim b:b="b":

Sub sub0()
 Response.Write "z":
End Sub
Sub sub1(x)
 Response.Write x:
End Sub
Sub sub2(x,y)
 Response.Write x & y:
End Sub

sub0()
sub0
Call sub0()
Call sub0

sub1(a)
sub1 a
Call sub1(a)
Call sub1 a '←×

sub2(a,b) '←×
sub2 a,b
Call sub2(a,b)
Call sub2 a,b '←×


引数がそれぞれ0,1,2個のSubプロシージャを用意し、
括弧()の有り無し、Callの有り無しで呼び出してみました。
結果は上手くいくものとそうでないものが有り、
上記の通りコメントで「×」としたものがエラーとなりました。

Callと括弧()はワンセットで使う、もしくはどちらも使わない
と覚えておくのが良いでしょう。