わいえむねっと

Contents
Categories
Calendar
2024/04
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Monthly Archives
~2000/01
Recent Entries
RSS1.0
Templates
Information
Processed: 0.068 sec
Chashed: -
2018/11/22 Thu
日記のフォントをちょっといじる。
というか、もろもろ古すぎるので いい加減どうにかしたい。https対応とか。
2014/12/10 Wed
2010/07/07の日記になぜか2014/06/29の内容が上書きされていたのを復旧。
オペミスなのかバグなのか。それともスクリプト以外で何か問題が発生していたのか。
待機で暇な時間に原因をぼけと考えてみたけど、特に思い当たることもなく。
うーん。
2011/11/07 Mon
Cookie絡みの修正が原因で、一部のプロファイルを指定した場合に元の状態に戻せなくなってしまっていたので暫定処置。
気付くの遅すぎる。
2011/10/23 Sun
スマートフォンからっぽいアクセスをちらほら見かけるようになってきたので、多少見やすくなる気がしないでもないプロファイルを用意してみる。
UA がそれっぽい場合に優先的に使用します。
見やすくなったところで、見る内容なんてないわけですけど。それはそれだ。

手動切替は上部メニュー左端のアイコンにて。トグル切替。Cookie 保存。


Mobilizer で見るとこんな感じ。




以下メモ。

プロファイル概要

  • viewport は width=device-width
  • 単純に sidemenu を display:none するだけだと float が破綻するので補正
  • li タグだけ width:auto の折り返し位置が微妙に内側になるのはなんでなの
  • とりあえず width:108% とかにしている

処理的なこと

  • プロファイル指定の優先順位は、GET/POSTパラメータ > Cookie > UA判定 > default
  • Cookie 周りの改修のついでに、ログイン処理も改修
  • 後勝ちログインから多重ログイン許可に
2011/09/03 Sat
写真の拡大表示が素気なさ過ぎるので、ThickBox を組み込んでみる。



若干 ThickBox 側にも手を入れたのでメモ。

  • params のスコープがなんだかおかしいのを修正
  • rel属性によるイメージグループ取得のコードが "オブジェクトでサポートされていないプロパティまたはメソッドです。" 例外で吹っ飛んでいるのを修正
  • 修正版は IE8、Firefox 3.6.20、Chrome 13 で動作確認

  • グループ表示の場合は画像クリックの動作を Close ではなく Next に変更
@@ -125,7 +128,8 @@
 			
 			TB_WIDTH = imageWidth + 30;
 			TB_HEIGHT = imageHeight + 60;
-			$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>"); 		
+			var imageAnchor = TB_NextHTML === "" ? "<a href='' id='TB_ImageOff' title='Close'>" : "<a href='' id='TB_imageNext' title='Next'>";
+			$("#TB_window").append(imageAnchor+"<img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>"); 		
 			
 			$("#TB_closeWindowButton").click(tb_remove);
 			
@@ -148,6 +152,7 @@
 					return false;	
 				}
 				$("#TB_next").click(goNext);
+				$("#TB_imageNext").click(goNext);


テスト



2010/12/30 Thu
最終忘年会ー。
毎度のことながらというかなんというか、ヤスさんには感謝。

相変わらずのいきあたりばったりで、店はここ最近定番の村さ来に。



二次会までの時間潰しに、今日出掛ける直前に勢いだけで実装してきた

  • 携帯からのログインシーケンスを改善
  • 携帯からの画像アップロードに対応

の動作確認をしたりなんだり。
2010/07/07 Wed
きのう勢いだけで実装したシンタックスハイライト記法についてちょっと整理。

ハイライト対象のサンプルは perlintro から拝借。



shebang 自動認識

Source:
|#!/usr/bin/perl
|use strict;
|use warnings;
|
|# This is a comment
|my $animal = "camel";
|my $answer = 42;
|
|print "The animal is $animal\n";
|print "The square of $answer is ", $answer * $answer, "\n";

Result:
#!/usr/bin/perl
use strict;
use warnings;

# This is a comment
my $animal = "camel";
my $answer = 42;

print "The animal is $animal\n";
print "The square of $answer is ", $answer * $answer, "\n";

略記

Source:
|#!perl
|use strict;
|use warnings;
|
|# This is a comment
|my $animal = "camel";
|my $answer = 42;
|
|print "The animal is $animal\n";
|print "The square of $answer is ", $answer * $answer, "\n";

Result:
use strict;
use warnings;

# This is a comment
my $animal = "camel";
my $answer = 42;

print "The animal is $animal\n";
print "The square of $answer is ", $answer * $answer, "\n";

行ハイライト

Source:
|#!perl[5,8]
|use strict;
|use warnings;
|
|# This is a comment
|my $animal = "camel";
|my $answer = 42;
|
|print "The animal is $animal\n";
|print "The square of $answer is ", $answer * $answer, "\n";

