<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>s2works</title>
    <link>http://s2works.homeunix.net/rss/</link>
    <language>ja</language>
    <ttl>40</ttl>
    <description>s2works の更新情報</description>
    
      
        <item>
          <title>とらのあな通販で見本の3, 4枚目を表示</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;h3&gt;説明&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;div class=&quot;image_right&quot;&gt;
      &lt;p&gt;&lt;a href=&quot;/download/images/greasemonkey/add_sample_page_in_toranoana.png&quot; class=&quot;thickbox&quot; title=&quot;Add sample page in toranoana&quot; rel=&quot;add_sample_page_in_toranoana&quot;&gt;&lt;img src=&quot;/download/images/greasemonkey/add_sample_page_in_toranoanas.jpg&quot; width=&quot;256&quot; height=&quot;190&quot; alt=&quot;Add sample page in toranoana&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
    &lt;/div&gt;
    &lt;p&gt;
      &lt;a href=&quot;http://www.toranoana.jp/mailorder/&quot; class=&quot;external&quot;&gt;とらのあなの通信販売&lt;/a&gt;で、標準では表示されない見本の3, 4枚目を表示します。
      ただし、ものによっては3, 4枚目の画像が存在しないため表示できません。
    &lt;/p&gt;
    &lt;p&gt;
      また、JavaScript によるポップアップを画像への直リンクに置き換えるため、
      &lt;a href=&quot;http://shiftingpixel.com/lightbox/&quot; class=&quot;external&quot;&gt;Greased Lightbox&lt;/a&gt; と併用すると快適になります。
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h3&gt;ダウンロード&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      &lt;a href=&quot;/download/files/greasemonkey/add_sample_page_in_toranoana_1.1.user.js&quot;&gt;add_sample_page_in_toranoana_1.1.user.js&lt;/a&gt;
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h3&gt;バージョン履歴&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;dl&gt;
      &lt;dt&gt;2010/02/18 ver.1.1&lt;/dt&gt;
      &lt;dd&gt;
        &lt;ul&gt;
          &lt;li&gt;XPath を使って書き直した。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/dd&gt;
    &lt;/dl&gt;
    &lt;dl&gt;
      &lt;dt&gt;2010/02/12 ver.1.0&lt;/dt&gt;
      &lt;dd&gt;
        &lt;ul&gt;
          &lt;li&gt;初版。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/dd&gt;
    &lt;/dl&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
          <pubDate>Fri, 12 Feb 2010 05:35:20 GMT</pubDate>
          <guid>http://s2works.homeunix.net/download/greasemonkey/add-sample-page-in-toranoana/</guid>
          <link>http://s2works.homeunix.net/download/greasemonkey/add-sample-page-in-toranoana/</link>
        </item>
      
        <item>
          <title>URL++/--</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;h3&gt;説明&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      URL をインクリメント/デクリメントする Bookmarklet です。
      URL 末尾の数字に1足した(引いた) URL へ移動します。
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h3&gt;インストール&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      以下のリンクをブックマークツールバーやお気に入り等へ入れてください。
    &lt;/p&gt;
    &lt;p&gt;
      &lt;a href=&quot;javascript:r=/^(.*?)(\d+)(\D*)$/;u=location.href;if(u.match(r)){s=u.replace(r,'$2');l=s.length;n=parseInt(s,10);n--;s=n.toString();while(s.length&amp;lt;l)s='0'+s;location.href=u.replace(r,'$1'+s+'$3');}&quot;&gt;URL--&lt;/a&gt;
      &lt;a href=&quot;javascript:r=/^(.*?)(\d+)(\D*)$/;u=location.href;if(u.match(r)){s=u.replace(r,'$2');l=s.length;n=parseInt(s,10);n++;s=n.toString();while(s.length&amp;lt;l)s='0'+s;location.href=u.replace(r,'$1'+s+'$3');}&quot;&gt;URL++&lt;/a&gt;
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h3&gt;動作確認&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;ul&gt;
      &lt;li&gt;Mozilla Firefox 3.5&lt;/li&gt;
      &lt;li&gt;Internet Explorer 8&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
          <pubDate>Fri, 12 Feb 2010 04:53:56 GMT</pubDate>
          <guid>http://s2works.homeunix.net/download/bookmarklet/increment-decrement-url/</guid>
          <link>http://s2works.homeunix.net/download/bookmarklet/increment-decrement-url/</link>
        </item>
      
        <item>
          <title>jTwitpic 1.4</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;p&gt;
    &lt;a href=&quot;/log/2009-12/jtwitpic/&quot;&gt;jTwitpic&lt;/a&gt; 1.4。
    Content-Type: multipart/alternative; に対応。
    これで HTML メールでも本文がつぶやきになるはず。
  &lt;/p&gt;
