question
dict
answers
list
id
stringlengths
2
5
accepted_answer_id
stringlengths
2
5
popular_answer_id
stringlengths
2
5
{ "accepted_answer_id": "48778", "answer_count": 2, "body": "```\n\n #include <stdio.h>\n int main()\n {\n int end = 0;\n char d[5];\n int digits = 0;\n d[digits++] = digits;\n printf(\"digits=%d\\n\",digits);\n printf(\"d[0]=%d\\n\",d[0]);\n \n do{\n printf(\"if enter 1, end.\");\n scanf(\"%d\",&end);\n }while (end = 0);\n \n return 0;\n }\n \n```\n\n\\---実行結果--- \ndigits=1 \nd[0]=1 \nif enter 1, end.\n\n\\---僕の理想の実行結果--- \ndigits=1 \nd[0]=0 ←ここが0 \nif enter 1, end.", "comment_count": 4, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T00:13:26.797", "favorite_count": 0, "id": "48777", "last_activity_date": "2018-09-28T01:06:56.427", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "20666", "post_type": "question", "score": 6, "tags": [ "c" ], "title": "d[digits++] = digits;と書くと、インクリメントは式が終わったあとって聞いたんですけど、なってないみたいです。誰か説明してくれませんか。", "view_count": 283 }
[ { "body": "式が終わった後にインクリメントされてるから`d[0]`に`1`が入ってるんですよ。\n\nインクリメントは値を返した後に行われます。 \nつまり、`digits`の値を`d[digits++]`に使った後には加算済み。 \nなので、左辺の処理が終わった後には`digits`は加算済みで、その後右辺が処理され、代入処理がうごいていると思われます。\n\nただ、この左辺と右辺の演算順は定義されていなかったんじゃないかな? \nなのでビルド環境を変えると、右辺処理して、左辺処理して、インクリメント、代入と所望の動きが得られるものもあるんじゃないかと思います。\n\nCでは定義されていない仕様もあ...
48777
48778
48779
{ "accepted_answer_id": "49000", "answer_count": 1, "body": "IJCAD2018でC#を使用して開発をしています。 \n事前選択で選択フィルターを適用した選択結果を取得したいのですが、用意されているCADの.Net APIに該当する機能が見つかりませんでした。 \nSelectImpliedに選択フィルターが設定できればよいのですが、オプションを指定することができませんでした。\n\n該当等する機能か回避方法があればご教示をお願いいたします。\n\n```\n\n [CommandMethod(\"test\", CommandFlags.Session | CommandFlags.UsePickSet)]\n public static void Test()\n {\n SelectionSet ss;\n SelectPick(out ss);\n \n }\n \n // 事前選択の結果を取得\n public static void SelectPick(out SelectionSet dst)\n {\n dst = null;\n \n // 選択フィルタ作成\n var selFilter = new SelectionFilter(new []\n {\n new TypedValue((int)DxfCode.Operator, \"<OR\"), \n new TypedValue((int)DxfCode.Start, \"INSERT\"), \n new TypedValue((int)DxfCode.Start, \"LINE\"), \n new TypedValue((int)DxfCode.Operator, \"OR>\"), \n });\n \n // 事前選択が設定されているか確認\n var pick = (short)Cad.SystemVariable[\"PICKFIRST\"];\n if (pick == 1)\n {\n // 事前選択\n // ※↓の選択結果に作成した選択フィルタ(selFilter)を適用したい\n var retPick = Cad.Editor.SelectImplied();\n if (retPick.Status == PromptStatus.OK)\n {\n dst = retPick.Value;\n }\n }\n }\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T02:23:11.050", "favorite_count": 0, "id": "48780", "last_activity_date": "2018-10-05T06:54:15.377", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30023", "post_type": "question", "score": 0, "tags": [ "c#", ".net", "ijcad" ], "title": "事前選択で選択フィルターを使用したい", "view_count": 338 }
[ { "body": "Editor.SelectImplied以外にも、Editor.GetSelectionメソッドでも事前選択セットから選択セットの作成が可能です。 \nEditor.GetSelectionメソッドでは選択フィルターが設定できるので、事前選択セットからフィルタリングされた結果の選択セットを取得することが可能です。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-05T06:54:15.377", "id": "49000", "last_...
48780
49000
49000
{ "accepted_answer_id": "48796", "answer_count": 2, "body": "**Let's Encrypt の自動更新がうまくいかないため、最初からやり直そうとしているのですが、下記の違いが分かりません** \n・それぞれメリットデメリットは何ですか?\n\n**[gitでインストール。自動更新する際、「○○-auto\nrenew」とするやり方](https://www.linode.com/docs/security/ssl/install-lets-encrypt-\nto-create-ssl-certificates/)** \n・このやり方で試している人をネットでよく見かけます\n\n**[公式ページ?に掲載されているやり方。certbot-nginxでインストール。自動更新する際は、autoなしの「certbot\nrenew」](https://certbot.eff.org/lets-encrypt/centosrhel7-nginx)** \n・このやり方で試している人はあまり見かけません\n\n* * *\n\n**環境** \n・CentOS7 \n・Nginx", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T03:02:53.577", "favorite_count": 0, "id": "48781", "last_activity_date": "2018-09-28T14:31:14.643", "last_edit_date": "2018-09-28T03:32:37.733", "last_editor_user_id": "19110", "owner_user_id": "7886", "post_type": "question", "score": 2, "tags": [ "letsencrypt" ], "title": "Let's Encrypt のインストール方法の違いについて", "view_count": 147 }
[ { "body": "一つ目に挙げたページに記載の <https://github.com/letsencrypt/letsencrypt> にアクセスすると、 \n現在は <https://github.com/certbot/certbot> にリダイレクトされます。 \n両者の違いは情報の鮮度の問題だと思いますが、[Let's Encryptのガイド](https://letsencrypt.org/getting-\nstarted/)にも[Certbot](https://certbot.eff.org/)への導線が引いてあるので、こちらの手順に従えばよいかと。\n\n「Let's Encrypt」は証...
48781
48796
48782
{ "accepted_answer_id": null, "answer_count": 1, "body": "### 問題\n\n現在React+Laravel環境でプロダクトを作っています。 \nサーバーサイドレンダリングが必要になり、[spatie/laravel-server-side-\nrendering](https://github.com/spatie/laravel-server-side-\nrendering)を使って構築しています。 \nローカルのテスト環境ではうまく構築できたものの、本番Docker環境(Laradockを使用)だと[この欄の](https://github.com/spatie/laravel-\nserver-side-rendering#prerequisites)NODE_PATHの設定でエラーを吐いてしまう状態です。 \nなのでLaradock環境での正しいNodeのPathを取得したく思っております。\n\n### エラーメッセージ\n\n```\n\n The command \"~/home/laradock/.nvm/versions/node/v10.10.0/bin/node \n /var/www/storage/app/ssr/37e4a57537aad3ba32e697047bbf2914.js\" failed.\n Exit Code: 127(Command not found)\n Working directory: /var/www/public Output:\n ================ Error Output: ================\n sh: 1: /var/www/home/laradock/.nvm/versions/node/v10.10.0/bin/node: not found\n \n```\n\n### Dockerコンテナ\n\n```\n\n 9d81cb0602e3 laradock_nginx \"nginx\" 2 hours ago Up 2 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp laradock_nginx_1\n 668f7d68aaf0 laradock_php-fpm \"docker-php-entrypoi…\" 2 hours ago Up 2 hours 9000/tcp laradock_php-fpm_1\n c7d82a9c046e laradock_mysql \"docker-entrypoint.s…\" 2 hours ago Up 2 hours 0.0.0.0:3306->3306/tcp laradock_mysql_1\n f0929682024f laradock_workspace \"/sbin/my_init\" 2 hours ago Up 2 hours 0.0.0.0:2222->22/tcp laradock_workspace_1\n c190eef71c4f docker:dind \"dockerd-entrypoint.…\" 2 hours ago Up 2 hours 2375/tcp laradock_docker-in-docker_1\n \n```\n\n### 試したこと\n\n * local環境では`which node`で出る`/Users/ksk/.nodebrew/current/bin/node`を.envに記載で動きました。\n\nしかし、Docker環境では`docker exec -it laradock_workspace_1 bash`でワークスペースにアタッチ後、`which\nnode`で出る`/home/laradock/.nvm/versions/node/v10.10.0/bin/node`を.envに記載しても上記エラーになってしまいます。。 \nまた、local環境でのNodePath`/Users/ksk/.nodebrew/current/bin/node`を設定しても同じエラー結果でした。。\n\nLaravelの`.env`ファイル\n\n```\n\n APP_NAME=Laravel\n APP_ENV=production\n APP_KEY=******************\n APP_DEBUG=true\n APP_LOG_LEVEL=debug\n APP_URL=http://localhost\n \n NODE_PATH=/home/laradock/.nvm/versions/node/v10.10.0/bin/node\n \n -----------以下略-----------\n \n```\n\n```\n\n```\n\n### 補足情報(FW/ツールのバージョンなど)\n\n * Docker version `v18.06.1-ce` \n\\-- workspaceにnvmを用いてNodeはインストール済み(v10.10.0)\n\n * Laravel version `v5.5.40`\n\n* * *\n\nそもそもDockerの理解が乏しいということもある上に拙い説明で大変恐縮ですが、同じような経験がある方いらっしゃいましたらご教授頂けますと助かります。。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T06:16:48.560", "favorite_count": 0, "id": "48784", "last_activity_date": "2018-09-28T07:47:23.683", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30266", "post_type": "question", "score": 1, "tags": [ "php", "node.js", "docker", "laravel" ], "title": "Laradock環境でnodeにアクセスできない", "view_count": 523 }
[ { "body": "自己解決しました。。\n\nworkspaceコンテナのPathを定義しても、ビルド環境だとphp-fpmが機能している為、pathがエラー吐いていると言う天に気づきました。\n\nなのでphp-fpmにnodeをインストールします。\n\nphp-fpmのDocker-fileに以下3行追加\n\n```\n\n RUN apt-get install -y gnupg\n RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -\n RUN apt-get install -y nodejs\n \n```...
48784
null
48787
{ "accepted_answer_id": "48790", "answer_count": 1, "body": "chainerで画像認識をするためCNNを実装している際、ある2つの中間層の出力f1(サイズ(b1,c1,h1,w1))とf2(サイズ(b2,c2,h2,w2))に対して、同じバッチ内ですべてのc1,c2の組み合わせに対してその行列の要素積をとり和を取る、つまり行列の内積を計算するプログラムを実装し、動かしたところ、GPUメモリ上限を上回ってしまう以下のエラーが発生してしまいました。\n\n```\n\n cupy.cuda.memory.OutOfMemoryError: out of memory to allocate 2684354560 bytes (total13247891968 bytes)\n \n```\n\nよりメモリ効率の良いプログラムに改良したいのですが、よろしければアドバイスをいただけないでしょうか。以下に自分が実装したコードを載せます。エラーが出た部分は下から4行目の計算です。 \n環境はchainerがversion4.1、pythonが3.6、GPUにはTITAN Xを使用しています。 \n初質問で勝手がわからない部分もありますがよろしくお願いします。\n\n```\n\n def make_FSPmatrix(fmap1,fmap2):\n \n b1,c1,h1,w1 = fmap1.shape\n b2,c2,h2,w2 = fmap2.shape\n if h1 > h2:\n h,w = h2,w2\n fmap1 = F.max_pooling_2d(fmap1,int(h1/h2))\n elif h2 > h1:\n h,w = h1,w1\n fmap2 = F.max_pooling_2d(fmap2,int(h2/h1))\n else:\n h,w, = h1,w1\n fm1_channel = F.transpose(fmap1,axes=(1,0,2,3))\n fm2_channel = F.transpose(fmap2,axes=(1,0,2,3))\n fsp_list = []\n #内積処理\n for i in range(len(fm2_channel)):\n fsp_list.append(fm1_channel*F.tile(fm2_channel[i][np.newaxis,:,:],(c1,1,1,1)))\n fsp_tuple = tuple(fsp_list)\n fsp = F.transpose(F.sum(F.concat(fsp_tuple,axis=0),axis=(2,3)))/(h*w)\n print(fsp.shape)\n \n return fsp\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T08:31:37.250", "favorite_count": 0, "id": "48788", "last_activity_date": "2018-09-28T10:13:44.843", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30268", "post_type": "question", "score": 1, "tags": [ "python", "chainer" ], "title": "Chainerで2つの特徴マップ間の全チャネルに対する行列の内積を効率よく計算したい", "view_count": 175 }
[ { "body": "面倒な和計算はeinsumに投げると簡単です.(少し親切でなかったので,Example Codeを書き換えました)\n\n短く書けば以下で十分です. \nCode 1\n\n```\n\n fsp = F.einsum(\"bcwh,bCwh->bwh\", fmap1, fmap2)\n \n```\n\n以下は検証用のコードです.\n\nCode 2\n\n```\n\n from chainer import functions as F\n import numpy as np\n \n \n batchsize = 3\n n_chan...
48788
48790
48790
{ "accepted_answer_id": "48804", "answer_count": 3, "body": "以下のように、tableAのIDに紐づくtableBがあります。 \nこれらのテーブルに対してtableAの結果全てと、tableAのIDに紐づいているtableBの件数を、下記希望取得結果のような形で取得できるSQLはあるでしょうか? \n現在の想定では、tableAの結果をループで回してtableBの件数を取得するしかないかなと考えています。\n\n```\n\n tableA\n id | name\n ーーーーーーー\n 1 | 山田太郎\n 2 | 鈴木次郎\n 3 | 田中三郎\n \n \n tableB\n id | tableA_id\n ーーーーーーー\n 1 | 1\n 2 | 1\n 3 | 1\n 4 | 3\n \n \n 希望取得結果\n 1 | 山田太郎 | 3\n 2 | 鈴木次郎 | 0\n 3 | 田中三郎 | 1\n \n```", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T09:11:07.983", "favorite_count": 0, "id": "48789", "last_activity_date": "2023-02-08T03:58:08.867", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "29367", "post_type": "question", "score": 3, "tags": [ "sql" ], "title": "IDが紐づいている別テーブルのレーコード件数を取得したい", "view_count": 19433 }
[ { "body": "```\n\n select a.id, a.name, grouped_b.Counted\n from tableA a\n left join\n (select tableA_id, COUNT(id) AS Counted from tableB group by tableA_id) grouped_b\n ON a.id=b.tableA_id\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date"...
48789
48804
48804
{ "accepted_answer_id": "48800", "answer_count": 2, "body": "# 環境\n\n * Python3.6.5 \n * chardet 3.0.4\n * Windows10\n\n# 背景\n\nPythonのchardetモジュールで、文字コードの判定結果を確認しています。\n\nUTF-8の\"あ\"という文字列の判定結果は\"UTF-8\"でしたが、\"testあ\"という文字列の判定結果は\"Windows-1254\"でした。これはWindowsのトルコ語の文字コードです。 \n<https://en.wikipedia.org/wiki/Windows-1254>\n\n```\n\n In [163]: chardet.detect( \"あ\".encode(\"utf-8\")) \n Out[163]: {'encoding': 'utf-8', 'confidence': 0.505, 'language': ''} \n \n In [164]: chardet.detect( \"testあ\".encode(\"utf-8\")) \n Out[164]: \n {'encoding': 'Windows-1254', \n 'confidence': 0.5889255495043456, \n 'language': 'Turkish'} \n \n In [165]: chardet.detect( \"tあ\".encode(\"utf-8\")) \n Out[165]: {'encoding': 'utf-8', 'confidence': 0.505, 'language': ''} \n \n In [166]: chardet.detect( \"stあ\".encode(\"utf-8\")) \n Out[166]: {'encoding': 'utf-8', 'confidence': 0.505, 'language': ''} \n \n In [167]: chardet.detect( \"estあ\".encode(\"utf-8\")) \n Out[167]: \n {'encoding': 'Windows-1254', \n 'confidence': 0.5153098558163024, \n 'language': 'Turkish'} \n \n```\n\n# 質問\n\n 1. \"testあ\"というUTF-8の文字列は、なぜ\"Windows-1254\"と判断されたのでしょうか?\n\n 2. chardetが文字列を\"UTF-8\"と判断するには、どのような文字があればよいのでしょうか?\n\n 3. chardetのSupport Encodingsというページに、Windows-1254は載っていませんでした。何か理由はあるのでしょうか? \n<https://chardet.readthedocs.io/en/latest/supported-encodings.html>\n\n単純な興味として質問しました。特に困ってはいません。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T11:18:43.003", "favorite_count": 0, "id": "48793", "last_activity_date": "2018-09-30T19:45:16.500", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "19524", "post_type": "question", "score": 5, "tags": [ "python", "文字コード" ], "title": "Pythonのchardetモジュールが、\"testあ\"という文字列(UTF-8)の文字コードを\"Windows-1254\"だと判定する", "view_count": 3662 }
[ { "body": "`\"testあ\"`のUTF-8表現は、74 65 73 74 e3 81 82 (1バイトデータの表記は全部16進、以下同様,\npython3風に書くと`b'\\x74\\x65\\x73\\x74\\xe3\\x81\\x82'`)で、chardetが判定するのは「文字列」ではなく、このバイト列です。\n\nちなみにこのバイト列をUTF-8, Shift_JIS, EUC-JP, ISO-8859-1, Code Page 437,\nWindows-1254で解釈すると、以下のようになります。\n\n```\n\n UTF-8 testあ (まぁ、当たり前)\n S...
48793
48800
48800
{ "accepted_answer_id": null, "answer_count": 0, "body": "初心者なので質問におかしな点があるかもしれませんが御容赦ください。\n\n以下のgemを使用としたのですが上手くいきません。 \n<https://github.com/craysiii/binance>\n\ncloud9では以下のやり方で上手くいったのですが、PCにrubyをインストールし、実行したら上手くいきません。\n\n```\n\n require 'binance'\n require 'eventmachine'\n \n puts client.ping\n \n```\n\nPCはwindowsでruby2.4.4です。gem listの中に使用したいgemは入っているのは確認できるのですが、以下のエラーが出てしまいます。\n\n```\n\n Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'\n C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- 2.4/rubyeventmachine (LoadError)\n                   ・\n                   ・\n                   ・\n \n```\n\n一応以下のサイトを参考にeventmachineをアンインストールし、--platform\nrubyをつけてインストールし直したのですが、やはりうまくいきません。 \n<https://github.com/eventmachine/eventmachine/issues/806>\n\n私の知識不足・検索不足は重々承知ですが、教えて頂けると幸いです。\n\n追記 \n以下が--platform rubyをつけてインストールした際のエラーコードです。\n\n```\n\n Temporarily enhancing PATH for MSYS/MINGW...\n Building native extensions. This could take a while...\n ERROR: Error installing eventmachine:\n ERROR: Failed to build gem native extension.\n \n current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.7/ext\n C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20180929-2192-1nwhkk4.rb extconf.rb\n checking for -lcrypto... no\n checking for -lssleay32... no\n checking for -lcrypto... no\n checking for -lssleay32... no\n checking for -lcrypto... no\n checking for -lssleay32... no\n checking for -lcrypto... no\n checking for -lssleay32... no\n checking for rb_trap_immediate in ruby.h,rubysig.h... no\n checking for rb_thread_blocking_region()... no\n checking for rb_thread_call_without_gvl() in ruby/thread.h... no\n checking for rb_thread_fd_select()... no\n checking for rb_fdset_t in ruby/intern.h... yes\n checking for rb_wait_for_single_fd()... no\n checking for rb_enable_interrupt()... no\n checking for rb_time_new()... no\n checking for inotify_init() in sys/inotify.h... no\n checking for __NR_inotify_init in sys/syscall.h... no\n checking for writev() in sys/uio.h... no\n checking for pipe2() in unistd.h... no\n checking for accept4() in sys/socket.h... no\n checking for SOCK_CLOEXEC in sys/socket.h... no\n checking for windows.h... yes\n checking for winsock.h... yes\n checking for -lkernel32... no\n could not find library: kernel32\n *** extconf.rb failed ***\n Could not create Makefile due to some reason, probably lack of necessary\n libraries and/or headers. Check the mkmf.log file for more details. You may\n need configuration options.\n \n Provided configuration options:\n --with-opt-dir\n --without-opt-dir\n --with-opt-include\n --without-opt-include=${opt-dir}/include\n --with-opt-lib\n --without-opt-lib=${opt-dir}/lib\n --with-make-prog\n --without-make-prog\n --srcdir=.\n --curdir\n --ruby=C:/Ruby24-x64/bin/$(RUBY_BASE_NAME)\n --with-ssl-dir\n --without-ssl-dir\n --with-ssl-include\n --without-ssl-include=${ssl-dir}/include\n --with-ssl-lib\n --without-ssl-lib=${ssl-dir}/lib\n --with-openssl-config\n --without-openssl-config\n --with-pkg-config\n --without-pkg-config\n --with-cryptolib\n --without-cryptolib\n --with-ssleay32lib\n --without-ssleay32lib\n --with-ssl-dir\n --without-ssl-dir\n --with-ssl-include\n --without-ssl-include=${ssl-dir}/include\n --with-ssl-lib\n --without-ssl-lib=${ssl-dir}/lib\n --with-cryptolib\n --without-cryptolib\n --with-ssleay32lib\n --without-ssleay32lib\n --with-ssl-dir\n --without-ssl-dir\n --with-ssl-include\n --without-ssl-include=${ssl-dir}/include\n --with-ssl-lib\n --without-ssl-lib=${ssl-dir}/lib\n --with-cryptolib\n --without-cryptolib\n --with-ssleay32lib\n --without-ssleay32lib\n --with-ssl-dir\n --without-ssl-dir\n --with-ssl-include\n --without-ssl-include=${ssl-dir}/include\n --with-ssl-lib\n --without-ssl-lib=${ssl-dir}/lib\n --with-cryptolib\n --without-cryptolib\n --with-ssleay32lib\n --without-ssleay32lib\n --with-kernel32lib\n --without-kernel32lib\n \n To see why this extension failed to compile, please check the mkmf.log which can be found here:\n \n C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/eventmachine-1.2.7/mkmf.log\n \n extconf failed, exit code 1\n \n Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.7 for inspection.\n Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/eventmachine-1.2.7/gem_make.out\n \n```\n\n追記2 \n返信遅れて申し訳わりません。 \nridk versionの結果は以下です。\n\n```\n\n ---\n ruby:\n path: C:/Ruby24-x64\n version: 2.4.4\n platform: x64-mingw32\n ruby_installer:\n package_version: 2.4.4-2\n git_commit: 513abb8\n msys2:\n path: C:\\Ruby24-x64\\msys64\n cc: x86_64-w64-mingw32-gcc (Rev1, Built by MSYS2 project) 8.2.0\n sh: GNU bash, バージョン 4.4.19(3)-release (x86_64-pc-msys)\n os: Microsoft Windows [Version 6.1.7601]\n \n```\n\nwindowsは7です。", "comment_count": 6, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T11:50:08.903", "favorite_count": 0, "id": "48794", "last_activity_date": "2018-09-30T23:10:44.433", "last_edit_date": "2018-09-30T23:10:44.433", "last_editor_user_id": null, "owner_user_id": null, "post_type": "question", "score": 0, "tags": [ "ruby", "rubygems" ], "title": "gemが上手く使用できない", "view_count": 996 }
[]
48794
null
null
{ "accepted_answer_id": "48810", "answer_count": 1, "body": "パッケージがどのように使われているかを調べるために \ngithubで特定のimport文を含むPythonのソースファイルが入ったリポジトリを検索したいです。 \nどうすれば検索できるでしょうか。 \nPythonでソースを組まずにWebブラウザで検索できることが一番望ましいですが、ソースを組む必要があればその方法を教えてください。 \n例) import random で検索すると import random を含んだソースファイルが入ったリポジトリを検索する。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T14:55:13.993", "favorite_count": 0, "id": "48797", "last_activity_date": "2018-09-29T04:14:57.243", "last_edit_date": "2018-09-28T15:51:42.900", "last_editor_user_id": "2238", "owner_user_id": "30138", "post_type": "question", "score": 1, "tags": [ "python", "github" ], "title": "githubの中にあるソースから特定のimport文を含むリポジトリを検索する", "view_count": 178 }
[ { "body": "一番簡単なのは、GitHub サイト上で \"random\" でコード検索し、言語を Python\nに絞ることでしょう。[このような感じです。](https://github.com/search?l=Python&q=random&type=Code)\n\n残念なことに、GitHub のサイト上ではダブルクォーテーションを使って全体一致させるような検索はできません。したがって \"import random\"\nと連続した並びのみを取り出すような検索はできません。このことは GitHub ヘルプの [\"Searching\ncode\"](https://help.github.co...
48797
48810
48810
{ "accepted_answer_id": null, "answer_count": 0, "body": "下記がError文になります。 \nsudo gem install compass -n /usr/local/bin/ \n上記等色々試したのですがインストール出来ず。。。 \nご教授頂けると幸いです。\n\n======================================================================\n\n```\n\n MacBook-Pro:~ WEB20-150129$ sudo gem install compass\n Password:\n Building native extensions. This could take a while...\n ERROR: Error installing compass:\n ERROR: Failed to build gem native extension.\n \n current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.25/ext/ffi_c\n /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180929-7168-fcft1p.rb extconf.rb\n checking for ffi.h... *** extconf.rb failed ***\n Could not create Makefile due to some reason, probably lack of necessary\n libraries and/or headers. Check the mkmf.log file for more details. You may\n need configuration options.\n \n Provided configuration options:\n --with-opt-dir\n --without-opt-dir\n --with-opt-include\n --without-opt-include=${opt-dir}/include\n --with-opt-lib\n --without-opt-lib=${opt-dir}/lib\n --with-make-prog\n --without-make-prog\n --srcdir=.\n --curdir\n --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)\n --with-ffi_c-dir\n --without-ffi_c-dir\n --with-ffi_c-include\n --without-ffi_c-include=${ffi_c-dir}/include\n --with-ffi_c-lib\n --without-ffi_c-lib=${ffi_c-dir}/lib\n --with-libffi-config\n --without-libffi-config\n --with-pkg-config\n --without-pkg-config\n /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)\n You have to install development tools first.\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:in `block in try_compile'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:524:in `with_werror'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:in `try_compile'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:1091:in `block in have_header'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'\n from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:1090:in `have_header'\n from extconf.rb:16:in `<main>'\n \n To see why this extension failed to compile, please check the mkmf.log which can be found here:\n \n /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.9.25/mkmf.log\n \n extconf failed, exit code 1\n \n Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.25 for inspection.\n Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.9.25/gem_make.out\n \n```\n\n======================================================================", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-28T19:52:28.977", "favorite_count": 0, "id": "48802", "last_activity_date": "2018-09-28T22:23:57.703", "last_edit_date": "2018-09-28T22:23:57.703", "last_editor_user_id": "19769", "owner_user_id": "30276", "post_type": "question", "score": 1, "tags": [ "sass" ], "title": "macでcompassを入れようとしたらErrorでハマってしまいました、、助けて頂けると幸いです。", "view_count": 123 }
[]
48802
null
null
{ "accepted_answer_id": "48812", "answer_count": 1, "body": "マストドンでトレンドになっているキーワードもしくはハッシュタグを取得したいと思います。 \nググってみましたが、そのような情報は見つかりませんでした。 \ntwitterのAPIではトレンドを取得する方法がありましたが、マストドンにもあるのでしょうか。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T02:02:06.063", "favorite_count": 0, "id": "48805", "last_activity_date": "2018-10-16T18:11:22.577", "last_edit_date": "2018-10-16T18:11:22.577", "last_editor_user_id": "2376", "owner_user_id": "30138", "post_type": "question", "score": 1, "tags": [ "python", "python3", "mastodon" ], "title": "python マストドンのトレンドキーワードを取得する。", "view_count": 104 }
[ { "body": "2018 年 9 月現在、Mastodon の [API\nドキュメント](https://github.com/tootsuite/documentation/blob/master/Using-the-\nAPI/API.md)にはトレンド (trend) 用の機能が書かれていません。\n\nそもそも Mastodon のトレンド機能自体が [Pull Request\n#7711](https://github.com/tootsuite/mastodon/pull/7711) (2018年6月)\nで削除されています。Mastodon ドキュメントのリポジトリ内において \"trend\...
48805
48812
48812
{ "accepted_answer_id": "48819", "answer_count": 1, "body": "[この例](https://openjfx.io/openjfx-docs/#maven)を参考にして、Maven + Java SDK 11 + Java\nFX アプリを作ってみました。\n\n**EntryPoint.java**\n\n```\n\n package com.example;\n \n import javafx.stage.Stage;\n import javafx.scene.Scene;\n import javafx.scene.control.Label;\n \n public class EntryPoint extends javafx.application.Application {\n \n public static void main (String[] args) {\n launch();\n }\n \n public void start(Stage stage) {\n Label label = new Label(\"Hello, JavaFX11!\");\n Scene scene = new Scene(label, 640, 480);\n stage.setScene(scene);\n stage.show();\n }\n }\n \n```\n\n**pom.xml**\n\n```\n\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n \n <modelVersion>4.0.0</modelVersion>\n <groupId>com.example</groupId>\n <artifactId>Example</artifactId>\n <version>1.0-SNAPSHOT</version>\n \n <dependencies>\n <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-controls -->\n <dependency>\n <groupId>org.openjfx</groupId>\n <artifactId>javafx-controls</artifactId>\n <version>11</version>\n </dependency>\n </dependencies>\n </project>\n \n```\n\nコンパイルしない限り、IntellIJ IDEAの方からは警告がありません。コンパイルしてみると、このようなエラーが出ます:\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/AsYuu.png)](https://i.stack.imgur.com/AsYuu.png)\n\n**JAVA_HOME** 環境変数を設定してみました。効果ありません。\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/b3Gn6.png)](https://i.stack.imgur.com/b3Gn6.png)\n\nIntellIJ IDEAで適切なSDKが設定してあります:\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/cUnq7.png)](https://i.stack.imgur.com/cUnq7.png)", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T02:16:05.000", "favorite_count": 0, "id": "48806", "last_activity_date": "2018-09-29T06:37:27.023", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "16876", "post_type": "question", "score": 0, "tags": [ "java", "maven", "intellij-idea", "javafx" ], "title": "Java SDK 11 + Java FX: javafx.stage.Stageにアクセスできません", "view_count": 273 }
[ { "body": "[リンク先のページ](https://openjfx.io/openjfx-\ndocs/#maven)の[pom.xml](https://openjfx.io/openjfx-\ndocs/pom.xml)にある以下の要素を省いているのが、原因ではないでしょうか。\n\n```\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-compiler-plugin</artifactId>\n <version>3.8.0</version>\...
48806
48819
48819
{ "accepted_answer_id": "48814", "answer_count": 1, "body": "Wikipediaのデータで辞書(単語帳)を作ろうと考えています。 \nWikipediaはよくフリーだと言われていますが、 \nググってみるとWikipediaのデータで作った著作物は頒布義務があるということがわかりました。\n\nWeb上で辞書を頒布することは問題ないのですが、 \n頒布する際は頒布情報として \n該当するWikipediaのページのURLを掲載するほかに \n何か必要なものがあるでしょうか。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T03:59:31.977", "favorite_count": 0, "id": "48811", "last_activity_date": "2018-09-29T04:41:13.957", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30138", "post_type": "question", "score": 2, "tags": [ "ライセンス" ], "title": "Wikipediaのデータで辞書を作る", "view_count": 246 }
[ { "body": "Wikipedia\nの記事[「Wikipedia:ウィキペディアを二次利用する」](https://ja.wikipedia.org/wiki/Wikipedia:%E3%82%A6%E3%82%A3%E3%82%AD%E3%83%9A%E3%83%87%E3%82%A3%E3%82%A2%E3%82%92%E4%BA%8C%E6%AC%A1%E5%88%A9%E7%94%A8%E3%81%99%E3%82%8B)が非常に参考になります。\n\nライセンスに従って二次利用する場合、[クリエイティブ・コモンズ・ライセンス](https://creativecommons.jp/licenses/...
48811
48814
48814
{ "accepted_answer_id": null, "answer_count": 0, "body": "```\n\n <script>\n swal({\n html: <div id=\"hoge\"></div>\n });\n $(function () {\n $(\"#hoge\").css({\n \"width\": \"500px\",\n \"height\": \"500px\",\n });\n });\n let map;\n let marker;\n function initMap() {\n map = new google.maps.Map(document.getElementById('hoge'), {\n center: {\n lat: 100,\n lng: 20,\n },\n zoom: 10\n });\n marker = new google.maps.Marker({\n position: {\n lat: 100,\n lng: 20,\n },\n map: map,\n });\n }\n <script src=\"https://maps.googleapis.com/maps/api/js?language=ja&key=HOGEHOGE&callback=initMap\"></script>\n </script>\n \n```\n\nこのようにコードを書くとscriptタグでエラーが出て実装できませんでした。 \nどうすればよいですか?", "comment_count": 4, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T04:38:30.190", "favorite_count": 0, "id": "48813", "last_activity_date": "2018-10-03T03:40:10.733", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "29664", "post_type": "question", "score": 0, "tags": [ "javascript", "html", "jquery" ], "title": "SweetAlert2でgooglemap apiを使用する方法", "view_count": 68 }
[]
48813
null
null
{ "accepted_answer_id": "48837", "answer_count": 1, "body": "フレンドクラスでなぜ前方宣言をしてるのに認識できない型ですとコンパイルエラー出るのか教えてほしいです。ちなみにコメント部の部分にclass\nfri{}コードを移動させるとコンパイル成功します。\n\n```\n\n class base;\n class fri {\n public:\n fri() { }\n \n void f(base& x) { cout << x.t; }\n };\n \n class fri;\n class base {\n friend class fri;\n \n private:\n int t;\n \n protected:\n enum tmp { e_a , e_b, e_c };\n \n public:\n //void fri::f();\n \n base(int x) { t = x; }\n ~base(){ }\n \n void f()\n {\n int x = e_a;\n cout <<\"x:\"<< x;\n }\n \n };\n \n //////////ここに書く\n int main() {\n base b(100);\n fri x;\n x.f(b);\n \n _getch();\n return 0;\n }\n \n```", "comment_count": 3, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T05:07:16.020", "favorite_count": 0, "id": "48815", "last_activity_date": "2018-09-30T23:47:14.630", "last_edit_date": "2018-09-30T23:47:14.630", "last_editor_user_id": null, "owner_user_id": null, "post_type": "question", "score": 0, "tags": [ "c++" ], "title": "c++,フレンドクラスの使おうとすると認識できない型です、というエラー出る。原因", "view_count": 1252 }
[ { "body": "そのエラーの原因は`friend`とは関係がありません。\n\n```\n\n class base;\n class fri {\n public:\n fri() { }\n \n void f(base& x) { cout << x.t; }\n };\n \n```\n\nメンバー関数`f`の中で`base`クラスを使っていますが、この段階では、`base`という名前のクラスがあると宣言しているだけで、具体的に、`base`にどんなメンバーがあるかは定義されていません。定義されていないのにメンバー変数`t`にアクセスしよう...
48815
48837
48837
{ "accepted_answer_id": "48820", "answer_count": 2, "body": "python3の入門をしている者ですが、 \n以下の条件を満たすコードをよりシンプルに書くには \nどのような方法があるのでしょうか。\n\n条件: \n・入力値に対して、1から10をかける \n・各整数の間に、半角スペース \n・最終値の後ろに半角スペース、または改行が入るのはNG\n\n私のコード:\n\n```\n\n num = int(input())\n for i in range(1, 11):\n if i == 10:\n print(i * num)\n else:\n print(str(i * num) + \" \", end=\"\")\n \n```\n\n入力: 2\n\n出力: 2 4 6 8 10 12 14 16 18 20", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T05:55:27.240", "favorite_count": 0, "id": "48817", "last_activity_date": "2018-10-02T04:49:05.767", "last_edit_date": "2018-09-29T06:11:52.587", "last_editor_user_id": "19110", "owner_user_id": "30279", "post_type": "question", "score": 3, "tags": [ "python", "python3" ], "title": "pyhon3 掛算リストで末尾に半角スペースを入れないで作成する仕方を教えてください。", "view_count": 292 }
[ { "body": "こんな感じでできます。\n\n```\n\n num = int(input())\n print(\" \".join(str(i * num) for i in range(1,11)), end=\"\")\n \n```", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T07:38:15.397", "id": "48820", "last_activity_date": "2018-09-29T07:38:1...
48817
48820
48820
{ "accepted_answer_id": null, "answer_count": 1, "body": "環境 \nOS CentOS release 6.10 (Final) \nApache Server version: Apache/2.2.15 (Unix) \npostfix 2.6.6\n\nドメインをさくらで取得しており \nwebサーバのみ他社(AWS CloudFront+LB+LightSail,DNS:Route53) \nメールはさくらのレンタルサーバ(プレミアム)を使用していました。\n\n本日10頃にゾーン変更のAレコード及びネームサーバを変更する形でwebサーバのみさくらのVPSへ移し \nweb上のメールフォームからメールを送信しましたが正常にメールが配送されません。\n\nmaillogは以下の様になっています。\n\n* * *\n```\n\n Sep 29 12:48:44 tk2-405-XXXXX postfix/pickup[11819]: 43504420A4: uid=48 from=<xxxxxxx@xxxxx.com>\n Sep 29 12:48:44 tk2-405-XXXXX postfix/cleanup[12041]: 43504420A4: message-id=<20180929034844.43504420A4@tk2-xxx-xxxxxx.vs.sakura.ne.jp>\n Sep 29 12:48:44 tk2-405-XXXXX postfix/smtp[12042]: warning: no MX host for xxxxxxxx.com has a valid address record\n Sep 29 12:48:44 tk2-405-XXXXX postfix/smtp[12042]: 430204634B: to=<xxxxxxx@xxxxx.com>, relay=none, delay=0, delays=0/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=xxxxx.sakura.ne.jp.xxxxxxxx.com type=AAAA: Host not found)\n Sep 29 12:48:44 tk2-405-XXXXX postfix/qmgr[1474]: 43504420A4: from=<xxxxxxx@xxxxx.com>, size=4501, nrcpt=1 (queue active)\n Sep 29 12:48:44 tk2-405-XXXXX postfix/qmgr[1474]: 430204634B: removed\n \n```\n\n* * *\n\nドメイン周りの設定は下記へ変更しております。\n\n▼現在のドメインゾーン設定\n\n```\n\n エントリ名 タイプ データ\n @ NS ns1.dns.ne.jp.\n NS ns2.dns.ne.jp.\n A さくらVPSサーバ IP\n MX 10 @\n www CNAME @\n mail CNAME @\n ftp CNAME @\n \n```\n\n・Aレコードは本日10時頃変更いたしました。\n\n▼現在のネームサーバ設定\n\n```\n\n ネームサーバ1 NS1.DNS.NE.JP\n ネームサーバ2 NS2.DNS.NE.JP\n ネームサーバ3\n ネームサーバ4\n \n```\n\n・本日10頃に上記設定へ変更いたしました。\n\n* * *\n\nテスト時別ドメインをVPS上のサーバに割り当ててテストした際は \n本日変更作業前にテストしましたが問題なくメールが配送されておりました。\n\n本日上記以外に下記行っています。 \n・さくらで取得したテスト用ドメインのAレコードをさくらVPSのサーバIPから変更 \n・さくらVPS上のに構築したwebサーバのSSL証明書の入替え(本番ドメインへの変更)\n\nDNS伝搬中に一時的に発生する問題でしょうか \n何かお分かりになりましたらご回答をお願いできれば幸いです。\n\n* * *\n\n※9月29日16時現在 \n商用利用しており、長時間不具合を出したままに出来ない為、現在、ドメイン(ゾーン、ネームサーバ)を変更前の状態に戻しています。", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T05:58:16.057", "favorite_count": 0, "id": "48818", "last_activity_date": "2019-04-23T01:00:19.870", "last_edit_date": "2018-09-30T11:52:44.383", "last_editor_user_id": "2376", "owner_user_id": "30185", "post_type": "question", "score": 0, "tags": [ "centos", "dns", "sendmail", "mail" ], "title": "フォームからメールが送信されない", "view_count": 661 }
[ { "body": "記入が遅れましたが自己解決できましたので、記載いたします。\n\n・さくらのドメインのゾーン設定のMXレコードのルール・・・@を指定した場合はaレコードで指定したサーバを使う \n・上記により内部配送が発生し結果メール配送がエラーになった\n\nMXレコードを直接さくらのレンタルサーバを指定したところ、問題なくメールが配送されました。", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-11-06T05:12:37.940", "id": "50004",...
48818
null
50004
{ "accepted_answer_id": "48823", "answer_count": 1, "body": "AテーブルとBテーブル 同じレイアウトのテーブルがあって、双方のテーブルにレコード(同一キーの) \nが存在した場合、Bテーブル側のレコードを出力したいです。Aテーブル側のレコードは出力したくありません。\n\nBテーブルがAテーブルの後継になる運用を目指しています。\n\nAテーブルにしか(当該キーの)レコードが存在しない場合は Aテーブル側の内容を出力 \nBテーブルにしか(当該キーの)レコードが存在しない場合は Bテーブル側の内容を出力 \nAB双方のテーブルに(当該キーの)レコードが存在する場合は Bテーブル側の内容を出力\n\nこういったことを達成したいです。 \nシステム移行でありがちな発行文ですが、お知恵を頂けませんでしょうか\n\n当方のDBMSはMSですが、SQL文にそう大差ない認識ですので どのDBMSの例でも良いので例を示して頂ければ幸いです。ちなみに\n以下2つのSELECT文をまとめて キーごと(USERID)のレコード出力を達成したいです。よろしくお願い致します。\n\n```\n\n SELECT USERID, USERNAME, LEVEL FROM TABLE_A\n SELECT USERID, USERNAME, LEVEL FROM TABLE_B\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T08:46:57.917", "favorite_count": 0, "id": "48821", "last_activity_date": "2018-09-29T09:36:10.967", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "25696", "post_type": "question", "score": 1, "tags": [ "sql" ], "title": "SQL文組立ての質問: 2つのテーブル(同レイアウト)、双方存在の場合Bテーブルから出力したい", "view_count": 92 }
[ { "body": "> Aテーブルにしか(当該キーの)レコードが存在しない場合は Aテーブル側の内容を出力 \n> Bテーブルにしか(当該キーの)レコードが存在しない場合は Bテーブル側の内容を出力 \n> AB双方のテーブルに(当該キーの)レコードが存在する場合は Bテーブル側の内容を出力\n\nは\n\n * Bテーブルの内容を出力\n * Bテーブルに含まれていないキーのAテーブルの内容を出力\n\nと簡略化することができます。含まれる・含まれないは[`IN`・`NOT IN`](https://docs.microsoft.com/ja-\njp/sql/t-sql/language-eleme...
48821
48823
48823
{ "accepted_answer_id": "48828", "answer_count": 1, "body": "[pytorch](/questions/tagged/pytorch \"'pytorch'\nのタグが付いた質問を表示\")の関数`gather`の処理内容が公式ドキュメントを読んでもよく分かりません。 \n例えば **Example** の`t`が、どのような計算をした結果、出力のようなテンソルになるのか、 \n具体的に教えていただけないでしょうか。\n\n**Example:** \n\n```\n\n >>> t = torch.tensor([[1,2],[3,4]])\n     >>> torch.gather(t, 1, torch.tensor([[0,0],[1,0]]))\n     tensor([[ 1, 1],\n      [ 4, 3]])\n \n```\n\n`dim = 0`だと、上記の入力tは下記のような出力になります。\n\n```\n\n tensor([[1, 2],\n [3, 2]])\n \n```\n\n**公式ドキュメント:** \n<https://pytorch.org/docs/stable/torch.html#torch.gather>\n\nご回答、何卒宜しくお願い致します。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T09:12:54.127", "favorite_count": 0, "id": "48822", "last_activity_date": "2018-09-29T12:15:37.870", "last_edit_date": "2018-09-29T09:33:38.203", "last_editor_user_id": "24284", "owner_user_id": "30280", "post_type": "question", "score": 4, "tags": [ "python", "pytorch" ], "title": "pytorchの関数gatherの処理内容について", "view_count": 5136 }
[ { "body": "公式ドキュメントを拝見いたしました。3Dのテンソルに対する計算式が載っていますね。 \nこれを2Dのテンソルに置き換えるには、添え字のkと書かれた部分を削除すればok。\n\n```\n\n out[i][j] = input[index[i][j]][j] # if dim == 0\n out[i][j] = input[i][index[i][j]] # if dim == 1\n \n```\n\nこの定義式通りに動いているように思います。 \n下記は理解しやすいかどうかわからないですが、対応関係が見えるように行列を配置してみました。\n\n```\n\n ...
48822
48828
48828
{ "accepted_answer_id": null, "answer_count": 2, "body": "swiftでコードを書いています。\n\nswiftのシミュレーター でiphone8でビルドしても普通に動くんですが、それ以外の実機(iphoneX)などでビルドするとUnexpectedly\nfound nil while unwrapping an Optional valueというエラーが出ます。\n\nちなみにエラーの箇所は \nlet userDefaults: UserDefaults = UserDefaults.standard \nlet teamID: String = (userDefaults.object(forKey: \"teamID\")! as? String)! \nです。\n\nuserDefaultsの箇所なのですが、新しい実機でビルドすると値を取得できないとかあるのですか?\n\nわかる方教えてください。", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T11:12:55.773", "favorite_count": 0, "id": "48825", "last_activity_date": "2022-09-26T08:05:40.513", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "29900", "post_type": "question", "score": 0, "tags": [ "swift" ], "title": "Unexpectedly found nil while unwrapping an Optional valueについて", "view_count": 485 }
[ { "body": "`UserDefaults`というのは、自分で値をセットしないと値は取り出せないのですが、アプリケーション起動時等、`object(forKey:)`を呼び出す前に`Userdefaults.standard.register([String:\nAny])`で該当するキーの値をセットしていますか? \nもしくは、`userDefaults.set(\"[チームID]\", forKey: \"teamID\")`で、値をセットしていますか?\n\nもしセットしていないのであれば、 \n`userDefaults.object(forKey: \"teamID\")`の直後の`!`で、`ni...
48825
null
48833
{ "accepted_answer_id": null, "answer_count": 0, "body": "マストドンのローカルタイムラインを1000個取得しようとしているのですが、 \n2回目以降のmastodon.timelineの実行で \nMastodonAPIError: ('Mastodon API returned error', 500, 'Internal Server\nError', None) \nが発生します。これはどうやって修正すればよいでしょうか。\n\n```\n\n from mastodon import Mastodon\n \n mastodon = Mastodon(\n client_id=\"app_key.txt\",\n access_token=\"user_key.txt\",\n api_base_url = \"https://mstdn.jp\")\n \n def main():\n time_line_list = []\n next_id = None\n loop = True\n toot_count = 0\n \n while loop:\n # ローカルタイムラインの取得\n timeline = mastodon.timeline(\n timeline='local',\n since_id=None,\n limit=40,\n max_id=next_id\n )\n \n loop = True\n next_id = timeline[-1]['id']\n toot_count += 40\n if toot_count > 1000:\n break\n \n for toot in timeline:\n time_line_list.append(toot)\n \n for toot in time_line_list:\n print(toot)\n \n```", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T12:11:52.283", "favorite_count": 0, "id": "48829", "last_activity_date": "2018-09-30T05:10:59.230", "last_edit_date": "2018-09-30T05:10:59.230", "last_editor_user_id": "19110", "owner_user_id": "30138", "post_type": "question", "score": 0, "tags": [ "python", "python3" ], "title": "マストドンのローカルタイムラインを取得する", "view_count": 176 }
[]
48829
null
null
{ "accepted_answer_id": null, "answer_count": 1, "body": "CentOS7のターミナル(GNOME上)でタブによる補完が遅延します。 \nタブを押して、1~2秒後に補完されることがしばしばあります。 \nコンソールではそのような現象はありません。 \n原因をご存知の方は教えて下さい。", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T15:13:14.340", "favorite_count": 0, "id": "48832", "last_activity_date": "2020-07-24T07:20:07.083", "last_edit_date": "2020-07-24T07:20:07.083", "last_editor_user_id": "3060", "owner_user_id": null, "post_type": "question", "score": 1, "tags": [ "centos" ], "title": "CentOS7 のターミナルで、タブによる入力補完に遅延が発生する", "view_count": 83 }
[ { "body": "[xrdp でターミナルの補完時に待たされる件](http://sdk0815.blogspot.com/2013/01/xrdp.html)\nを読みますと、「gnome-terminal の Preferences で \"Terminal bell\" をオフにする」と書かれています。\n\n* * *\n\n_この投稿は[@metropolis\nさんのコメント](https://ja.stackoverflow.com/questions/48832/centos7%e3%81%a7%e3%81%ae%e8%a3%9c%e5%ae%8c%e3%81%ae%e9%81%85%e5%bb%...
48832
null
68899
{ "accepted_answer_id": "49022", "answer_count": 1, "body": "■概要 \nポップアップ系のダイアログの背景を透明化し、 \n特定の文字列だけをデバイスコンテキストを使用して描画させています。 \nこれを実現するためにSetLayeredWindowAttributes()を使用しています。 \nしかし、調べたところによると上記APIを使用した場合、非力なマシンだと処理が \n重くなる可能性があるとの情報があったので、より軽量で速度の早い方法が無いかを探しています。\n\n■質問内容 \nSetLayeredWindowAttributes()を使用した背景色の透過処理以外で \nより軽量になる方法は無いでしょうか? \n※DirectXを使ったやり方の方が軽くなるなど、全く別のアプローチ掲示でも何でも構いません。\n\n■制約や補足 \nWin32のDLLモジュールを作成し、そのDLLロードしたアプリケーション上で \nダイアログ用のスレッドを生成し、そのスレッド上でダイアログプロシージャを \n動作させています。(そのため、直接アプリケーション側のウィンドウプロシージャを使用できないので直接描画ができません) \nダイアログ側は属性として「Layred(WS_EX_LAYERED)」を設定しています。\n\n■現状のソースコード\n\n```\n\n DllMain(HINSTANCE hInstDLL, ...)\n {\n .\n .\n .\n case DLL_PROCESS_ATTACH:\n CreateThread(..., DlgThreadProc, hInstDLL, ...);\n .\n .\n .\n }\n \n DWORD WINAPI DlgThreadProc( LPVOID lpParameter )\n {\n HWND hOwner;\n HWND hDlg;\n MSG tagMsg;\n DWORD dwExitCode;\n BOOL bRinf;\n \n while (1)\n {\n // ロード対象のプロセスIDからウィンドウハンドル取得(内容は割愛)\n hOwner = GetWindowHandle(GetCurrentProcessId());\n if (hOwner != NULL)\n {\n break;\n }\n \n // タイムスライス譲渡\n Sleep(0);\n }\n \n hDlg = CreateDialogParam( (HINSTANCE)lpParameter, MAKEINTRESOURCEA(IDD_DIALOGBAR), hOwner, (DLGPROC)DlgProc, 0L );\n if ( hDlg == NULL )\n {\n dwExitCode = GetLastError();\n goto ERROR_END;\n }\n \n ShowWindow( hDlg, SW_SHOWNORMAL );\n \n while ( 1 )\n {\n bRinf = GetMessage( &tagMsg, NULL, 0, 0 );\n switch ( bRinf )\n {\n case 0: // プログラム終了\n \n dwExitCode = ERROR_SUCCESS;\n break;\n \n case -1: // イベントメッセージ取得エラー\n \n dwExitCode = GetLastError();\n break;\n \n default:\n \n if ( IsDialogMessage( hDlg, &tagMsg ) == FALSE )\n {\n TranslateMessage( &tagMsg );\n DispatchMessage( &tagMsg );\n }\n \n break;\n }\n \n if ( bRinf == 0 || bRinf == -1 ) break;\n }\n \n ERROR_END:\n ExitThread( dwExitCode );\n }\n \n INT_PTR CALLBACK DlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )\n {\n INT iRet;\n \n iRet = 0;\n \n switch (uMsg)\n {\n case WM_INITDIALOG:\n \n // カラーキー設定にて描画内容を排他\n SetLayeredWindowAttributes(hwndDlg, GetSysColor(COLOR_BTNFACE), 0, LWA_COLORKEY);\n \n iRet = 1;\n \n break;\n \n case WM_PAINT:\n hdc = BeginPaint(hwndDlg, &ps);\n \n SetBkMode(hdc, TRANSPARENT);\n SetTextColor(hdc, RGB(196, 163, 191));\n \n // 透明化されたダイアログに文字列描画\n TextOut(hdc, 20, 0, \"テスト描画\", sizeof(\"テスト描画\"));\n \n EndPaint(hwndDlg, &ps);\n break;\n \n case WM_CLOSE:\n EndDialog( hwndDlg, 0 );\n break;\n \n default:;\n }\n \n return iRet;\n }\n \n```", "comment_count": 4, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-29T17:25:15.990", "favorite_count": 0, "id": "48834", "last_activity_date": "2018-10-06T13:48:16.770", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "20931", "post_type": "question", "score": 1, "tags": [ "c", "winapi" ], "title": "Win32のダイアログプロシージャによるダイアログ画面の透明化処理の軽量化方法", "view_count": 250 }
[ { "body": "先日、頂いたアドバイスを元に試してみたところうまくいきました。 \n下記に試した擬似コードを掲載します。\n\n```\n\n static WNDPROC g_DefWndProc;\n \n INT_PTR CALLBACK HookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n {\n HDC hdc;\n PAINTSTRUCT ps;\n \n switch (uMsg)\n ...
48834
49022
49022
{ "accepted_answer_id": "48845", "answer_count": 1, "body": "pytubeのライブラリーを使用しているのですが以下のコードでクラス変数から値を取り出そうと考えたのですが、全部`None`になりうまく取り出せません。\n\n```\n\n <Stream: itag=\"17\" mime_type=\"video/3gpp\" res=\"144p\" fps=\"30fps\" vcodec=\"mp4v.20.3\" acodec=\"mp4a.40.2\">\n \n```\n\nクラスの中のデータは上記のようになっています。\n\n```\n\n from pytube import YouTube\n # from enum import Enum\n \n url = 'https://www.youtube.com/watch?v=W3cYmuXUbl0'\n \n class Youtubehq():\n \"\"\"docstring for Youtubehq\"\"\"\n def __init__(self, url):\n self.url = url\n \n def movieq(self):\n yt = YouTube(self.url)\n for class_d in yt.streams.all():\n res = class_d.res\n print(res)\n \n \n selectq = Youtubehq(url)\n selectq.movieq()\n \n```\n\n詳しい方ご教授して頂けると幸いです。 \nよろしくお願いします。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T05:02:06.167", "favorite_count": 0, "id": "48839", "last_activity_date": "2018-09-30T07:19:10.407", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "22565", "post_type": "question", "score": 0, "tags": [ "python", "python3" ], "title": "pytubeのライブラリーから出てくるクラス変数から値を取り出したい。", "view_count": 71 }
[ { "body": "resはresolutionの略なので、`class_d.resolution`を試してください。 \n(実装でもresと略しています:\n<https://github.com/nficano/pytube/blob/master/pytube/streams.py#L314>", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T07:19:10.407", "id": "48845", "last_activity_date": "...
48839
48845
48845
{ "accepted_answer_id": "48844", "answer_count": 1, "body": "このURLをブラウザで入力すると \n<http://wikipedia.simpleapi.net/ja/48503/> \nこのページへリダイレクトします。 \n[https://ja.wikipedia.org/wiki/コロッケ](https://ja.wikipedia.org/wiki/%E3%82%B3%E3%83%AD%E3%83%83%E3%82%B1)\n\nこのような場合に、リダイレクト前のURLを引数にしてリダイレクト先のURLを取得する \n方法はないのでしょうか。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T05:33:40.977", "favorite_count": 0, "id": "48841", "last_activity_date": "2018-09-30T07:14:17.237", "last_edit_date": "2018-09-30T05:53:20.480", "last_editor_user_id": "19110", "owner_user_id": "30138", "post_type": "question", "score": 3, "tags": [ "python", "python3", "http" ], "title": "Python URLのリダイレクト先のURLを取得する。", "view_count": 3817 }
[ { "body": "requestsモジュールを使用してできました。\n\n```\n\n import requests\n print(requests.get(\"http://wikipedia.simpleapi.net/ja/48503/\").url)\n \n > https://ja.wikipedia.org/wiki/%E3%82%B3%E3%83%AD%E3%83%83%E3%82%B1\n \n```\n\nrequestsではHTTP 301を自動的に解消するためこの方法が使えます。", "comment_count": 2, "conten...
48841
48844
48844
{ "accepted_answer_id": null, "answer_count": 0, "body": "pythonでファイルを読み込みしようとすると、\n\n```\n\n file_object = open('C:\\Users\\   \\Documents\\   .png','r')\n \n```\n\n以下のエラーが出ます。\n\n```\n\n SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \\UXXXXXXXX escape\n \n```", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T06:12:01.470", "favorite_count": 0, "id": "48842", "last_activity_date": "2018-10-01T02:39:15.307", "last_edit_date": "2018-10-01T02:39:15.307", "last_editor_user_id": "23994", "owner_user_id": "30290", "post_type": "question", "score": 1, "tags": [ "python" ], "title": "pythonでファイルを読み込みしようとするとエラーが出ます。", "view_count": 134 }
[]
48842
null
null
{ "accepted_answer_id": null, "answer_count": 1, "body": "全体は、UITableViewで、「ツイート」 「ツイートと返信」などはSection、 \nその下は、UIContainerViewでTableViewを管理しているのだと予想していますが、 \nどのようにして、UITableViewの中のTableViewのスクロールを干渉しないように実現させているのでしょうか?\n\n[![Twitter](https://i.stack.imgur.com/ybsJw.png)](https://i.stack.imgur.com/ybsJw.png)", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T09:00:13.590", "favorite_count": 0, "id": "48848", "last_activity_date": "2018-10-11T16:47:03.103", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "25991", "post_type": "question", "score": 0, "tags": [ "swift", "ios", "xcode", "twitter" ], "title": "TwitterのiOSアプリのプロフィール画面の実装", "view_count": 958 }
[ { "body": "サクッとつくってみました\n\n[![Twitter Like\nUI](https://i.stack.imgur.com/Gz2D4.gif)](https://i.stack.imgur.com/Gz2D4.gif) \n前提として、Twitterの中がどうなってるのかはわかりません。 \n世界的なアプリはビックリするような実装してたりするので。\n\n似たようなUIをどう作るかですが、私が考えた流れを書いてみます。\n\n・同じScroll方向の入れ子はあまり現実的ではありません(経験上)、 \n特に2つでスクロール量をコンバートするのは本当に危険です(非常に難しい) \nという...
48848
null
49203
{ "accepted_answer_id": "48856", "answer_count": 1, "body": "AさんのuidをBさんが知った場合、Bさんは自分のrequest.auth.uidをねつ造して本来Aさんしかアクセスできないアイテムにアクセスできますか?\n\nそれともuidが他のユーザに見えても大丈夫ですか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T10:29:31.430", "favorite_count": 0, "id": "48850", "last_activity_date": "2019-07-30T08:01:20.460", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30294", "post_type": "question", "score": 1, "tags": [ "firebase" ], "title": "Firebase auth uidの扱いについて", "view_count": 449 }
[ { "body": "バックエンドにWEBAPIなどが存在し、そこでFirebaseのUIDをキーに何か個人情報をHTTPで検索する場合などは当然脆弱性の余地がありますが、FirebaseのUIDをユーザーに知られても、FirebaseAPIから個人情報を抜かれることはありません。 \nただ、基本的にBtoC系のサービスで、バックエンドで管理しているユーザーの一意キーを公開するのはおすすめしません。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T15:06:29.67...
48850
48856
48856
{ "accepted_answer_id": "48875", "answer_count": 1, "body": "# 環境\n\n * Python 3.7\n * Holoviews 1.10.7\n\n# やりたいこと\n\nHoloviewsで、グラフを横に2つ並べて表示させたいです。\n\n```\n\n import math\n xs1 = range(-10,11)\n xs2 = range(-5,5)\n ys1 = [100-x**2 for x in xs1]\n ys2 = [10*math.sin(x) for x in xs2]\n c1 = hv.Curve((xs1, ys1))\n c2 = hv.Curve((xs2, ys2))\n c1+c2\n \n```\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/LbPKC.png)](https://i.stack.imgur.com/LbPKC.png)\n\nしかし、上記のコードだと、左側と右側のグラフの軸の範囲は同期されています。左側のグラフの軸範囲を変更すると、右側も軸範囲も変わります。\n\n以下のコードのように、左側のグラフと右側のグラフで、軸名を変更すれば、軸範囲は同期しないことが分かりました。\n\n```\n\n c1 = hv.Curve((xs1, ys1),\"x1\",\"y1\")\n c2 = hv.Curve((xs2, ys2),\"x2\",\"y2\")\n \n```\n\n# 質問\n\n左側のグラフと右側のグラフで軸名が同じ状態で、軸範囲を同期させないようにするには、どうすればよいでしょうか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T13:17:15.013", "favorite_count": 0, "id": "48852", "last_activity_date": "2018-10-01T11:18:04.317", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "19524", "post_type": "question", "score": 1, "tags": [ "python" ], "title": "Holoviewsでグラフを複数表示させたとき、軸範囲を同期させない方法", "view_count": 430 }
[ { "body": "```\n\n %%opts Layout [shared_axes=False]\n \n xs1 = range(-10,11)\n xs2 = range(-5,5)\n ys1 = [100-x**2 for x in xs1]\n ys2 = [10*math.sin(x) for x in xs2]\n c1 = hv.Curve((xs1, ys1))\n c2 = hv.Curve((xs2, ys2))\n \n c1+c2\n \n```\n\nでどうでしょうか", "comment_count": 3...
48852
48875
48875
{ "accepted_answer_id": null, "answer_count": 1, "body": "Android\nStudioでプログラミングを行っています。ランダムな数字が格納されているListからfor文で値を取り出しswitch文で処理をふりわけています。\n\nbutton.setBackgroundColor(Color.Black)としている部分があるのですが \nなぜかfor文の処理がすべて終わったあとに色が変わります。原因を教えていただきたいです。よろしくお願いいたします。\n\n```\n\n for(int r : randomList){\n try {\n sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n switch (r) {\n case 1:\n button1.setBackgroundColor(Color.BLACK);\n break;\n case 2:\n button2.setBackgroundColor(Color.BLACK);\n break;\n case 3:\n button3.setBackgroundColor(Color.BLACK);\n break;\n case 4:\n button4.setBackgroundColor(Color.BLACK);\n break;\n }\n }\n \n```", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T13:40:23.053", "favorite_count": 0, "id": "48854", "last_activity_date": "2021-03-07T04:30:55.380", "last_edit_date": "2021-03-07T04:30:55.380", "last_editor_user_id": "3060", "owner_user_id": "26076", "post_type": "question", "score": 0, "tags": [ "java", "android" ], "title": "for文のループが終わってから処理される", "view_count": 453 }
[ { "body": "ソースコードを読んでいないので推測を含みますが、`button.setBackgroundColor()`メソッドを呼び出しても、背景色を表す数値が`button`インスタンスに渡されるだけで、その値を参照して実際のボタンの背景色を変える処理が実行されていないからではないでしょうか。時間をおいて背景色をセットしたいということであれば、[このページ](https://stackoverflow.com/questions/51080537/setbackgroundcolor-\nis-getting-ignored)が参考になるかもしれません。", "comment_count": 2,...
48854
null
48855
{ "accepted_answer_id": "48858", "answer_count": 2, "body": "cssをatomで記述しています。コードがわかりやすいようにコメントを多用していたのですが今日atomを開いてみると\n\n```\n\n /*グラフã®ä¸­å¤®å¯„ã›*/\n \n```\n\nのように文字化けしていました。どなたか直す方法をご存知の方教えて頂けると助かります。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-09-30T16:59:02.843", "favorite_count": 0, "id": "48857", "last_activity_date": "2019-07-20T20:34:37.497", "last_edit_date": "2019-07-20T20:34:37.497", "last_editor_user_id": "32986", "owner_user_id": "29853", "post_type": "question", "score": 1, "tags": [ "css", "atom-editor", "文字化け" ], "title": "atomのcssのコメントにつて", "view_count": 111 }
[ { "body": "文字コードの設定が何かしらの理由で変わったのではないかと推測されます。\n\nウィンドウ右下の表示から手動で文字コードを変えて上手く表示されるものを探すか、[auto-\nencoding](https://atom.io/packages/auto-encoding)\nなどの自動検出パッケージをインストールして文字コードを自動変更させてください。\n\nまた、Atom のデフォルト設定で文字化けするということは、その CSS ファイルが UTF-8\n以外の文字コードで保存されているのではないかと思います。現代的にはウェブ用のファイルの文字コードは Unicode 系に統一するのが良いと思い...
48857
48858
48858
{ "accepted_answer_id": null, "answer_count": 1, "body": "visual studio 2017 professional\nを用いてC++の実装をしているのですが、既存のソリューションを読みこんだ際にビルド/リビルドを行ったのですが、構成マネージャをwin32にして行うと、ビルド自体は正常終了するのですが、\n\n```\n\n 〇〇dllを開始できません。〇〇dllは有効なwin32アプリケーションではありません。\n \n```\n\nとエラーダイアログが表示されます。そこでx64にしてビルドを行うと、先ほどは出力されなかったエラーで、\n\n```\n\n 無効な型変換です\n \n```\n\nというエラーが一部指摘され、ビルドに失敗します。\n\nなぜ、win32ではビルドが通ったのに、x64だとビルドが通らないのか、原因と解決策を教えていただきたいです。", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T01:02:43.047", "favorite_count": 0, "id": "48860", "last_activity_date": "2018-10-01T07:20:10.967", "last_edit_date": "2018-10-01T01:32:13.170", "last_editor_user_id": "3060", "owner_user_id": "30303", "post_type": "question", "score": 0, "tags": [ "c++" ], "title": "visual studioでのビルドエラーwin32とx64", "view_count": 7455 }
[ { "body": "`WPARAM` は 32bit 環境では 32bit 値、 64bit 環境では 64bit 値なのに対して `UINT` は両環境で 32bit\nです。そのためもともと `UINT` を引数にとる関数をキャストで無理やり `WPARAM`\nを受け取るように変換しても、ポインタを受け渡す目的は達せず、動きません。\n\n```\n\n int g(UINT w, LONG u) { return 0; }\n int (*p)(WPARAM, LONG)=g; // C2440\n p = static_cast<int(*)(WPARAM,LONG)>(g); // C...
48860
null
48865
{ "accepted_answer_id": null, "answer_count": 1, "body": "[python3](/questions/tagged/python3 \"'python3'\nのタグが付いた質問を表示\")と[tkinter](/questions/tagged/tkinter \"'tkinter'\nのタグが付いた質問を表示\")を用いてGUIを作成しようとしたのですが、わからない点があったので質問させて頂きます。\n\n### やりたいこと\n\n①:「startボタン」と「stopボタン」の2つのボタンが配置されているメインウィンドウの作成 \n②:「startボタン」を押すと、接続しているUSBカメラの映像をメインウィンドウ内に表示 \n③:「stopボタン」を押すと、②で表示されたUSBカメラの映像を消す(メインウィンドウは残したまま)\n\n### 困っている点\n\n①と②は色々なサイトを参考にして作成できたのですが、③の処理のところで \nUSBカメラの映像を消すことが出来なくて困っています。\n\n現状「stopボタン」を押すとUSBカメラの映像はそのまま変化なしで、以下のエラーメッセージが出ます。\n\n```\n\n Exception in thread Thread-8:\n Traceback (most recent call last):\n File \"C:\\Users\\usr\\Anaconda3\\lib\\threading.py\", line 916, in _bootstrap_inner self.run()\n File \"C:\\Users\\usr\\Anaconda3\\lib\\threading.py\", line 864, in run\n self._target(*self._args, **self._kwargs)\n TypeError: destroy() missing 1 required positional argument: 'panel'\n \n```\n\n### コード\n\n```\n\n import cv2\n from PIL import Image\n from PIL import ImageTk\n import threading\n import tkinter as tk\n \n \n def button1_clicked():\n thread = threading.Thread(target=videoLoop, args=())\n thread.start()\n \n def button2_clicked():\n thread = threading.Thread(target=destroy, args=())\n thread.start()\n \n def destroy(panel):\n panel.destroy()\n \n def videoLoop(mirror=False):\n No=0\n cap = cv2.VideoCapture(No)\n cap.set(cv2.CAP_PROP_FRAME_WIDTH, 800)\n cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 600)\n \n while True:\n ret, to_draw = cap.read()\n if mirror is True:\n to_draw = to_draw[:,::-1]\n \n image = cv2.cvtColor(to_draw, cv2.COLOR_BGR2RGB)\n image = Image.fromarray(image)\n image = ImageTk.PhotoImage(image)\n panel = tk.Label(image=image)\n panel.image = image\n panel.place(x=50, y=50)\n \n return panel\n \n \n root = tk.Tk()\n root.geometry(\"1920x1080+0+0\")\n \n button1 = tk.Button(root, text=\"start\", bg=\"#fff\", font=(\"\",50), command=button1_clicked)\n button1.place(x=1000, y=100, width=400, height=250)\n \n button2 = tk.Button(root, text=\"stop\", bg=\"#fff\", font=(\"\",50), command=button2_clicked)\n button2.place(x=1000, y=360, width=400, height=250)\n \n root.mainloop()\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T04:04:23.017", "favorite_count": 0, "id": "48862", "last_activity_date": "2022-06-12T10:03:05.367", "last_edit_date": "2021-03-15T00:08:49.223", "last_editor_user_id": "3060", "owner_user_id": "30306", "post_type": "question", "score": 0, "tags": [ "python", "python3", "opencv", "tkinter" ], "title": "Python3とTkinterを用いてカメラ映像をon/off出来るボタン付きGUIを作成したい", "view_count": 2664 }
[ { "body": "私はそのカメラ映像自身に変わるものを持っておりませんので、上記のエラー状況だけを見て解答を書かせていただきます。\n\nエラーの内容は、`destroy()`という関数が、`panel`という引数を要求しているのにも関わらず、その`panel`という引数の値には、何も入れ込まれていませんよ。という感じのエラーです。\n\n```\n\n def destroy(panel):\n panel.destroy()\n \n```\n\nで定められている通り、`destroy`関数の引数として`panel`が設定されていますね。この関数を使う時には、`panel`というもの...
48862
null
48864
{ "accepted_answer_id": "49002", "answer_count": 1, "body": "IJCAD2018を使用してC#で開発を行っております。 \nAutoCADの場合、 \n[DllImport(\"accore.dll\", CharSet = CharSet.Unicode, CallingConvention =\nCallingConvention.Cdecl)] \nprivate static extern int acedEntSel(String str, out AdsName objName, double[]\nresult); \nとすることでacadEntSelを呼び出すことができるようになり、 \nこれを使用することでユーザーが選択したオブジェクトのIDや座標を取得することが \nできるのですが、これはIJCAD2018では互換性のあるDLLなどは存在しないのでしょうか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T05:38:02.610", "favorite_count": 0, "id": "48863", "last_activity_date": "2018-12-13T06:20:36.537", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30311", "post_type": "question", "score": 0, "tags": [ ".net", "ijcad" ], "title": "IJCAD2018 でC#でのプログラミングにおけるaccore.dllとの互換性について", "view_count": 127 }
[ { "body": "IJCADの.NETからacadEntSel関数を使用するには、\n\n```\n\n [DllImport(\"gced.dll\", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl,EntryPoint = \"gcedEntSel\")]\n public static extern int acedEntSel(String str, out ads_name entres, double[] ptres);\n \n```\n\nとすることで、関数を呼び出すことが出来ると思い...
48863
49002
49002
{ "accepted_answer_id": null, "answer_count": 2, "body": "以下のコードで数字が格納されたリストからひとつずつ取り出して、反復処理をしています。ところがこのコードを実行するとボタンの色が同時にかわる現象が発生します。\n\nデバッグを実行しステップイン実行するとたしかに反復処理になっているのですが、なぜこのようなことがおこるか全くわかりませんでした。\n\n前回の質問ではThread.sleep()を使用して待機させていたのですが、for文の処理が全て終わってからボタンの色が変わりました。\n\n**今までに試したこと** \n①ハンドラー:ハンドラーを使うと色が同時に変わる \n②timer.scedule(): sceduleも結果は一緒で同時に色が変わる \n③Thread.sleep(): Thread.sleep()を使うとfor文が終了して色が変わる \n④switch文全体をtimer処理しようと思いついたが、ローカル変数をうけとることができない。 \n⑤ローカルにアクセスするためにrun()メソッドにfor文を書けばよいと思ったが構文ルールに反するみたい\n\n「色を変える→1秒止まる->また色を変える」とやりたいだけなのですが・・・\n\nよろしくお願いいたします。\n\n```\n\n for(int r : randomList){\n switch (r) {\n case 1:\n button1.setBackgroundColor(Color.BLACK);\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run(){\n button1.setBackgroundColor(Color.WHITE);\n }\n }, 100);\n break;\n case 2:\n button2.setBackgroundColor(Color.BLACK);\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run(){\n button2.setBackgroundColor(Color.WHITE);\n }\n }, 100);\n break;\n case 3:\n button3.setBackgroundColor(Color.BLACK);\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run(){\n button3.setBackgroundColor(Color.WHITE);\n }\n }, 100);\n break;\n case 4:\n button4.setBackgroundColor(Color.BLACK);\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run(){\n button4.setBackgroundColor(Color.WHITE);\n }\n }, 100);\n break;\n }\n }\n \n```", "comment_count": 7, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T07:29:37.337", "favorite_count": 0, "id": "48866", "last_activity_date": "2022-12-27T08:02:15.277", "last_edit_date": "2018-10-01T12:50:38.423", "last_editor_user_id": "26076", "owner_user_id": "26076", "post_type": "question", "score": 2, "tags": [ "android", "java" ], "title": "Listから取り出したボタンを 1秒まってからボタンの色を変えたい。", "view_count": 505 }
[ { "body": "**コメントでの助言もあり解決しました(質問者自身による投稿)**\n\n```\n\n for (int r : randomList) {\n new Handler().postDelayed(new Runnable(){\n public void run(){\n \n }\n }, listCount3);\n \n s...
48866
null
48880
{ "accepted_answer_id": null, "answer_count": 1, "body": "PC上でラズパイから送ったセンサのデータをCSV形式で保存しようと考えているのですが、data.csvは作成されますがデータが書き込まれません \nちなみに渡しているデータはカンマ区切りのデータ(1,2,3.1,4.2,5.3のようなもの)です\n\nラズパイ側かphp側どちらに問題があるのかすらよくわかりません \nめちゃくちゃな質問とは思いますがどなたか詳しい方いらっしゃいましたら助言お願いいたします.\n\nデータ送信部(raspberrypi)\n\n```\n\n #!/usr/bin/env python\n # -*- coding: utf-8 -*-\n \n import requests\n import serial\n import time\n \n if __name__ == '__main__':\n gpio_seri = serial.Serial('/dev/ttyACM0', 9600, timeout=10)\n print(gpio_seri.portstr)\n time.sleep(3)\n while 1:\n gpio_seri.write('get')\n time.sleep(1)\n data = gpio_seri.readline()\n print(data)\n url = \"http://192.168.0.103:8080/test1.php/\"\n s = requests.session()\n r = s.post(url, data)\n \n```\n\nデータ受信部(php)\n\n```\n\n <?php\n \n $data1 = $_POST['data'];\n \n $filename = \"data.csv\";\n $fp = fopen('data.csv', 'a');\n \n $line = implode($data1);\n \n fwrite($fp, $line . \"\\n\");\n \n fclose($fp);\n \n ?>\n \n```", "comment_count": 5, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T07:43:48.697", "favorite_count": 0, "id": "48867", "last_activity_date": "2018-10-01T10:49:16.680", "last_edit_date": "2018-10-01T07:51:33.067", "last_editor_user_id": null, "owner_user_id": "26483", "post_type": "question", "score": 0, "tags": [ "python", "php", "apache", "raspberry-pi", "xampp" ], "title": "raspberrypiからphpへPOSTでセンサデータを送りたい", "view_count": 1441 }
[ { "body": "解決しました \n下記のコードのように変更すると成功しました \nコメント下さった方々本当にありがとうございます\n\nコメントを参考に送信側を色々変更しました\n\n加えて受信側の書き込みの部分はfwiteを用いずにcurrentに変更しました\n\n送信側\n\n```\n\n #!/usr/bin/env python\n # -*- coding: utf-8 -*-\n \n import requests\n import serial\n import time\n \n if __name__ == '__main__':\n ...
48867
null
48873
{ "accepted_answer_id": "48882", "answer_count": 1, "body": "**現状** \n・Windows10で(.CR2拡張子の)ファイルコピーしようとしたら巡回冗長検査 (CRC) エラーとなりました \n・しかしHoneyview(画像ビューア)ソフトウェアで開いたら普通に画像表示されました\n\n* * *\n\n**質問** \n・ソフトウェアで画像表示された、ということはファイルは壊れていないのですか? \n※これまで巡回冗長検査 (CRC) エラーが出た場合、データが壊れたと思いファイル削除していました \n・ファイル表示できてもファイルコピー出来ないことはあり得るのですか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T09:38:37.527", "favorite_count": 0, "id": "48868", "last_activity_date": "2018-10-02T00:53:41.840", "last_edit_date": "2018-10-02T00:53:41.840", "last_editor_user_id": "3060", "owner_user_id": "7886", "post_type": "question", "score": 1, "tags": [ "windows", "画像" ], "title": "巡回冗長検査 (CRC) エラーなのに画像ビューアで表示できた場合、データは壊れていないのですか?", "view_count": 672 }
[ { "body": "CRC は単純に巡回冗長検査で、いろんなところで使われています。ファイルをコピーしただけで CRC エラーが出るということなら、ハードディスクや SSD\nなど記憶メディア上でハードウェアが自動で行っている CRC 検査に失敗したということです。\n\nディスク装置上、セクタは 512byte や 4096byte などのペイロード(純粋にユーザが登録したいデータ)と、付随する何らかの情報( CRC\n値とかセクタ番号とか)から構成されているので、セクタ内部のどこかが誤っているということになりそうです。\n\n * ファイルの内容は壊れているの?\n\n壊れていると考えてよいです。原因はハード...
48868
48882
48882
{ "accepted_answer_id": null, "answer_count": 1, "body": "Laravelを使って、入力フォームを作成しています。 \nバリデーションのルールで正規表現を使って、 **4桁の数字、または空欄**\nを指定して、入力チェックを行いたいのですが、regexを指定した時点で空欄がバリデーションに引っかかってしまいます。\n\n例えば、\n\n```\n\n $rules = [\n 'value1' => ['regex:/^\\d{4}$/'],\n 'value2' => ['regex:/^(\\d{4})?$/']\n 'value3' => ['regex:/^(\\d{4}|\\s*)$/'],\n 'value4' => ['regex:/^(\\d{4}|\\n*)$/'],\n 'value5' => ['regex:/^(\\d{4}| *)$/']\n ];\n \n```\n\nこのような方法は試しましたが、空欄で送信するとバリデーションに引っかかります。 \nこの他にも考えられる方法は試してみましたが、出来ません。 \nそもそもregexを設定した時点で空欄も無効になっている気がします。\n\n```\n\n 'value' => ['regex:/\\s*/']\n \n```\n\nちなみに\\dを抜いて、↑のような方法や\n\n```\n\n 'value' => ['regex:/.*/']\n \n```\n\n↑も試しましたが、両記とも全角スペースだと通りますが、半角スペース、空欄の場合はダメでした。\n\nどのように設定すれば良いのでしょうか?", "comment_count": 4, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T09:45:30.450", "favorite_count": 0, "id": "48869", "last_activity_date": "2018-10-01T10:22:20.613", "last_edit_date": "2018-10-01T10:22:20.613", "last_editor_user_id": "30313", "owner_user_id": "30313", "post_type": "question", "score": 1, "tags": [ "php", "laravel" ], "title": "Laravelのバリデーションでregexを指定すると、入力フォームで空欄が送信できなくなる。", "view_count": 2754 }
[ { "body": "nullableを使うことで設定することが出来ました。\n\n```\n\n 'value' => ['nullable','regex:/^\\d{4}$/'],\n \n```\n\n正規表現に付け足すのではなく、1つのバリデーションを設定します。\n\nregex内で **| (パイプ)** を使う際は、バリデートを分けるために **| (パイプ)**\nが使用できないため配列型で設定しますが、この場合必要ないので、\n\n```\n\n 'value' => 'nullable | regex:/^\\d{4}$/',\n \n```\n\nこれで出来ました。 ...
48869
null
48872
{ "accepted_answer_id": "48871", "answer_count": 2, "body": "プログラムというのはまずプログラムの仕様を決めて、\n\nそのプログラムのアルゴリズムや流れをフローチャートかアクティビティ図に書き込み、\n\nそのフローチャートかアクティビティ図をもとにプログラミング言語でプログラムをするのがプログラムの基本だと思っています。\n\nしかし、自分が作ったアルゴリズムやプログラムの流れに不備がないか不安な時や[アセンブリ言語](https://ja.wikipedia.org/wiki/%E3%82%A2%E3%82%BB%E3%83%B3%E3%83%96%E3%83%AA%E8%A8%80%E8%AA%9E)や[LISP](https://ja.wikipedia.org/wiki/LISP)などといった特殊な仕組みのコードを使う言語を使う予定がある時など(よくネタプログラミング言語のベースとなる[Brainf**k](https://ja.wikipedia.org/wiki/Brainfuck)も特殊な仕組みに入れられますね。)に\n\nそのプログラムを本来使う予定のとは違うプログラミング言語でテストしてから、本来使う予定のプログラミング言語でプログラムを組むというのはありなのでしょうか?\n\n僕もこれがありなのかどうか不安なので、早急にお答えください。", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T10:08:51.283", "favorite_count": 0, "id": "48870", "last_activity_date": "2018-10-01T11:01:28.050", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "26886", "post_type": "question", "score": 0, "tags": [ "プログラミング言語" ], "title": "あるプログラムの試作品を言語Aで作成し実際に作るときは言語Bで作るということはできますか?", "view_count": 171 }
[ { "body": "TL;DR: 可能です。\n\n* * *\n\n理論的な話をすると、 **チューリング完全**\nという概念があり、広く使われているプログラミング言語の多くは万能チューリングマシンと同じ計算能力を持つとされています。\n\nこのため、あるチューリング完全である言語で実装可能なものは、他のチューリング完全な言語でも実装可能となります。\n\nただし、言語特有のライブラリなどに依存する問題により、実際には実現困難な場合もあります。", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date"...
48870
48871
48874
{ "accepted_answer_id": null, "answer_count": 1, "body": "ネットで書いてあったのを試してみてpyinstallerで.exeファイルにしてみたんですけど他の(pythonが入っていない)PCで開けません。\n\n<http://kconcon3.hatenablog.com/entry/2018/01/22/230000>\n\n[![フォルダの中身を見ているスクリーンショットです。フォルダが3つとファイルが2つあります。フォルダ名は順に __pycache__, build,\ndist です。ファイル名は順に sav, sav.spec\nです。](https://i.stack.imgur.com/Optfd.jpg)](https://i.stack.imgur.com/Optfd.jpg)", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T12:18:50.507", "favorite_count": 0, "id": "48877", "last_activity_date": "2018-10-02T01:11:45.573", "last_edit_date": "2018-10-01T14:54:14.900", "last_editor_user_id": "19110", "owner_user_id": "30290", "post_type": "question", "score": 0, "tags": [ "python" ], "title": "python 3.7.0 + pyinstallerで作ったプログラムを他のPCで開く方法", "view_count": 1628 }
[ { "body": "あくまで推測ですが、--onefile を指定してみたらどうですか? \n下記の書き込みによると、「引数に「--onefile」と入力しておくと、関連するファイルを1つにまとめることができます。」\n\n<https://atelier.hatenadiary.com/entry/2018/07/01/220418>\n\nおそらくPythonが入っていない環境で必要なライブラリが足りないのでエラー発生したと思われます。 \n一回やってみてください。", "comment_count": 1, "content_license": "CC BY-SA 4.0", "c...
48877
null
48884
{ "accepted_answer_id": null, "answer_count": 0, "body": "```\n\n // list.js に食わせるデータ\r\n var database = [\r\n {\"name\":\"name1\", \"value\":\"v1\"},\r\n {\"name\":\"name2\", \"value\":\"v2\"},\r\n {\"name\":\"name3\", \"value\":\"v3\"},\r\n {\"name\":\"name4\", \"value\":\"v4\"},\r\n {\"name\":\"name5\", \"value\":\"v5\"},\r\n {\"name\":\"name6\", \"value\":\"w1\"},\r\n {\"name\":\"name7\", \"value\":\"w2\"},\r\n {\"name\":\"name8\", \"value\":\"w3\"},\r\n {\"name\":\"name9\", \"value\":\"w4\"},\r\n ];\r\n \r\n // 検索オプション\r\n var options = {\r\n valueNames: ['name','value'],\r\n page: 3,\r\n pagination: true,\r\n item: '<div><h4 class=\"name\"></h4><p class=\"value\"></p></div>'\r\n };\r\n \r\n var result = new List('mylist', options, database);\r\n \r\n // 検索ヒット数を表示\r\n result.on('searchComplete', function(a){\r\n $(\"#hits\").html(a.matchingItems.length);\r\n });\r\n $(\"#hits\").html(result.size);\n```\n\n```\n\n <html>\r\n <head>\r\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-3.2.1.min.js\"></script>\r\n <script type=\"text/javascript\" src=\"https://cdnjs.cloudflare.com/ajax/libs/list.js/1.5.0/list.min.js\"></script>\r\n </head>\r\n <body>\r\n <div id=\"mylist\">\r\n <input type=\"text\" class=\"fuzzy-search\">\r\n <p style=\"font-size: 15px\">ヒット数 : <span id=\"hits\"></span></p>\r\n <ul class=\"list\"></ul>\r\n <ul class=\"pagination\"></ul>\r\n </div>\r\n </body>\r\n </html>\n```\n\n問題:class=\"fuzzy-search\" だとページボタンが表示されません。 \n現象確認:page:3と設定しているため、例えば検索フォームで v を入力すると\n5件がヒットし、ページボタンが表示されることを期待しているのですが、表示されません。 \nclass=\"search\" とすると問題なくページボタンが表示されます。 \nand検索を使いたいのでfuzzy-search を有効にしたいのですが、解決策をご教授いただけると幸いです。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T13:03:56.833", "favorite_count": 0, "id": "48878", "last_activity_date": "2018-10-01T13:03:56.833", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30320", "post_type": "question", "score": 2, "tags": [ "javascript", "html" ], "title": "list.js で fuzzy-search をすると pagination が消える", "view_count": 176 }
[]
48878
null
null
{ "accepted_answer_id": null, "answer_count": 0, "body": "アンドロイドスタジオのbuild.gradleでの設定に関してです。\n\n```\n\n dependencies {\n implementation fileTree(dir: 'libs', include: ['*.jar'])\n implementation\"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version\"\n implementation\"org.jetbrains.anko:anko-common:Sanko_version\"\n implementation 'com.android.support:appcompat-v7:28.0.0-rc01'\n \n```\n\nこちらの最後の一文、が\n\n> This detector looks for usages of libraries where the version you are using\n> is not the current stable release. Using older versions is fine, and there\n> are cases where you deliberately want to stick with an older version.\n> However, you may simply not be aware that a more recent version is\n> available, and that is what this lint check helps find\n\nと、問題がある。と出てしまいます。 \nどうやら以前のバージョンと最新のバージョンが違うせいで、問題がでているようなのでバージョンをそろえようとしました。 \nsupport libraryとバージョンを合わせるとよいみたいなのでsupport library を確認しようとしても、入っていませんでした。 \n<https://developer.android.com/topic/libraries/support-library/setup?hl=ja> \nこちらのサイトを参考にAndroid Support Repositoryまではいれることができました。 \nしかし、ここからの解決策がわかりません。[![画像の説明をここに入力](https://i.stack.imgur.com/J30kp.jpg)](https://i.stack.imgur.com/J30kp.jpg)", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T14:11:02.613", "favorite_count": 0, "id": "48879", "last_activity_date": "2018-10-01T16:49:20.123", "last_edit_date": "2018-10-01T16:49:20.123", "last_editor_user_id": "19769", "owner_user_id": "30204", "post_type": "question", "score": 2, "tags": [ "android-studio", "build" ], "title": "アンドロイドスタジオのbuild.gradleでの設定", "view_count": 89 }
[]
48879
null
null
{ "accepted_answer_id": "48883", "answer_count": 2, "body": "javaのコードで入力待ちのためにwhileを使用すると画面がフリーズしてしまいます。C#では`Application.DoEvents()`というものがあり対処できたのですがJavaでフリーズさせない方法はあるのでしょうか?検索しても情報が見つからないので助けてほしいです。\n\n```\n\n int count = 0;\n \n while(true){\n if(count == 4){\n break;\n }\n }\n \n```\n\ncountの値が4になるまで永遠に待ちたいのですが、whileを使用すると画面がフリーズします。どうすればよいでしょうか。", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-01T18:47:24.350", "favorite_count": 0, "id": "48881", "last_activity_date": "2018-10-02T10:38:43.767", "last_edit_date": "2018-10-02T01:23:26.270", "last_editor_user_id": "3060", "owner_user_id": "26076", "post_type": "question", "score": 2, "tags": [ "android", "java" ], "title": "条件がそろうまでコードを進ませたくない", "view_count": 3400 }
[ { "body": "> 永遠に待ちたい\n\nこういう待ち方をすると正常終了もできませんよ。待っちゃダメです。「待つ」という考え方を捨ててください。いまどき windows も android\nも「ハンドラの中で待つ」という処理は禁止されています。\n\n提示質問文書だけでは具体的に何がしたいのかわかりませんが、 \n\\- ***条件が成立したのち△△△をしたい \nのなら \n\\- ***状況を変化させるハンドラの中で条件成立を判断する \n\\- タイマーハンドラの中で条件成立を判断する \nのように考えます。\n\n[for文のループが終わってから処理される](https://ja.stack...
48881
48883
48883
{ "accepted_answer_id": "48890", "answer_count": 2, "body": "int main関数の方で `derive<int> d;`\nと宣言すると[純枠仮想関数をオーバーライドするものがありません]というエラー出ます、純枠仮想関数を派生先で定義しているのにも関わらずエラーでる理由がわかりません。教えていただけますでしょうか?\n\n```\n\n template<class type,class typeb>\n class base {\n private:\n \n protected:\n \n public:\n base(){ }\n \n virtual void f(int x) {\n typeb a = x;\n std::cout << \"仮想関数\"<< a <<\"\\n\";\n }\n \n virtual type f2(type x)const = 0;//純粋仮想関数\n \n };\n \n template<class typec> \n class derive : public base<class type,class typeb> {\n \n public:\n derive(){ }\n \n void f(int x) {\n std::cout << \"派生\"<< x<<\"\\n\";\n }\n \n typec f2(typec x)const {\n std::cout << x;\n \n return x;\n }\n \n };\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T03:59:57.507", "favorite_count": 0, "id": "48889", "last_activity_date": "2018-10-02T23:22:42.127", "last_edit_date": "2018-10-02T23:22:42.127", "last_editor_user_id": "4236", "owner_user_id": null, "post_type": "question", "score": 0, "tags": [ "c++" ], "title": "テンプレートクラスの派生で純枠仮想関数をオーバーライドするものがありません", "view_count": 2039 }
[ { "body": "純枠仮想関数以前の問題として、[テンプレート仮引数](https://en.cppreference.com/w/cpp/language/template_parameters)と[プロトタイプ宣言](https://en.cppreference.com/w/cpp/language/class#Forward_declaration)を混同し、無茶苦茶なコードになっています。これらを区別するため、質問文のテンプレート仮引数をPascal形式で書き直します。\n\n```\n\n template<class Type, class Typeb>\n class base {\n...
48889
48890
48890
{ "accepted_answer_id": null, "answer_count": 0, "body": "OpenCvSharpにてdrawcontoursを使用して輪郭描画を行っていますが、この時輪郭描画で表示される色についてご質問があります。(出力画像は(8U3C)) \nこの描画される色に黒や黒に近い色を使いたいのですが、例えばColorに渡すScalarの値を(0, 0, 0)とすると線が消失します。((255, 0,\n0)の様にすれば表示されます) \n透過っぽくもあった為、念の為、Scalarの4番目の要素を(0, 0, 0, 255)の様にしても線が表示されません。 \ndrawcontoursで黒線を表示する為にはどうすればよろしいかご教授願います。\n\n環境はVisual Studio Express 2017 で \nOpenCvSharp3 AnyCPU(v4.0.30319)を使用しています。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T05:20:20.293", "favorite_count": 0, "id": "48891", "last_activity_date": "2018-10-02T05:20:20.293", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30326", "post_type": "question", "score": 2, "tags": [ "c#", "opencv" ], "title": "drawcontoursの色について", "view_count": 236 }
[]
48891
null
null
{ "accepted_answer_id": "48899", "answer_count": 1, "body": "環境\n\nリモートOS:CentOS6.10 => npm v6.4.1, nodejs v10.11.0\n\nローカルOS:Windows10 => 仮想環境: virtualbox, vagrant, エディタ: VSCode\n\n**試してみたこと**\n\n```\n\n [helloworld.js]\n \n var http = require('http');\n http.createServer(function (req, res) {\n res.writeHead(200, {'Content-Type': 'text/plain'});\n res.end('Hello World\\n');\n }).listen(1337, '192.168.33.10');\n console.log('Server running at http://192.168.33.10:1337/');\n```\n\nこのhelloworld.jsを /home/vagrant/nodejsフォルダの中に入れてここに移動し、コマンド 「 node\nhelloworld.js 」と打ちまして\n\n```\n\n [launch.json]\n \n {\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"type\": \"node\",\n \"request\": \"attach\",\n \"name\": \"Attach to Remote\",\n \"address\": \"192.168.33.10\",\n \"port\": 1337,\n \"localRoot\": \"${workspaceFolder}\",\n \"remoteRoot\": \"/home/vagrant/nodejs/\"\n }\n ]\n }\n \n```\n\nそしてこのようにlaunch.jsonを作成しました。\n\nその後、何度かサーバーを実行したりデバッガを実行したりしてみました。\n\n**結果**\n\n```\n\n ランタイム プロセスに接続できません。10000ミリ秒後にタイムアウトします \n -(理由: ターゲットからの応答が正しくないようです。エラー:Unexpected token H in JSON at position 0。 応答: Hello World)。\n```\n\nデバッグコンソール上では、\n\n```\n\n Node.js のバージョンを判別できなかったため、インスペクター プロトコルをデバッグしています \n (Error: connect ECONNREFUSED 192.168.33.10:1337)\n```\n\n↑このようなエラーが出ました。「応答: Hello\nWorld」と出ていることからも、なんとなく接続はしているのでは?と思ったのですが、どうもデバッガが実行できないようです。 \n何か設定にミス等があれば、ご教授頂けると幸いです。よろしくお願いいたします。", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T05:23:12.537", "favorite_count": 0, "id": "48892", "last_activity_date": "2018-10-02T08:28:07.533", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "28320", "post_type": "question", "score": 1, "tags": [ "javascript", "node.js", "vscode" ], "title": "VSCode上でNodeJSをデバッグする方法がわかりません。", "view_count": 1850 }
[ { "body": "リモートのnode.jsを以下のようにしてデバックモードで起動して、 \n<https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_attaching-to-\nnodejs>\n\n```\n\n node --inspect helloworld.js\n \n```\n\n又は\n\n```\n\n node ----inspect-brk helloworld.js\n \n```\n\nそこに表示されるポート番号(上記のようにプションがなければ9229)を`launch.json`のポート番号に設...
48892
48899
48899
{ "accepted_answer_id": null, "answer_count": 1, "body": "「ディレクトリの中にある複数のファイル」を以下のような構造体で表しています。\n\n```\n\n type MyDirectory struct {\n Name string\n Files []MyFile\n }\n \n type MyFile struct {\n Name string\n }\n \n```\n\n上記の `MyFile` 構造体に、ディレクトリ名とファイル名とを連結したパスを取得するメソッドを持たせたいのですが、下記の `\"?\"`\nの部分で行き詰りました。\n\n```\n\n func (f *MyFile) path() string {\n return filepath.Join(\"?\", f.Name)\n }\n \n```\n\nどのような方法がありますでしょうか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T05:37:32.060", "favorite_count": 0, "id": "48893", "last_activity_date": "2018-10-03T05:25:54.337", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "19759", "post_type": "question", "score": 2, "tags": [ "go" ], "title": "構造体の子側のメソッドから親のフィールドを参照したい", "view_count": 212 }
[ { "body": "自己回答です。[類似の質問](https://stackoverflow.com/questions/27918208/go-get-parent-\nstruct)がありました。 \n子のフィールドに、親を参照するポインタを持たせる方法です。\n\n```\n\n type MyDirectory struct {\n Name string\n Files []MyFile\n }\n \n type MyFile struct {\n Dir *MyDirectory\n Name string\n ...
48893
null
48920
{ "accepted_answer_id": null, "answer_count": 1, "body": "visual studioでビルド実行時、\n\n1>〇〇.vcxproj -> C:\\trunk...(略)...\\GUM.\\Debug\\〇〇.dll \n1>指定されたパスが見つかりません。 \n1>プロジェクト \"〇〇.vcxproj\" のビルドが終了しました。 \n========== すべてリビルド: 1 正常終了、0 失敗、0 スキップ ==========\n\nと結果が出力されたのですが、 \ndllのフォルダパスで、GUMとDebugの間の「.」は何ですか? \nこのドットがなければフォルダパスは問題ないのですが、このドットがあることでパスが見つからないといわれているのでしょうか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T05:51:58.463", "favorite_count": 0, "id": "48894", "last_activity_date": "2022-02-15T04:06:05.577", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30303", "post_type": "question", "score": 0, "tags": [ "visual-studio" ], "title": "visual studioのビルド時のdllのパスについて", "view_count": 790 }
[ { "body": "Visual Studioのプロジェクトファイルは、実は[MSBuild](https://docs.microsoft.com/ja-\njp/visualstudio/msbuild/msbuild?view=vs-2017)というビルドツールのプロジェクトファイルであり、Visual\nStudioはMSBuildを呼び出しているに過ぎません。Visual Studio上の設定がそのままMSBuildの変数となります。\n\n> GUMとDebugの間の「.」は何ですか?\n\nVisual\nStudio上の設定のどこかで「.」のような値を設定してしまった結果です。MSBuildは変数で...
48894
null
48905
{ "accepted_answer_id": "48903", "answer_count": 2, "body": "Xcode 10.0でTableViewのカスタムセルのボタンをクラスTableViewCellにリンクしたいのですが、「Could not insert\nnew action」のエラーが出てしまいます。対応方法を教えていただけるでしょうか。\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/Opnbf.png)](https://i.stack.imgur.com/Opnbf.png)", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T06:35:19.453", "favorite_count": 0, "id": "48895", "last_activity_date": "2018-10-04T01:03:16.103", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "21142", "post_type": "question", "score": 0, "tags": [ "swift", "ios", "swift4", "uitableview" ], "title": "TableViewのカスタムセルのボタンがクラスにリンクできません", "view_count": 572 }
[ { "body": "まず第一に確認すべきは、セルのCustom Classの設定が正しいかどうかでしょう。\n\n[![セルのCustom\nClass](https://i.stack.imgur.com/U1aw5.png)](https://i.stack.imgur.com/U1aw5.png)\n\nこの辺り、一度正しく設定して他の接続ができていた状態であっても、ソースコードやstoryboardのその後の編集などにより、設定が壊れてしまう場合があります。一度空欄にして(薄く`UITableViewCell`と表示されるはず)、また入力し直すなどして見てください。\n\n* * *\n\nただ上記の設定を...
48895
48903
48903
{ "accepted_answer_id": "48904", "answer_count": 1, "body": "windowsのコマンドプロンプトで、`php artisan serve`と書いて実行すると`Laravel development server\nstarted:http://・・・` と表示され、そのURLをブラウザで開くと500エラーが出ます。\n\nプロジェクトは、コマンドプロンプト上でただ`laravel new プロジェクト名`と打ち、プロジェクト内に入って`composer\nupdate`を行ったあとに、`php artisan serve`を打ったので中身を私は特に触っていません。\n\n解決策を教えてくださると助かります。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T06:40:51.403", "favorite_count": 0, "id": "48896", "last_activity_date": "2019-08-27T09:03:30.557", "last_edit_date": "2018-10-02T07:12:53.830", "last_editor_user_id": "29826", "owner_user_id": "30328", "post_type": "question", "score": 0, "tags": [ "php", "laravel" ], "title": "laravel 500エラーになる", "view_count": 1587 }
[ { "body": "php artisan\nserveではデフォルトでは8000ポートを使用していたかと思いますが、そのポートを既に別のプロセスが使用しているということはないでしょうか? \n下記コマンドで確認ください。また、storage/logsディレクトリにログが出力されていると思うので、それも確認ください。\n\n```\n\n netstat -ano\n \n```", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T12:09:22.890",...
48896
48904
48904
{ "accepted_answer_id": null, "answer_count": 0, "body": "Pythonを使ってみようとインストールしました。(Python2.7)でもってpipのバージョン確認(9.0.3) \nまず手始めにnumpをインストールしようと`python -m pip install nump`としたところ、\n\n```\n\n Collecting numpy\n Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.conne\n ction.VerifiedHTTPSConnection object at 0x03386F10>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/numpy/\n Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.conne\n ction.VerifiedHTTPSConnection object at 0x03386790>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/numpy/\n Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.conne\n ction.VerifiedHTTPSConnection object at 0x03387CB0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/numpy/\n Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.conne\n ction.VerifiedHTTPSConnection object at 0x03387DB0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/numpy/\n Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.conne\n ction.VerifiedHTTPSConnection object at 0x03386510>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/numpy/\n Could not find a version that satisfies the requirement numpy (from versions: )\n No matching distribution found for numpy\n You are using pip version 9.0.3, however version 18.0 is available.\n You should consider upgrading via the 'python -m pip install --upgrade pip' command.\n \n```\n\nと出てインストールできず、pipをバージョンアップしてみたいなメッセージがでているのでメッセージ通り \n`Python -m pip install --upgrade pip`としたところ\n\n```\n\n Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connect\n ion.VerifiedHTTPSConnection object at 0x03276BD0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/\n Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connect\n ion.VerifiedHTTPSConnection object at 0x03276CB0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/\n Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connect\n ion.VerifiedHTTPSConnection object at 0x03276D10>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/\n Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connect\n ion.VerifiedHTTPSConnection object at 0x03276E10>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/\n Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connect\n ion.VerifiedHTTPSConnection object at 0x03276F10>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pip/\n Requirement already up-to-date: pip in c:\\python27\\lib\\site-packages\n You are using pip version 9.0.3, however version 18.0 is available.\n You should consider upgrading via the 'python -m pip install --upgrade pip' command.\n \n```\n\nとでてアップグレードも出来ません。 \nちなみに他のものをインストールを試みましたが上記の様なメッセージがでて出来ませんでした。 \n要するにpipが正常動作しません。 \nどうすれば動作するようになりますでしょうか。 \n(windows7)", "comment_count": 5, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T07:39:45.343", "favorite_count": 0, "id": "48897", "last_activity_date": "2018-10-02T07:47:35.583", "last_edit_date": "2018-10-02T07:47:35.583", "last_editor_user_id": "3060", "owner_user_id": "30329", "post_type": "question", "score": 0, "tags": [ "python", "pip" ], "title": "pipが全く動きません。", "view_count": 1329 }
[]
48897
null
null
{ "accepted_answer_id": "48910", "answer_count": 1, "body": "現在ironフレームワークを用いたWebプログラミングを勉強しています。 \nその中でセッション周りの実装の際に、ironが提供するトレイトを実装している型をキーにしていろいろやり取りをするのですが、以下のようにわかりやすく実装しなおそうと思っています。(説明が長くなりますすみません...)\n\n* * *\n\nセッションを扱うには、自身で定義した2つのstruct(`Session`,\n`SessionKey`とします)に対し、ironクレートによって提供されている`typemap::Key`トレイトを次のように適用します。\n\n```\n\n struct Session; // セッションデータとして扱う構造体(自分はHashMapを1つ持つタプル構造体にしています)\n struct SessionKey; // 関数を呼ぶ際、扱う型を決定するのに使用します\n // 例)get_ref::<SessionKey>() -> &Sessionが返される\n \n impl typemap::Key for SessionKey {\n type Value = Session;\n }\n \n```\n\nこのようにimplすることで、上の例のように`SessionKey`をキーにして`Session`構造体をやり取りします。\n\nわかりやすさのために、`typemap::Key, Value`ではなく次のような名前で扱おうと考えています。\n\n```\n\n trait SessionType {\n type SessionData;\n }\n \n```\n\nという名前で定義したトレイトと関連型を、\n\n```\n\n impl SessionType for SessionKey {\n type SessionData = Session;\n }\n \n```\n\n同じようにimplします。 \nこれによって、`typemap::Key`のimplは内部に隠しつつ、わかりやすい名前で扱えないかと考えています。 \nなので次のように実装しました。\n\n```\n\n extern crate iron;\n use iron::typemap;\n \n struct Session;\n struct SessionKey;\n \n // こっちを使いたい\n trait SessionType {\n type SessionData;\n }\n // このように実装したい(見える部分)\n impl SessionType for SessionKey {\n type SessionData = Session;\n }\n \n // こちらを追加(見えない部分)\n impl<S: SessionType> typemap::Key for S {\n type Value = <S as SessionType>::SessionData;\n }\n \n fn main(){\n // ...\n }\n \n```\n\n```\n\n impl<S: SessionType> typemap::Key for S {\n type Value = <S as SessionType>::SessionData;\n }\n \n```\n\nこれは、`SessionType`トレイトを実装している全ての構造体に対し、`typemap::Key`を実装します。またその構造体に`SessionType`トレイトを実装した際の`type\nSession`に指定した型`<S as\nSessionType>::SessionData`を`Value`に指定します。こうすることで`typemap::Key`の実装を見える部分で行う必要がなくなると考えました。 \nしかしエラーになります。\n\n```\n\n error[E0210]: type parameter `S` must be used as the type parameter for some local type (e.g. `MyStruct<T>`);\n only traits defined in the current crate can be implemented for a type parameter\n --> src\\main.rs:17:1\n |\n 17 | / impl<S: SessionType> Key for S {\n 18 | | type Value = <S as SessionType>::Session;\n 19 | | }\n | |_^\n \n```\n\nこのエラーの原因がわかりません。 \nちなみに\n\n```\n\n trait Key {\n type = Value;\n }\n \n```\n\nというトレイトを自分で定義し、`typemap::Key`と同じように書いた場合はエラーが出ませんでした。(しかしironの関数を利用するには`typemap::Key`の実装が必要...) \nこれは`typemap::Key`が外部で定義されているから無理ということなのでしょうか?しかしエラー文からはそのように読み取れないので理由がわかりません。\n\n長文になってしまい申し訳ありません。 \nこのエラーの原因と回避の仕方がわかる方いらっしゃいませんか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-02T17:26:43.137", "favorite_count": 0, "id": "48909", "last_activity_date": "2018-10-02T22:14:37.437", "last_edit_date": "2018-10-02T17:46:08.000", "last_editor_user_id": "29682", "owner_user_id": "29682", "post_type": "question", "score": 4, "tags": [ "rust" ], "title": "Rustでのエラー『type parameter `_` must be used as the type parameter for some local type』について。", "view_count": 367 }
[ { "body": "> これはtypemap::Keyが外部で定義されているから無理ということなのでしょうか?\n\n概ねそのような理由です。具体的にはOrphan\nRule(孤児規則)と呼ばれる制約に引っかかっています。自分で定義していないトレイトを自分で定義していない型に対して(今回はジェネリクスなので定義していない型も含んでいます)実装できるとすると、複数人が同じことをした場合に実装が複数存在して一貫性がなくなります。エラーメッセージに出ているように\n`rustc --explain E0210` で詳しく解説されています。\n\n日本語記事だと下記があるようです。 \n参考: Rustのコヒーレンス ...
48909
48910
48910
{ "accepted_answer_id": "48915", "answer_count": 3, "body": "提示コードのコメント部なのですがエラーコード[エラー C2679 二項演算子 '<<': 型 'type' の右オペランドを扱う演算子が見つかりません\n(または変換できません)。] \nとコンパイルエラーになるのですがなぜでしょうか?そろらくテンプレートのtypeに関係がると思われるのですが初学者のため修正方法がわかりません。教えてくれますでしょうか?\n\n```\n\n #include <iostream>\n \n #pragma once\n #ifndef ___Header\n #define ___Header\n \n \n \n template<typename type,typename typeb>\n class base {\n private:\n \n protected:\n \n public:\n base(){ }\n \n virtual void f(int x) {\n //type a = x;\n std::cout << \"仮想関数\"<< x <<\"\\n\";\n }\n \n virtual type f2(type x)const = 0;//純粋仮想関数\n \n };\n \n class type {\n \n };\n class typeb {\n \n };\n \n /*in main(){//int main()関数でこうする場合\n derive<int> d;\n \n _getch();\n return 0;\n }\n */\n \n template<typename typec> \n class derive : public base<typename type, typename typeb> {\n \n public:\n derive(){ }\n \n void f(int x) {\n std::cout << \"派生\"<< x<<\"\\n\";\n }\n \n type f2(type x)const {//この関数の中\n //int a = x;\n std::cout << x;\n \n return x;\n \n }\n \n };\n \n \n \n #endif\n \n```", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T00:00:21.443", "favorite_count": 0, "id": "48911", "last_activity_date": "2018-10-03T02:14:43.590", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": null, "post_type": "question", "score": 0, "tags": [ "c++" ], "title": "c++でテンプレートを使ってstd::cout<<x:で画面に表示できない。理由", "view_count": 810 }
[ { "body": "```\n\n type f2(type x)const {//この関数の中\n //int a = x;\n std::cout << x;\n \n return x;\n \n }\n \n```\n\nここで、xの型は \"type\"とされています。 \n\"std::cout << x;\"の部分で、class型のxをcoutに出力できるような値(String,int等)に変換しようとしますが、class\ntypeでは何も定義され...
48911
48915
48912
{ "accepted_answer_id": null, "answer_count": 0, "body": "iPhoneX以降のモデルのロック解除時やコントロールセンターを呼び出す際、指のスライド具合で画面の特定部分にぼかしがかかりますが、Processingで同じような表現をしたくてfilter(BLUR,\n5.0*mouseX/width)などと関数を使っても、ぼかし具合が強くなると処理が重くなってしまいます。これを滑らかに行う方法はあるのでしょうか?", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T05:06:58.293", "favorite_count": 0, "id": "48918", "last_activity_date": "2018-10-15T11:41:44.420", "last_edit_date": "2018-10-03T05:09:24.993", "last_editor_user_id": "19110", "owner_user_id": "29682", "post_type": "question", "score": 1, "tags": [ "processing" ], "title": "Processingでリアルタイムに滑らかにぼかしをかける方法について", "view_count": 381 }
[]
48918
null
null
{ "accepted_answer_id": "48951", "answer_count": 1, "body": "SSHTunnelを使って、mysql serverに接続しようとしています。 \n構成は A:自宅のPC、 B:sshするサーバ、 C:mysqlが立っているサーバ、となっており、A→B→Cの順番に繋げようとしています。 \nCのmysqlの立っているサーバは、Bのサーバのipアドレスからのみアクセスできるように設定してあります。 \nそのため、SSHTunnelを使って、Bを経由して、Cのサーバに接続を試みようとしています。\n\n以下のコードを実行すると、タイムアウトになってしまい、2003のエラーがでます。 \nPortが違っているとタイムアウトになると思いますが、Cのサーバはmysqlサーバ標準の3306でアクセスできるようになっています。 \nremote_bind_address、local_bind_addressなどが怪しいと思っていますが、エラーがでてしまう原因は分かるでしょうか。\n\n因みにterminal上で次のようなことを実行した場合は問題なく、mysql serverにアクセスできます。\n\n```\n\n ssh ssh_user@ssh_server_host_name -p 22 \n mysql -h mysql_server_host_name -P 3306 -u mysql_user -p\n \n```\n\npython3.7での実装\n\n```\n\n # -*- coding: utf-8 -*-\n from sshtunnel import SSHTunnelForwarder\n # モジュール読み込み\n import pymysql.cursors\n \n # SSH関連の設定\n with SSHTunnelForwarder(\n (\"ssh_server_host_name\", 22),\n ssh_username=\"ssh_user\",\n ssh_password=\"ssh_pass\",\n remote_bind_address=('mysql_server_host_name', 3306)\n ) as server:\n print(\"connected server\")\n \n # # MySQLに接続する\n conn = pymysql.connect(host='mysql_server_host_name',\n user='mysql_user',\n password='pass',\n db='db_name',\n charset='utf8',\n port=server.local_bind_port,\n cursorclass=pymysql.cursors.DictCursor)\n # select\n # SQLを実行する\n cursor = conn.cursor()\n sql = \"show tables\"\n cursor.execute(sql)\n \n # Select結果を取り出す\n rets = cursor.fetchall()\n for r in rets:\n print(r)\n \n # MySQLから切断する\n conn.close()\n \n```\n\nエラーメッセージ\n\n```\n\n Traceback (most recent call last):\n File \"/Users/user/venv/lib/python3.7/site-packages/pymysql/connections.py\", line 582, in connect\n **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py\", line 727, in create_connection\n raise err\n File \"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py\", line 716, in create_connection\n sock.connect(sa)\n socket.timeout: timed out\n \n During handling of the above exception, another exception occurred:\n \n Traceback (most recent call last):\n File \"/Users/user/PycharmProjects/bitflyerPredict/database.py\", line 25, in <module>\n cursorclass=pymysql.cursors.DictCursor)\n File \"/Users/user/PycharmProjects/bitflyerPredict/venv/lib/python3.7/site-packages/pymysql/__init__.py\", line 94, in Connect\n return Connection(*args, **kwargs)\n File \"/Users/user/PycharmProjects/bitflyerPredict/venv/lib/python3.7/site-packages/pymysql/connections.py\", line 327, in __init__\n self.connect()\n File \"/Users/user/PycharmProjects/bitflyerPredict/venv/lib/python3.7/site-packages/pymysql/connections.py\", line 629, in connect\n raise exc\n pymysql.err.OperationalError: (2003, \"Can't connect to MySQL server on '(hostname)' (timed out)\")\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T05:30:33.120", "favorite_count": 0, "id": "48921", "last_activity_date": "2018-10-04T05:20:00.977", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30337", "post_type": "question", "score": 0, "tags": [ "python", "mysql", "python3", "ssh" ], "title": "SSHTunnelを使ったmysql serverへの接続でタイムアウトエラー", "view_count": 910 }
[ { "body": "localhostの server.local_bind_port に mysql 接続してみるとどうでしょうか?\n\n```\n\n conn = pymysql.connect(host='localhost',\n user='mysql_user',\n password='pass',\n db='db_name',\n charset=...
48921
48951
48951
{ "accepted_answer_id": null, "answer_count": 1, "body": "EBSの可用性については、同ゾーン内にレプリケートするため冗長化は不要との記載を目にします。 \nもし利用しているEBSに障害が発生した場合、レプリケートされたディスクからインスタンスを復旧することができるのでしょうか。 \n可能な場合、AWS内部で行われるのか、手動で実行する必要があるのかも知りたいです。\n\nこのようなことが可能なら、(ハード障害での)スナップショットの必要性があまり感じられないと思いまして。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T06:50:41.083", "favorite_count": 0, "id": "48922", "last_activity_date": "2018-10-03T08:06:37.293", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30336", "post_type": "question", "score": 2, "tags": [ "aws" ], "title": "EBSレプリケートについて", "view_count": 757 }
[ { "body": "ポイントとして「可用性」と「耐久性」があります。 \n<https://aws.amazon.com/jp/ebs/features/#durabilityandsecurity> \nこちらを確認すると\n\n可用性について\n\n> 99.999% の可用性を維持する設計となっています\n\n耐久性について\n\n> ボリュームのサイズやパフォーマンスに応じて年間故障率 (AFR) が 0.1%~0.2%\n> になるように設計されています。この場合の「故障」は、ボリュームが完全に、または部分的に失われることを指します。\n\n可用性については「停止なく動き続けるか」というもので \n...
48922
null
48927
{ "accepted_answer_id": null, "answer_count": 1, "body": "XcodeでPlaygroundを実行したところ、エラーメッセージが表示されて動作しません。\n\n[手順] \n下記サイトを参考にXcode betaとSwift for TensorFlowを導入しました。 \n<https://github.com/tensorflow/swift/blob/master/Usage.md>\n\nXcode beta上でToolchainsにSwift for\nTensorFlowを設定した後に、サイトを参考にPlaygroundで以下のコードを実行したところエラーが発生しました。\n\n```\n\n import TensorFlow\n \n let x = Tensor<Float>([[1, 2], [3, 4]])\n print(x)\n \n```\n\n[エラーメッセージ] \nThe LLDB RPC server has crashed.\n\n上記エラーの解消方法を教えてください。 \nよろしくお願いします。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T07:09:32.497", "favorite_count": 0, "id": "48923", "last_activity_date": "2018-10-05T19:43:05.460", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30340", "post_type": "question", "score": 0, "tags": [ "swift", "tensorflow" ], "title": "Swift for TensorFlowがPlaygroundで動作しない", "view_count": 176 }
[ { "body": "はじめまして。同じようにTensorFlowを導入してみましたが、同じように落ちるようです。 \nこちらの環境は、\n\n * macOS X 10.14 (Mojave)\n * Xcode 10.0 (App Storeからダウンロードのため、β番ではありません)\n * TensorFlow 質問にあったもの? (September 17, 2018 非CUDA版です)\n\nと、なりますが、\n\n * Useageに記述のあったREPLは、`/Library/Developer/Toolchains/swift-latest/usr/bin/swift`を`Terminal`...
48923
null
49008
{ "accepted_answer_id": "48970", "answer_count": 1, "body": "monacaを利用しているものですが、IOSでWebRTCを使ったアプリ作成を行いたいと思っています。 \nしかし内部ブラウザであるWKWebViewでは使えないことがわかり、別途cordovaプラグインを使用することにしました。 \n見つけたものが「iosrtc(<https://github.com/BasqueVoIPMafia/cordova-plugin-iosrtc>)」 \nというもので、プラグインをアップロード、有効化して試しにカスタムデバッカーでビルドしようとしました。 \nしかしここでエラーが出てしまい、先に進めない状況になってしまっています。\n\n```\n\n Remove DerivedData files...\n \n Remove IB Support files...\n Change Xcode Version to 9\n Build Error: Error: Sandbox Exec Error: [ ** ARCHIVE FAILED **\n \n \n The following build commands failed:\n CompileSwift normal arm64 /tmp/monaca/5bb44c3ee788859048201c66/project/platforms/ios/testcamera/Plugins/cordova-plugin-iosrtc/iosrtcPlugin.swift\n CompileSwift normal arm64 /tmp/monaca/5bb44c3ee788859048201c66/project/platforms/ios/testcamera/Plugins/cordova-plugin-iosrtc/PluginRTCTypes.swift\n CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler\n (3 failures)\n Error: Error code 65 for command: xcodebuild with args: -xcconfig,/private/tmp/monaca/5bb44c3ee788859048201c66/project/platforms/ios/cordova/build-debug.xcconfig,-workspace,testcamera.xcworkspace,-scheme,testcamera,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,testcamera.xcarchive,archive,CONFIGURATION_BUILD_DIR=/private/tmp/monaca/5bb44c3ee788859048201c66/project/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/private/tmp/monaca/5bb44c3ee788859048201c66/project/platforms/ios/build/sharedpch\n ]\n \n```\n\nswiftを使用しているようなので,config.xmlに\n\n```\n\n <platform name=\"ios\">\n <preference name=\"ios-XCBuildConfiguration-SWIFT_VERSION\" value=\"4\"/>\n </platform>\n \n```\n\nを追記しました。 \nとりあえず、「iosrtc」cordovaプラグイン無しでビルドをしてみたところ成功したため、証明書関係は問題ないようです。 \n(それなのにエラーコード 65 が出ているのが気になりますが...)\n\nご教授お願い致します。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T07:13:55.593", "favorite_count": 0, "id": "48924", "last_activity_date": "2018-10-05T01:27:25.043", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "26628", "post_type": "question", "score": 1, "tags": [ "javascript", "html", "monaca", "cordova" ], "title": "monacaで「iosrtc」cordovaプラグインのビルドエラー", "view_count": 500 }
[ { "body": "cordova-plugin-iosrtcのドキュメント\n\n<https://github.com/BasqueVoIPMafia/cordova-plugin-\niosrtc/blob/master/docs/Building.md>\n\nを読むと書いてありますが、このプラグインはただ組み込んだだけでは動作せず、その後、手動でXcodeに設定を行う必要があるとされています。\n\nこのドキュメントも、どうも古くて不十分のようなのですが、自分が手元で確認した限りでは、\n\n 1. Swiftのバージョンを3.0にする\n 2. Bridgingヘッダーを設定する\n\nの2つが必要...
48924
48970
48970
{ "accepted_answer_id": null, "answer_count": 1, "body": "## 前提\n\n`app/assets/stylesheets/style.css.scss` に、以下の定義を書いています。\n\n```\n\n @each $color in red, purple, blue, green, yellow, orange {\n .c_#{$color} {\n color: $color;\n }\n }\n \n```\n\n* * *\n\n## 発生している問題・エラーメッセージ\n\nスタイルは適用されるのですが、ターミナルに以下の警告が出ます。\n\n> You probably don't mean to use the color value ' blue ' in interpolation\n> here. \n> It may end up represented as #0000ff, which will likely produce invalid\n> CSS. \n> Always quote color names when using them as strings (for example, \"blue\"). \n> If you really want to use the color value here, use ' \"\" + $color '.\n\n* * *\n\n## 試したこと\n\n警告に書いてある通り、以下のように修正しましたが、スタイルが適用されず、無効な値になります。\n\n```\n\n @each $color in red, purple, blue, green, yellow, orange {\n .c_#{$color} {\n \"\" + $color;\n }\n }\n \n```\n\nどのように修正すればよいでしょうか。\n\n* * *\n\n## 補足情報 (OS, ツールのバージョンなど)\n\n環境: Rails 4.2.10", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T07:48:48.727", "favorite_count": 0, "id": "48925", "last_activity_date": "2019-05-05T08:28:01.913", "last_edit_date": "2019-05-05T05:49:57.890", "last_editor_user_id": "32986", "owner_user_id": "30342", "post_type": "question", "score": 0, "tags": [ "ruby-on-rails", "ruby", "sass" ], "title": "sassで`color: value`利用時に警告が出る", "view_count": 203 }
[ { "body": "use ' \"\" + $color ' は \"\" + $color; にするように言ってるのではなく \ncolor: などのプロパティを追加するよう警告しています。 \nなので下記のようにすればエラーにならないです。\n\n```\n\n @each $color in red, purple, blue, green, yellow, orange {\n .c_#{$color} {\n color: $color\n }\n }\n \n```", "comment_count": 0, "content_l...
48925
null
54737
{ "accepted_answer_id": null, "answer_count": 1, "body": "Symfony1系やSymfony2系の記事は見つかるのですが、 \nSymfony3系で開発を行なっており、 \nタイトル通りcookieにセキュア属性をつけたいのですが設定方法がわかりません。 \nどのように設定すれば良いでしょうか?", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T08:42:41.360", "favorite_count": 0, "id": "48928", "last_activity_date": "2018-10-04T04:01:58.407", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30344", "post_type": "question", "score": 0, "tags": [ "php" ], "title": "Symfony3でcookieにセキュア属性つけたい", "view_count": 188 }
[ { "body": "使い方がわかっていなかったのですが、 \nアドバイスありがとうございます。 \n以下のような感じで、newするときに「$secure」に「true」を設定しました。\n\n```\n\n $cookie = new Cookie($key, $data, $expire, $path, $domain, $secure, $httpOnly);\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T04:01:58.40...
48928
null
48947
{ "accepted_answer_id": "48958", "answer_count": 3, "body": "「どの暗号化方式を使用しているか分かる方法ってありますか?」\n\n気になったことがあったので、質問させてください。 \nどうか有識者の方にご回答いただけると助かります。\n\nhttps通信がTLS1.0対応している場合は、 \n以下のような対応する暗号化方式があります。\n\n・256bit AES暗号 SHA-1 MAC \n・128bit AES暗号 SHA-1 MAC \n・168bit トリプルDES暗号 SHA-1 MAC \n・128bit RC4暗号 SHA-1 MAC \netc\n\n気になったのは、実際の一回一回のhttps通信ごとに \nどの暗号化方式を使っているのかわかる方法があるのか \nについてです。\n\n私の稚拙な理解では \nそもそも、何に依存して暗号化方式を変えているのか、 \n毎回https通信ごとに違う暗号化方式を使っているのか \n実は通信先のPCとサーバが同じであれば、毎回同じ暗号化方式なのか \nもわかっていません。\n\nどこのサイトを見ればわかるかも。というのでも構いません。 \nどうかご教授のほどお願い申し上げます。\n\n以上です。", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T11:41:19.837", "favorite_count": 0, "id": "48930", "last_activity_date": "2018-10-04T22:52:44.097", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "10862", "post_type": "question", "score": 1, "tags": [ "https", "ssl" ], "title": "TLS1.0対応の暗号化方式のうちどれを使っているのかを確認するには?", "view_count": 2165 }
[ { "body": "Webサーバーの設定でプロトコルと暗号スイートをログに出力することは可能です。 \n使用しているサーバーによって設定方法は異りますので、ドキュメントや解説サイトなどを調べてみてください。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T05:02:03.090", "id": "48949", "last_activity_date": "2018-10-04T05:02:03.090", "last_edit_date":...
48930
48958
48958
{ "accepted_answer_id": null, "answer_count": 1, "body": "```\n\n button.setEnabled(false);\n \n```\n\nこのときのデフォルトの透明度が知りたいです。もしくはfalseのときの状態のときの透明度をなくしたいです。\n\n**試したこと**\n\n```\n\n textView.setText(String.valueOf(button.getAlpha())); // 結果は1でした\n \n```\n\nenabled falseのときは1の状態で透明ということになりますから、これは一体どうすればいいんでしょうか?", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T12:05:28.950", "favorite_count": 0, "id": "48931", "last_activity_date": "2018-10-03T15:44:56.533", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "26076", "post_type": "question", "score": 0, "tags": [ "android", "java" ], "title": "setEnabled(false)のボタンの透明度を変えたい。", "view_count": 151 }
[ { "body": "**終わらせていただきます(質問者自身による投稿)** \nsetEnabledのfalseのときの **デフォルトカラーの透明度** を変えたかったのですが、あまりこだわらなくてもよいのかなと思えてきました。\n\nxmlで状態別を指定する方法はネットで検索すればでてきますね。\n\n質問の消し方がわからないのでとりあえずはこのままにしておきます。\n\n失礼いたしました。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T15:44:56.533...
48931
null
48940
{ "accepted_answer_id": "48945", "answer_count": 1, "body": "colab上でOpenAIGymのBipedalWalker-v2を実行するために,colabにBox2Dをインストールしようとしています. \nそこで,以下のコマンドでインストールしようとしました.\n\n```\n\n !apt-get install python-box2d > /dev/null\n !pip install gym[Box_2D]\n import gym\n env = gym.make(\"BipedalWalker-v2\")\n \n```\n\nしかし,以下のimportされていないと表示されてしまいました.\n\n```\n\n /usr/local/lib/python3.6/dist-packages/gym/envs/box2d/lunar_lander.py in <module>()\n 2 import numpy as np\n 3 \n ----> 4 import Box2D\n 5 from Box2D.b2 import (edgeShape, circleShape, fixtureDef, \n polygonShape, revoluteJointDef, contactListener)\n 6 \n \n ModuleNotFoundError: No module named 'Box2D'\n \n```\n\napt-getを使わずにgithubから自分でビルドしようとしましたが,以下のようにパスが違うと言われてしまいました.\n\n```\n\n fatal: destination path 'pybox2d' already exists and is not an \n empty directory.\n Using setuptools (version 39.1.0).\n Traceback (most recent call last):\n File \"pybox2d/setup.py\", line 151, in <module>\n write_init()\n File \"pybox2d/setup.py\", line 66, in write_init\n license_header = open(os.path.join(source_dir, \n 'pybox2d_license_header.txt')).read()\n FileNotFoundError: [Errno 2] No such file or directory: \n 'Box2D/pybox2d_license_header.txt'\n \n```\n\nどのようにしたらcolab上でBox2Dをインストールできるでしょうか", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T12:27:56.427", "favorite_count": 0, "id": "48932", "last_activity_date": "2018-10-04T02:43:49.543", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30347", "post_type": "question", "score": 0, "tags": [ "python", "google-colaboratory" ], "title": "google colabにBox2Dインストールする方法", "view_count": 339 }
[ { "body": "以下のコマンドで取り敢えずenvまでは動作します。\n\n```\n\n !pip install box2d-py\n !pip install gym[Box_2D]\n import gym\n env = gym.make(\"BipedalWalker-v2\")\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T02:43:49.543", "id": "48945", "las...
48932
48945
48945
{ "accepted_answer_id": null, "answer_count": 2, "body": "**最終的にやりたいこと** \n・対象フォルダ(サブフォルダ含む)内にある特定拡張子ファイルのみ、指定フォルダへ移動したい \n・同名ファイルが存在していた場合、上書きではなく連番付与したい\n\n* * *\n\n**試したこと** \n・[特定ファイルを指定フォルダに一括移動させるバッチファイル](https://www.lisz-works.com/entry/file-batch-\nprocessing)で移動確認は出来たのですが、同名ファイルが存在していた場合、1ファイルに上書きされてしまいます\n\n* * *\n\n**Q** \n・同名ファイルが存在していた場合、上書きではなく連番付与する、条件追加が分かりません \n・同名ファイルが存在していた場合の条件分岐はどの段階で追加する? list.txt作成する時? それとも、ファイルを1行ずつ処理する時?", "comment_count": 6, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T12:46:58.047", "favorite_count": 0, "id": "48933", "last_activity_date": "2019-02-13T12:02:40.520", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "7886", "post_type": "question", "score": 1, "tags": [ "windows" ], "title": "Windowsバッチのファイル移動で、同名ファイルが存在していた場合、上書きではなく連番付与したい", "view_count": 7744 }
[ { "body": "> 同名ファイルが存在していた場合の条件分岐はどの段階で追加する? list.txt作成する時? それとも、ファイルを1行ずつ処理する時?\n\nlist.txt作成時に条件分岐を加えると、ファイル作成前に新規作成された場合上書きされますので、処理する時に追記するべきだと思います。\n\n> 同名ファイルが存在していた場合、上書きではなく連番付与する、条件追加が分かりません\n\nPowershellの方が連番の取得など細かい操作に向いているので、Powershellで実装例を作ってみました。\n\n```\n\n # 変数を変更して実行すること\n Move-Mp3 -Path \...
48933
null
48965
{ "accepted_answer_id": null, "answer_count": 3, "body": "新人プログラマーです。\n\nあるオブジェクトを生成するサービスの名前を、\n\n> Hoge_Service.web.Services.CreateObjectService\n\nと名付けたら、先輩に名前空間もクラス名もダメだと言われました。 \nいったい何がおかしいのでしょうか。\n\n`質問時のメールアドレスを間違えて登録してしまいました。`", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T13:11:51.747", "favorite_count": 0, "id": "48934", "last_activity_date": "2018-10-04T04:49:22.127", "last_edit_date": "2018-10-04T04:49:22.127", "last_editor_user_id": "30353", "owner_user_id": "30349", "post_type": "question", "score": 0, "tags": [ "c#" ], "title": "C#のいい名前空間とクラス名とは?CreateObjectServiceはなんでだめなの?", "view_count": 1605 }
[ { "body": ".NET Frameworkには[名前付けのガイドライン](https://docs.microsoft.com/en-\nus/dotnet/standard/design-guidelines/naming-guidelines)があります。この中に\n\n> Do not use underscores to differentiate words, or for that matter, anywhere\n> in identifiers.\n\nとあり`Hoge_Service`について`_`で区切るべきではありません。\n\n> The PascalCasing conventio...
48934
null
48936
{ "accepted_answer_id": "48943", "answer_count": 1, "body": "今オライリー・ジャパンの「Pythonではじめる機械学習」という本で機械学習の勉強を始めています。そこで、GitHubにあるmglearnというライブラリを入手したいのですが、やり方が分からず困っています。Download\nZIPというボタンを押して保存したりしているのですが、うまくいきません。できるだけ詳しく教えていただけると助かります。mglearnのリンク先は下です。 \n<https://github.com/amueller/introduction_to_ml_with_python>\n\n回答ありがとうございます。説明が足りなかったので、もっと詳しく書きます。自分が使いたいコードが入っているのはmglearnというファイルです。しかし、上のリンク先には他にimagesや01-introduction.ipynbなども入っています。mglearnのみダウンロードすることは可能ですか。DownloadZIPを押すと全てダウンロードされます。そして、「X,\ny = mglearn.datasets.make_forge()」というコードをjupyter notebookで打つと「name 'mglearn'\nis not defined」という表示が出てきます。", "comment_count": 7, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-03T14:35:12.247", "favorite_count": 0, "id": "48937", "last_activity_date": "2018-10-09T05:31:42.683", "last_edit_date": "2018-10-09T05:31:42.683", "last_editor_user_id": "3054", "owner_user_id": "30352", "post_type": "question", "score": 1, "tags": [ "python", "機械学習", "github" ], "title": "『Pythonではじめる機械学習』の mglearn を使いたいが、not defined となる", "view_count": 18547 }
[ { "body": "簡単に結論をいえば、jupyter notebook(それ以外の場合も同じです)で`mglearn`を使う場合には、`!pip install\nmglearn`でインストールして(勿論できていれば必要はないですが)、`import mglearn`でインポートする必要があります。\n\nただし、`mglearn`をインポートする方法としては、`import\nmglearn`と明示的にする以外に別の方法があり、「Pythonではじめる機械学習」では、その別の方法を使っています。\n\n02-supervised-learning のコードは以下のようになっています。これだけをみるとJupyte...
48937
48943
48943
{ "accepted_answer_id": null, "answer_count": 1, "body": "<https://github.com/momokogumi/Sukebo-sample-game>\n\n上記のサイトからUnityのプロジェクトをZipファイルでダウンロードし、解凍して開きました。 \nしかし画像データが壊れてしまっています。\n\n文字データしか入ってません。\n\n動作環境はWindow10、ver2018.2です。\n\n[![まっしろ](https://i.stack.imgur.com/wDNBj.png)](https://i.stack.imgur.com/wDNBj.png)", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T01:20:17.260", "favorite_count": 0, "id": "48942", "last_activity_date": "2018-10-04T06:35:14.777", "last_edit_date": "2018-10-04T06:35:14.777", "last_editor_user_id": "26581", "owner_user_id": "26581", "post_type": "question", "score": 5, "tags": [ "unity3d", "github", "unity2d" ], "title": "Githubにてダウンロードしたプロジェクト内にテキストデータしか入ってない", "view_count": 892 }
[ { "body": "該当のpngファイルは「Git LFS」として登録されており、これが原因で単純にZIPファイルでダウンロードするとうまく開けないようです。 \n(私もGit LFSについてはまだ詳しくないのですが、ファイルの実体ではなくそこに\"ファイルがある\"という情報だけが記録されているような状態)\n\nGit LFSの問題としてissueが立っていました。 \n[\"Download zip\" button doesn't get lfs files #903](https://github.com/git-\nlfs/git-lfs/issues/903)\n\nなお、対策としてはgitコマン...
48942
null
48944
{ "accepted_answer_id": "48952", "answer_count": 1, "body": "カノニカルについて \nPCサイトがもともとあって、SP専用サイトだけを作ってほしいと言われて作りました。\n\nSPサイトをメインのサイトとして、PCはおまけとして残してほしいと言われています。\n\n両方のサイトは、ファイル名が違うが、両方とも残す場合は、PCサイトにカノニカルをつけて \nやればそれだけで問題ないと考えて良いでしょうか?\n\nPCサイトのみに下記を記載\n\n```\n\n <head>\n \n <link rel=”canonical” href=”http://www.example.com/sp” />\n \n </head>\n \n```\n\nこうすれば内容がかぶっていたも問題ないですよね。", "comment_count": 3, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T04:54:14.737", "favorite_count": 0, "id": "48948", "last_activity_date": "2018-10-04T06:41:35.047", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "24247", "post_type": "question", "score": 1, "tags": [ "html" ], "title": "カノニカルについて", "view_count": 117 }
[ { "body": "Googleは、類似ページや重複ページがある場合に、正規ページを指定することを勧めています。\n\n・[Search Console\nヘルプ](https://support.google.com/webmasters/answer/139066?hl=ja)\n\nそこには、正規ページを指定する方法が、数種類記載されていますが、`canonical`による方法もその一つです。\n\n一方、SP専用サイトを作って、PCサイトを残すということであれば、別の方法があります。\n\n・ [google モバイルSEOの各種設定 別々の URL](https://developers.google.c...
48948
48952
48952
{ "accepted_answer_id": "48955", "answer_count": 1, "body": "悩み \n・xampp-apache-confフォルダのhttpd.confを編集しapacheのstartを押すとエラーが出て動かない。 \n編集部分 \n・httpd.confファイル末尾に\n\n```\n\n Alias / \"/xampp/htdocs/作成したプロジェクト名/public/\"\n <Directory \"/xampp/htdocs/作成したプロジェクト名/public/\">\n Options Indexes FollowSymLinks MultiViews\n AllowOverrise all\n Order allow,deny\n Allow from all\n </Directory>\n \n```\n\nこれを記述しただけです。 \nC:の直下にxamppを置いているのでパスが間違っている可能性はないと思います。\n\n解決方法の分かる方、よろしくお願いします。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T06:00:59.687", "favorite_count": 0, "id": "48953", "last_activity_date": "2018-10-04T11:34:11.223", "last_edit_date": "2018-10-04T11:34:11.223", "last_editor_user_id": "3060", "owner_user_id": "30328", "post_type": "question", "score": 0, "tags": [ "apache", "xampp" ], "title": "xamppのhttpd.confを編集したらapacheが動かなくなった", "view_count": 238 }
[ { "body": "httpd.confの文法チェックをしてみてください。`C:\\`直下ということはWindowsでしょうから、以下の記事を参考にしてください。\n\n参考:\n[Windows版Apacheのconfigテスト](https://qiita.com/rsuzuki/items/22493421b57ee37646df)\n\nヘルプの確認\n\n```\n\n > httpd.exe -h\n \n```\n\n文法チェック\n\n```\n\n > httpd.exe -S\n > httpd.exe -t\n \n```", "comment_count...
48953
48955
48955
{ "accepted_answer_id": null, "answer_count": 1, "body": "初心者です。 \nテキストファイル(a.txt)に記載されている文字と文字列が完全一致した行の文字列を取得したい。\n\na.txt \n1,ringo,250 \n2,banana,100 \n3,mikan,150\n\n文字列がringoだった場合、後ろの250を取得したい。", "comment_count": 4, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T06:33:05.857", "favorite_count": 0, "id": "48956", "last_activity_date": "2018-10-06T09:13:24.923", "last_edit_date": "2018-10-06T09:13:24.923", "last_editor_user_id": "3060", "owner_user_id": "30329", "post_type": "question", "score": 0, "tags": [ "python", "python3" ], "title": "完全一致検索がしたい", "view_count": 475 }
[ { "body": "オーソドックスに、こういうのはいかがでしょうか。 \n最初の番号、1,2,3は省いています。省かなかった場合は、インデックスの指定が一個増えます。\n\n```\n\n b = open(\"a.txt\",\"r\")\n data = b.readlines()\n #dict内包表記を使う 3.x系です。\n datas = {i.rstrip().split(\",\")[0]:i.rstrip().split(\",\")[1] for i in data}\n print(datas)\n \n print(datas[\"ringo\"]...
48956
null
48960
{ "accepted_answer_id": "48966", "answer_count": 2, "body": "```\n\n def outer():\n def inner():\n a = 2\n b = a + 1\n return b\n \n inner()\n \n c = str(b)\n print(c)\n \n outer()\n \n```\n\nやりたいことはinnerのbをouterで使いたいのです。 \n基本的な質問かもしれませんが、教えていただけるとありがたいです。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T07:36:59.427", "favorite_count": 0, "id": "48959", "last_activity_date": "2018-10-04T17:21:44.197", "last_edit_date": "2018-10-04T17:21:44.197", "last_editor_user_id": "19110", "owner_user_id": "30362", "post_type": "question", "score": 1, "tags": [ "python", "python3" ], "title": "別の関数から関数に値を渡す方法", "view_count": 3966 }
[ { "body": "関数はステートレスな(内部に状態を持たない)ものです。 \nそして、関数には引数で値を渡し、関数からは返り値で値を得るというのが基本です。\n\nオブジェクトのような内部状態(プロパティ)を持つもの、同じ引数でも内部状態によって返り値が変わるメソッドとは区別してください。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T08:37:41.640", "id": "48961", "last_activity_date": "2018...
48959
48966
48961
{ "accepted_answer_id": null, "answer_count": 0, "body": "## 前提\n\nVPN という概念は知識として知っていますが、構築は今回が初めてです。\n\n* * *\n\n## 発生している問題\n\nローカルの PC から VPN で GCP に接続したいのですが、 GCP のファイアフォールの設定が甘いのか、 ping が飛ばないです。\n\nローカルのルーターはヤマハの RTX1200 で、問題なく接続を示す UP が表示されており、 GCP についても VPN\nトンネルは「確立済み」が表示されております。\n\nVPC ネットワークも作成済みで\n\n * IP アドレス範囲:`192.168.200.0/24`\n * ゲートウェイ:`192.168.200.1`\n * 限定公開の Google アクセス:オフ\n\nと設定しています。\n\nVM (Linux) についても、\n\n * プライマリ内部 IP:`192.168.200.2`\n * 外部 IP:(エフェメラル)\n\nなのですが、 \nローカルからの ping (`192.168.200.2`とエフェメラル) を受け付けない状態です。\n\nまた、ブラウザからの SSH も受け付けません。 \nデフォルトのネットワークでも VM を起動していますが、そちらは問題なく SSH がつながります。\n\nおそらくFWの設定と思うのですが、この場合どう設定すれば良いか、ご教授をお願いします。\n\n* * *\n\n## 追記\n\n接続ができるようになり、 PING およびローカルからの ssh が可能となりました (GCP 側の FW の設定 `tcp:22` を IP 範囲\n`0.0.0.0/0` で設定)。\n\nただ、常時接続とはいかず、定期的に切断される状態です。 \n常時接続する場合の設定について、ご教授をお願いします。\n\n* * *\n\n## Yamaha ルータの設定内容\n\n```\n\n tunnel select 1\n description tunnel vpngcp\n ipsec tunnel 101\n ipsec sa policy 101 1 esp aes-cbc sha-hmac\n ipsec ike version 1 2\n ipsec ike always-on 1 on\n ipsec ike encryption 1 aes-cbc\n ipsec ike group 1 modp1024\n ipsec ike hash 1 sha\n ipsec ike keepalive log 1 on\n ipsec ike keepalive use 1 on icmp-echo 192.168.200.2\n ipsec ike local address 1 192.168.0.1\n ipsec ike local name 1 <自分のグローバルIP> ipv4-addr\n ipsec ike pfs 1 on\n ipsec ike pre-shared-key 1 text <自分で設定したパスワード>\n ipsec ike remote address 1 <GCPのVPN用IP>\n ipsec ike remote name 1 <GCPのVPN用IP> ipv4-addr\n ipsec auto refresh 1 on\n ip tunnel tcp mss limit auto\n tunnel enable 1\n \n```", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T09:28:49.383", "favorite_count": 0, "id": "48962", "last_activity_date": "2019-05-05T06:00:58.133", "last_edit_date": "2019-05-05T06:00:58.133", "last_editor_user_id": "32986", "owner_user_id": "30365", "post_type": "question", "score": 0, "tags": [ "google-cloud" ], "title": "GCPにVPNで接続したい", "view_count": 593 }
[]
48962
null
null
{ "accepted_answer_id": null, "answer_count": 1, "body": "以下のsample.shをbashで動かした際に、変数を代入した特殊変数でエラーが吐かれます。 \nおそらく文字列として扱われているため、引数を引っ張ってこれていないのだと思いますが、何か対策はありますか。\n\n```\n\n [root@ test]# cat sample.sh\n #!/bin/bash\n \n echo $2\n \n echo ${2}\n \n N=2\n echo ${$N}\n \n [root@ test]# sh sample.sh a b c\n b\n b\n sample.sh: 行 8: ${$N}: 誤った代入です\n \n```", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T10:13:42.613", "favorite_count": 0, "id": "48967", "last_activity_date": "2018-10-05T01:31:04.270", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30370", "post_type": "question", "score": 4, "tags": [ "bash", "shellscript" ], "title": "bashの特殊変数への代入にエラー", "view_count": 2429 }
[ { "body": "```\n\n #!/bin/bash\n \n echo $2\n \n echo ${2}\n \n N=2\n echo ${!N}\n \n```\n\nとすることで、\n\n```\n\n % ./sample.sh foo bar\n bar\n bar\n bar\n \n```\n\nが実現できます。", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T...
48967
null
48977
{ "accepted_answer_id": null, "answer_count": 1, "body": "初心者です\n\nグーグルスプレッドシートの内容を 外部のHTMLへ読み込むことは出来るのでしょうか? \n(例 スプレッドシートのA1をHTMLのPタグの中に入れる) \nGASのHTMLに読み込むと言った資料を見つけることはできたのですが \n外部のHTMLから読み込みというものが見つからず質問させていただいています\n\n可能であればご教授いただけますと幸いです\n\nよろしくお願いいたします", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T10:19:34.243", "favorite_count": 0, "id": "48968", "last_activity_date": "2019-03-17T00:01:10.187", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30369", "post_type": "question", "score": 0, "tags": [ "html", "google-apps-script" ], "title": "グーグルスプレッドシートの内容を外部のHTMLから読み込むことは出来るのでしょうか?", "view_count": 2907 }
[ { "body": "Googleスプレッドシートの内容を直接外部のHTMLに設定することはできません。 \nですが、以下の方法で実現は可能です。(設定などは適時変更してください)\n\n 1. GAS(Google Apps Script)を使用してスプレッドシートの内容を返すAPIを作成。\n 2. APIを公開 \n * GASのメニュー → 公開 → ウェブアプリケーションとして導入 → アプリケーションにアクセスできるユーザを「全員(匿名ユーザを含む)」更新\n * ↑URLをコピー\n 3. HTML上のJavaScriptから1で作成したAPIを呼び出す。\n\n実際のコードは以下の...
48968
null
52637
{ "accepted_answer_id": "48972", "answer_count": 1, "body": "C++でpairのqueueを作りたいのですが、単純に書いて`gcc\nhoge.cpp`などとするとコンパイルが失敗して次のようなエラーメッセージが出ます。`g++ -std=c++11\nhoge.cpp`だとコンパイルが成功します。下部の質問にお答えいただけると助かります。よろしくお願いいたします。\n\n### (A)こうやるとコンパイル失敗する\n\n```\n\n queue<pair<int, int>>Q\n \n # (参考)エラーメッセージ\n hoge.cpp:22:22: error: a space is required between consecutive right angle brackets\n (use '> >')\n queue<pair<int, int>>Q;\n ^~\n 1 error generated.\n \n```\n\n### (B)こうやるとコンパイル成功する\n\n```\n\n typedef pair<int, int> P;\n queue<P>Q\n \n```\n\n### 質問\n\n 1. どうして(A)だとコンパイルが失敗して、(B)だと成功するのでしょうか?\n 2. (A)でも、C++11でコンパイルするとコンパイルが成功するのはどういう仕様追加によるものでしょうか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T12:35:03.460", "favorite_count": 0, "id": "48971", "last_activity_date": "2018-10-04T21:51:10.137", "last_edit_date": "2018-10-04T21:51:10.137", "last_editor_user_id": "4236", "owner_user_id": "29267", "post_type": "question", "score": 1, "tags": [ "c++", "c++11" ], "title": "C++におけるqueue<pair<int, int>>Qの定義方法について", "view_count": 1629 }
[ { "body": "**_1.どうして(A)だとコンパイルが失敗して、(B)だと成功するのでしょうか?_**\n\nC++11より前のC++の字句解析処理で、`>>`は右シフト演算子としての解釈が優先されていたためです。(A)と(B)の中間で、こんなのはコンパイルが通るはず(エラーメッセージでもそう言ってます)です。\n\n### (A')\n\n```\n\n queue<pair<int, int> >Q\n \n```\n\n※空白が1個挟まっているせいで`>>`が右シフト演算子という解釈があり得なくなる。\n\n(B)ではもちろん`>>`なんて出てきませんから、解釈の問題とかは起こらないわけです...
48971
48972
48972
{ "accepted_answer_id": "48984", "answer_count": 1, "body": "やりたいこと:RSpecのテストの途中でrailsの設定を変更して、後でもとに戻したい\n\n例えば、特定の用途のメール送信に使う独自のdelivery_methodを作ってあって、特定のテスト内ではこれを有効にしてテストしたい、という場合。\n\n# 最初のアイデア\n\n```\n\n context 'my_super_methodを使うケース' do\n before do\n ActionMailer::Base.delivery_method = :my_super_method\n end\n after do\n ActionMailer::Base.delivery_method = :test\n end\n it 'my_super_methodはxxな振る舞いをする' do\n # my_super_methodを使ったふるまいのテスト\n end\n end\n \n```\n\n## 問題\n\nActionMailer::Base.delivery_methodが:testであることを前提にしている。もしこれが他の値になっていたら、他のテストの挙動を壊してしまう\n\n# 次のアイデア\n\nテスト実行前の ActionMailer::Base.delivery_method を保存しておきます\n\n```\n\n context 'my_super_methodを使うケース' do\n __keeped_method = nil\n before do\n __keeped_method = ActionMailer::Base.delivery_method\n ActionMailer::Base.delivery_method = :my_super_method\n end\n after do\n ActionMailer::Base.delivery_method = __keeped_method\n end\n it 'my_super_methodはxxな振る舞いをする' do\n # my_super_methodを使ったテスト\n end\n end\n \n```\n\nbeforeとafterで値を共有する必要があるので、外で変数を初期化しました。 \nbyebugで確認する限りうまく動いているのですが、こんなところに変数宣言してよかったっけ。あとで鼻から悪魔出てきたりしない?\n\n「大丈夫、同じようなことしている例があるよ!」とか「コレコレの理由でダメだろう」とか、「こう書けばもっとシンプルに書けるよ」とか、そんなのを教えてください。\n\nなお、my_super_methodは例としてあげただけなので、「ActionMailer::Base.delivery_methodを変更するのではなくて、MySuperMethodクラスに対してテスト書くべき」みたいな枠外のアドバイスはいらないです。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T13:37:17.433", "favorite_count": 0, "id": "48974", "last_activity_date": "2018-10-04T22:17:00.140", "last_edit_date": "2018-10-04T22:15:23.810", "last_editor_user_id": "85", "owner_user_id": "13276", "post_type": "question", "score": 1, "tags": [ "ruby-on-rails", "rspec" ], "title": "RSpecテストでrailsの設定を変更して、後でもとに戻したい", "view_count": 172 }
[ { "body": "こういうユースケースではインスタンス変数を使うのがポピュラーなのではないでしょうか。\n\n```\n\n context 'my_super_methodを使うケース' do\n before do\n @original_method = ActionMailer::Base.delivery_method\n ActionMailer::Base.delivery_method = :my_super_method\n end\n after do\n ActionMailer::Base.delivery_me...
48974
48984
48984
{ "accepted_answer_id": "49012", "answer_count": 1, "body": "java(kotlin)でサブクラスから必ずsuperを呼ばせることはできますか? \nIDE保管(ビルドエラー)でもthrowでも良いのですが必ず呼ばせるようにしたいです。\n\nAndroidの開発で継承元fragmentのonSaveInstanceStateを利用しており、サブクラスからonSaveInstanceStateのsuperを呼ばれないとうまく動作しません。 \n可能であればビルドエラーをはくようにしたいです。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T13:44:22.323", "favorite_count": 0, "id": "48975", "last_activity_date": "2018-10-06T05:21:56.057", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "3693", "post_type": "question", "score": 1, "tags": [ "java", "kotlin" ], "title": "java(kotlin)でサブクラスから必ずsuperを呼ばせる", "view_count": 173 }
[ { "body": "Android限定で使ったことはないですが、`support-annotations`\nの`@CallSuper`アノテーションを使えば、コンパイル時にチェックを追加でるそうです。 \n詳しくは[アノテーションによるコード検査の改善](https://developer.android.com/studio/write/annotations)を。", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-06T05:21:56.057", "id": ...
48975
49012
49012
{ "accepted_answer_id": null, "answer_count": 0, "body": "ubuntu18で自作OSを作っています。 \n[この方](http://yuma.ohgami.jp/)の「フルスクラッチで作る!x86_64自作OS」を読んで自分で書いてみているのですが、4章のkbcの割り込みを実装しqemu3.0.0をつかって起動させ実際にキーボードで適当に打つとqemuの再起動(OVMFの画面であるtianocoreのロゴが出てくる)がかかります。 \n具体的なソースは[こちら](https://github.com/cupnes/x86_64_jisaku_os_samples/tree/master/040_intr)の方のものを使用しています。\n\nまた、手持ちのノートパソコン(ubuntu18)を使って、aptで入れた古いバージョン(2.4)を使うとkbcの割り込みが起こり、文字が表示されます。 \nソースではkbc以外の割り込みは無限ループになるようにかかれているのでkbc以外の割り込みが起きているとも考えにくいのですが", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T14:54:53.217", "favorite_count": 0, "id": "48976", "last_activity_date": "2018-10-04T14:54:53.217", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30373", "post_type": "question", "score": 2, "tags": [ "c", "アセンブリ言語", "qemu", "x86" ], "title": "qemu3.0.0をつかってkbcの割り込みを使うとqemuが再起動する", "view_count": 62 }
[]
48976
null
null
{ "accepted_answer_id": null, "answer_count": 1, "body": "MySQL5.7.23をインストールし、/etc/my.cnfで以下の設定を入れて文字コードを設定しています。\n\n```\n\n [mysqld]\n character-set-server = utf8mb4\n \n [client]\n default-character-set=utf8mb4\n \n```\n\n環境はVirtualbox(ホスト:win10 ゲスト:CentOS7)です。\n\nteratermでMySQLに入り「show variables like '%char%';」を実行して文字コードが正しい事を確認しました。\n\n```\n\n character_set_client utf8mb4 \n character_set_connection utf8mb4 \n character_set_database utf8mb4 \n character_set_filesystem binary \n character_set_results utf8mb4 \n character_set_server utf8mb4 \n character_set_system utf8 \n character_sets_dir /usr/share/mysql/charsets/ \n validate_password_special_char_count 1 \n \n```\n\n一方、MySQL Workbenchで同じコマンドを実行すると結果が異なってしまいます。\n\n```\n\n character_set_client utf8\n character_set_connection utf8\n character_set_database utf8mb4\n character_set_filesystem binary\n character_set_results utf8\n character_set_server utf8mb4\n character_set_system utf8\n character_sets_dir /usr/share/mysql/charsets/\n validate_password_special_char_count 1\n \n```\n\nまた、workbench上で絵文字の格納されたカラムをselectすると文字化けして表示されます。 \nこの時「SET NAMES utf8mb4;」を実行すると正常に表示されます。\n\n以上からworkbenchがサーバではなくローカルの設定を使っているように見受けられるのですがworkbenchには文字コードの設定が出来そうな箇所が無く、ホストにはmysqlをインストールしていないのでmy.cnf(my.ini)も存在しません。\n\nworkbenchがどこのどういった設定を読み込んでいるのかわかりますでしょうか。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T16:24:03.580", "favorite_count": 0, "id": "48978", "last_activity_date": "2019-06-22T02:32:35.293", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "11050", "post_type": "question", "score": 2, "tags": [ "mysql", "centos", "windows-10" ], "title": "MySQL Workbenchとサーバ上でshow variables like '%char%';の結果が異なる", "view_count": 609 }
[ { "body": "<https://dev.mysql.com/doc/workbench/en/wb-mysql-connections-new.html>\n\n^ 上記ページによれば、 MySQL Workbench は問答無用で utf8 を利用して connection を張る様子です。\n\n> When opening connections, MySQL Workbench automatically sets the client\n> character set to utf8. Manually changing the client character set, such as\n> us...
48978
null
55998
{ "accepted_answer_id": "48983", "answer_count": 2, "body": "ruby においては、(整備されているならば)クラスやメソッドのドキュメントを `ri` コマンドで、コマンドライン上から参照できます。\n\npython における、 ruby の `ri` 相当のコマンドはありますか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-04T16:45:59.907", "favorite_count": 0, "id": "48981", "last_activity_date": "2018-10-04T17:12:08.600", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "754", "post_type": "question", "score": 4, "tags": [ "python" ], "title": "python における ruby の ri 相当のコマンドはありますか?", "view_count": 113 }
[ { "body": "help関数で行けました。下記はコマンドラインにてeval関数のヘルプを得る場合。\n\n```\n\n python -c help(eval)\n \n```\n\nまたipythonと呼ばれるインタープリタでは、eval?でdocument表示できます。 \nまた??を後ろにつけることでソースコードも表示できますが、evalはCで実装された組込み関数なのでソースは見れません。(pythonで実装されているとソースが見れます。)", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creat...
48981
48983
48983
{ "accepted_answer_id": null, "answer_count": 2, "body": "仮想環境をVagrant+VirtualBoxで立ち上げ、そこに簡単なWebサービスを試しに展開してみようと思っています。Vagrantを起動後、ローカルのPCから下図の設定でアクセス出来る事は確認できました。 \n[![RLoginのServer Edit\nEntry設定。ローカルでアクセスに成功したのと同じSSH認証鍵を利用](https://i.stack.imgur.com/tA6K1.png)](https://i.stack.imgur.com/tA6K1.png)\n\n同じ設定で外部PCからアクセスした所、以下の様なエラーが出てしまったのですが、外部からアクセスする場合追加で設定が必要なのでしょうか? \n[![画像の説明をここに入力](https://i.stack.imgur.com/Epr1K.png)](https://i.stack.imgur.com/Epr1K.png)\n\nちなみにVagrantのSSHの設定は以下の通りでした。 \n[![画像の説明をここに入力](https://i.stack.imgur.com/Encs6.png)](https://i.stack.imgur.com/Encs6.png)\n\n追記: \n(1)頂いたアドバイスを基に調べて見た所、ポートフォワーディングを行えば良さそうだと判断し、Vagrantfileで以下の設定を付け加えた後に再起動した時に表示された結果を添付します。\n\n```\n\n config.vm.network \"forwarded_port\", guest: 80, host: 8080\n \n```\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/bEfSq.png)](https://i.stack.imgur.com/bEfSq.png)\n\n(2)[Qiitaの記事](https://qiita.com/_norin_/items/8f534bd0531a960af5e9)を参考にポートに同じネットワーク内のPCからアクセス出来るかをPowerShellで調べてみた所、問題は無さそうでした。 \n[![画像の説明をここに入力](https://i.stack.imgur.com/UxvyY.png)](https://i.stack.imgur.com/UxvyY.png)", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-05T00:58:37.190", "favorite_count": 0, "id": "48986", "last_activity_date": "2023-07-10T04:05:55.800", "last_edit_date": "2018-10-07T01:15:29.793", "last_editor_user_id": "19869", "owner_user_id": "19869", "post_type": "question", "score": 0, "tags": [ "vagrant", "virtualbox" ], "title": "WinSock Have Error #10060: Vagrant+VirtualBoxで立ち上げたUbuntuに外部からアクセスできません。", "view_count": 2782 }
[ { "body": "ローカルPCからゲストOSへの接続時、ポート番号に`2222`を指定されていますが、こちらはゲストOS側でsshの待ち受けポートを変更していますか?それともポートフォワーディングを使用されているのでしょうか。\n\nどちらにせよ、まずは「外部PCからローカルPC」に対して`2222`ポートへの接続が通るかを確認してみてください(ローカルPCでのファイアウォール設定等)。\n\n併せて、ゲストOSがどんなネットワーク設定になっているかも質問に追記してもらうと、より具体的な回答がつけやすいと思います。例えば「ホストオンリーアダプタ」を使用している場合には、ローカルPCとゲストOS間でしか通信ができま...
48986
null
48987
{ "accepted_answer_id": "49107", "answer_count": 1, "body": "[よく使うmysqldumpのオプションと使用例](https://qiita.com/ryounagaoka/items/7be0479a36c97618907f)\nを見ていました。\n\nそこでは、 mysqldump を行うにあたっては、 --flush-logs を付与すると良い、ということが書いてあります。\n\n### 質問\n\n * mysqldump において、 --flush-logs を行う理由は何ですか? \n * これを付与しなかった場合、どのようなトラブルが想定されますか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-05T02:37:24.020", "favorite_count": 0, "id": "48989", "last_activity_date": "2018-10-09T09:43:07.230", "last_edit_date": "2018-10-05T02:42:27.333", "last_editor_user_id": "754", "owner_user_id": "754", "post_type": "question", "score": 1, "tags": [ "mysql" ], "title": "mysqldump の --flush-logs オプションは何の目的で付与される?", "view_count": 2808 }
[ { "body": "ざっくりいうと復元の際に便利だからですね。 \n省略すると、作業手順が増えるので、復旧に時間がかかると言ったことが考えられます。\n\n * ダンプからリストアした場合は、ダンプ取得時の古い状態になります。 \nバイナリログからロールフォワードリカバリを行えば、ダンプ取得後~障害発生直前までに戻せます。\n\n * `--flush-logs` は バイナリログがローテートされて新しいファイルが作成されるオプションです。 \n復元時は 新しいバイナリログの先頭から リカバリを行えば良く、古いバイナリログは無視できます。\n\n * オプションを省略した場合は、バイナリログから復元ポイ...
48989
49107
49107
{ "accepted_answer_id": null, "answer_count": 1, "body": "外国人なので日本語のレベルは申し訳ございません。\n\n他のウェブサイトからデータを取得してデータベースに入れましたが \"Price (販売価格)\" という列を価格順にソートしたいです。\n\nここで問題なのは、\"6,690万円(1戸)\" のようにセルの中に数字と一緒に日本語の文字も含まれており、恐らくちゃんとソートが機能していません。\n\n対象の列は \"LongText\" 、テーブルの文字コードは \"Utf8mb4 Unicode ci\" です。\n\nMySQLで上記のようなPriceの列をどうすればソートできますか?\n\n**試したコード:**\n\n```\n\n SELECT * FROM `estates` ORDER BY LPAD(lower(price), 10,0) ASC\n \n```\n\n```\n\n SELECT price FROM `estates` ORDER BY number+0 ASC\n \n```\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/2n7QJ.jpg)](https://i.stack.imgur.com/2n7QJ.jpg)", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-05T04:38:29.333", "favorite_count": 0, "id": "48991", "last_activity_date": "2022-11-29T10:30:23.163", "last_edit_date": "2022-11-29T10:23:25.853", "last_editor_user_id": "3060", "owner_user_id": "30379", "post_type": "question", "score": 0, "tags": [ "mysql", "mariadb" ], "title": "\"数値 + 単位\" で価格を表す列を、数値順でソートしたい", "view_count": 153 }
[ { "body": "データベースにレコード作成する時に数値型に変換しておいてはいかがでしょう", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2022-11-29T10:30:23.163", "id": "92499", "last_activity_date": "2022-11-29T10:30:23.163", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id...
48991
null
92499
{ "accepted_answer_id": null, "answer_count": 1, "body": "ゲームのステージとかでの移動範囲限界とかを設けたり、箱の上に乗ったりしたいです。\n\nそのために3Dの物体が接触しているという情報を受け取る必要があります。\n\n2Dの場合は三平方の定理などの資料が見つかるのですが、3Dでの資料が見つからないです。\n\n3Dの場合どのように物体の接触を感知しているのでしょうか。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-05T06:18:18.887", "favorite_count": 0, "id": "48997", "last_activity_date": "2018-10-09T02:10:49.903", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30381", "post_type": "question", "score": 1, "tags": [ "c++", "opengl" ], "title": "OpenGLで当たり判定をつけたい", "view_count": 1327 }
[ { "body": "2Dゲームの場合、キャラクターを覆うような四角形を定義し、四角形同士が重なっているかどうかで大雑把に衝突しているかどうかを判定していると思います。 \nその後、キャラクターの形にあった判定を使用した細かな衝突判定を行うと思います。\n\n3Dでも同じようにキャラクターを囲うような立方体AABB(Axis-Aligned Bounding\nBox)を定義して、その立方体同士が重なっているかどうかで衝突判定をする方法があります。 \nその後、キャラクターの各パーツごとのAABBによる衝突判定を繰り返し、最終的にポリゴン単位での衝突判定まで落とし込んだりしますが、衝突判定の精度によってどこまでや...
48997
null
49077
{ "accepted_answer_id": null, "answer_count": 1, "body": "Linuxをインストールしようとしたのですが、m.2のSSDを使用しているみたいで、LinuxでSSDを認識しません。何か解決策はありますでしょうか。 \n機種はXPS 13 プラチナです。", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-05T08:48:42.333", "favorite_count": 0, "id": "49003", "last_activity_date": "2019-04-30T20:59:43.653", "last_edit_date": "2018-10-05T13:42:00.227", "last_editor_user_id": "3054", "owner_user_id": "30384", "post_type": "question", "score": 0, "tags": [ "linux" ], "title": "Linuxのインストール時にM.2 SSDが認識されない", "view_count": 11401 }
[ { "body": "@sayuri\n氏のコメントにより、この質問は解決したようです。外部サイトにある内容ですが、引用して回答としておきます。(一部画像が表示されないなどありますが、英語版に変更することで正常に表示されました。\n-- 2019/05/01時点)\n\n> ### ハード ドライブが認識されない\n>\n> PCIeベースのm2ドライブしかないシステムでUbuntu 14.04/15.04メディアを起動すると、インストーラがハード\n> ドライブを検出できないことがあります(通常、インストーラはデフォルトで/dev/sdxのみを検索します)。\n>\n> ### NVMEロード\n>\n> メモ:\...
49003
null
54617
{ "accepted_answer_id": null, "answer_count": 3, "body": "### 質問\n\nグラフ構造に対して幅優先探索を再帰関数を使って実装することはできるのでしょうか?\n\n深さ優先探索の場合、スタックか再帰関数を使って実装ができます。 \n一方で深さ優先探索の場合、キューを使って実装することはできたのですが、キューを使わずに再帰関数で実装することができずに困っています。\n\n参考までに、キューを使った実装を下にのせておきました。幅優先探索するためのヒントもしくは、実装をご教示くださると助かります。 \nおそらく、bfs_visit(int\nu)のような、uを訪れる関数を定義して、それらを再帰関数として使うのだろうと思っています。ですが、深さ優先探索とは違って、幅優先にさせるロジックをどう実装したらよいのかわかりません。\n\n### 参考\n\nこの問題を再帰関数による幅優先探索で解こうとしています。キューを使った場合は、後述のソースコードで問題なくとおります。 \n[http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_11_C&lang=jp](http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_11_C&lang=jp)\n\n### キューを使った場合の幅優先探索の実装\n\n(長いのでスクロールしてください)\n\n```\n\n #include <iostream>\n #include <queue>\n #define NIL -1\n #define N 110\n \n using namespace std;\n \n bool A[N][N];\n int d[N];\n int n;\n \n void bfs(int s) {\n queue<int> q;\n for (int i = 0; i < N; i++) d[i] = NIL;\n q.push(s);\n d[s] = 0;\n while(!q.empty()) {\n int u = q.front(); q.pop();\n for (int v = 0; v < n; v++) {\n if (A[u][v] && d[v] == NIL) {\n q.push(v);\n d[v] = d[u] + 1;\n }\n }\n }\n }\n \n int main() {\n \n cin >> n;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n A[i][j] = false;\n }\n }\n \n for (int i = 0; i < n; i++) {\n int u, k, v;\n cin >> u >> k;\n u--;\n for (int j = 0; j < k; j++) {\n cin >> v;\n v--;\n A[u][v] = true;\n }\n }\n \n bfs(0);\n \n for (int i = 0; i < n; i++) {\n cout << i+1 << \" \" << d[i] << endl;\n }\n }\n \n```", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-05T22:58:21.330", "favorite_count": 0, "id": "49009", "last_activity_date": "2019-01-05T05:38:26.700", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "29267", "post_type": "question", "score": 0, "tags": [ "c++", "c", "アルゴリズム", "グラフ理論" ], "title": "幅優先探索を、キューを使わずに再帰関数を使って実装することはできるのでしょうか?", "view_count": 3328 }
[ { "body": "単純ループは簡単に再帰処理に書き直せるので、出来なくはないでしょう。それが自然かとか分かりやすいかとかは別にするのであれば。\n\n```\n\n void fn(int start, int end) {\n for( int i = start; i < end; ++ i ) {\n cout << i << endl;\n }\n }\n \n void fr(int i, int end) {\n if( i >= end ) return;\n cout << i << endl;\...
49009
null
49011
{ "accepted_answer_id": null, "answer_count": 1, "body": "Emacsをインストールしましたが、Emacsを開けません。\n\n以下サイトを参考にEmacsをダウンロードしました。 \n<http://baker-street.jugem.jp/?eid=636>", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-06T00:52:16.040", "favorite_count": 0, "id": "49010", "last_activity_date": "2018-10-06T05:39:18.657", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30384", "post_type": "question", "score": -2, "tags": [ "linux", "emacs" ], "title": "linux mintでEmacsが起動しない", "view_count": 451 }
[ { "body": "参考にされたページの手順ではパッケージ名に`emacs-\nnox`を指定していますが、[リポジトリ](https://launchpad.net/~kelleyk/+archive/ubuntu/emacs/+packages)を確認すると(コンソール版の)正しいパッケージ名は`emacs25-nox`または`emacs26-nox`のようです。 \n起動しない原因は **そもそもインストールが完了していない** 可能性があるので、例えば`which\nemacs`などを実行してインストールが出来ているかを確認してください。\n\n何かパッケージをインストールする場合には、事前に`apt\n...
49010
null
49013
{ "accepted_answer_id": null, "answer_count": 1, "body": "ネットワーク関連初心者です。\n\nvirtualbox上でubuntuをゲストOSとして使用しています。 \nこのubuntuのipアドレスを知りたいと思い、ifconfigコマンドで \n調べようとしたのですが、192.168.**.**等が表示ませんでした。 \nそこで少し調べた結果、 \n<https://qiita.com/amoO_O/items/ff1aa16bf1b60f34bb5d> \nを参考にipアドレスを付けよう?としたのですが \nNATネットワークしかなく、ホストオンリーネットワークのタブがないため \n困っております。\n\n分かりやすくご教授いただければ幸いです。よろしくお願いいたします。", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-06T07:19:19.760", "favorite_count": 0, "id": "49015", "last_activity_date": "2018-10-06T11:08:18.387", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30396", "post_type": "question", "score": 0, "tags": [ "virtualbox" ], "title": "virtualboxでホストオンリーネットワークタブがない", "view_count": 6156 }
[ { "body": "ホストオンリーネットワークアダプタが未作成であれば、「ファイルメニュー」あるいは「グローバルツール」から「ホストネットワークマネージャー」を選択して、ホストオンリーネットワークアダプタを「作成」する必要があります。\n\n作成した後は、仮想マシンの設定で「ネットワークアダプタ」の空きアダプタを有効化して「ホストオンリーアダプタ」を選択すれば、仮想マシンで利用可能になると思います。", "comment_count": 3, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-06T11:08:18.38...
49015
null
49021
{ "accepted_answer_id": "49136", "answer_count": 1, "body": "参照透過性が満たされることの利点は何ですか? \n具体的には変数が代入できることで生じる具体的なバグが知りたいです。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-06T07:21:51.460", "favorite_count": 0, "id": "49016", "last_activity_date": "2018-10-10T09:13:24.660", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "29865", "post_type": "question", "score": 1, "tags": [ "haskell" ], "title": "参照透過性が満たされることの利点は何ですか", "view_count": 512 }
[ { "body": "変数はなんらかの計算結果を値として参照するために用います. \nこれにより計算結果の再利用を実現しているわけですね. \nこの参照が透過的であるということは,いつでも変数と参照対象の値を入れ替え可能ということです. \n変数は参照対象を変更することはなく,いつも同じ計算結果を参照するということになります.\n\nこれには2つ利点があります.\n\n * その計算結果を参照する手段が失なわれないことが(変数の有効範囲では)保証される.\n * その変数で参照している値が意図した計算の結果であるかを確認するためには,その変数を初期化しているところ一箇所を確認すればよい.\n\n変数が参照す...
49016
49136
49136
{ "accepted_answer_id": "49030", "answer_count": 1, "body": "・users_table \n・posts_table \nという2つのテーブルがあり、user has many postsの関係です。\n\nusersは、id・name \npostsは、id・user_id・content・created_at \nのカラムを持っています。\n\nそこで、2018年9月3日以降に投稿したユーザを取得したいと考えました。\n\n```\n\n $user = User::with(['posts' => function($query){\n $query->where('created_at', '>', '2018-09-03');\n }])->get();\n dd($user);\n \n```\n\n・User.php\n\n```\n\n public function posts(){\n return $this->hasMany('App\\Post', 'user_id', 'id');\n }\n \n```\n\n・users_tableの中身 \n[![画像の説明をここに入力](https://i.stack.imgur.com/TTUXD.png)](https://i.stack.imgur.com/TTUXD.png)\n\n・posts_tableの中身 \n[!['postsテーブル'](https://i.stack.imgur.com/c4NeJ.png)](https://i.stack.imgur.com/c4NeJ.png) \n9月3日以降に投稿したユーザはuser_idが1または、3のユーザですので \ndd($user)では、user1・user3が取得される予定ですが、三人とも取得されてしまいます。\n\nリレーション先の情報を元に、絞り込むにはどうすれば良いでしょうか? \nよろしくお願い致します。\n\n[追記]\n\n```\n\n $user = User::whereHas('posts', function($query){\n $query->where('created_at', '>', '2018-09-03');\n });\n \n```\n\nを利用することによって、解決しましたが、whereHasでできて、eager loadでできないのは何故 \nなのでしょうか? \nよろしくお願いいたします。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-06T07:37:55.060", "favorite_count": 0, "id": "49018", "last_activity_date": "2018-10-07T06:01:44.547", "last_edit_date": "2018-10-06T09:01:37.763", "last_editor_user_id": "28944", "owner_user_id": "28944", "post_type": "question", "score": 0, "tags": [ "laravel", "laravel-5" ], "title": "Laravelでリレーション先(hasMany)の情報を利用し絞り込み", "view_count": 2318 }
[ { "body": "`whereHas` はサブクエリを用いてリレーションを用いたSQLを発行します。追記にある通り、今回の目的ではこれを用いるが正解です。\n\n一方、eager loadというのは先に取得したModelのコレクションに対して **あとからリレーションの取得**\nを行います。ここで指定できるクエリはメインのクエリ(ここではユーザー)に影響を与えることはなく、その **リレーション(post)を絞り込む** だけです。\n\n(日本語訳ドキュメントをもう一度読んでみてください\n[Eloquent:リレーション#Eagerロード](https://readouble.com/laravel/5.6...
49018
49030
49030
{ "accepted_answer_id": "49150", "answer_count": 2, "body": "簡易なアプリです。最新技術を使っている、Java 11 + Java FX + Maven + Spring の「Hello, world」アプリです。\n\n```\n\n package com.example;\n \n import com.example.beans.TestSpringBean;\n import org.springframework.context.ApplicationContext;\n import org.springframework.context.support.ClassPathXmlApplicationContext;\n \n import javafx.stage.Stage;\n import javafx.scene.Scene;\n import javafx.scene.control.Label;\n \n \n public class EntryPoint extends javafx.application.Application {\n \n public static void main (String[] args) {\n ApplicationContext applicationContext = new ClassPathXmlApplicationContext(\"ApplicationContext.xml\");\n TestSpringBean testSpringBean = (TestSpringBean) applicationContext.getBean(\"testSpringBean\");\n System.out.println(testSpringBean.getTestString());\n launch();\n }\n \n @Override\n public void start(Stage stage) {\n Label label = new Label(\"Hello, JavaFX11!\");\n Scene scene = new Scene(label, 640, 480);\n stage.setScene(scene);\n stage.show();\n }\n }\n \n```\n\nIntelIJ IDEAには、mavenのcompileをしてみると、特に問題ありません:\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/uCevY.png)](https://i.stack.imgur.com/uCevY.png)\n\n`maven-\npackage`も、正常です。ですが構成されたファイルを実行してみると、「JavaFXランタイム・コンポーネントが不足しており、このアプリケーションの実行に必要です」というエラーが出ます:\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/91aSq.png)](https://i.stack.imgur.com/91aSq.png)\n\nPOM.xml:\n\n```\n\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n \n <modelVersion>4.0.0</modelVersion>\n <groupId>com.example</groupId>\n <artifactId>OTCJA</artifactId>\n <version>1.0-SNAPSHOT</version>\n \n <dependencies>\n <dependency>\n <groupId>org.springframework</groupId>\n <artifactId>spring-context</artifactId>\n <version>5.1.0.RELEASE</version>\n </dependency>\n \n <dependency>\n <groupId>org.openjfx</groupId>\n <artifactId>javafx-controls</artifactId>\n <version>11</version>\n </dependency>\n </dependencies>\n \n <build>\n <plugins>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-compiler-plugin</artifactId>\n <version>3.7.0</version>\n <configuration>\n <release>11</release>\n </configuration>\n </plugin>\n <plugin>\n <groupId>org.codehaus.mojo</groupId>\n <artifactId>exec-maven-plugin</artifactId>\n <version>1.6.0</version>\n <executions>\n <execution>\n <goals>\n <goal>java</goal>\n </goals>\n </execution>\n </executions>\n <configuration>\n <mainClass>com.example.EntryPoint</mainClass>\n </configuration>\n </plugin>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-dependency-plugin</artifactId>\n <executions>\n <execution>\n <id>copy-dependencies</id>\n <phase>prepare-package</phase>\n <goals>\n <goal>copy-dependencies</goal>\n </goals>\n <configuration>\n <outputDirectory>\n ${project.build.directory}/libs\n </outputDirectory>\n </configuration>\n </execution>\n </executions>\n </plugin>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-jar-plugin</artifactId>\n <configuration>\n <archive>\n <manifest>\n <addClasspath>true</addClasspath>\n <classpathPrefix>libs/</classpathPrefix>\n <mainClass>com.example.EntryPoint</mainClass>\n </manifest>\n </archive>\n </configuration>\n </plugin>\n </plugins>\n </build>\n </project>\n \n```\n\n## 環境\n\n * OS: Windows 10\n * IntelIJ IDEA バージョン:2018.2\n * ベンター:確か、[http://jdk.java.net](http://jdk.java.net/11/)です\n\n[![画像の説明をここに入力](https://i.stack.imgur.com/N4BJu.png)](https://i.stack.imgur.com/N4BJu.png)", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-06T08:11:02.827", "favorite_count": 0, "id": "49019", "last_activity_date": "2018-10-12T07:14:07.517", "last_edit_date": "2018-10-10T13:36:35.300", "last_editor_user_id": "16876", "owner_user_id": "16876", "post_type": "question", "score": 0, "tags": [ "java", "maven", "javafx" ], "title": "Maven + Java SDK 11 + Java FX: JavaFXランタイム・コンポーネントが不足しており、このアプリケーションの実行に必要です", "view_count": 5340 }
[ { "body": "実行の際に[ここ](https://openjfx.io/openjfx-docs/#install-\njavafx)に記載されているオプション(以下)を指定していないことが原因だと思います。\n\n```\n\n --module-path $PATH_TO_FX --add-modules=javafx.controls\n \n```\n\nRun > Edit Configurations > JAR Applications > (作成したJar) を選択し、「VM\nOptions」に上記を入力して実行すれば、おそらく動くと思います(試していませんが...)。`$PAT...
49019
49150
49150
{ "accepted_answer_id": null, "answer_count": 0, "body": "```\n\n my @old = qw( 12 34abc56def 999 );\n my @new = map { /([a-z]+)/ } @old;\n for my $n ( @new ){ print \"[$n]\\n\"; }\n print scalar @new,\"\\n\";\n \n```\n\n上記コードの出力は、以下を期待していたのですが、\n\n```\n\n []\n [abc]\n []\n 3\n \n```\n\n実行してみると、\n\n```\n\n [abc]\n 1\n \n```\n\nとなります。 \nどうしてこのような出力になるのか理解できません。 \n(mapの使い方が間違っている?) \nどなたか、解説していただけないでしょうか?", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-07T00:17:27.997", "favorite_count": 0, "id": "49023", "last_activity_date": "2018-10-07T04:54:41.757", "last_edit_date": "2018-10-07T04:54:41.757", "last_editor_user_id": "3060", "owner_user_id": "24431", "post_type": "question", "score": 0, "tags": [ "perl" ], "title": "perlのmapについて", "view_count": 100 }
[]
49023
null
null
{ "accepted_answer_id": null, "answer_count": 2, "body": "※環境ASP.NET MVC4(C#)\n\nお世話になります。\n\n目的→knockoutjsで3連動のドロップダウンリストを実現する\n\n公式サンプルを参考に3連動用(親・子・孫)のモックデータを作り \n実現できることは確認済です。\n\nしかし3連動用のデータは本来はDBから抽出します。 \n今はIListで取得しています。 \n問題なのは、SQL抽出結果をそのモックデータと同じ構造にすることです(←両者後述します)。 \nいろんなサイトで調べましたが、難儀し結果わからず、質問した次第です。\n\nSQL抽出結果からモックデータと同じ構造の配列を作るにはどうしたらよいのでしょうか? \n親の配列の中に子の配列があり、子の中にコードと名称の配列がある(?)イメージです。 \nこの辺不得意分野で、分かりやすい説明も頂けたら助かります。 \nそして非常に急いでおります(汗) \nどなたかご教授お願い致します。\n\n以下SQL抽出内容とモックデータ構造です。 \n(値は例として書き換えています。)\n\n`<SQL抽出内容>`\n\n```\n\n 親 子 孫コード 孫名称\n 2019, 部門1, 001, 部門1のサブ名称\n 2019, 部門1, 002, 部門1のサブ名称2\n 2019, 部門2, 002, 部門2のサブ名称\n 2018, 部門1, 001, 部門1のサブ名称\n 2018, 部門A, 001, 部門Aのサブ名称\n 2018, 部門A, 002, 部門Aのサブ名称2\n \n```\n\n`<モックデータ>`\n\n```\n\n var moq = \n [\n {\n \"親\": \n [\n {\n \"子\": \n [\n {\n \"孫コード\": \"001\",\n \"孫名称\" : \"部門1のサブ名称\"\n },\n {\n \"孫コード\": \"002\",\n \"孫名称\" : \"部門1のサブ名称2\"\n }\n ],\n \"子値\": \"部門1\"\n },\n {\n \"子\": \n [\n {\n \"孫コード\": \"001\", \n \"孫名称\": \"部門2のサブ名称\" \n }\n ],\n \"子値\": \"部門2\"\n }\n ],\n \"親値\": \"2019\"\n },\n {\n \"親\": \n [\n {\n \"子\": \n [\n {\n \"孫コード\": \"001\",\n \"孫名称\" : \"部門1のサブ名称\"\n }\n ],\n \"子値\": \"部門1\"\n },\n {\n \"子\": \n [\n {\n \"孫コード\": \"001\", \n \"孫名称\": \"部門Bのサブ名称\" \n },\n {\n \"孫コード\": \"002\", \n \"孫名称\": \"部門Bのサブ名称\" \n } \n ],\n \"子値\": \"部門B\"\n }\n ],\n \"親値\": \"2018\"\n }\n ];\n \n```", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-07T00:37:18.473", "favorite_count": 0, "id": "49024", "last_activity_date": "2018-10-20T07:41:10.433", "last_edit_date": "2018-10-07T02:56:26.463", "last_editor_user_id": "20098", "owner_user_id": "30402", "post_type": "question", "score": 0, "tags": [ "c#" ], "title": "SQL抽出結果から配列の配列を作るには?", "view_count": 2040 }
[ { "body": "モックデータは複雑な構造のJSON形式ですので、SQL抽出結果をご希望の構造に変換するライブラリは存じ上げません。(おそらく存在しないと予想します)\n\n`DataContractJsonSerializer`などの標準的なライブラリを使ってJSONへ変換することは可能です。 \n下記のサンプルコードが参考になるかご確認ください。\n\nなお下記のサンプルコードを実行するには、参照設定で`System.Runtime.Serialization`の追加とNuGetで`System.Data.SQLite.Core`の追加が必要です。\n\n```\n\n using System;\n...
49024
null
49046
{ "accepted_answer_id": null, "answer_count": 2, "body": "OSをMojave にアップグレードしてからXcode 8.3.3を起動しようとしたところ、\n\n問題が起きたためXcodeを開けません \n開発者にXcodeがこのバージョンのmac OSで動作する事を確認してください\n\nというエラーが出てしまいます \nmojaveは最新のXcodeしか対応してないのでしょうか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-07T04:38:40.043", "favorite_count": 0, "id": "49027", "last_activity_date": "2018-10-07T10:45:42.423", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30398", "post_type": "question", "score": 2, "tags": [ "xcode" ], "title": "mac OS Mojave でXcode 8 は対応してないのでしょうか?", "view_count": 4589 }
[ { "body": "Xcode\n8.3.3のリリース日が2017年6月ですが、その時の対応OSが10.12なので、10.14と2つもOSバージョンが違うと、サポート外は充分あり得ることだと思いますし、10.14の新機能への対応やSwiftのバージョンも上がっているため、Xcode\n10が必須なのだとおもいます。\n\nもし仮に、Swiftのバージョンが上がることを嫌ってのXcode\n8から最新のXcodeへの乗り換えをためらっておられるのでしたら、これを機会に最新Swiftに開発中のコードを書き替えることをお勧めします。\n\n逆に業務などでソースコードに安易に手を入れられないのであれば、開発用OSとXcod...
49027
null
49031
{ "accepted_answer_id": "49033", "answer_count": 1, "body": "# 環境\n\n * Python 3.6.6 :: Anaconda, Inc.\n * pip 18.0\n * Windows10\n * conda 4.5.11\n\n# 問題\n\n先日`conda update --all`でパッケージをアップデートしたら、`pip install`で次のエラーが発生しました。\n\n```\n\n >python -m pip install docutils\n Exception:\n Traceback (most recent call last):\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py\", line 2869, in _dep_map\n return self.__dep_map\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py\", line 2663, in __getattr__\n raise AttributeError(attr)\n AttributeError: _DistInfoDistribution__dep_map\n \n During handling of the above exception, another exception occurred:\n \n Traceback (most recent call last):\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\packaging\\requirements.py\", line 93, in __init__\n req = REQUIREMENT.parseString(requirement_string)\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pyparsing.py\", line 1632, in parseString\n raise exc\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pyparsing.py\", line 1622, in parseString\n loc, tokens = self._parse( instring, 0 )\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pyparsing.py\", line 1379, in _parseNoCache\n loc,tokens = self.parseImpl( instring, preloc, doActions )\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pyparsing.py\", line 3395, in parseImpl\n loc, exprtokens = e._parse( instring, loc, doActions )\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pyparsing.py\", line 1383, in _parseNoCache\n loc,tokens = self.parseImpl( instring, preloc, doActions )\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pyparsing.py\", line 3183, in parseImpl\n raise ParseException(instring, loc, self.errmsg, self)\n pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)\n \n During handling of the above exception, another exception occurred:\n \n Traceback (most recent call last):\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py\", line 2949, in __init__\n super(Requirement, self).__init__(requirement_string)\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\packaging\\requirements.py\", line 97, in __init__\n requirement_string[e.loc:e.loc + 8]))\n pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at \"'; extra '\"\n \n During handling of the above exception, another exception occurred:\n \n Traceback (most recent call last):\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_internal\\basecommand.py\", line 141, in main\n status = self.run(options, args)\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_internal\\commands\\install.py\", line 330, in run\n self._warn_about_conflicts(to_install)\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_internal\\commands\\install.py\", line 456, in _warn_about_conflicts\n package_set, _dep_info = check_install_conflicts(to_install)\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_internal\\operations\\check.py\", line 98, in check_install_conflicts\n package_set = create_package_set_from_installed()\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_internal\\operations\\check.py\", line 41, in create_package_set_from_installed\n package_set[name] = PackageDetails(dist.version, dist.requires())\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py\", line 2607, in requires\n dm = self._dep_map\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py\", line 2871, in _dep_map\n self.__dep_map = self._compute_dependencies()\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py\", line 2881, in _compute_dependencies\n reqs.extend(parse_requirements(req))\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py\", line 2942, in parse_requirements\n yield Requirement(line)\n File \"C:\\Users\\yuji3\\Anaconda3_5.2.0\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py\", line 2951, in __init__\n raise RequirementParseError(str(e))\n pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at \"'; extra '\"\n You are using pip version 18.0, however version 18.1 is available.\n You should consider upgrading via the 'python -m pip install --upgrade pip' command.\n \n```\n\n# 質問\n\n上記のエラーは、どのようにして調査・解決すればよいでしょうか?", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-07T06:06:30.307", "favorite_count": 0, "id": "49032", "last_activity_date": "2018-10-08T03:08:06.657", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "19524", "post_type": "question", "score": 3, "tags": [ "python", "pip", "conda" ], "title": "`conda update --all`したら`pip install`がエラーになりました", "view_count": 808 }
[ { "body": "役に立つかどうかはわかりませんが、コメントに書いた[pip install AttributeError:\n_DistInfoDistribution__dep_map](https://stackoverflow.com/questions/52582563/pip-\ninstall-attributeerror-distinfodistribution-dep-map)を載せておきます。そこにこのように書かれていました。 \n一時的なエラーのようで、新しいリリースを待てば治ると思います。\n\n`conda install 'testpath<0.4'`\n\nとされてみたらいかがです...
49032
49033
49033
{ "accepted_answer_id": "49040", "answer_count": 2, "body": "Xcode10.0\nswiftで、`ViewController`に、別の`ViewController`をポップアップウインドウのようにように表示しています。 \n別の`ViewController`からは`dismiss(animated: true, completion:\nnil)`で元の`ViewContoroller`で戻っています。\n\n * 別の`ViewController`の`Presentation`が`FullScreen`だと元の`ViewController`の`viewWillAppear`が呼び出されます\n * 別の`ViewController`の`Presentation`が`OverCurrentContext`だと元の`ViewController`の`viewWillAppear`が呼び出されません\n\n`viewWillAppear`が呼び出されない理屈はわかりますが、`Presentation`が`OverCurrentContext`でも`viewWillAppear`を呼び出す方法をどちらかご教授ください。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-07T08:02:25.850", "favorite_count": 0, "id": "49034", "last_activity_date": "2018-10-09T06:48:16.483", "last_edit_date": "2018-10-09T06:48:16.483", "last_editor_user_id": "19110", "owner_user_id": "21142", "post_type": "question", "score": 3, "tags": [ "swift", "ios", "xcode", "swift4" ], "title": "ViewControllerのPresentationがOverCurrentContexだと元のViewContorollerに戻った時にviewWillAppearが呼び出されない", "view_count": 2261 }
[ { "body": "すでにお分かりの通り、提示スタイルに`.overCurrentContext`を指定すると、子画面表示の時に`viewWillDisappear`も呼ばれませんし、子画面から戻ってきたときに`viewWillAppear`も呼ばれません。\n\n従って、あなたのアプリのコードに、`viewWillAppear`を呼ぶような内容を記述してやる必要があります。\n\n`dismiss(animated: true, completion:\nnil)`のように`completion`引数を`nil`にしてしまわずに、なんらかの処理を行うクロージャを渡してやればそこに`dismiss`処理完了後に行う...
49034
49040
49040
{ "accepted_answer_id": "49041", "answer_count": 2, "body": "wikipediaの記事を元に作られた資料はクリエイティブ・コモンズ・ライセンスになりますが、 \nクリエイティブ・コモンズ・ライセンスで作成された資料をプログラムに入れて使用する場合、 \nそのプログラムはクリエイティブ・コモンズ・ライセンスとして頒布しなければならないのでしょうか。", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-07T11:59:49.213", "favorite_count": 0, "id": "49036", "last_activity_date": "2018-10-07T14:10:04.823", "last_edit_date": "2018-10-07T14:10:04.823", "last_editor_user_id": "3054", "owner_user_id": "30138", "post_type": "question", "score": 2, "tags": [ "ライセンス" ], "title": "CCライセンスの資料を入れたプログラムのライセンス", "view_count": 422 }
[ { "body": "<https://creativecommons.jp/faq/#a5>\n\nクリエイティブ・コモンズの、日本語のサイトを発見したので、ここに記します。\n\n> ソフトウェアにCCライセンスを付けることはできますか?\n>\n> 可能ですが、お勧めはできません。 \n> CCライセンスは、ソースコードとオブジェクトコードについては、適用の対象として考慮していないからです。Free Software\n> Foundationによって公開されているライセンス(日本語参考訳)や、Open Source\n> Initiativeがリストに挙げているライセンス(日本語参考訳)等、ソフトウェアに...
49036
49041
49041
{ "accepted_answer_id": null, "answer_count": 0, "body": "python scikit-learn にて RandomForestを用いたプログラムを実装中です. \nn個の目的変数を分類,回帰で分析する際にn個モデルを作るのではなく \n一つのモデルでn個の出力をするmulti-output classification and regression について \n調べています.\n\nscikit-learnのドキュメントの中で具体的にどういう仕組みで一つのモデルでn個の出力できるのか説明が見つけられなかったのですが \nご存知の方がいましたら教えてください.\n\nよろしくお願いいたします.", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-07T13:01:30.067", "favorite_count": 0, "id": "49037", "last_activity_date": "2018-10-07T13:01:30.067", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30407", "post_type": "question", "score": 3, "tags": [ "python", "scikit-learn" ], "title": "multi-output classification and regression", "view_count": 98 }
[]
49037
null
null
{ "accepted_answer_id": "49044", "answer_count": 2, "body": "現在、次のようなデータの中に出てくる \n配列words内の単語を「その他」に置き換えたいと考えております。\n\nwords内の単語が単独で出てくる場合には、置き換えることができますが、 \n文字列の一部になっている場合には、置換できません。\n\nどのようにすれば、置換できるか、ご教示頂けると大変助かります。\n\n```\n\n import pandas as pd # pandas\n import numpy as np\n \n df = pd.DataFrame(\n {'x': ['カレーライス',\n 'ピラフ; チャーハン',\n 'チャーハン',\n 'ハンバーグ; 餃子',\n '餃子',\n 'そば; 玉丼',\n 'うどん']})\n \n words = [\"チャーハン\",\"餃子\"]\n for w in words:\n df[\"x\"]=df[\"x\"].replace(w, \"その他\")\n \n print(df)\n \n```", "comment_count": 2, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-07T19:59:10.883", "favorite_count": 0, "id": "49042", "last_activity_date": "2018-10-07T21:42:53.407", "last_edit_date": "2018-10-07T20:56:19.740", "last_editor_user_id": "20148", "owner_user_id": "20148", "post_type": "question", "score": 1, "tags": [ "python", "pandas" ], "title": "文字列の一部となっている単語の置き換え", "view_count": 1815 }
[ { "body": "この言語については詳しくないので見当違いな回答になってしまうかもしれませんが、一般的な処理の方法としては、df[\"x\"]についてもfor文で回して置き換えればいいのではないでしょうか?\n\n```\n\n for w in words:\n for x in df[\"x\"]:\n x.replace(w, \"その他\")\n \n```\n\nこんな感じでしょうか……", "comment_count": 1, "content_license": "CC BY-SA 4.0", "creation_date":...
49042
49044
49044
{ "accepted_answer_id": null, "answer_count": 2, "body": "Unity公式サイトで「はじめてのUnity」で勉強し始めたものです。\n\n```\n\n using System.Collections;\n using System.Collections.Generic;\n using UnityEngine;\n \n public class DangerWall : MonoBehaviour {\n //オブジェクトと接触した時に呼ばれるコールバック \n void OnCollisionEnter(Collision hit)\n {\n //もし接触したオブジェクトのタグが”Player”の場合 \n if(hit.gameObject.CompareTag(\"Player\")){\n \n //現在のシーン番号を取得 \n int sceneIndex = SceneManager.GetActiveScene().buildIndex;\n \n SceneManager.LoadScene(sceneIndex);\n } \n }\n \n \n \n }\n \n```\n\nエラーが出るのは\n\n```\n\n int sceneIndex = SceneManager.GetActiveScene().buildIndex; \n \n SceneManager.LoadScene(sceneIndex);\n \n```\n\nの部分で \n「SceneManagerはこのコンテキストに存在しない」 \nというエラーが出ます。 \nどこの部分に問題があるのか教えてください!", "comment_count": 0, "content_license": "CC BY-SA 4.0", "creation_date": "2018-10-07T23:45:34.297", "favorite_count": 0, "id": "49045", "last_activity_date": "2018-11-03T11:17:00.363", "last_edit_date": null, "last_editor_user_id": null, "owner_user_id": "30412", "post_type": "question", "score": 0, "tags": [ "unity3d" ], "title": "Unityのエラー", "view_count": 322 }
[ { "body": "[障害物とリスタート→シーンの再読込](https://unity3d.com/jp/learn/tutorials/projects/hajiuni/adding-\nobstacles-and-restart)のコードと比較するとusingが足りないようです。 \nこれがエラーの原因ではないでしょうか。\n\n**リンク先のusing**\n\n```\n\n using UnityEngine;\n using System.Collections;\n using UnityEngine.SceneManagement;\n \n```", "comme...
49045
null
49047