<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" >
  <channel>
  <title>Lutetiums</title>
  <link>https://lutetiums.koushijima.com/</link>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="https://lutetiums.koushijima.com/RSS/" />
  <description></description>
  <lastBuildDate>Tue, 13 Apr 2021 12:16:48 GMT</lastBuildDate>
  <language>ja</language>
  <copyright>© Ninja Tools Inc.</copyright>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />

    <item>
    <title>QGIS カスタム UI の日付入力は QgsDateTimeEdit を使う</title>
    <description>
    <![CDATA[<p>QGIS にて地物属性のフォームにカスタムUIを使う場合で日付・時刻を入力するフィールドを設ける場合、Input Widgets 内の QdateEdit やQdateTimeEdit は使用せず、QGIS custom widgets 内の QgsDateTimeEdit を使用する。（基本的にどんな入力についてもカスタム UI は QGIS custom widgets から使う）<br />
<br />
理由：<br />
Qt の標準日付入力は Nullable じゃないので、日付 Null の表現ができず、デフォルトの日付（時刻）が入力・表示されてしまう。<br />
一方、QgsDateTimeEdit は allowNull プロパティがあり Null を許容する。<br />
<img src="//lutetiums.koushijima.com/Img/1617800298/" alt="" /><br />
<br />
詳細：（QGIS 3.10.4 LTR）</p><br /><br /><a href="https://lutetiums.koushijima.com/gis/qgis20210407" target="_blank">つづきはこちら</a>]]>
    </description>
    <category>GIS</category>
    <link>https://lutetiums.koushijima.com/gis/qgis20210407</link>
    <pubDate>Wed, 07 Apr 2021 12:57:48 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/23</guid>
  </item>
    <item>
    <title>Windows 環境で Django のサービス化</title>
    <description>
    <![CDATA[Windows 環境で Django（含むGeoDjango）をサービス化するための備忘録。<br />
Linux なら<a class="external" href="https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/" title="">公式ドキュメント</a>にあるように uWSGI, gunicorn を使えばよい。<br />
<br />
<br />

<h4>使用するもの</h4>
<ol>
<li>&nbsp;<a class="external" href="https://github.com/Pylons/waitress" title="">Waitress WSGI server</a></li>
<li>&nbsp;<a class="external" href="https://github.com/winsw/winsw" title="">winsw</a></li>
</ol>
<h4>手順</h4>
<ol>
<li>django の venv 環境に waitress 追加<br />
<code>pip install waitress</code></li>
<li>winsw の xml 編集 (hoge はアプリケーションに合わせてい適宜修正) <br />

<pre class="brush: xml"><service>
 <id>waitress.service</id>
 <name>Waitress</name>
 <env name="VIRTUAL_ENV" value="D:\hoge\.venv"></env>
 <env name="PATH" value="%VIRTUAL_ENV%\Scripts;%PATH%"></env>
 <description>python ap server </description>
 <executable>waitress-serve</executable>
 <arguments>--port=8000 hoge.wsgi:application</arguments>
 <logmode>rotate</logmode>
</service>
</pre>
</li>
<li>winsw と xml を適当な名前に変更 して install （例 waitress.exe, waitress.xml にリネーム）<br />
<code>d:\hoge&gt;waitress.exe install</code></li>
<li>サービスに登録されていることを確認<br />
<a target="_blank" href="//lutetiums.koushijima.com/File/waitress.png" title=""><img src="//lutetiums.koushijima.com/Img/1598163060/" alt="" /></a></li>
</ol><br />
上記設定は ipv4 の場合。ipv6 でサービス実行する場合は 起動時の引数のポート番号部分を変える。<br />
waitress-serve --listen=*:8000 hoge.wsgi:application]]>
    </description>
    <category>Python</category>
    <link>https://lutetiums.koushijima.com/python/20200823_django</link>
    <pubDate>Sun, 23 Aug 2020 05:28:59 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/22</guid>
  </item>
    <item>
    <title>QGIS で角度をつけたポイントとラベル</title>
    <description>
    <![CDATA[<h4>角度を持たせたポイントでラベルをシンボルの先に表示したい場合の設定方法</h4>
<h4>【条件】</h4>
<p>属性に回転角とラベル表示する文字列が入力されている</p>
<ul>
<li>"angle" にシンボルの角度（0&deg;〜360&deg;）</li>
<li>&rdquo;label&rdquo; に注記として表示する文字列</li>
</ul>
この注記ラベルを矢印の先にうまい具合に表示したい<br />
<br />
<br />

<p class="caption">矢印シンボルにのみ角度を設定した状態</p>
<a target="_blank" href="//lutetiums.koushijima.com/File/Screenshot_20190906_001351.png" title=""><img src="//lutetiums.koushijima.com/Img/1567696453/" alt="" /></a>
<p class="caption"></p><br /><br /><a href="https://lutetiums.koushijima.com/gis/qgis20190905" target="_blank">つづきはこちら</a>]]>
    </description>
    <category>GIS</category>
    <link>https://lutetiums.koushijima.com/gis/qgis20190905</link>
    <pubDate>Thu, 05 Sep 2019 15:23:20 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/20</guid>
  </item>
    <item>
    <title>Shift + Delete で削除してしまったディレクトリ・ファイルの復旧 TestDisk</title>
    <description>
    <![CDATA[<h3>やりたいこと</h3>
<ul>
<li>Windows、Linux で"Shift+Delete" や "ゴミ箱を空にする" で消してしまったファイルを復旧する</li>
<li>ディレクトリ構造を維持したまま復旧する&larr;重要</li>
</ul>
<h3>用意するもの</h3>
<ol>
<li>復旧データを保存するために十分な空き容量のあるハードディスク<br />
NASやクラウドでもマウントできていればOK<br />
（復旧したいデータが保存されていたハードディスクとは別の保存領域。 同じディスクでは復旧中に上書きしてしまって、取り戻せなくなるファイルが出る）</li>
<li>復旧ソフト <a href="https://www.cgsecurity.org/wiki/TestDisk" title="" class="external">TestDisk</a></li>
</ol>
<h4>手順</h4>
<a href="https://www.cgsecurity.org/wiki/TestDisk_Step_By_Step" title="" class="external">TestDisk Step-by-Step</a> 参照<br />
<br />
FAT12, FAT16, FAT32, ext2, NTFS のパーティションからのファイル復旧手順が <span class="mw-headline" id="Recover_deleted_files">Recover deleted files の項目にあります。</span><br />

<h3>何故 TestDisk か</h3>
対応しているフォーマットであれば、ディレクトリ構造を維持したまま復旧されるので、ルートからごっそり削除した場合でも、コマンド打って一晩ほっておけば大体復旧できる。（意図して削除したファイルも戻るので、復旧後いらないファイルは再度削除する。）<br />
ディレクトリ構造無視して復旧するソフトでは、同じ名前のファイルが複数フォルダに有った場合、毎回別の保存先を指定しなくてはならず、放ったらかしにできない。<br />

<div><br />

<table border="1">
<tbody>
<tr>
<td style="background-color: #ccc; text-align: center;">復旧ソフト名</td>
<td style="background-color: #ccc; text-align: center;">復元数制限</td>
<td style="background-color: #ccc; text-align: center;">ディレクトリ構造</td>
<td style="background-color: #ccc; text-align: center;">安定性</td>
</tr>
<tr>
<td>Recuva</td>
<td style="text-align: center;">◯ <br />
制限無し</td>
<td style="text-align: center;">&times;</td>
<td style="text-align: center;">◯</td>
</tr>
<tr>
<td>DataRecovery</td>
<td style="text-align: center;">△<br />
仕様上は無し</td>
<td style="text-align: center;">◯</td>
<td style="text-align: center;">△<br />
大量のファイル復旧はできない<br />
（落ちる）</td>
</tr>
<tr>
<td>EaseUS Data Recovery <br />
Wizard Free 12.8</td>
<td style="text-align: center;">&times;<br />
500MBまで</td>
<td style="text-align: center;">&times;</td>
<td style="text-align: center;">◯</td>
</tr>
<tr>
<td>TestDisk</td>
<td style="text-align: center;">◯</td>
<td style="text-align: center;">◯</td>
<td style="text-align: center;">◯</td>
</tr>
</tbody>
</table>
</div>]]>
    </description>
    <category>Linux</category>
    <link>https://lutetiums.koushijima.com/linux/20181231_undelete</link>
    <pubDate>Mon, 31 Dec 2018 13:56:50 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/19</guid>
  </item>
    <item>
    <title>無料帳票印刷ライブラリ （C# Windows Form アプリケーション）ーその３－</title>
    <description>
    <![CDATA[<h3>Windows Form に配置・データソース設定</h3>
<br />
単純な .Net Form アプリケーションにレポートのプレビュー画面を配置。<br />
プログラム側からデータソースを設定するサンプルです。<br />
<br />

<pre class="brush: csharp"> 
using System;
using System.Data;
using System.Windows.Forms;

using Npgsql;

namespace RDLReport
{
    public partial class Form1 : Form
    {
        private fyiReporting.RdlViewer.ViewerToolstrip reportToolStrip;
        private fyiReporting.RdlViewer.RdlViewer rdlViewer1;
        public Form1()
        {
            InitializeComponent();
            this.SuspendLayout();


            // 
            // rdlViewer（印刷プレビュー）
            // 
            this.rdlViewer1 = new fyiReporting.RdlViewer.RdlViewer();
            this.rdlViewer1.Cursor = System.Windows.Forms.Cursors.Default;
            this.rdlViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.rdlViewer1.dSubReportGetContent = null;
            this.rdlViewer1.Folder = null;
            this.rdlViewer1.HighlightAll = false;
            this.rdlViewer1.HighlightAllColor = System.Drawing.Color.Fuchsia;
            this.rdlViewer1.HighlightCaseSensitive = false;
            this.rdlViewer1.HighlightItemColor = System.Drawing.Color.Aqua;
            this.rdlViewer1.HighlightPageItem = null;
            this.rdlViewer1.HighlightText = null;
            this.rdlViewer1.Location = new System.Drawing.Point(0, 0);
            this.rdlViewer1.Name = "rdlViewer1";
            this.rdlViewer1.PageCurrent = 1;
            this.rdlViewer1.Parameters = "";
            this.rdlViewer1.ReportName = null;
            this.rdlViewer1.ScrollMode = fyiReporting.RdlViewer.ScrollModeEnum.Continuous;
            this.rdlViewer1.SelectTool = false;
            this.rdlViewer1.ShowFindPanel = false;
            this.rdlViewer1.ShowParameterPanel = false;
            this.rdlViewer1.ShowWaitDialog = true;
            this.rdlViewer1.Size = new System.Drawing.Size(580, 472);
            this.rdlViewer1.SourceFile = null;
            this.rdlViewer1.SourceRdl = null;
            this.rdlViewer1.TabIndex = 0;
            this.rdlViewer1.UseTrueMargins = true;
            this.rdlViewer1.Zoom = 0.4202973F;
            this.rdlViewer1.ZoomMode = fyiReporting.RdlViewer.ZoomEnum.FitPage;
            this.Controls.Add(this.rdlViewer1);


          ///
         /// 印刷ボタン等
         ///
            reportToolStrip = new fyiReporting.RdlViewer.ViewerToolstrip(rdlViewer1);
            this.Controls.Add(reportToolStrip);


            this.ResumeLayout(false);


          ///
         /// レポートにデータ流し込み
         ///
            LoadData();
        }

        private void LoadData()
        {
            // 流し込み用データ取得　（レポート側はDataTable で受け取るのでその準備）
            string constring = @"Server = 127.0.0.1; Port = 5432; User Id = postgres; Password = *****; Database = dvdrental;";
            using (NpgsqlConnection conn = new NpgsqlConnection(constring))
            {
                string sql = "Select * from staff where first_name='Mike';";
                NpgsqlDataAdapter dataAdapter = new NpgsqlDataAdapter(sql, conn);
                DataSet dataSet = new DataSet();
                dataAdapter.Fill(dataSet);
                DataTable dt = dataSet.Tables[0];
                try
                {
                    // RDLファイル読み込み
                    rdlViewer1.SourceFile = new Uri(@"C:\test.rdl");
                    //データ流し込み
                    rdlViewer1.Report.DataSets["Data"].SetData(dataSet.Tables[0]);
                    // パラメータにデータセット
                    rdlViewer1.Parameters += string.Format("param1={0}", "スタッフ情報");
                    rdlViewer1.Rebuild();
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.Print(ex.Message);
                }
            }
        }
    }
}
</pre>
実行するとツールバー付きの印刷プレビュー画面が表示できる。<br />
<br />
<a target="_blank" href="//lutetiums.koushijima.com/File/PreviewSample.png" title=""><img src="//lutetiums.koushijima.com/Img/1540476230/" alt="" /></a> <br />
<br />
<br />
［ <a href="http://lutetiums.koushijima.com/cs/cs_report_20181014" title="">その１：概要・参照設定</a>｜<a href="http://lutetiums.koushijima.com/cs/cs_report_20181016" title="">その２：RDLデザイン</a> ］]]>
    </description>
    <category>C#</category>
    <link>https://lutetiums.koushijima.com/cs/cs_report_20181024</link>
    <pubDate>Wed, 24 Oct 2018 14:54:07 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/18</guid>
  </item>
    <item>
    <title>無料帳票印刷ライブラリ （C# Windows Form アプリケーション）ーその２－</title>
    <description>
    <![CDATA[<h3>データソース作成</h3>
以降　postgres 使います。<br />
<br />
サンプルDBは以下より&darr;<br />
<a href=" http://www.postgresqltutorial.com/postgresql-sample-database/" title="" target="_blank">http://www.postgresqltutorial.com/postgresql-sample-database/</a><br />
<br />
dvdrental&nbsp; データベースを手順に沿って作成<br />
<br />

<h3>RDL編集</h3>
<h4>・準備</h4>
My-FyiReportingの配布 zip には Npgsql.dll が同梱されていないので、別途<a href="http://pgfoundry.org/frs/?group_id=1000140" title="" target="_blank">ダウンロード</a>して、<br />
前回<a href="https://github.com/majorsilence/My-FyiReporting/wiki/Downloads" title="">ダウンロード</a>したMy-FyiReporting を展開したフォルダにコピーしてておく<br />

<h4>・RDL作成</h4>
デザイナ（RDLDesigner.exe）を起動<br />
<a target="_blank" href="//lutetiums.koushijima.com/File/RDLDsigner.png" title=""><img src="//lutetiums.koushijima.com/Img/1539698703/" alt="" /></a> <br />
［File］ メニューの［New Report］をクリック<br /><br /><a href="https://lutetiums.koushijima.com/cs/cs_report_20181016" target="_blank">つづきはこちら</a>]]>
    </description>
    <category>C#</category>
    <link>https://lutetiums.koushijima.com/cs/cs_report_20181016</link>
    <pubDate>Sun, 14 Oct 2018 15:04:28 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/17</guid>
  </item>
    <item>
    <title>無料帳票印刷ライブラリ  （C# Windows Form アプリケーション）</title>
    <description>
    <![CDATA[ライブラリを購入する必要がないというだけで、手間はかかるので、トータルコストは帳票製品を購入したほうが安いはずです。<br />
<br />
人件費はかけられるけど物品の購入はできないとか、客先用件でどうしてもオープンソースのみとか、特殊な要件に限られると思いますが、以下解説。
<h3>紹介するライブラリ</h3>
<a href="https://github.com/majorsilence/My-FyiReporting" title="My-FyiReporting">My-FyiReporting<br />
<br />
</a>
<h3>依存するライブラリ</h3>
<ul>
<li><a href="https://github.com/zxing/zxing" title="">ZXing</a></li>
<li><a href="https://github.com/icsharpcode/SharpZipLib" title="">SharpZipLib</a></li>
<li><a href="https://github.com/schourode/iTextSharp-LGPL" title="">iTextSharp 4</a></li>
</ul>
<h3>ライセンス（2018年10月現在）</h3>
<table style="width: 312px; height: 140px;" border="1">
<thead>
<tr>
<td style="text-align: center; background-color: #ccc;">ライブラリ名</td>
<td style="text-align: center; background-color: #ccc;">ライセンス</td>
</tr>
</thead>
<tbody>
<tr>
<td>My-FyiReporting</td>
<td>Apache License 2.0</td>
</tr>
<tr>
<td>ZXing</td>
<td>Apache License 2.0</td>
</tr>
<tr>
<td>SharpZipLib</td>
<td>MIT</td>
</tr>
<tr>
<td>iTextSharp 4</td>
<td>LGPL</td>
</tr>
</tbody>
</table>
*iTextSharp は 5 以降AGPLのためソースコードを公開できない商用アプリケーションの場合はコマーシャルライセンスを購入する必要あり。<br />
バグや<a href="https://developers.itextpdf.com/question/versions-older-than-5" title="">著作権侵害コードの混入</a>を防ぐため&nbsp; iTextSharpは外したほうが安全。（外しても帳票の作成・印刷はできます。）<br /><br /><a href="https://lutetiums.koushijima.com/cs/cs_report_20181014" target="_blank">つづきはこちら</a>]]>
    </description>
    <category>C#</category>
    <link>https://lutetiums.koushijima.com/cs/cs_report_20181014</link>
    <pubDate>Sun, 14 Oct 2018 05:25:36 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/16</guid>
  </item>
    <item>
    <title>セッションが複数あるCD-Rを読む（Linux）</title>
    <description>
    <![CDATA[セッション数の確認<br />
<code>cdrdao disk-info --device /dev/cdrom</code><br />
<br />
指定のセッションをマウント<br />
<code>sudo mount /dev/cdrom /mnt -t iso9660 -o session=0</code><br />
<br />
"session="にて読み込むセッション番号を指定する（0からセッション数-1まで）<br />
<br />
アンマウントは以下<br />
<code>sudo umount /mnt</code><br />
<br />
古いMacで追記を繰り返したマルチセッションのCD-Rが、Windowsでは最後に焼いたデータしか読めなかったので。 <br />
やっぱりLinuxは便利(^-^) 実行環境は Suse Leap 42.3]]>
    </description>
    <category>Linux</category>
    <link>https://lutetiums.koushijima.com/linux/20180610</link>
    <pubDate>Sat, 09 Jun 2018 15:45:07 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/15</guid>
  </item>
    <item>
    <title>Suse Leap 42.2 ディスクアクセスが頻発して重い （baloo_file）</title>
    <description>
    <![CDATA[Open Suse 13.2 から Suse Leap 42.2 にアップデートして以降、なんとなく動作がモッサリしたなと思っていたら、日に日に重たくなり最近固まりかける。<br />
KSysGuardをみてみたら、 baloo_file_extractor がやたらとメモリを食っていた。<br />
<br />
<a target="_blank" href="//lutetiums.koushijima.com/File/Screenshot_20170601_225732.png" title=""><img src="//lutetiums.koushijima.com/Img/1496329511/" alt="" /></a> <br />
<br />
何をするにも固まりかけるので、ひとまず<br />
<br />
<code>balooctl stop</code><br /><br /><a href="https://lutetiums.koushijima.com/linux/2170601" target="_blank">つづきはこちら</a>]]>
    </description>
    <category>Linux</category>
    <link>https://lutetiums.koushijima.com/linux/2170601</link>
    <pubDate>Thu, 01 Jun 2017 15:02:08 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/14</guid>
  </item>
    <item>
    <title>nanoCAD インストール手順</title>
    <description>
    <![CDATA[AutoCAD の代わりになるCADソフト探しの候補の１つ nanoCAD フリー版のダウンロードからインストールまで<br />
<ol>
<li><a href="https://nanocad.com/" title="nanoCAD 公式" class="external">https://nanocad.com/</a>のDownload nanoCAD をクリック<a target="_blank" href="//lutetiums.koushijima.com/File/NanoCad1.png" title=""><img src="//lutetiums.koushijima.com/Img/1486048215/" alt="" /><br />
</a></li>
</ol><br /><br /><a href="https://lutetiums.koushijima.com/cad/20170203" target="_blank">つづきはこちら</a>]]>
    </description>
    <category>CAD</category>
    <link>https://lutetiums.koushijima.com/cad/20170203</link>
    <pubDate>Thu, 02 Feb 2017 15:20:50 GMT</pubDate>
    <guid isPermaLink="false">lutetiums.koushijima.com://entry/11</guid>
  </item>

    </channel>
</rss>