&lt;/div&gt;
</description>
          <pubDate>Thu, 28 Jan 2010 07:46:49 GMT</pubDate>
          <guid>http://s2works.homeunix.net/log/2010-01/jtwitpic-1-4/</guid>
          <link>http://s2works.homeunix.net/log/2010-01/jtwitpic-1-4/</link>
        </item>
      
        <item>
          <title>Google Reader で ASCII.jp の URL を置き換える</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;h3&gt;説明&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      &lt;a href=&quot;http://www.google.com/reader/&quot; class=&quot;external&quot;&gt;Google Reader&lt;/a&gt; で
      &lt;a href=&quot;http://ascii.jp/&quot; class=&quot;external&quot;&gt;ASCII.jp&lt;/a&gt; の
      記事を読むとリンク先が http://ascii.jp/elem/000/000/000/000000/summary.html?rss のような URL
      になっており「(続きはこちら)」をクリックしなければ全文を読めません。
      このスクリプトは URL を http://ascii.jp/elem/000/000/000/000000/ のように置き換え、すぐに全文を読めるようにします。
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h3&gt;ダウンロード&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      &lt;a href=&quot;/download/files/greasemonkey/replace_the_url_of_ascii.jp_in_google_reader_1.0.user.js&quot;&gt;replace_the_url_of_ascii.jp_in_google_reader_1.0.user.js&lt;/a&gt;
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h3&gt;バージョン履歴&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;dl&gt;
      &lt;dt&gt;2010/01/21 ver.1.0&lt;/dt&gt;
      &lt;dd&gt;
        &lt;ul&gt;
          &lt;li&gt;初版。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/dd&gt;
    &lt;/dl&gt;
  &lt;/div&gt;
&lt;/div&gt;
</description>
          <pubDate>Thu, 21 Jan 2010 04:04:13 GMT</pubDate>
          <guid>http://s2works.homeunix.net/download/greasemonkey/replace-the-url-of-ascii.jp-in-google-reader/</guid>
          <link>http://s2works.homeunix.net/download/greasemonkey/replace-the-url-of-ascii.jp-in-google-reader/</link>
        </item>
      
        <item>
          <title>jTwitpic 1.3</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;p&gt;
    本文につぶやきを入力しても大丈夫なように &lt;a href=&quot;/log/2009-12/jtwitpic/&quot;&gt;jTwitpic&lt;/a&gt; をバージョンアップ。
    件名と本文の両方が入力されている場合は「件名 本文」がつぶやきになります。
  &lt;/p&gt;
