<< | < | 2004-06 | > | >> | ||
---|---|---|---|---|---|---|
Su | Mo | Tu | We | Th | Fr | Sa |
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 |
CASE:1
+---------+
| tooltip |
+---------+
* <-マウスカーソル
CASE:2
+---------+
| tooltip |
+------*--+
|
+-マウスカーソル
#bookmarksPanel > hbox {
display: none !important;
}
(c:define-c-struct DEPOT
((char *) name)
(c:int wmode)
(c:int inode)
(c:int fd)
(c:int fsiz)
((char *) map)
(c:int msiz)
((c:int *) buckets)
(c:int bnum)
(c:int rnum)
(c:int fatal)
(c:int ioff)
(c:int mroff)
(c:int mrsiz)
(c:int align))
(c:define DP_OREADER 1)
(c:define DP_OWRITER 2)
(c:define DP_OCREAT 4)
(c:define DP_OTRUNC 8)
(c:define DP_ONOLCK 16)
(c:define DP_DOVER 0)
(c:define DP_DKEEP 1)
(c:define DP_DCAT 2)
(let ((dll "qdbm.dll"))
(c:define-dll-entry (DEPOT *) dpopen ((char *) c:int c:int) dll)
(c:define-dll-entry c:int dpclose ((DEPOT *)) dll)
(c:define-dll-entry c:int dpput ((DEPOT *) (char *) c:int (char *) c:int c:int) dll)
(c:define-dll-entry c:int dpout ((DEPOT *) (char *) c:int) dll)
(c:define-dll-entry (char *) dpget ((DEPOT *) (char *) c:int c:int c:int (c:int *)) dll)
(c:define-dll-entry c:int dpgetwb ((DEPOT *) (char *) c:int c:int c:int (char *)) dll)
(c:define-dll-entry c:int dpvsiz ((DEPOT *) (char *) c:int) dll)
(c:define-dll-entry c:int dpiterinit ((DEPOT *)) dll)
(c:define-dll-entry (char *) dpiternext ((DEPOT *) (c:int *)) dll)
(c:define-dll-entry c:int dpsetalign ((DEPOT *) c:int) dll)
(c:define-dll-entry c:int dpsync ((DEPOT *)) dll)
(c:define-dll-entry c:int dpoptimize ((DEPOT *) c:int) dll)
(c:define-dll-entry (char *) dpname ((DEPOT *)) dll)
(c:define-dll-entry c:int dpfsiz ((DEPOT *)) dll)
(c:define-dll-entry c:int dpbnum ((DEPOT *)) dll)
(c:define-dll-entry c:int dpbusenum ((DEPOT *)) dll)
(c:define-dll-entry c:int dprnum ((DEPOT *)) dll)
(c:define-dll-entry c:int dpwritable ((DEPOT *)) dll)
(c:define-dll-entry c:int dpfatalerror ((DEPOT *)) dll)
(c:define-dll-entry c:int dpinode ((DEPOT *)) dll)
(c:define-dll-entry c:int dpfdesc ((DEPOT *)) dll)
(c:define-dll-entry c:int dpremove ((char *)) dll)
(c:define-dll-entry c:int dprepair ((char *)) dll)
(c:define-dll-entry c:int dpinnerhash ((char *) c:int) dll)
(c:define-dll-entry c:int dpouterhash ((char *) c:int) dll)
(c:define-dll-entry c:int dpprimenum (c:int) dll)
)
(setq db (dpopen (si:make-string-chunk "test.qdbm")
(logior DP_OWRITER DP_OCREAT)
0))
3615104
(dpput db
(si:make-string-chunk "foo") -1
(si:make-string-chunk "bar") -1
DP_DKEEP)
1
(setq vbuf (si:make-chunk nil 4096))
#<chunk 93786188>
(setq size (dpgetwb db
(si:make-string-chunk "foo") -1
0 (1- (si:chunk-size vbuf)) vbuf))
3
(si:unpack-string vbuf 0 size)
"bar"
(dpclose db)
1
# -*- MODE: RUBY; Package: EDITOR; -*-
#
# $HeadURL: file:///G:/repo/ndiary_log/2004/06/20040621.diary $
#
# $LastChangedDate: 2004-06-22 00:57:21 +0900 (Tue, 22 Jun 2004) $
#
# $LastChangedRevision: 150 $
#
# $LastChangedBy: lkpteam $
#
# sample
# <!--plug=status?sfile=e:/www/ndiary/log/status.txt?template=e:/www/ndiary/log/status.html-->
#
def plug(opt)
status_file = opt['sfile'] if opt['sfile']
template = opt['template'] if opt['template']
st = ''
begin
open(status_file, 'r'){ |file|
st = file.read.split(/\n/).last
}
rescue Errno::ENOENT
return '<!--plug-in error: status file not found-->'
end
str = ''
if template then
begin
open(template, 'r'){ |file|
str = eval(file.read)
}
rescue Errno::ENOENT
return '<!--plug-in error: template file not found-->'
end
else
str << <<END
<div class="status">
STATUS:::#{st}
</div>
END
end
return str
end
"<div class=\"status\">
<div class=\"kln\">カレン「ねぇ、どうなってるの?」</div>
<div class=\"ponta\">ポン太さん「えーと、今は……#{st}になってるね」</div>
<div class=\"ponta\">ポン太さん「ちなみにこの状態は#{File.mtime(status_file).strftime("%Y年%m月%d日%H時%M分")}に設定されたみたい」</div>
<div class=\"kln\">カレン「ふーん……」</div>
</div>"
面接結果待ち
<hoge>
<hogehoge>
<foo>
</hogehoge>
</hoge>
(defun file-read (file)
(interactive)
(let ((buf (get-buffer-create "*result*"))
line *default-fileio-encoding* *default-eol-code*)
(set-buffer buf)
(setq need-not-save t)
(with-open-file (s file :encoding :text)
(with-output-to-selected-buffer
(while (setq line (read-char s nil))
(princ line)
)))))
(defun file-read-utf8 (file)
(interactive)
(let ((buf (get-buffer-create "*result*"))
line *default-fileio-encoding* *default-eol-code*)
(declare (special *default-fileio-encoding*))
(declare (special *default-eol-code*))
(setq *default-fileio-encoding* *encoding-utf8n*)
(setq *default-eol-code* *eol-lf*)
(set-buffer buf)
(set-buffer-fileio-encoding *encoding-utf8n*)
(set-buffer-eol-code *eol-lf*)
(setq need-not-save t)
(with-open-file (s file :encoding :raw)
(with-output-to-selected-buffer
(while (setq line (read-char s nil))
(princ line)
)))))
def toxml(diaries, putmonth = true, year = '')
body = ''
@diaries = diaries
topic = Marshal::load(filter_topics(diaries))
pattern = Regexp::compile(@pattern)
topic.keys.sort.reverse_each{ |month|
next unless month[0..3].index(year)
monthlink = []
monthxml = ''
topic[month].keys.sort.each{ |date|
d = Time::local(month[0..3], month[4..5], date)
monthxml << %Q!\t\t\t<date value="#{d.strftime2(@topicDateFormat)}">\n!
monthxml << topic[month][date].collect!{ |t|
monthlink << %Q!\t\t\t<file>\n\t\t\t\t\t<number>#{@monthPartNames[date.to_i]}</number>\n\t\t\t\t\t<url>#{date2monthlyfilelink(month+date)}</url>\n\t\t\t\t</file>!
begin
category = []
tmp = t[1].gsub(pattern,@replace)
while /\[(\w+)\]/ =~ tmp
category << $1
tmp.sub!($1,'')
end
category.uniq!
end
%Q!\t\t\t\t<topic>\n\t\t\t\t\t#{category.size != 0 ? "<title category=\"" + category.join(' ') + "\">" : "<title>"}#{t[1].gsub(pattern, @replace)}</title>\n\t\t\t\t\t<link>#{date2monthlyfilelink(month+date, true)}#{t[0]}</link>\n\t\t\t\t</topic>!
}.join("\n")
monthxml << "\n\t\t\t</date>\n"
}
if putmonth then
monthlink.uniq!
body << %Q!\t\t<month value="#{month}">\n\t\t\t<part>\n\t!
body << monthlink.join("\n\t")
body << %Q!\n\t\t\t</part>\n!
end
body << monthxml
body << "\t\t</month>\n"
}
if putmonth then
return "\t<topics>\n" + body + "\t</topics>"
else
return "\t<topics>\n" + body + "\t</topics>"
end
end
def writeXML(diaries, putmonth = true, year = nil)
@outputKcode = 1 if (@outputKcode < 1 or @outputKcode > 4)
if /\.xml?$/i !~ @filename then
years = []
if year.kind_of?(Array) then
years = year
elsif year.nil? then
enumerate_years(diaries).each{ |y|
years << y
}
else
years = [year]
end
years.each{ |y|
part_diaries = diaries.dup
part_diaries.delete_if{ |date| date[0..3] != y }
putxml(@outputDirectory + @filename + y + '.xml',
@logDirectory + @filename + '.xml', part_diaries, putmonth, y)
}
else
putxml(@outputDirectory + @filename, @logDirectory + @filename, diaries, putmonth)
end
end
def putxml(filename, skelton, diaries, putmonth, year = '')
out = open(filename, "w")
begin
infile = open(skelton)
infile.each { |line|
loadplugin(line)
if line.gsub!(/<!--body-->/i, "") then
out.print toxml(diaries, putmonth, year).kconv(@outputKcode)
end
out.print line.kconv(@outputKcode)
}
infile.close
out.close
rescue Errno::ENOENT
$stderr.puts "\n** error: topics skelton file: '#{skelton}' not found.\n"
return
end
print "make '#{filename}'\n"
end
def maketopiclist_xml
if !@config['TOPIC_XML'].nil? and @config['TOPIC_XML'].size > 0 then
t = Topics::new
t.topicDateFormat = @config['TOPIC_XML_DATE_FORMAT']
t.topicMonthFormat = @config['TOPIC_XML_MONTH_FORMAT']
t.diary = @pastdiary
@config['TOPIC_XML'].each{ |topic|
filename, regexp, pattern, replace = topic.split(/\t/)
t.skelton = filename
t.regexp = regexp ? regexp : ''
t.pattern = pattern ? pattern : ''
t.replace = replace ? replace : ''
t.writeXML(@pastdiary.allDiaries.keys, true, @years)
}
end
end
#make topic list ( xml )
ndiary.maketopiclist_xml
# ==== Topics ( XML ) ========
TOPIC_XML_MONTH_FORMAT = '%Y/%0m'
TOPIC_XML_DATE_FORMAT = '%0d (%e)'
TOPIC_XML = topics/topicsxml (\[PC\]|\[GAME\]|\[xyzzy\])$ [●◎□■◇◆△▲▽▼☆★]|\.\.\.とか *
#TOPIC_XML = topics/topicsxml [●◎□■◇◆△▲▽▼☆★]|\.\.\.とか *
# ==== End Topics ( XML ) ====
<?xml version="1.0" encoding="Shift_JIS" ?>
<!DOCTYPE ndiary SYSTEM "ndiary_custom.dtd">
<?xml-stylesheet href="default.xsl" type="text/xsl" media="screen" ?>
<ndiary>
<header>
<author>LKPTeam</author>
<sitename>LKPTeamの人生投げてます?な日記</sitename>
<site>http://www5d.biglobe.ne.jp/~lostland/ndiary/index.html</site>
<description>トピック一覧とか、そんなの。ただしxyzzy、PC、GAMEカテゴリのトピックのみリストアップ</description>
</header>
<!--body-->
</ndiary>
<!ELEMENT ndiary (header,topics)>
<!ELEMENT header (author, sitename, site, description)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT sitename (#PCDATA)>
<!ELEMENT site (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT topics (month+)>
<!ELEMENT month (part?,date+)>
<!ATTLIST month value CDATA #REQUIRED>
<!ELEMENT part (file+)>
<!ELEMENT file (number,url)>
<!ELEMENT number (#PCDATA)>
<!ELEMENT url (#PCDATA)>
<!ELEMENT date (topic+)>
<!ATTLIST date value CDATA #REQUIRED>
<!ELEMENT topic (title,link)>
<!ELEMENT title (#PCDATA)>
<!ATTLIST title category CDATA "none">
<!ELEMENT link (#PCDATA)>
<?xml version="1.0" encoding="Shift_JIS" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html xml:lang="ja" lang="ja">
<head>
<title>Topic List -- <xsl:value-of select="ndiary/header/sitename" /></title>
<style type="text/css">
body { background-color: #bcc5ca; }
a:link { text-decoration:none; color: #436976; }
a:visited { text-decoration:none; color: #536976; }
a:hover { text-decoration:underline; }
a:active { text-decoration:none; }
h1 { font-size:large; }
h2 { font-size:medium; margin-left:30px; }
li { font-size:x-small; }
dl { background-color: #dee7ec; }
dd { padding-left:0em; margin-left:0px; }
.backlink { text-align:right; font-size:x-small; }
</style>
</head>
<body>
<h1><xsl:text>Topic List -- </xsl:text><xsl:value-of select="ndiary/header/sitename" /></h1>
<h2><xsl:value-of select="ndiary/header/description" /></h2>
<div class="backlink">
<a>
<xsl:attribute name="href">
<xsl:value-of select="ndiary/header/site" />
</xsl:attribute>
<xsl:value-of select="ndiary/header/sitename" />
<xsl:text>に戻る</xsl:text>
</a>
</div>
<hr />
<xsl:apply-templates select="ndiary/topics/month" />
</body>
</html>
</xsl:template>
<xsl:template match="ndiary/topics/month">
<dl>
<dt><xsl:value-of select="concat(substring(@value,1,4),'年',substring(@value,5,2),'月')" /><xsl:text> ( </xsl:text><xsl:apply-templates select="part/file" /><xsl:text> )</xsl:text></dt>
<dd>
<xsl:apply-templates select="date" />
</dd>
</dl>
</xsl:template>
<xsl:template match="part/file">
<a>
<xsl:attribute name="href">
<xsl:value-of select="url" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="url" />
</xsl:attribute>
<xsl:value-of select="number" />
</a>
<xsl:choose>
<xsl:when test="last() = position()">
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> / </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="date">
<ul>
<li><xsl:value-of select="@value" /><xsl:text> </xsl:text><xsl:apply-templates select="topic" /></li>
</ul>
</xsl:template>
<xsl:template match="topic">
<a>
<xsl:attribute name="href">
<xsl:value-of select="link" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Category:</xsl:text><xsl:value-of select="title/@category" />
</xsl:attribute>
<xsl:value-of select="title" />
</a>
<xsl:choose>
<xsl:when test="last() = position()">
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> / </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
#!/usr/local/bin/ruby.exe -Ku
require 'uconv'
require "rexml/document"
file = Uconv.sjistou8(File.open("topicsxml2004.xml").read)
doc = REXML::Document.new file
body = ''
doc.elements.each("ndiary/topics/month"){ |el|
mhtml = "<dl><dt>" + el.attributes['value'][0..3] + "年"
mhtml << el.attributes['value'][4..5] + "月"
begin
month_part = []
el.elements.each("part/file"){ |part|
month_part << %Q!<a href="#{part.elements['url'].text}">#{part.elements['number'].text}</a>!
}
mhtml << " ( " + month_part.join(' / ') + " ) "
end
mhtml << "</dt>\n"
mhtml << "<dd><ul>\n"
el.elements.each("date"){ |d|
mhtml << %Q!<li>#{d.attributes['value']} !
li = []
d.elements.each("topic"){ |topic|
case topic.elements['title/@category'].to_s
when 'PC'
cl = 'pc'
when 'GAME'
cl = 'game'
when 'xyzzy'
cl = 'xyzzy'
else
cl = 'other'
end
li << %Q!<a href="#{topic.elements['link'].text}" class="#{cl}" title="#{topic.elements['title/@category']}">#{topic.elements['title'].text.gsub!(/(\[.+\])/,'')}</a>!
}
mhtml << li.join(' / ')
mhtml << "</li>\n"
}
body << mhtml + "</ul></dd></dl>\n"
}
html = <<END
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Topic List -- #{doc.elements['ndiary/header/sitename'].text}</title>
<style type="text/css">
body { color: #d0d0d0; background-color: #0f0f0f; }
a:link { text-decoration:none; color: #a3c9d6; }
a:visited { text-decoration:none; color: #638996; }
a:hover { text-decoration:underline; }
a:active { text-decoration:none; }
a.pc { text-decoration:none; color: #b0ffb0; }
a.pc:visited { text-decoration:none; color: #e0ffe0; }
a.pc:hover { text-decoration:underline; }
a.game { text-decoration:none; color: #b0b0ff; }
a.game:visited { text-decoration:none; color: #e0e0ff; }
a.game:hover { text-decoration:underline; }
a.xyzzy { text-decoration:none; color: #ffb0b0; }
a.xyzzy:visited { text-decoration:none; color: #ffe0e0; }
a.xyzzy:hover { text-decoration:underline; }
a.other { text-decoration:none; color: #b0b0b0; }
a.other:visited { text-decoration:none; color: #e0e0e0; }
a.other:hover { text-decoration:underline; }
h1 { font-size:large; }
h2 { font-size:medium; margin-left:30px; }
li { font-family: Verdana, sans-serif; font-size:x-small; }
dl { background-color: #2f2f2f; }
dd { padding-left:0em; margin-left:0px; }
.backlink { text-align:right; font-size:x-small; }
#category-summary { font-family: Verdana, Arial, sans-serif; font-size:small; }
#category-pc { color: #b0ffb0; }
#category-pc2 { color: #e0ffe0; }
#category-game { color: #b0b0ff; }
#category-game2 { color: #e0e0ff; }
#category-xyzzy { color: #ffb0b0; }
#category-xyzzy2 { color: #ffe0e0; }
#category-other { color: #b0b0b0; }
#category-other2 { color: #e0e0e0; }
</style>
</head>
<body>
<h1>Topic List -- #{doc.elements['ndiary/header/sitename'].text}</h1>
<h2>#{doc.elements['ndiary/header/description'].text}</h2>
<div class="backlink">
<a href="#{doc.elements['ndiary/header/site'].text}">#{doc.elements['ndiary/header/sitename'].text}に戻る</a>
</div>
<hr />
<div id="category-summary">
Category Color[Visited]:
<span id="category-pc">PC</span>[<span id="category-pc2">PC</span>] /
<span id="category-game">GAME</span>[<span id="category-game2">GAME</span>] /
<span id="category-xyzzy">xyzzy</span>[<span id="category-xyzzy2">xyzzy</span>] /
<span id="category-other">other</span>[<span id="category-other2">other</span>]
</div>
<!--body-->
</body>
</html>
END
print html.sub(/<!--body-->/,body)