<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE feed [
      <!ENTITY lt "&#38;#60;">
      <!ENTITY gt "&#62;">
      <!ENTITY amp "&#38;#38;">
      <!ENTITY apos "&#39;">
      <!ENTITY quot "&#34;">
      <!ENTITY nbsp "&#160;">
      <!ENTITY copy "&#169;">
]>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title type="text">開発ブログ</title>
    <subtitle type="text">MASA Lab softlab-Software Architecture Laboratory</subtitle>
    <updated>2026-04-17T14:23:27+09:00</updated>
    <id>http://softlab.masa-lab.net/modules/d3blog/index.php</id>
    <link rel="alternate" type="text/xhtml" hreflang="ja" href="http://softlab.masa-lab.net/" />
    <link rel="self" type="application/atom+xml" href="http://softlab.masa-lab.net/modules/d3blog/index.php?page=atom" />
    <rights>Copyright &copy; 2008-2019 by MASA-Lab</rights>
    <generator uri="http://softlab.masa-lab.net/">D3BLOG - XOOPS BLOG MODULE</generator>
    <entry>
        <title>VMWare Workstation Pro でディスク拡張ができない！</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=371" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=371</id>
        <published>2022-04-06T19:20:45+09:00</published>
        <updated>2022-04-06T19:22:49+09:00</updated>
        <category term="開発プロジェクト" label="開発プロジェクト" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">VMWare WorkStation Pro でディスクを拡張しようとしたが、以下のエラーが出る
呼び出された機能は部分的なチェーンでは実行できません。親仮想ディスクを開いてください。
どうやらスナッ...</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>VMWare WorkStation Pro でディスクを拡張しようとしたが、以下のエラーが出る<br /><pre class="blogCode"><code>
呼び出された機能は部分的なチェーンでは実行できません。親仮想ディスクを開いてください。
</code></pre><br />どうやらスナップショットの削除がうまくいかずに<br />スナップショットがあるかのように見えているらしい<br />たしかにフォルダを眺めると<br />vmdk ファイルがいくつか残っている<br /><br />いったんスナップショットの作成を行って<br />すぐにスナップショットの削除を行って、無事にクリーンアップされてから<br />ディスクの拡張を行ったらうまくできた！<br /><br />よかったー</div>]]>
       </content>
    </entry>
    <entry>
        <title>Mac ntfs ドライブを読み書き可能でマウントする</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=324" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=324</id>
        <published>2020-06-01T15:55:38+09:00</published>
        <updated>2020-06-01T16:04:01+09:00</updated>
        <category term="開発プロジェクト" label="開発プロジェクト" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">とりあえず繋いじゃう読み取り専用になっているターミナルで