&lt;/div&gt;
</description>
          <pubDate>Thu, 21 Jan 2010 03:14:24 GMT</pubDate>
          <guid>http://s2works.homeunix.net/log/2010-01/jtwitpic-1-3/</guid>
          <link>http://s2works.homeunix.net/log/2010-01/jtwitpic-1-3/</link>
        </item>
      
        <item>
          <title>Google Reader でアキバ総研の画像リンク URL を置き換える</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;h3&gt;説明&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      &lt;a href=&quot;http://www.google.com/reader/&quot; class=&quot;external&quot;&gt;Google Reader&lt;/a&gt; で
      &lt;a href=&quot;http://akiba.kakaku.com/&quot; class=&quot;external&quot;&gt;アキバ総研 (秋葉原総合研究所)&lt;/a&gt; の
      記事を読むと全ての画像のリンク先が http://akiba.kakaku.com/# になっているので大きな画像を直接開けません。
      このスクリプトはサムネイル画像の URL から大きな画像の URL を推測してリンクを書き換え、
      大きな画像を直接開くことができるようにします。(あくまでも推測なのでたまに間違っている場合があります。)
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h3&gt;ダウンロード&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      &lt;a href=&quot;/download/files/greasemonkey/replace_the_image_link_url_of_akiba_souken_in_google_reader_1.0.user.js&quot;&gt;replace_the_image_link_url_of_akiba_souken_in_google_reader_1.0.user.js&lt;/a&gt;
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h3&gt;バージョン履歴&lt;/h3&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;dl&gt;
      &lt;dt&gt;2010/01/14 ver.1.0&lt;/dt&gt;
      &lt;dd&gt;
        &lt;ul&gt;
          &lt;li&gt;初版。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/dd&gt;
    &lt;/dl&gt;
  &lt;/div&gt;
&lt;/div&gt;</description>
          <pubDate>Thu, 14 Jan 2010 02:11:08 GMT</pubDate>
          <guid>http://s2works.homeunix.net/download/greasemonkey/replace-the-image-link-url-of-akiba-souken-in-google-reader/</guid>
          <link>http://s2works.homeunix.net/download/greasemonkey/replace-the-image-link-url-of-akiba-souken-in-google-reader/</link>
        </item>
      
        <item>
          <title>jTwitpic - 携帯電話から Twitpic へ文字化けせずにアップロードする</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;p&gt;
    携帯電話から &lt;a href=&quot;http://twitpic.com/&quot; class=&quot;external&quot;&gt;Twitpic&lt;/a&gt; へ日本語の文字化けなしでアップロードする為のサービスを作ってみた。
  &lt;/p&gt;
  &lt;p&gt;
    使い方は簡単。例えば Twitpic のメールアドレスが example.1234@twitpic.com の場合、件名か本文につぶやきを書き、写真を添付して example.1234@s2works.homeunix.net に送るだけ。
  &lt;/p&gt;
  &lt;p&gt;
    &lt;a href=&quot;/download/jtwitpic/&quot;&gt;スクリプトは別のページで公開中。&lt;/a&gt;
  &lt;/p&gt;
  &lt;p&gt;
    なにか問題があれば &lt;a href=&quot;http://twitter.com/saasan&quot; class=&quot;external&quot;&gt;saasan&lt;/a&gt; へどうぞ。
  &lt;/p&gt;