Result:
use strict;
use warnings;

# This is a comment
my $animal = "camel";
my $answer = 42;

print "The animal is $animal\n";
print "The square of $answer is ", $answer * $answer, "\n";

開始行指定

Source:
|#!perl[5,8]#5
|my $animal = "camel";
|my $answer = 42;
|
|print "The animal is $animal\n";
|print "The square of $answer is ", $answer * $answer, "\n";

Result:
my $animal = "camel";
my $answer = 42;

print "The animal is $animal\n";
print "The square of $answer is ", $answer * $answer, "\n";



行ハイライトと開始行指定については暫定。もう少し直感的にしたいところ。

    |#!perl
  *5|my $animal = "camel";
    |my $answer = 42;
    |
   *|print "The animal is $animal\n";
    |print "The square of $answer is ", $answer * $answer, "\n";

とか?
2010/07/06 Tue
SyntaxHighlighter を組み込んでみたりとか。



以下、メモ。

  • テーブルでレイアウトしているので各行が tr なのかと思いきや、tr は1つだけで、これは gutter と code を横に並べているのみ
  • このため、フォントスタイルの指定によっては行がずれてしまう(code 側にだけ bold が適用されることで、高さに差異が生じてしまうことがあるため)
  • IE用の補正項目がいくつか存在
  • important だらけなので、スタイルを上書きする場合は要注意


行のずれについての検証

SyntaxHighlighter のバージョンは 3.0.83。
ハイライト対象に使用したのは、これのコード。

IE8

  • font-size: 90%;

  • font-size: 90%; font-weight: normal;

  • font-size: 85%;

FireFox 3.6.6

  • font-size: 90%;

  • font-size: 90%; font-weight: normal;

  • font-size: 85%;


適用にあたり追加したスタイル(および、それ自身によるハイライト表示)

shCoreDefault.css をベースに指定し、一部のスタイルを下記内容の外部CSSで補正しています。

.syntaxhighlighter {
    border: 1px solid #c9d7f1;
    font-size: 85% !important;
    width: 95ex !important;
}
.syntaxhighlighter.ie {
    font-size: 85% !important;
}

.syntaxhighlighter.collapsed .toolbar {
    border-style: none !important;
}

.syntaxhighlighter .gutter .line {
    border-color: #c9d7f1 !important;
}
.syntaxhighlighter .toolbar,
.syntaxhighlighter .gutter .line.highlighted {
    background-color: #c9d7f1 !important;
}

.syntaxhighlighter .bold,
.syntaxhighlighter .keyword,
.syntaxhighlighter .script,
.syntaxhighlighter.printing .keyword,
.syntaxhighlighter.printing .script {
    font-weight: normal !important;
}
  • 外枠を追加
  • フォントサイズと幅を変更
  • collapsed=true の場合に border が重複するので無効化
  • アイコンとセパレータの色を変更
  • bold を無効化
2010/05/25 Tue
XMLファイルをパースしているところの50msec程の処理時間をどうにかしようとSQL経由にしたら3倍以上時間がかかるようになったので泣いた。
HAVING 遅すぎる。
2010/05/21 Fri
8年前に書いたものを概ねそのままで使い続けていたパラメータ展開周りの処理をごっそり入れ替えてみたので、例によってなんかぶっ飛ぶかも。

以下、SSIメモ。

use CGI;

my $q = new CGI;

foreach my $key($q->param)
{
    foreach($q->param($key))
    {
        print "param($key): $_\n";
    }
}

my  $i = 0;
foreach(@ARGV)
{
    print "\$ARGV[$i]: $_\n";
    $i++;
}

# <!--#include virtual="foo.pl?foo:bar+baz:qux"-->
# param(keywords): foo:bar
# param(keywords): baz:qux
# $ARGV[0]: foo:bar
# $ARGV[1]: baz:qux

# <!--#include virtual="foo.pl?foo:bar baz:qux"-->
# param(keywords): foo:bar
# param(keywords): baz:qux
# $ARGV[0]: foo:bar baz:qux

# <!--#include virtual="foo.pl?foo:bar&baz:qux"-->
# param(foo): bar baz=qux

# <!--#include virtual="foo.pl?foo=bar+baz=qux"-->
# param(foo): bar baz=qux

# <!--#include virtual="foo.pl?foo=bar baz=qux"-->
# param(foo): bar baz=qux

# <!--#include virtual="foo.pl?foo=bar&baz=qux"-->
# param(foo): bar
# param(baz): qux
ついでにPATH_INFOにも対応。
以下のようなURLでアクセスができるようになったかも。

http://sakanaya.k​ir.jp/ymnet/diary/d/20100521
http://sakanaya.k​ir.jp/ymnet/diary/d/20100521/2
http://sakanaya.k​ir.jp/ymnet/diary/d/SandBox
< Previous | Next >