% sudo mount
すると
/dev/diskxxxx on /Volumes/USB_SSD (ntfs, local, nodev, nosuid, read-only, ...
的なものが出てくる(USB_SSD の場所はたぶんデ...</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>とりあえず繋いじゃう<br /><br />読み取り専用になっている<br /><br />ターミナルで<br /><pre class="blogCode"><code>
% sudo mount
</code></pre><br />すると<br /><pre class="blogCode"><code>
/dev/diskxxxx on /Volumes/USB_SSD (ntfs, local, nodev, nosuid, read-only, ...
</code></pre><br />的なものが出てくる<br />(USB_SSD の場所はたぶんディスクに付けた名前？)<br /><br />finder でマウントを解除<br />ターミナルで<br /><pre class="blogCode"><code>
% sudo mkdir /Volumes/USB_SSD_RW
% sudo mount -t ntfs -o nobrowse,rw /dev/diskxxx /Volumes/USD_SSD_RW/
% ln -s /Volumes/USB_SSD_RW ~/
</code></pre><br />とすると自分のホームディレクトリに USB_SSD_RW とかできるので<br />そこを読み書きする<br /><br />終わったら<br /><pre class="blogCode"><code>
% sudo umount /dev/diskxxx
% rm ~/USB_SSD_RW
</code></pre><br />とかする<br />(マウントポイント /Volumes/USB_SSD_RW は勝手に消される)<br /><br /><br />参考<br /><a href="https://qiita.com/amaebi/items/25471c4b494a252dfbde" rel="external">https://qiita.com/amaebi/items/25471c4b494a252dfbde</a></div>]]>
       </content>
    </entry>
    <entry>
        <title>XCode シミュレータのフォルダを探す</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=273" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=273</id>
        <published>2017-12-10T22:40:00+09:00</published>
        <updated>2019-04-03T15:05:02+09:00</updated>
        <category term="開発プロジェクト" label="開発プロジェクト" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">XCode で開発しているときに以前に使ったシミュレータが分からなくなってしまうことがある一生懸命データ追加したのに、別のシミュレータ立ち上げてしまって、表示されないとか悲しい...</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>XCode で開発しているときに<br />以前に使ったシミュレータが分からなくなってしまうことがある<br /><br />一生懸命データ追加したのに、別のシミュレータ立ち上げてしまって、表示されないとか悲しい<br /><br />という訳で、以前に使ったシミュレータのデバイスとバージョンを調べたい<br /><br /><pre class="blogCode"><code>
cd ~/Library/Developer/CoreSimulator/Devices
find . -name &#039;*.app&#039; -print | awk -F/ &#039;{print $2,$8}&#039;
</code></pre><br /><br />こうすると、シミュレータで動かしたアプリケーションの一覧とそのデバイス用のフォルダが得られる<br />(*.app の部分を具体的なアプリケーションの名前にすれば、そのアプリケーションを動かしたシミュレータのフォルダだけが表示される)<br /><pre class="blogCode"><code>
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx foobar.app
</code></pre><br /><br />判明したdeviceフォルダの中の device.plist を見る<br /><pre class="blogCode"><code>
cat xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/device.plist
</code></pre></div>]]>
       </content>
    </entry>
    <entry>
        <title>python cgi troubleshoot</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=234" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=234</id>
        <published>2017-10-28T22:00:00+09:00</published>
        <updated>2018-02-16T15:08:21+09:00</updated>
        <category term="Python" label="Python" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">python cgi でのトラブルシューティング環境変数の状態などを確認したい場合に以下を env.cgi として保存し .htaccess でアクセスさせる</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>python cgi でのトラブルシューティング<br />環境変数の状態などを確認したい場合に<br />以下を env.cgi として保存し .htaccess でアクセスさせる<br /><pre class="blogCode"><code>
#!/usr/local/bin/python
# -*- coding: utf-8 mode: python -*-

import os

def to_table(dic):
    keys = [key for key in dic]
    keys.sort()
    code = &quot;&lt;table style=&#039;border:solid&#039;&gt;&quot;
    for key in keys:
        code += &quot;&lt;tr&gt;&lt;th&gt;%s&lt;/th&gt;&lt;td&gt;%s&lt;/td&gt;&lt;/tr&gt;&quot; % (key, dic[key])
        pass
    code += &quot;&lt;/table&gt;&quot;
    return code

def application(environ, start_response):
    status = &quot;200 OK&quot;
    headers = [(&#039;Content-Type&#039;, &quot;text/html;charset=UTF-8&quot;)]
    code = &quot;&lt;html&gt;&lt;body&gt;&quot;
    code += &quot;&lt;h3&gt;environ&lt;/h3&gt;&quot;
    code += to_table(environ)
    code += &quot;&lt;h3&gt;os.environ&lt;/h3&gt;&quot;
    code += to_table(os.environ)
    code += &quot;&lt;/body&gt;&lt;/html&gt;&quot;
    start_response(status, headers)
    return [code]

if __name__ == &quot;__main__&quot;:
    from wsgiref.handlers import CGIHandler
    CGIHandler().run(application)
    pass
</code></pre></div>]]>
       </content>
    </entry>
    <entry>
        <title>python 開発環境</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=232" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=232</id>
        <published>2017-10-28T21:20:00+09:00</published>
        <updated>2018-02-16T15:06:17+09:00</updated>
        <category term="Python" label="Python" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">python で開発を行う場合に、virtualenv を使うと固有なパッケージなどを設定した仮想環境を作ることができる</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>python で開発を行う場合に、virtualenv を使うと<br />固有なパッケージなどを設定した仮想環境を作ることができる<br />■まずはインストール<br /><pre class="blogCode"><code>
% sudo easy_install virtualenv
</code></pre><br /><br />■使い方 (環境作成)<br /><br /><pre class="blogCode"><code>
% mkdir test
% cd test
% virtualenv --no-site-packages .
</code></pre><br /><br />これで bin/, local/, include/, lib/ などがカレントに作成される<br /><br />■使い方 (使う)<br /><pre class="blogCode"><code>
% source bin/activate
</code></pre><br /><br />で virtualenv に入る<br /><br />好きなものをインストールなど<br /><pre class="blogCode"><code>
(test) % pip install django
</code></pre><br /><br />virtualenv から出る<br /><pre class="blogCode"><code>
(test) % deactivte
</code></pre><br /><br /><br /><a href="http://qiita.com/H-A-L/items/5d5a2ef73be8d140bdf3" rel="external">http://qiita.com/H-A-L/items/5d5a2ef73be8d140bdf3</a></div>]]>
       </content>
    </entry>
    <entry>
        <title>coreserver (xrea) でpython</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=231" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=231</id>
        <published>2017-10-27T22:10:00+09:00</published>
        <updated>2018-02-16T15:06:29+09:00</updated>
        <category term="Python" label="Python" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">.htaccess に以下を追加AddHandler cgi-script .py.py は cgiスクリプトとして実行#! には 制限なし？#!/virtual/username/bin/python などもOKヘッダを出力しないと 500 エラーになるたとえば以下のようなもの...</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>.htaccess に以下を追加<br />AddHandler cgi-script .py<br /><br />.py は cgiスクリプトとして実行<br />#! には 制限なし？<br />#!/virtual/username/bin/python <br />などもOK<br /><br />ヘッダを出力しないと 500 エラーになる<br />たとえば以下のようなものを出力しておく<br />print 'Content-type: text/html; charset=UTF-8\n'<br /><br />RewriteBase は public_html 以下を書く<br />public_html/test1 なら<br /><br />RewriteBase /test1/<br /><br /><br />ちなみに coreserver では .htaccess に<br />Options<br />を書くとInternal Server Errorになる？</div>]]>
       </content>
    </entry>
    <entry>
        <title>swift で protocol を dict のキーにしたい</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=270" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=270</id>
        <published>2017-08-25T22:10:00+09:00</published>
        <updated>2018-02-16T15:28:43+09:00</updated>
        <category term="swift" label="swift" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">swift3swift で protocol を dict のキーにしたいswift の Dictionary のキーは Hashable でなければならないそこで protocol に Hashable をつけてみる
protocol Foo: Hashable {
  var a: Int { get }
}

var v: [Foo: Int] = [:...</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>swift3<br /><br />swift で protocol を dict のキーにしたい<br /><br />swift の Dictionary のキーは Hashable でなければならない<br />そこで protocol に Hashable をつけてみる<br /><br /><pre class="blogCode"><code>
protocol Foo: Hashable {
  var a: Int { get }
}

var v: [Foo: Int] = [:]
v[f] = 1

</code></pre><br />しかしこれでは<br />Using 'Foo' as a concrete type conforming to protocol 'Hashable' is not supported<br />Protocol 'Foo' can only be used as a generic constraint because it has Self or associated type requirements<br /><br />などとエラーになる<br />そこで ObjectIdentifier を使って<br /><pre class="blogCode"><code>
var v: [ObectIdentifier: Int] = [:]
v[ObjectIdentifier(f)] = 1
</code></pre><br />とするが<br />Cannot invoke initialize for type 'ObjectIdentifier' with an argument list of type '(Foo)'<br />となる<br />おそらく protocol は struct で実装することができ、<br />ObjectIdentifier は struct などには使えないからダメなのだろう<br />そこで Foo を class に限定する<br /><pre class="blogCode"><code>
protocol Foo: class {
  var a: Int { get }
}

var v: [ObjectIdentifier: Int] = [:]
v[ObjectIdentifier(f)] = 1
</code></pre><br /><br />これで完成！</div>]]>
       </content>
    </entry>
    <entry>
        <title>iOS アプリから外部ディスプレイへの出力</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=223" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=223</id>
        <published>2017-08-22T21:10:00+09:00</published>
        <updated>2018-02-16T15:27:32+09:00</updated>
        <category term="swift" label="swift" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">[UIScreen screens] count] で画面数を取得？http://do-gugan.com/~furuta/archives/2012/01/ios_4.htmlhttp://blog.syuhari.jp/archives/2251swiftだと自動的にreleaseされてしまうのでUIWindow のインスタンスは保持しておかなけ...</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>[UIScreen screens] count] で画面数を取得？<br /><a href="http://do-gugan.com/~furuta/archives/2012/01/ios_4.html" rel="external">http://do-gugan.com/~furuta/archives/2012/01/ios_4.html</a><br /><br /><a href="http://blog.syuhari.jp/archives/2251" rel="external">http://blog.syuhari.jp/archives/2251</a><br /><br />swiftだと自動的にreleaseされてしまうので<br />UIWindow のインスタンスは保持しておかなければダメ！</div>]]>
       </content>
    </entry>
    <entry>
        <title>swift coredata メソッド名に注意！</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=268" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=268</id>
        <published>2017-08-22T20:23:43+09:00</published>
        <updated>2018-02-16T15:27:16+09:00</updated>
        <category term="swift" label="swift" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">長いこと原因が分からなかったトラブルがようやくわかった！！！swift で CoreData を使っていた元々は ObjectiveC で書かれていたものを swift に書き直していたのだがなぜか CoreData で relationshi...</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>長いこと原因が分からなかったトラブルが<br />ようやくわかった！！！<br /><br />swift で CoreData を使っていた<br />元々は ObjectiveC で書かれていたものを swift に書き直していたのだが<br />なぜか CoreData で relationship しているプロパティに代入をする部分で<br /><pre class="blogCode"><code>