&lt;/div&gt;</description>
          <pubDate>Wed, 16 Dec 2009 23:41:32 GMT</pubDate>
          <guid>http://s2works.homeunix.net/log/2009-12/jtwitpic/</guid>
          <link>http://s2works.homeunix.net/log/2009-12/jtwitpic/</link>
        </item>
      
        <item>
          <title>jTwitpic</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;h2&gt;説明&lt;/h2&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      携帯電話から &lt;a href=&quot;http://twitpic.com/&quot; class=&quot;external&quot;&gt;Twitpic&lt;/a&gt; へ文字化けせずにアップロードする為の ruby スクリプトです。
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h2&gt;使用方法&lt;/h2&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      jtwitpic.rb を編集して設定を変更し起動します。
      ローカルに SMTP サーバーが立ち上がるのでそこにメールを送ります。
    &lt;/p&gt;
    &lt;p&gt;
      例えば、自分のサーバーが s2works.homeunix.net で Twitpic のメールアドレスが example.1234@twitpic.com の場合、
      件名か本文につぶやきを書き、写真を添付して example.1234@s2works.homeunix.net に送るだけです。
    &lt;/p&gt;
    &lt;p&gt;
      現在、当サーバーでも&lt;a href=&quot;/log/2009-12/jtwitpic/&quot;&gt;稼働中&lt;/a&gt;です。お試しください。
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h2&gt;動作に必要な物&lt;/h2&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;ul&gt;
      &lt;li&gt;ruby 1.8.7 以降&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;http://tmail.rubyforge.org/&quot; class=&quot;external&quot;&gt;TMail — A Ruby Email Handler&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;http://rubyist.g.hatena.ne.jp/muscovyduck/20070707/p1&quot; class=&quot;external&quot;&gt;smtpserver&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;SMTP サーバー&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;

  &lt;h2&gt;動作を確認した機種&lt;/h2&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;ul&gt;
      &lt;li&gt;docomo D705i&amp;mu;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;

  &lt;h2&gt;ダウンロード&lt;/h2&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;p&gt;
      &lt;a href=&quot;/download/files/jtwitpic_1.4.rb&quot;&gt;jtwitpic_1.4.rb&lt;/a&gt;
    &lt;/p&gt;
  &lt;/div&gt;

  &lt;h2&gt;バージョン履歴&lt;/h2&gt;
  &lt;div class=&quot;section&quot;&gt;
    &lt;dl&gt;
      &lt;dt&gt;2010/01/28 ver.1.4&lt;/dt&gt;
      &lt;dd&gt;
        &lt;ul&gt;
          &lt;li&gt;Content-Type: multipart/alternative; に対応した。これで HTML メールでも本文がつぶやきになるはず。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/dd&gt;
    &lt;/dl&gt;
    &lt;dl&gt;
      &lt;dt&gt;2010/01/21 ver.1.3&lt;/dt&gt;
      &lt;dd&gt;
        &lt;ul&gt;
          &lt;li&gt;Message-Id をちゃんと付けるようにした。&lt;/li&gt;
          &lt;li&gt;件名につぶやきが入力されていない場合エラーになる問題に対応した。&lt;/li&gt;
          &lt;li&gt;本文につぶやきが入力されている場合に対応した。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/dd&gt;
    &lt;/dl&gt;
    &lt;dl&gt;
      &lt;dt&gt;2010/01/16 ver.1.2&lt;/dt&gt;
      &lt;dd&gt;
        &lt;ul&gt;
          &lt;li&gt;エラーログを出力するようにした。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/dd&gt;
    &lt;/dl&gt;
    &lt;dl&gt;
      &lt;dt&gt;2009/12/21 ver.1.1&lt;/dt&gt;
      &lt;dd&gt;
        &lt;ul&gt;
          &lt;li&gt;例外処理を追加。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/dd&gt;
    &lt;/dl&gt;
    &lt;dl&gt;
      &lt;dt&gt;2009/12/16 ver.1.0&lt;/dt&gt;
      &lt;dd&gt;
        &lt;ul&gt;
          &lt;li&gt;初版。&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/dd&gt;
    &lt;/dl&gt;
  &lt;/div&gt;
&lt;/div&gt;</description>
          <pubDate>Wed, 16 Dec 2009 23:36:28 GMT</pubDate>
          <guid>http://s2works.homeunix.net/download/jtwitpic/</guid>
          <link>http://s2works.homeunix.net/download/jtwitpic/</link>
        </item>
      
        <item>
          <title>Windows 7 で JPEG 以外のファイルにもタグを付けたい</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;p&gt;
    Windows 7 (というか Vista 以降) ではエクスプローラー上で JPEG にタグを付けることができるが、
    PNG や GIF には付けることができない。
    画像に限らず、全てのファイルにタグを付けて管理できれば便利そうなのだが。
    ということで、エクスプローラーでできないならプログラムを組んで無理矢理タグを付けてみようという試み。
  &lt;/p&gt;
  &lt;pre&gt;&lt;code&gt;using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Text;

