<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Music and Technology - Medium]]></title>
        <description><![CDATA[Composition,Programming,Data Analysis and Tech - Medium]]></description>
        <link>https://medium.com/music-and-technology?source=rss----22d6b8c4a224---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Music and Technology - Medium</title>
            <link>https://medium.com/music-and-technology?source=rss----22d6b8c4a224---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 11:23:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/music-and-technology" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[WH-1000XM4の予約と各ストアの比較]]></title>
            <link>https://medium.com/music-and-technology/wh-1000xm4%E3%81%AE%E4%BA%88%E7%B4%84%E3%81%A8%E5%90%84%E3%82%B9%E3%83%88%E3%82%A2%E3%81%AE%E6%AF%94%E8%BC%83-6b741fa9c2f?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/6b741fa9c2f</guid>
            <category><![CDATA[日本語]]></category>
            <category><![CDATA[ソニー]]></category>
            <category><![CDATA[headphones]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[sony]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Sun, 23 Aug 2020 09:39:13 GMT</pubDate>
            <atom:updated>2020-08-23T09:39:13.372Z</atom:updated>
            <content:encoded><![CDATA[<p>2020/9/4にSonyのヘッドフォンの新作が出るので予約した。</p><p><a href="https://amzn.to/2Qjhb08">ソニー ワイヤレスノイズキャンセリングヘッドホン WH-1000XM4 : LDAC/Amazon Alexa搭載/Bluetooth/ハイレゾ 最大30時間連続再生 密閉型 マイク付 2020年モデル ブラック WH-1000XM4 B</a></p><p>現在使っているWH-1000XM3は2年ほど使い気に入っているが、アームの部分が壊れたりしているため（そして修理するのと買い直すのとあまり金額が変わらない）予約した。</p><p>予約する上で、Sony、ヨドバシ、ビックのECサイトを比べたので記載しておく。</p><p>Sony：会員だと（税前）10％オフクーポンが定期的にもらえる（？）ようだ。そのため、ヨドバシ、ビックが10％「ポイント」なのと比較すると良い。また3年保証が無料でついてくるのも他と比べて良い。ただ郵送が300円程度の課金、ヤマト指定するとさらに300円かかるのが微妙。</p><p>ヨドバシ：10％ポイント。配送料無料。しかし長期保証がECサイトからは申し込めないのが残念。</p><p>ビック：10％ポイント。配送料無料。長期保証（3年）がECサイトから申し込める。</p><p>ということで今回僕はビックで予約し、3年保証をつけました。楽しみ。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b741fa9c2f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/wh-1000xm4%E3%81%AE%E4%BA%88%E7%B4%84%E3%81%A8%E5%90%84%E3%82%B9%E3%83%88%E3%82%A2%E3%81%AE%E6%AF%94%E8%BC%83-6b741fa9c2f">WH-1000XM4の予約と各ストアの比較</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[解決：protectedcloudkeysyncing wants to use the local items]]></title>
            <link>https://medium.com/music-and-technology/%E8%A7%A3%E6%B1%BA-protectedcloudkeysyncing-wants-to-use-the-local-items-ae6aa0089edb?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/ae6aa0089edb</guid>
            <category><![CDATA[プログラミング]]></category>
            <category><![CDATA[日本語]]></category>
            <category><![CDATA[keychain]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Tue, 03 Mar 2020 05:54:45 GMT</pubDate>
            <atom:updated>2020-03-03T05:54:45.870Z</atom:updated>
            <content:encoded><![CDATA[<p>修理に出していたMacが帰ってきたので、TimeMachineを用いてデータを移行したら、</p><pre>protectedcloudkeysyncing wants to use the local items</pre><p>のPop upが出続けて詰んだ。Alfred4すら起動されない…</p><p>keychainsにLocal Itemsと言う空のものがあり、こいつが悪さしているようだ。</p><h3>解決方法</h3><p>下記の記事の下部に乗っている対応を行った。</p><p><a href="https://discussions.apple.com/thread/5473260">Local Items Keychain Password - Apple Community</a></p><pre>If everything from the above fails for whatever reason the last resort you can do the following:</pre><pre>Open terminal<br>cd ~/Library/Keychains<br>ls    <br>When you &#39;ls&#39; here you will see a folder that contains a bunch of random number liks so:<br>94ED610F-DD96-4ECF-A2BC-7D2F8651A464  (this number is unique on each system)<br>rm -rf 94ED610F-DD96-4ECF-A2BC-7D2F8651A464<br>Reboot<br>&lt;when you log back in everything should be back to normal&gt;</pre><p>僕の場合、</p><pre>~/Library/Keychains</pre><p>に4ファイルほどあったので別の所に移動し再起動。</p><p>するとPop upはでなくなった。</p><p>今の所、他の問題も起きずに済んでいる。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae6aa0089edb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/%E8%A7%A3%E6%B1%BA-protectedcloudkeysyncing-wants-to-use-the-local-items-ae6aa0089edb">解決：protectedcloudkeysyncing wants to use the local items</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scalaでfile.writeした時に件数が足りない]]></title>
            <link>https://medium.com/music-and-technology/scala%E3%81%A7file-write%E3%81%97%E3%81%9F%E6%99%82%E3%81%AB%E4%BB%B6%E6%95%B0%E3%81%8C%E8%B6%B3%E3%82%8A%E3%81%AA%E3%81%84-75d3cd838365?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/75d3cd838365</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[プログラミング]]></category>
            <category><![CDATA[scala]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Thu, 09 Jan 2020 08:00:05 GMT</pubDate>
            <atom:updated>2020-01-09T08:00:05.735Z</atom:updated>
            <content:encoded><![CDATA[<p>scalaで数字をサンプリングしファイルに書き込むことを行っていた</p><pre>for {</pre><pre>  _ &lt;- 1 to 10000</pre><pre>} {</pre><pre>  file.write(Functions.sample().toString + &quot;\n&quot; )</pre><pre>}</pre><p>この時、出力されたファイルを見ても10000行あるはずが9500行程度しかなく困っていた。</p><h3><strong>解決</strong></h3><pre>file.close()</pre><p>を行っていなかったからだった…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75d3cd838365" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/scala%E3%81%A7file-write%E3%81%97%E3%81%9F%E6%99%82%E3%81%AB%E4%BB%B6%E6%95%B0%E3%81%8C%E8%B6%B3%E3%82%8A%E3%81%AA%E3%81%84-75d3cd838365">Scalaでfile.writeした時に件数が足りない</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Poetryのインストールと仮想環境作成先の変更]]></title>
            <link>https://medium.com/music-and-technology/poetry%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%A8%E4%BB%AE%E6%83%B3%E7%92%B0%E5%A2%83%E4%BD%9C%E6%88%90%E5%85%88%E3%81%AE%E5%A4%89%E6%9B%B4-96e1bab83725?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/96e1bab83725</guid>
            <category><![CDATA[プログラミング]]></category>
            <category><![CDATA[pipenv]]></category>
            <category><![CDATA[poetry]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Tue, 24 Dec 2019 17:32:00 GMT</pubDate>
            <atom:updated>2019-12-24T17:35:34.628Z</atom:updated>
            <content:encoded><![CDATA[<p>pipenvが怪しくなってきたので、poetryを使ってみるよ。</p><h3>インストール</h3><p>こちらに従って進める。</p><p><a href="https://cocoatomo.github.io/poetry-ja">https://cocoatomo.github.io/poetry-ja</a></p><h3>仮想環境の作成先をprojectと同じディレクトリにする</h3><p>デフォルトだと仮想環境は`~/Library/Caches/pypoetry/virtualenvs/` に作られる。</p><p>project配下に .venv ファイルを作りたい場合は下記。</p><pre>$ poetry config --list<br>$ poetry config virtualenvs.in-project true</pre><p>上記を行う前に仮想環境を作ってしまっていた場合、その環境を削除する必要がある。</p><p>仮想環境の削除は下記。</p><pre>$ poetry env list<br>poetry-xx-py3.6</pre><pre>$ poetry env remove poetry-xx-py3.6</pre><p>上記を行った上で poetry install すれば .venv 環境がつくられる。</p><h3>参考にさせて頂いた記事</h3><ul><li><a href="https://cocoatomo.github.io/poetry-ja">Poetry documentation</a></li><li><a href="https://github.com/python-poetry/poetry/pull/731">New env command and sub commands by sdispater · Pull Request #731 · python-poetry/poetry</a></li></ul><p><a href="http://kk6.hateblo.jp/entry/2018/12/20/124151#venv%E3%81%AE%E4%BD%9C%E6%88%90%E5%85%88%E3%82%92%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E5%86%85%E3%81%AB%E3%81%97%E3%81%9F%E3%81%84">http://kk6.hateblo.jp/entry/2018/12/20/124151#venvの作成先をプロジェクト内にしたい</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96e1bab83725" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/poetry%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%A8%E4%BB%AE%E6%83%B3%E7%92%B0%E5%A2%83%E4%BD%9C%E6%88%90%E5%85%88%E3%81%AE%E5%A4%89%E6%9B%B4-96e1bab83725">Poetryのインストールと仮想環境作成先の変更</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[pipenvコマンドで`ModuleNotFoundError: No module named ‘pkg_resources’`]]></title>
            <link>https://medium.com/music-and-technology/pipenv%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%A7-modulenotfounderror-no-module-named-pkg-resources-9b5fda9b00d7?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/9b5fda9b00d7</guid>
            <category><![CDATA[pipenv]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[homebrew]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[プログラミング]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Tue, 10 Dec 2019 03:48:50 GMT</pubDate>
            <atom:updated>2019-12-10T03:48:50.815Z</atom:updated>
            <content:encoded><![CDATA[<p>pipenv コマンドを打ってもエラーが出てしまった</p><pre>$ pip install pipenv<br>$ pipenv — python 3.5<br>Traceback (most recent call last):<br> File “/usr/local/Cellar/pipenv/2018.7.1/libexec/bin/pipenv”, line 6, in &lt;module&gt;<br> from pkg_resources import load_entry_point<br>ModuleNotFoundError: No module named ‘pkg_resources’</pre><p>この理由は、以前に brew install pipenv しており、 pipenv がそちらを見てしまっていたから。</p><h4>対処法</h4><p>brew でインストールした pipenv は使っていなかったともあり、 brew uninstall pipenv した</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b5fda9b00d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/pipenv%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%A7-modulenotfounderror-no-module-named-pkg-resources-9b5fda9b00d7">pipenvコマンドで`ModuleNotFoundError: No module named ‘pkg_resources’`</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[macOS catalina でpython3.5をインストールしようとしたら詰まった]]></title>
            <link>https://medium.com/music-and-technology/macos-catalina-%E3%81%A7python3-5%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%9F%E3%82%89%E8%A9%B0%E3%81%BE%E3%81%A3%E3%81%9F-9480751e0416?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/9480751e0416</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[pyenv]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[プログラミング]]></category>
            <category><![CDATA[macos-catalina]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Sun, 08 Dec 2019 11:09:22 GMT</pubDate>
            <atom:updated>2019-12-08T11:13:55.055Z</atom:updated>
            <content:encoded><![CDATA[<pre>$ pyenv install 3.5.6<br>python-build: use openssl from homebrew<br>python-build: use readline from homebrew<br>Downloading Python-3.5.6.tar.xz...<br>-&gt; <a href="https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tar.xz">https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tar.xz</a><br>Installing Python-3.5.6...<br>python-build: use readline from homebrew</pre><pre>BUILD FAILED (OS X 10.15 using python-build 20180424)</pre><pre>Inspect or clean up the working tree at /var/folders/fd/gftrqmpn6553y7psnl368g9w0000gp/T/python-build.20191208194328.82654<br>Results logged to /var/folders/fd/gftrqmpn6553y7psnl368g9w0000gp/T/python-build.20191208194328.82654.log</pre><pre>Last 10 log lines:<br>  &quot;_Py_SetProgramName&quot;, referenced from:<br>      _main in _testembed.o<br>  &quot;_Py_SetStandardStreamEncoding&quot;, referenced from:<br>      _main in _testembed.o<br>ld: symbol(s) not found for architecture x86_64<br>clang: error: linker command failed with exit code 1 (use -v to see invocation)clang: error: linker command failed with exit code 1 (use -v to see invocation)</pre><pre>make: *** [Programs/_testembed] Error 1<br>make: *** Waiting for unfinished jobs....<br>make: *** [python.exe] Error 1<br></pre><p><a href="https://53ningen.com/macos-pyenv-binutils-error/">macOS で pyenv から python を導入する際 binutils が入ってるとコケる</a></p><p>↑上を参考にして再度インストールしたところ、別のメッセージとなった</p><pre>$ pyenv install 3.5.6<br>python-build: use openssl from homebrew<br>python-build: use readline from homebrew<br>Downloading Python-3.5.6.tar.xz...<br>-&gt; <a href="https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tar.xz">https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tar.xz</a><br>Installing Python-3.5.6...<br>python-build: use readline from homebrew</pre><pre>BUILD FAILED (OS X 10.15 using python-build 20180424)</pre><pre>Inspect or clean up the working tree at /var/folders/fd/gftrqmpn6553y7psnl368g9w0000gp/T/python-build.20191208195352.2757<br>Results logged to /var/folders/fd/gftrqmpn6553y7psnl368g9w0000gp/T/python-build.20191208195352.2757.log</pre><pre>Last 10 log lines:<br>  File &quot;/private/var/folders/fd/gftrqmpn6553y7psnl368g9w0000gp/T/python-build.20191208195352.2757/Python-3.5.6/Lib/ensurepip/__main__.py&quot;, line 4, in &lt;module&gt;<br>    ensurepip._main()<br>  File &quot;/private/var/folders/fd/gftrqmpn6553y7psnl368g9w0000gp/T/python-build.20191208195352.2757/Python-3.5.6/Lib/ensurepip/__init__.py&quot;, line 209, in _main<br>    default_pip=args.default_pip,<br>  File &quot;/private/var/folders/fd/gftrqmpn6553y7psnl368g9w0000gp/T/python-build.20191208195352.2757/Python-3.5.6/Lib/ensurepip/__init__.py&quot;, line 116, in bootstrap<br>    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)<br>  File &quot;/private/var/folders/fd/gftrqmpn6553y7psnl368g9w0000gp/T/python-build.20191208195352.2757/Python-3.5.6/Lib/ensurepip/__init__.py&quot;, line 40, in _run_pip<br>    import pip<br>zipimport.ZipImportError: can&#39;t decompress data; zlib not available<br>make: *** [install] Error</pre><p><a href="https://teratail.com/questions/149770">MacにPython 3.5.4を入れることが出来ない｜teratail</a></p><p>↑を参考に</p><pre>CFLAGS=&quot;-I$(xcrun --show-sdk-path)/usr/include&quot; pyenv install 3.5.6</pre><p>したところ無事インストールできた</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9480751e0416" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/macos-catalina-%E3%81%A7python3-5%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%9F%E3%82%89%E8%A9%B0%E3%81%BE%E3%81%A3%E3%81%9F-9480751e0416">macOS catalina でpython3.5をインストールしようとしたら詰まった</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode : Number of Connected Components in an Undirected Graph]]></title>
            <link>https://medium.com/music-and-technology/leetcode-number-of-connected-components-in-an-undirected-graph-e3063e182128?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/e3063e182128</guid>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[プログラミング]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Sun, 06 Oct 2019 05:32:06 GMT</pubDate>
            <atom:updated>2019-10-06T05:32:06.087Z</atom:updated>
            <content:encoded><![CDATA[<h3>LeetCode : Number of Connected Components in an Undirected Graph</h3><p><a href="https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/">https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/</a></p><p>連結グラフの数を数える問題</p><pre>class Solution(object):<br>    def countComponents(self, n, edges):<br>        &quot;&quot;&quot;<br>        :type n: int<br>        :type edges: List[List[int]]<br>        :rtype: int<br>        &quot;&quot;&quot;<br>        def add_to_connected(one,another,connected):<br>            if one in connected:<br>                connected[one].add(another)<br>            else:<br>                connected[one] = set([another])<br>                <br>        connected = {}<br>        for left, right in edges:<br>            add_to_connected(left,right,connected)<br>            add_to_connected(right,left,connected)<br>            <br>        checked = [0 for _ in range(n)]<br>        <br>        def dfs(connected, node):<br>            if checked[node] == 1:<br>                return True<br>            checked[node] = 1<br>            <br>            # 接続先が無ければ何もしない<br>            if not node in connected:<br>                return True<br>            <br>            for next_node in connected[node]:<br>                _ = dfs(connected, next_node)<br>               <br>            return True</pre><pre>        cnt = 0<br>        for i in range(n):<br>            if checked[i] == 0:<br>                cnt += 1<br>                _ = dfs(connected, i)<br>        <br>        return cnt</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3063e182128" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/leetcode-number-of-connected-components-in-an-undirected-graph-e3063e182128">LeetCode : Number of Connected Components in an Undirected Graph</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode:Find K Pairs with Smallest Sums]]></title>
            <link>https://medium.com/music-and-technology/leetcode-find-k-pairs-with-smallest-sums-a7ee79093819?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/a7ee79093819</guid>
            <category><![CDATA[heapq]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Sun, 22 Sep 2019 10:46:24 GMT</pubDate>
            <atom:updated>2019-09-22T10:46:24.863Z</atom:updated>
            <content:encoded><![CDATA[<p>This problem is difficult for me.</p><pre>class Solution(object):<br>    def kSmallestPairs(self, nums1, nums2, k):<br>        &quot;&quot;&quot;<br>        :type nums1: List[int]<br>        :type nums2: List[int]<br>        :type k: int<br>        :rtype: List[List[int]]<br>        &quot;&quot;&quot;<br>               <br>        tables = ([[1 for _ in range(len(nums2) + 1)]] +<br>                  [[1] + [0 for _ in range(len(nums2))] for _ in range(len(nums1))])<br>        # print(tables)<br>        def read_tables(i1,i2):<br>            return tables[i1+1][i2+1]<br>        <br>        def write_tables(i1,i2,num):<br>            tables[i1+1][i2+1] = num<br>            <br>        def push_output_and_write_table(idx1,idx2):<br>            outputs.append([nums1[idx1],nums2[idx2]])<br>            write_tables(idx1,idx2,1)<br>        <br>        if len(nums1)==0 or len(nums2) == 0:<br>            return []        <br>        <br>        candidates = [(nums1[0]+nums2[0],(0,0))]<br>        heapq.heapify(candidates)<br>        outputs = []<br>        <br>        while len(outputs) &lt; k and len(candidates) &gt; 0:<br>            _,(idx1,idx2) = heapq.heappop(candidates)<br>            push_output_and_write_table(idx1,idx2)<br>            if idx1+1 &lt; len(nums1) and read_tables(idx1+1,idx2-1) == 1:<br>                heapq.heappush(candidates, (nums1[idx1+1]+nums2[idx2],(idx1+1,idx2)))<br>            if idx2+1 &lt; len(nums2) and read_tables(idx1-1,idx2+1) == 1:<br>                heapq.heappush(candidates, (nums1[idx1]+nums2[idx2+1],(idx1,idx2+1)))<br>            <br>        <br>        return outputs</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7ee79093819" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/leetcode-find-k-pairs-with-smallest-sums-a7ee79093819">LeetCode:Find K Pairs with Smallest Sums</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode : Kth Largest Element in a Stream]]></title>
            <link>https://medium.com/music-and-technology/leetcode-kth-largest-element-in-a-stream-4e751e2c0e5c?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/4e751e2c0e5c</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[プログラミング]]></category>
            <category><![CDATA[coding-interviews]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[日本語]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Sat, 21 Sep 2019 09:11:55 GMT</pubDate>
            <atom:updated>2019-09-21T09:14:06.438Z</atom:updated>
            <content:encoded><![CDATA[<h3>LeetCode : <a href="https://leetcode.com/problems/kth-largest-element-in-a-stream/">Kth Largest Element in a Stream</a></h3><p>My submission is below.</p><pre>import bisect</pre><pre>class KthLargest(object):</pre><pre>def __init__(self, k, nums):<br>        &quot;&quot;&quot;<br>        :type k: int<br>        :type nums: List[int]<br>        &quot;&quot;&quot;<br>        <br>        self.k = k<br>        self.nums = sorted(nums)[-k:]</pre><pre>def add(self, val):<br>        &quot;&quot;&quot;<br>        :type val: int<br>        :rtype: int<br>        &quot;&quot;&quot;<br>        k = self.k<br>        bisect.insort(self.nums,val)<br>        if len(self.nums) &gt; k:<br>            self.nums = self.nums[-k:]<br>            <br>        return self.nums[0]</pre><p>This solution is slow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eRzM-hhAokF6EAFDTzapBA.png" /></figure><p>Faster solutions than mine are often written with heapq .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e751e2c0e5c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/leetcode-kth-largest-element-in-a-stream-4e751e2c0e5c">LeetCode : Kth Largest Element in a Stream</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[色弱の方向けにmatplotlibでグラフを作成する際のtips]]></title>
            <link>https://medium.com/music-and-technology/%E8%89%B2%E5%BC%B1%E3%81%AE%E6%96%B9%E5%90%91%E3%81%91%E3%81%ABmatplotlib%E3%81%A7%E3%82%B0%E3%83%A9%E3%83%95%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B%E9%9A%9B%E3%81%AEtips-5444e99b850b?source=rss----22d6b8c4a224---4</link>
            <guid isPermaLink="false">https://medium.com/p/5444e99b850b</guid>
            <category><![CDATA[colorblind]]></category>
            <category><![CDATA[matplotlib]]></category>
            <category><![CDATA[色弱]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[プログラミング]]></category>
            <dc:creator><![CDATA[takkii]]></dc:creator>
            <pubDate>Mon, 09 Sep 2019 10:20:56 GMT</pubDate>
            <atom:updated>2019-09-09T10:20:55.915Z</atom:updated>
            <content:encoded><![CDATA[<p>色弱の方だとグラフの色を区別できず、グラフの内容を理解するのが難しいことがある。</p><p>そのような時は、plt.styleで下記を指定すると良い。</p><pre>plt.style.use([&#39;seaborn-colorblind&#39;])</pre><p>グラフのデザインをいい感じにしてくれる。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5444e99b850b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/music-and-technology/%E8%89%B2%E5%BC%B1%E3%81%AE%E6%96%B9%E5%90%91%E3%81%91%E3%81%ABmatplotlib%E3%81%A7%E3%82%B0%E3%83%A9%E3%83%95%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B%E9%9A%9B%E3%81%AEtips-5444e99b850b">色弱の方向けにmatplotlibでグラフを作成する際のtips</a> was originally published in <a href="https://medium.com/music-and-technology">Music and Technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>