NSInvalidArgumentException reason: [NSSet intersectsSet:]: set argument is not an NSSet
</code></pre><br />というエラーが発生していたのだった<br /><br />原因は、自分で作成したメソッド名にあった<br />プロパティが members だとして<br />members にアクセスすると [Member]として取得できないので<br />func getMembers() -> [Member]<br />というメソッドを作成して、それを使っていたのだった<br />どうも、swift では getXxxxx というアクセッサが生成されているのか、<br />members にアクセスしたときに、getMembers() が呼ばれてしまい<br />そのために members が NSSet としてアクセスできなくなったためのようだ<br /><br />という訳で、プロパティ名に get なんちゃら というようなメソッドを<br />無意識に使ってしまうのは、とても危険ということ<br />ちなみに、メソッド名を考えるのが面倒だったので<br />_getXxxxx としたら、これもダメだったみたい<br />全然ちがう名前を付けなければダメ</div>]]>
       </content>
    </entry>
    <entry>
        <title>Frame には要注意</title>
        <link rel="alternate" type="text/xhtml" href="http://softlab.masa-lab.net/modules/d3blog/details.php?bid=265" />
        <id>http://softlab.masa-lab.net/modules/d3blog/details.php?bid=265</id>
        <published>2017-05-29T22:10:00+09:00</published>
        <updated>2018-02-16T15:25:59+09:00</updated>
        <category term="VCL" label="VCL" />
        <author>
            <name>masa</name>
        </author>
        <summary type="html" xml:base="http://softlab.masa-lab.net/" xml:lang="ja">VCL XE7LiveBindings で CustomFormat を設定しても一向に反映されないいや、デザインモードでは見えるのだが実行してみると反映されていないLiveBindings のバグなのかと思って、色々と試してみた...</summary>
       <content type="html" xml:lang="ja" xml:base="http://softlab.masa-lab.net/">
<![CDATA[<div>VCL XE7<br /><br />LiveBindings で CustomFormat を設定しても<br />一向に反映されない<br />いや、デザインモードでは見えるのだが<br />実行してみると反映されていない<br /><br />LiveBindings のバグなのかと思って、色々と試してみた<br />全然わからない<br /><br />結局、フレームのせいだった<br />フレームで、grid と PrototypeBindSource を設定して<br />そのフレームをフォームに張り付けていたのだが<br />どうもメインのフォームに張り付けたフレームで<br />IfThen などのCustomFormat が削除されてしまうのだ<br />何度やってもダメ<br />Bind 関係の uses が足りないせいか？と思って<br />色々追加するが結局ムダ<br /><br />張り付けて一回目のコンパイルはOKなのに<br />その後、すでにデザインモードで動作しなくなっている！！<br />そして再度コンパイルすると当然ダメ！<br />これひどい</div>]]>
       </content>
    </entry>
</feed>