namespace ImageTag
{
  class EntryPoint
  {
    [STAThread]
    static void Main(string[] args)
    {
      const int FILE_EXPLORER_KEYWORDS = 0x9C9E;

      try
      {
        Image jpg = new Bitmap(&amp;quot;test.jpg&amp;quot;);
        Image png = new Bitmap(&amp;quot;test.png&amp;quot;);

        int[] pils = jpg.PropertyIdList;
        int index  = Array.IndexOf(pils, FILE_EXPLORER_KEYWORDS);
        PropertyItem pi = jpg.PropertyItems[index];

        System.Console.WriteLine(&amp;quot;pi.Type : {0}&amp;quot;, pi.Type);
        System.Console.WriteLine(&amp;quot;pi.Value.GetType() : {0}&amp;quot;, pi.Value.GetType());
        string tags = Encoding.Unicode.GetString(pi.Value);
        System.Console.WriteLine(&amp;quot;FILE_EXPLORER_KEYWORDS : {0}&amp;quot;, tags);

        png.SetPropertyItem(pi);
        png.Save(&amp;quot;tagged_test.png&amp;quot;, System.Drawing.Imaging.ImageFormat.Png);
        png.Save(&amp;quot;tagged_test.jpg&amp;quot;, System.Drawing.Imaging.ImageFormat.Jpeg);
      }
      catch( Exception exception)
      {
        Console.WriteLine(&amp;quot;ERROR : {0}&amp;quot;, exception);
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;p&gt;
    言語は C#。
    test.jpg に付いているタグを PropertyItems で取得して、それを test.png に SetPropertyItem で移植する。
    なんで移植するのかというと、PropertyItem をいちから作る方法がないらしいから。
    移植後、tagged_test.png と tagged_test.jpg として保存する。
  &lt;/p&gt;
  &lt;p&gt;
    結果は tagged_test.png にはタグが付かず、tagged_test.jpg にはタグが付いた状態になった。
    PNG だと保存時にタグが消えてしまうようだ。
  &lt;/p&gt;
  &lt;p&gt;
    結論 : JPEG 以外の画像ファイルにタグを付けるのは無理っぽい。
    下記の参考サイトによると、PropertyItems で取得するのは Exif 情報のようなので JPEG 以外で付けられないのも納得。
  &lt;/p&gt;
  &lt;p&gt;
    参考サイト
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;http://mark.michaelis.net/Blog/RetrievingMetaDataFromJPEGFilesUsingC.aspx&quot; class=&quot;external&quot;&gt;Mark Michaelis' Weblog - Retrieving Meta Data from JPEG Files Using C#&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;http://www.atmarkit.co.jp/fdotnet/dotnettips/047exif/exif.html&quot; class=&quot;external&quot;&gt;＠IT：.NET TIPS デジカメ画像のExif情報を取得するには？ - C#&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/p&gt;
&lt;/div&gt;</description>
          <pubDate>Sat, 12 Dec 2009 23:09:42 GMT</pubDate>
          <guid>http://s2works.homeunix.net/log/2009-12/windows-7-image-tag/</guid>
          <link>http://s2works.homeunix.net/log/2009-12/windows-7-image-tag/</link>
        </item>
      
        <item>
          <title>トップページのサイト内検索を Ajax 化</title>
          <description>&lt;div class=&quot;section&quot;&gt;
  &lt;p&gt;
    トップページのサイト内検索を Ajax 化してみた。
    &lt;a href=&quot;http://code.google.com/intl/ja/apis/ajaxsearch/&quot; class=&quot;external&quot;&gt;Google AJAX Search API&lt;/a&gt; と
    &lt;a href=&quot;http://jquery.com/&quot; class=&quot;external&quot;&gt;jQuery&lt;/a&gt;
    を利用。
    jQuery を使うと面倒な Ajax も簡単に書けるな。
  &lt;/p&gt;
&lt;/div&gt;
</description>
          <pubDate>Fri, 25 Sep 2009 06:05:36 GMT</pubDate>
          <guid>http://s2works.homeunix.net/log/2009-09/ajax-site-search/</guid>
          <link>http://s2works.homeunix.net/log/2009-09/ajax-site-search/</link>
        </item>
      
    
  </channel>
</rss>
