question dict | answers list | id stringlengths 2 5 | accepted_answer_id stringlengths 2 5 ⌀ | popular_answer_id stringlengths 2 5 ⌀ |
|---|---|---|---|---|
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "qmailを使用しています。 \n今回、メールアドレスの `mail@example.com` という `example.com`\nを変更したいのですが、controlフォルダ内のファイルを変えてもドメインが変更されません。\n\n聞きたい事は、ドメインを変えるファイルが何かと、設定反映はファイル更新後に反映されるのか?ご指導お願い致します。",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-16T09:13:30.170",
"favorite_count": 0,
"id": "94203",
"last_activity_date": "2023-03-17T08:52:31.680",
"last_edit_date": "2023-03-17T08:52:31.680",
"last_editor_user_id": "20350",
"owner_user_id": "20350",
"post_type": "question",
"score": 0,
"tags": [
"qmail"
],
"title": "qmail に設定したドメインを変えたい",
"view_count": 104
} | [] | 94203 | null | null |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "Unity 2021.3.16f1を使っており、プラットフォームはWebGLです。 \nサーバーに配置したmp4をVideoPlayerで再生しようとしているのですが、タイトルの通り音声と映像がずれてしまいます。 \n具体的には、映像がフリーズしている間音声は止まらず音声だけが先行しています。 \nVideoPlayer.timeやVideoPlayer.frameは映像がフリーズしていても、音声と一緒にインクリメントされているのでバッファリング中を検知することもできません。 \n上記の現象は今のところWebGLのみで発現しています。 \nVideoPlayerの設定は以下の通りです。\n\n```\n\n private VideoPlayer CreateVideoPlayer()\n {\n videoPlayerObject = new GameObject(\"VideoPlayerObject\");\n videoPlayerObject.transform.parent = this.transform;\n videoPlayerObject.transform.position = Vector3.zero;\n var vp = videoPlayerObject.AddComponent<VideoPlayer>();\n VideoPlayerSetting(vp);\n return vp;\n }\n \n private void VideoPlayerSetting(VideoPlayer vp)\n {\n vp.prepareCompleted += OnPrepareCompleted;\n vp.renderMode = VideoRenderMode.MaterialOverride;\n vp.targetMaterialRenderer = screenRenderer;\n vp.playOnAwake = true;\n vp.isLooping = false;\n vp.waitForFirstFrame = true;\n vp.skipOnDrop = false;\n vp.source = VideoSource.Url;\n vp.audioOutputMode = VideoAudioOutputMode.Direct;\n }\n \n```\n\nこちらが生成されたVideoPlayerです。 \n[](https://i.stack.imgur.com/ChNCP.png)\n\nUnityフォーラムにも同じような内容投稿があり、回答でバージョンが古いといわれていますが本バージョンがLTSの最新なのでこれ以上はアップデートできません。 \n<https://forum.unity.com/threads/audio-video-stuttering-on-webgl.1409379/>\n\nこちら何か対策はあるでしょうか?",
"comment_count": 3,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-16T10:21:30.473",
"favorite_count": 0,
"id": "94204",
"last_activity_date": "2023-03-17T02:39:52.120",
"last_edit_date": "2023-03-17T00:25:23.010",
"last_editor_user_id": "2238",
"owner_user_id": "57549",
"post_type": "question",
"score": 0,
"tags": [
"c#",
"unity3d"
],
"title": "VideoPlayerでストリーミング再生すると映像と音がずれる",
"view_count": 196
} | [] | 94204 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "例えば頂点が3個のグラフの場合、それが単純で無向グラフでラベル無しで連結となると2通りだと直ぐに分かる。でも4個となるとイメージしても厄介だし5個だと紙と鉛筆を使っても怪しい。そこでプログラミングで列挙してみたいと思ったのだけどコレが厄介。連結の判断は兎も角、同型の判別が大変。接続行列だと頂点5個でも単純に2^10通りある。連結だからもう少しは減らせるとしても。頂点が10個だともう数的に大変なわけですが、何とか上手い手はないものでしょうか。 \n無闇に接続行列を虱潰しに確認するのは大変そう。だからといって候補を上げる段階で上手く絞り込みながらというのも考えが纏まりません。例えば頂点が5個や6個の場合で良いので上手い手法を教えて下さい。",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-16T11:18:09.137",
"favorite_count": 0,
"id": "94205",
"last_activity_date": "2023-03-17T00:35:18.237",
"last_edit_date": "2023-03-17T00:35:18.237",
"last_editor_user_id": "19110",
"owner_user_id": "35515",
"post_type": "question",
"score": 2,
"tags": [
"アルゴリズム",
"グラフ理論"
],
"title": "ラベル無し連結単純無向グラフの型の列挙は?",
"view_count": 178
} | [
{
"body": "難問だと思いますが結果は <https://oeis.org/A001349> にあるので文献を漁るのがよさそうです\n\n頂点数0から10はこうなってます\n\n0 1 \n1 1 \n2 1 \n3 2 \n4 6 \n5 21 \n6 112 \n7 853 \n8 11117 \n9 261080 \n10 11716571",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-16T23:20:01.290",
"id": ... | 94205 | null | 94214 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "Spresenseにカメラを接続し \nAIで人間を検知し信号出すだけのサンプルプログラムとかありますでしょうか?",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-17T07:32:43.470",
"favorite_count": 0,
"id": "94219",
"last_activity_date": "2023-03-24T00:34:28.973",
"last_edit_date": "2023-03-17T07:33:18.070",
"last_editor_user_id": "57562",
"owner_user_id": "57562",
"post_type": "question",
"score": 0,
"tags": [
"spresense",
"arduino"
],
"title": "Spresense ai人間を検出し 信号を出すだけのやり方",
"view_count": 92
} | [
{
"body": "SpresenseのSDKで、TensorflowLMのPaersonDetectのサンプルを動かすコンフィグがありますね。\n\n./tools/config.py examples/tf_example_persondetect\n\nでコンフィグしてビルド出来ます。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-24T00:34:28.973",
"id": "94290",
"last_activity_date": "2023-... | 94219 | null | 94290 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "1.時間のフォーマットを変更したいですが、\n\n```\n\n df['datetime'] = pd.to_datetime(df['datetime'],format='%Y年%m月%d日 %H時%M分')\n \n```\n\nうまくいかないんです。 \n正しい書き方は何ですか。\n\n2.散布図の作り方、\n\n```\n\n plt.plot_date(datetime, temp)\n \n```\n\nうまくいかないんです。 \n正しい書き方は何ですか。 \nよろしくお願いします。\n\n[](https://i.stack.imgur.com/p90I3.jpg)",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-17T07:38:09.097",
"favorite_count": 0,
"id": "94220",
"last_activity_date": "2023-03-18T06:32:20.847",
"last_edit_date": "2023-03-18T06:32:20.847",
"last_editor_user_id": "3060",
"owner_user_id": "56371",
"post_type": "question",
"score": -2,
"tags": [
"python",
"pandas"
],
"title": "時系列のフォーマットを変更と描画",
"view_count": 106
} | [
{
"body": "`datetime` 項目が既に日時データである場合 \n@kunif 氏がコメントで記しているように `dt` アクセサで変換可能 \n(ちなみに `pd.to_datetime(STRING, formt='')` は文字列を日時データに変換する方法)\n\n```\n\n import pandas as pd\n import numpy as np\n rng = pd.date_range(start=\"2023-3-20\", periods=40, freq=\"30min\")\n df = pd.DataFrame({\n 'dat... | 94220 | null | 94222 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "flask_mail.Mailを用いて、Gmailを経由するメール送信をした。\n\nまずアプリケーションのコンフィグを設定し、アプリケーションをMailに登録する。\n\n```\n\n from flask_mail import Mail, Message\n \n app = Flask(__name__)\n \n app.config[\"MAIL_SERVER\"] = os.environ.get(\"MAIL_SERVER\")\n app.config[\"MAIL_PORT\"] = os.environ.get(\"MAIL_PORT\")\n app.config[\"MAIL_USE_TLS\"] = os.environ.get(\"MAIL_USE_TLS\")\n app.config[\"MAIL_USE_SSL\"] = os.environ.get(\"MAIL_USE_SSL\")\n app.config[\"MAIL_USERNAME\"] = os.environ.get(\"MAIL_USERNAME\")\n app.config[\"MAIL_PASSWORD\"] = os.environ.get(\"MAIL_PASSWORD\")\n app.config[\"MAIL_DEFAULT_SENDER\"] = os.environ.get(\"MAIL_DEFAULT_SENDER\")\n \n mail = Mail(app)\n \n```\n\nここで環境変数は次のように設定しておく。\n\nなお`MAIL_PASSWORD`はGmailのアプリパスワードである。\n\n```\n\n MAIL_SERVER=smtp.gmail.com\n MAIL_PORT=587\n MAIL_USE_TLS=True\n MAIL_USE_SSL=False\n MAIL_USERNAME=[myaddress@gmail.com]\n MAIL_PASSWORD=[ewmtzfkhzgbuxov]\n MAIL_DEFAULT_SENDER=Flaskbook <myaddress@gmail.com>\n \n```\n\n次にflask_mail.Messageを用いてメールの送信を行う。\n\nまず送信用の関数を作成する。\n\n```\n\n def send_email(to, subject, template, **kwargs):\n # to: 送信先メールアドレス\n # subject: メールのタイトル的なもの\n # template: テンプレート\n \n msg = Message(subject, recipients=[to])\n msg.body = render_template(template + \".txt\", **kwargs)\n msg.html = render_template(template + \".html\", **kwargs)\n \n mail.send(msg)\n \n```\n\nそしてフォームを作成し、メールを送信してみる。\n\n```\n\n # email: 送信先メールアドレス\n send_email(\n email,\n \"問い合わせありがとうございます。\",\n \"contact_mail\",\n username=username,\n description=description,\n )\n \n```\n\nすると、次のようなエラーが発生する。\n\n```\n\n File \"/Users/Desktop/Flask/apps/minimalapp/app.py\", line 97, in contact_complete\n send_email(\n File \"/Users/Desktop/Flask/apps/minimalapp/app.py\", line 116, in send_email\n mail.send(msg)\n File \"/Users/Desktop/Flask/venv/lib/python3.8/site-packages/flask_mail.py\", line 491, in send\n with self.connect() as connection:\n File \"/Users/Desktop/Flask/venv/lib/python3.8/site-packages/flask_mail.py\", line 144, in __enter__\n self.host = self.configure_host()\n File \"/Users/Desktop/Flask/venv/lib/python3.8/site-packages/flask_mail.py\", line 156, in configure_host\n host = smtplib.SMTP_SSL(self.mail.server, self.mail.port)\n File \"/opt/anaconda3/lib/python3.8/smtplib.py\", line 1034, in __init__\n SMTP.__init__(self, host, port, local_hostname, timeout,\n File \"/opt/anaconda3/lib/python3.8/smtplib.py\", line 253, in __init__\n (code, msg) = self.connect(host, port)\n File \"/opt/anaconda3/lib/python3.8/smtplib.py\", line 339, in connect\n self.sock = self._get_socket(host, port, self.timeout)\n File \"/opt/anaconda3/lib/python3.8/smtplib.py\", line 1040, in _get_socket\n new_socket = socket.create_connection((host, port), timeout,\n File \"/opt/anaconda3/lib/python3.8/socket.py\", line 808, in create_connection\n raise err\n File \"/opt/anaconda3/lib/python3.8/socket.py\", line 796, in create_connection\n sock.connect(sa)\n \n ConnectionRefusedError: [Errno 61] Connection refused\n \n```\n\n解決策をご教授お願いします。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-17T10:00:48.130",
"favorite_count": 0,
"id": "94223",
"last_activity_date": "2023-03-20T09:01:39.327",
"last_edit_date": "2023-03-17T10:06:25.183",
"last_editor_user_id": "26370",
"owner_user_id": "51540",
"post_type": "question",
"score": 0,
"tags": [
"python",
"flask",
"gmail"
],
"title": "Gmailを経由したflask-mailが送信できないエラー",
"view_count": 223
} | [
{
"body": "## 挙動の推定原因\n\n環境変数の内容とスタックトレースを見る限り、GmailのSMTPサーバーへ接続する際に本来の意図と違い、SSLを利用した接続をしようとしています。\n\n### 詳細\n\n環境変数として、`MAIL_USE_SSL=False`と質問文に記載されたもの **そのまま**\nを設定している場合、`os.environ`経由で取得する値は、`False`というbool値ではなく`\"False\"`という文字列となっています。\n\n`if`などの真偽値判定において、空でない文字列である`\"False\"`は`True`として扱われます。 \n結果として、本来`Fa... | 94223 | null | 94254 |
{
"accepted_answer_id": "94227",
"answer_count": 1,
"body": "### 実現したいこと\n\nWebサーバのアクセスログから送信元IP、宛先IP、宛先ポート番号、TCP/UDPの項目で整理したCSVファイルを取得しました。\n\nデータ内にそれぞれの要素(送信元IP、宛先IP、宛先ポート番号、TCP/UDP)の組み合わせが何件あるかを集計したい。\n\n[](https://i.stack.imgur.com/yrVv0.png)\n\n### これまでに試したこと\n\nPythonのPandasで以下のようなコードを使い、データの集計はできましたが、TCP/UDPの情報が集計データから消えてしまったため、TCP/UDPのデータを残しつつ、集計したい。\n\n```\n\n pd.pivot_table(index=\"送信元IP\", columns=[\"宛先IP\",\"宛先ポート番号\"],margins=True, margins_name=\"合計\", aggfunc=\"count\")\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-17T14:52:31.550",
"favorite_count": 0,
"id": "94225",
"last_activity_date": "2023-03-17T16:54:41.020",
"last_edit_date": "2023-03-17T16:11:40.910",
"last_editor_user_id": "3060",
"owner_user_id": "57568",
"post_type": "question",
"score": 0,
"tags": [
"python"
],
"title": "データの集計について",
"view_count": 72
} | [
{
"body": "※ データを1行増やしています\n\n```\n\n import pandas as pd\n import io\n \n csv_data = '''\n 送信元IP,宛先IP,宛先ポート番号,TCP/UDP\n 1.1.1.1,3.3.3.3,53,6\n 2.2.2.2,9.9.9.9,54,17\n 4.4.4.4,10.10.10.10,56,6\n 1.1.1.2,3.3.3.3,57,17\n 2.2.2.3,9.9.9.9,59,6\n 4.4.4.4,10.10.10.10,56,6\n '''\n ... | 94225 | 94227 | 94227 |
{
"accepted_answer_id": "94245",
"answer_count": 1,
"body": "現在Flutterの学習を進めております。学習の一環で、DoropdownButtonのアイテムに、IconやTextを含む自作したWidgetを使いたいと考え以下のコードを作成しました。実行したところ画面に描画はされるのですが、一度タップすると以下のエラーが発生してしまいアイテムの選択やその後の操作ができません。 \n(お恥ずかしながら、エラーメッセージを読んでも何を修正すればよいのか分からず。。。)\n\n【エラーメッセージ】\n\n```\n\n The following assertion was thrown building Container(AlignmentDirectional.centerStart, constraints: BoxConstraints(0.0<=w<=Infinity, 48.0<=h<=Infinity)):\n 'package:flutter/src/widgets/framework.dart': Failed assertion: line 5067 pos 12: 'state._element == null': is not true.\n \n```\n\nDropMenuItemのchildに指定できるWidgetの複雑さに制限があったり、そもそもDropdownMenuItemにはTextしか指定できないなど制約があったりするのでしょうか? \nDropdownButtonのアイテムに自作のWidgetを使用するにはどのように修正すればよいでしょうか。\n\n【コード】\n\n```\n\n import 'package:flutter/material.dart';\n \n void main() {\n runApp(\n MyApp()\n );\n }\n \n class MyApp extends StatelessWidget {\n \n Widget build(BuildContext context) {\n return MaterialApp(\n title: 'DropdownButton Test',\n home: MyHomePage(),\n );\n }\n }\n \n class MyHomePage extends StatefulWidget {\n \n State<MyHomePage> createState() {\n return _MyHomePageState();\n }\n }\n \n class _MyHomePageState extends State<MyHomePage> {\n \n List<DropdownMenuItem> _itemArray = [];\n \n _MyHomePageState() {\n for(int i = 0; i < 2; ++i) {\n _itemArray.add(\n DropdownMenuItem(\n value: i,\n child: MyListItem(i),\n )\n );\n }\n }\n \n void onChangedDropdownList(dynamic value) {\n print('onChangedDropdownList value = ${value}');\n }\n \n Widget build(BuildContext context) {\n return Scaffold(\n body: Center(\n child: Container(\n child: DropdownButton(\n value: 0,\n items: _itemArray,\n onChanged: onChangedDropdownList,\n )\n ),\n ),\n );\n }\n }\n \n class MyListItem extends StatefulWidget {\n \n late _MyListItemState _myListItemState;\n int _testIndex;\n \n MyListItem(\n this._testIndex,\n ) {\n _myListItemState = _MyListItemState(this);\n }\n \n State<StatefulWidget> createState() {\n return _myListItemState;\n }\n }\n \n class _MyListItemState extends State<MyListItem> {\n \n MyListItem _myListItem;\n \n _MyListItemState(\n this._myListItem,\n ) {\n \n }\n \n void _setStateSample() {\n setState(() {\n \n });\n }\n \n Widget build(BuildContext context) {\n return Container(\n color: Colors.yellow,\n child: Row(\n children: [\n Icon(Icons.person),\n Text('Test Index = ${_myListItem._testIndex}, '),\n Text('AAABBBCCC'),\n ],\n )\n );\n }\n }\n \n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-17T14:55:48.737",
"favorite_count": 0,
"id": "94226",
"last_activity_date": "2023-03-19T12:18:33.903",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57343",
"post_type": "question",
"score": 0,
"tags": [
"flutter"
],
"title": "Flutterで、DropdownButtonのアイテムに自作のWidgetを使うには",
"view_count": 47
} | [
{
"body": ">\n> DropMenuItemのchildに指定できるWidgetの複雑さに制限があったり、そもそもDropdownMenuItemにはTextしか指定できないなど制約があったりするのでしょうか?\n\n複雑だったり、大きかったりなどの理由で配置でエラーがでるかもしれないけど、今回のエラー原因は異なるようです。\n\n直接的な原因は、MyListItemのcreateStateで作るべきStateを、コンストラクタで作った物を返してるところかな。 \ncreateStateでは毎回新規にStateを作らないと駄目なはずが、そうではないのでフレームワーク内で必要とするオブジェクトがなくなって... | 94226 | 94245 | 94245 |
{
"accepted_answer_id": "94349",
"answer_count": 1,
"body": "現在EPSON TM-m10と言うレシートプリンタの制御で遊んでいます。 \nメーカー提供のJavaScriptライブラリのサンプルコードを使用し、Apacheサーバー上にtest.phpと言うスクリプトを作成し、ブラウザから以下のようなURLでアクセスすることで印刷は出来るようになりました。\n\n`http://192.168.100.100/test.php?id=123&data=456&price=12300`\n\nしかし、毎回プリンタとの接続からデバイスオブジェクトの作成など、コールバック関数の待ち時間が長い状況です。\n\n今回の質問は、新たにmachiuke.phpと言うスクリプトで、印刷直前(プリンタオブジェクトまで作成して待っている)の状況で状態を監視、リクエストが来たときにすぐに印刷できないかな?と考えています。 \n何分初心者故のため、的を射ていない質問で申し訳ありません。 \n数台のPCからリクエストしたいので、単一PCでブラウザを開いておく事は難しいです。\n\nそもそもこのやり方は間違っているなどがあれば教えて頂ければと思います。",
"comment_count": 5,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-17T22:04:08.633",
"favorite_count": 0,
"id": "94228",
"last_activity_date": "2023-03-28T02:30:26.163",
"last_edit_date": "2023-03-28T02:30:26.163",
"last_editor_user_id": "3060",
"owner_user_id": "44556",
"post_type": "question",
"score": 0,
"tags": [
"javascript"
],
"title": "webページでデータを監視する事は出来るのでしょうか?",
"view_count": 138
} | [
{
"body": "コメントのやりとりにて解決したようなので、記録として回答します。\n\nメーカー提供のJavascriptライブラリとはこちら。 \n[アプリケーション開発キット Epson ePOS\nSDK](https://partner.epson.jp/support/details/contents164/) \n[ドライバー・ソフトウェア基本情報(Epson ePOS SDK for\nJavaScript)](https://www.epson.jp/dl_soft/readme/35962.htm)\n\nただし、こちら英語サイトの方が新しい版数になっています。 \n[Epson ePO... | 94228 | 94349 | 94349 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "Google Cloud Vision API に画像を送信した時、どこの国に設置されているサーバに向けて送信されるのでしょうか。\n\nサンプルコードを元にプログラムを作成し、動いています。 \nですが認証に使用されるURLはアメリカのサーバですし、それ以外に国や地域を指定しているような場所が見当たりません。 \nまさか全てをアメリカのサーバで処理しているとも思えません。 \nCloud Console からプロジェクトの設定を確認したところ、リージョンとゾーンは設定なしの状態でした。\n\n1.どこの国のサーバで画像を処理しているのか \n2.送信先はどのように決定されているのか\n\nについてご存じないでしょうか。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-18T00:32:11.537",
"favorite_count": 0,
"id": "94229",
"last_activity_date": "2023-03-18T00:32:11.537",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57570",
"post_type": "question",
"score": 0,
"tags": [
"google-cloud"
],
"title": "Google Cloud Vision API に画像を送信した時に、どこの国のサーバに送られるのか知りたい",
"view_count": 36
} | [] | 94229 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "githubにて以下のようなブランチ構成で作業をしています。\n\n * mainブランチ:実際のサーバーにデプロイする状態のコードを反映\n * developブランチ:作業内容を反映してテストするブランチ\n * featureブランチ:作業を行うブランチ\n\nコードの修正時は、featureブランチで作業をしてdevelopへマージし、テストを行なって問題なければmainへマージする流れです。 \ndevelopからmainへマージすると、mainに以下のようなマージコミットが追加されると思います。\n\n```\n\n Merge pull request #1 from hoge/develop\n \n```\n\nこの状態でdevelopブランチをgithub上で確認すると、`This branch is 1 commit behind main.`\nとなっています。当然、マージコミット分遅れているのはわかるのですが、これだとdevelopブランチを作り替えない限り、マージするごとにどんどん遅れていくことになるかなと思いました。逆に上記の状態でmain→developのマージをしても今度はdevelopが先行してしまいます。\n\n質問としては\n\n 1. 一般的には、このような問題は起きないのでしょうか?\n 2. ブランチモデル的にも珍しい使い方だとは思っていないのですが、マージし終わったブランチは都度削除する運用が一般的なのでしょうか?(今回のdevelopブランチのような商用リリース前のstagingのような使い方をするブランチ)\n 3. この問題を解決する良い方法は何かありますか?",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-18T04:18:35.800",
"favorite_count": 0,
"id": "94231",
"last_activity_date": "2023-05-24T01:06:25.250",
"last_edit_date": "2023-05-20T07:58:12.073",
"last_editor_user_id": "3060",
"owner_user_id": "57574",
"post_type": "question",
"score": 0,
"tags": [
"git",
"github"
],
"title": "githubでdevelopブランチをmainブランチへマージした際の状態について",
"view_count": 253
} | [
{
"body": "[A successful Git branching model](https://nvie.com/posts/a-successful-git-\nbranching-model/)(俗に言う git-flow)のreleaseブランチが省略された運用になっているのかと思われますが。\n\n> 一般的には、このような問題は起きないのでしょうか?\n\nリンク先の図の通り、普通の状態です。 \nつまりそもそも問題とは捉えられていません。\n\n>\n> ブランチモデル的にも珍しい使い方だとは思っていないのですが、マージし終わったブランチは都度削除する運用が一般的なのでしょうか?(今回のde... | 94231 | null | 94953 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "要旨: \n学習を行う環境の制約上,学習の経過を一旦保存しそれらを読み込んで学習を再開するコードを書く必要があります.しかし,エラーが出てしまい学習が行えません.\n\nエラー文:\n\n```\n\n Traceback (most recent call last):\n File \"c:/Users/.../Desktop/PINN_ACSL/NN.py\", line 531, in <module>\n optimizer.step(PINN.closure)\n File \"C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\torch\\optim\\optimizer.py\", line 140, in wrapper\n out = func(*args, **kwargs)\n File \"C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\torch\\autograd\\grad_mode.py\", line 27, in decorate_context\n return func(*args, **kwargs)\n File \"C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\torch\\optim\\lbfgs.py\", line 352, in step\n y = flat_grad.sub(prev_flat_grad)\n TypeError: sub(): argument 'other' (position 1) must be Tensor, not NoneType\n \n```\n\n使用しているオプティマイザは`torch.optim.LBFGS`です. \nセーブには`torch.save(optimizer.state_dict(), PATH)`を, \nロードには`optimizer.load_state_dict(torch.load(PATH))`を使っています.\n\n`print(torch.load(PATH))`では学習率やtensorの値が見られるのに, \n`print(optimizer.load_state_dict(torch.load(PATH)))`ではNoneが返されるのが疑問です. \nよろしくお願いいたします.",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-18T07:21:32.827",
"favorite_count": 0,
"id": "94235",
"last_activity_date": "2023-03-18T07:21:32.827",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57579",
"post_type": "question",
"score": 0,
"tags": [
"python",
"pytorch"
],
"title": "optimizer.state_dict()で保存したオプティマイザのパラメータを使って学習の再開ができません",
"view_count": 46
} | [] | 94235 | null | null |
{
"accepted_answer_id": "94237",
"answer_count": 2,
"body": "現在個人的に使用する言語をJavaからPythonに置き換えてるのですが、Javaで書いた大きなプログラムもあるため一部をPythonで書き、そこで取得した文字列を昔書いたJavaのプログラムに送り処理したいと考えています。\n\n**追記:ローカルで動かしているプログラム間です**\n\nPythonで取得した文字列を逐次的にJavaプログラムに送る方法、あるいはもっと一般的にアプリ間でデータを送受信する方法は無いでしょうか? \n文字列をファイルに書き込みそれを読み取るという方法も考えましたが、ラグが生じ、またHDD/SSDへの頻繁な読み書きが必要なため直接データの送受信したいと思います。\n\n具体的にやりたい事は以下の通りなのでこれが解決できる手段が他にあればそれでも構いません:\n\n 1. [MisskeyボットをPythonで作る - Qiita](https://qiita.com/CyberRex/items/e49828dba8e5867d8b26)に書かれてる方法でMisskeyのグローバルタイムラインを取得する\n 2. 取得したノートをJavaで書いたコードで処理する\n\n以上、よろしくお願いします。",
"comment_count": 7,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-18T09:21:03.047",
"favorite_count": 0,
"id": "94236",
"last_activity_date": "2023-04-12T09:59:30.313",
"last_edit_date": "2023-03-18T10:53:33.653",
"last_editor_user_id": "816",
"owner_user_id": "816",
"post_type": "question",
"score": 1,
"tags": [
"python",
"java",
"misskey"
],
"title": "Pythonで取得した文字列をJavaで作成したアプリに送る方法(あるいは一般的にアプリ間でデータを送受信する方法)",
"view_count": 424
} | [
{
"body": "開発言語やOSの異なるプログラム間での通信を行う場合、TCP/IP(socket)を使うのがよいと思います。\n\n**処理の流れ**\n\n 1. あらかじめJava側のTCP/IP(socket)サーバを立ち上げておく\n 2. Python側からJava側へ、なんらかの処理依頼を送信する\n 3. Java側で依頼されたなんらかの処理を実行し、処理結果をPython側へ送信する\n 4. Python側で処理結果を受信する\n\n**Java側のコード例**\n\n```\n\n import java.io.BufferedReader;\n import java.... | 94236 | 94237 | 94237 |
{
"accepted_answer_id": "94240",
"answer_count": 1,
"body": "2つのデータを結合して、重複するデータがあれば合算したい。\n\n```\n\n # データ1\n df1 = pd.DataFrame({\"送信元IP\": [1.1.1.1, 3.3.3.3, 5.5.5.5], \n \"宛先IP\": [2.2.2.2, 4.4.4.4, 6.6.6.6], \n \"宛先ポート\": [53, 55, 22],\n \"合計\":[1,1,1]})\n # データ2\n df2 = pd.DataFrame({\"送信元IP\": [1.1.1.1, 3.3.3.3, 5.5.5.5], \n \"宛先IP\": [2.2.2.2, 4.4.4.4, 6.6.6.6], \n \"宛先ポート\": [53, 55, 22],\n \"合計\":[1,1,1]})\n \n```\n\n### これまでに試したこと\n\nConcatを使ってdf1とdf2を結合した後、以下のコードで合計欄を結合後の値になるようにしました。\n\n```\n\n df3=pd.concat([\"df1\",\"df2\",ignore_index=True)\n dfx = df3.groupby(df.columns.tolist(), as_index=False).size().rename({'size': '合計'}, axis=1)\n print(dfx)\n \n```\n\n理想としては、2つのデータを結合した際に重複する値に関しては、合計欄が合算した値になるようにしたいです。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-18T16:59:04.073",
"favorite_count": 0,
"id": "94238",
"last_activity_date": "2023-03-19T04:28:12.247",
"last_edit_date": "2023-03-19T04:28:12.247",
"last_editor_user_id": "3060",
"owner_user_id": "57568",
"post_type": "question",
"score": 0,
"tags": [
"python",
"pandas"
],
"title": "データの結合と合算",
"view_count": 92
} | [
{
"body": "```\n\n import pandas as pd\n \n df1 = pd.DataFrame({\n \"送信元IP\": ['1.1.1.1', '3.3.3.3', '5.5.5.5'],\n \"宛先IP\": ['2.2.2.2', '4.4.4.4', '6.6.6.6'],\n \"宛先ポート\": [53, 55, 22],\n \"合計\":[1,1,1]\n })\n \n df2 = pd.DataFrame({\n \"送信元IP\": ['1.1.1.1',... | 94238 | 94240 | 94240 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "Discord.jsを用いてBotを作成しているものです。 \nこのbotには、以下の機能が搭載されています。\n\n<ロール管理> \n・!login ロール名:ロール取得 \n・!logout ロール名:ロール剥奪\n\n<サーバー管理> \n・testロール所有者の送信テキストの代理送信 \n・mutedロール所有者の送信テキストの削除\n\nコードの記述順は上の通りです。\n\n以下はサーバー管理の部分のコードになります。\n\n```\n\n client.on('messageCreate', msg => {\n if (msg.member.roles.cache.some(role => role.name === 'test')) {\n msg.delete();\n msg.channel.send(`test: ${msg.content}`);\n }\n \n //mutedロール所有者のメッセージ削除\n if (msg.member.roles.cache.some(role => role.name === 'muted')) {\n msg.delete();\n }\n \n });\n \n```\n\nこの部分の”mutedロール所有者のメッセージ削除”の部分が悪さをしているのか、mutedロールを所有しているユーザーが!logout\nmutedを実行しようとするとbotがエラーを起こし止まってしまいます。\n\n内部処理としては\n\n 1. !logout mutedを検知する\n 2. mutedロールを持つユーザーかどうかチェックする\n 3. 2がtrueならメッセージ削除、falseならそのまま残す\n 4. 3の結果に問わずlogoutの処理が実行されるが、メッセージが削除されている場合!logout mutedの検知に失敗してエラーを起こす\n\nとなっていると思うのですが、これの対処法を教えていただきたいです。 \n2の処理でreturnを嚙ませるとこれまたエラーを吐いてbotが停止します。",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-18T17:06:36.230",
"favorite_count": 0,
"id": "94239",
"last_activity_date": "2023-08-05T19:13:39.653",
"last_edit_date": "2023-03-19T05:21:40.660",
"last_editor_user_id": "3060",
"owner_user_id": "57585",
"post_type": "question",
"score": 0,
"tags": [
"javascript",
"discord"
],
"title": "サーバー管理botのエラー(Discord.js)",
"view_count": 117
} | [
{
"body": "良い解答になるかよくわかりませんが、提供されているコードだけでは、正確な修正点などをお答えすることはできませんね。\n\nやりたい機能については、スラッシュコマンドを使用した方が簡単でいいと思います。\n\n何かあれば、言っていただければ代理でBOTの作成など行えますm(__)m",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-08-05T19:13:39.653",
"id": "95863",
"last_activity_date": "2... | 94239 | null | 95863 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "クラウドサービスでJSON等のデータを投げたらPDFを返してくれるようなサービスはありませんでしょうか? \n現在ウェブシステム開発時には何かしらのPDF生成モジュールを使ってXY座標を計算しながらPDF帳票を生成しています。 \n非常に生産性が悪いと思いますので、グラフィカルに帳票をデザインしてJSONデータ等をPOSTしたら自動的にPDFデータを生成してくれるようなサービスはありませんでしょうか?\n\n※補足 \nWindowsデスクトップのツール等はいくつか見つけているのですが、デザイン含めクラウドで完結出来るツールを探しています。理由はシステム利用者の方がご自身でデザインの調整を行う事が多い為です。",
"comment_count": 4,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-19T02:27:48.647",
"favorite_count": 0,
"id": "94242",
"last_activity_date": "2023-03-19T02:27:48.647",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "22529",
"post_type": "question",
"score": 0,
"tags": [
"pdf"
],
"title": "クラウドサービスでJSON等のデータを投げたらPDFを返してくれるようなサービスはありませんでしょうか?",
"view_count": 99
} | [] | 94242 | null | null |
{
"accepted_answer_id": "94250",
"answer_count": 1,
"body": "##### 質問内容\n\n`Player`クラスのコンストラクタの配列で継承している親クラス`GameObject`の参照を入れてそれを`Player_Controller`クラスのコンストラクタに入れてそれを親クラスの`Component`クラスに入れてそれを \n`Player_Controller`クラスで利用したいのですが現状では`Playr`クラスの`///`コメント部 `new\nPlayer_Controller(this.GameObject)`にて`this.GameObject`をしていまっていて新しい変数を用意してしまっている事により以下のエラーが出て`プロパティx`が参照できないという結果になってしまっているのですがどうやって子クラスから親クラスの参照取るのでしょうか?`C++`でいう`this`のようなことがしたいです。\n\n##### 知りたいこと\n\n`Player.js`のコメント部にて親クラスの参照を取る方法が知りたい\n\n#### 調べたこと\n\nサイトA:https://magazine.techacademy.jp/magazine/22392 \nサイトB:https://developer.mozilla.org/ja/docs/Web/JavaScript/Inheritance_and_the_prototype_chain\n\n##### 環境\n\nOS: Windows10 \nブラウザ: chrome \n利用ライブラリ: p5\n\n##### GameObject.js\n\n```\n\n \"use strict\"\n \n class GameObject\n {\n constructor()\n {\n this.position = new Vector(0,0);\n }\n \n Update()\n {\n \n }\n \n Update()\n {\n \n } \n \n }\n \n```\n\n##### Player_Controller.js\n\n```\n\n \"use strict\"\n \n class Player_Controller extends Component\n {\n // ################################ コンストラクタ ################################ \n constructor(go)\n {\n super(go);\n }\n \n // ################################ Start ################################ \n Start()\n {\n \n }\n \n // ################################ Update ################################ \n Update()\n {\n if(keyIsDown(LEFT_ARROW) == true)\n {\n super.gameObject.position.x += -10;\n }\n else if(keyIsDown(RIGHT_ARROW) == true)\n {\n super.gameObject.position.x += 10;\n }\n }\n \n }\n \n```\n\n##### Component.js\n\n```\n\n \"use strict\"\n \n class Component\n {\n // ################################ コンストラクタ ################################ \n constructor(go)\n {\n this.gameObject = go;\n }\n \n // ################################ Start ################################ \n Start()\n {\n \n }\n \n \n // ################################ Update ################################ \n Update()\n {\n \n }\n \n }\n \n```\n\n##### Player.js\n\n```\n\n \"use strict\"\n \n class Player extends GameObject\n {\n // ################################ コンストラクタ ################################ \n constructor()\n {\n super();\n ////////////////////////////////////////////////////////////////////////\n this.array = [\n new Player_Controller(this.GameObject)\n ];\n this.player_sprite = loadImage(\"asset/player.png\");\n /////////////////////////////////////////////////////////////////////////\n \n }\n \n // ################################ Update ################################ \n Update()\n {\n this.array[0].Update();\n }\n \n // ################################ Render ################################ \n Render()\n {\n \n image(this.player_sprite,this.position.x,this.position.y);\n }\n }\n \n \n```\n\n##### Vector.js\n\n```\n\n const PI = 3.14159; //円周率\n const sinSpeed = PI / 100.0; //sin波 加算\n const speed = 10; //移動速度\n \n //ベクトルの引き算 \n //引数 Vector型\n function VectorSub(a,b)\n {\n let xx = a.x - b.x;\n let yy = a.y - b.y;\n \n return new Vector(xx,yy);\n }\n \n \n \n function Range(a,b)\n {\n return sqrt((a.x * a.x) + (b.y * b.y));\n }\n \n \n \n \n //ベクター\n class Vector\n {\n add(other)\n {\n console.assert(other instanceof Vector);\n \n return new Vector(this.x + other.x,this.y + other.y);\n }\n \n \n constructor(xx,yy)\n {\n this.x = xx;\n this.y = yy;\n } \n }\n \n \n //線分\n class LineSegment\n {\n constructor(a,b)\n {\n this.start = new Vector(a.x,a.y);\n this.end = new Vector(b.x,b.y); \n }\n }\n \n \n```\n\n##### Error\n\n```\n\n Uncaught TypeError: Cannot read properties of undefined (reading 'position')\n at Player_Controller.Update (Player_Controller.js:26:30)\n at Player.Update (Player.js:19:23)\n at Game.Update (Game.js:19:21)\n at draw (Main.js:17:10)\n at _main.default.redraw (p5.js:70809:27)\n at _draw (p5.js:63046:25)\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-19T02:54:01.333",
"favorite_count": 0,
"id": "94243",
"last_activity_date": "2023-03-21T12:42:01.563",
"last_edit_date": "2023-03-21T12:42:01.563",
"last_editor_user_id": "-1",
"owner_user_id": "55177",
"post_type": "question",
"score": 0,
"tags": [
"javascript"
],
"title": "Javascript 子クラスで自分の親クラスの参照を渡す方法が知りたい",
"view_count": 190
} | [
{
"body": "派生クラスの参照は基底クラスの参照として扱えますので、\n\n```\n\n new Player_Controller(this)\n \n```\n\nでよいでしょう。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-19T21:48:52.157",
"id": "94250",
"last_activity_date": "2023-03-19T21:48:52.157",
"last_e... | 94243 | 94250 | 94250 |
{
"accepted_answer_id": "94263",
"answer_count": 1,
"body": "google colaboratoryでPythonを使っています。`pip install`\nなどの外部ライブラリから引用するコマンドが使えません。pip自体に「\"pip\" is not\ndefined」というエラー出るので、pipのバージョンの問題ではないと思います。\n\nPython初心者なので、提示する情報が足りていないかもしれませんが答えていただけると幸いです。よろしくお願いします。\n\n### エラー\n\n```\n\n File \"<ipython-input-1-b0bfe1142762>\", line 2\n pip install pycryptodome\n ^\n SyntaxError: invalid syntax\n \n```\n\n### コード\n\n```\n\n pip install pycryptodome\n from Crypto.Util import number\n \n def elgamal_gen_key(bits):\n while True:\n q = number.getPrime(bits-1)\n p = 2*q + 1\n if number.isPrime(p):\n break\n \n while True:\n g = number.getRandomRange(3, p)\n if pow(g, 2, p) == 1:\n continue\n if pow(g, q, p) == 1:\n continue\n break\n x = number.getRandomRange(2, p-1)\n y = pow(g, x, p)\n return (p, g, y), x\n def elgamal_encrypt(m, pk):\n p, g, y = pk\n assert(0 <= m < p)\n r = number.getRandomRange(2, p-1)\n c1 = pow(g, r, p)\n c2 = (m * pow(y, r, p)) % p\n return (c1, c2)\n def elgamal_decrypt(c, pk, sk):\n p, g, y = pk\n c1, c2 = c\n return (c2 * pow(c1, p - 1 - sk, p)) % p\n \n pk, sk = elgamal_gen_key(bits=20)\n print('pk:', pk) \n print('sk:', sk) \n print()\n \n m = 314159 # 平文\n print('m:', m)\n c = elgamal_encrypt(m, pk) # 暗号化\n print('c:', c)\n d = elgamal_decrypt(c, pk, sk) # 復号\n print('d:', d)\n \n```",
"comment_count": 4,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-19T14:49:28.847",
"favorite_count": 0,
"id": "94247",
"last_activity_date": "2023-03-22T01:50:27.077",
"last_edit_date": "2023-03-22T01:50:27.077",
"last_editor_user_id": "3060",
"owner_user_id": "57597",
"post_type": "question",
"score": 0,
"tags": [
"python",
"google-colaboratory",
"pip"
],
"title": "Google Colab で pip install が使用できない",
"view_count": 495
} | [
{
"body": "原因は`pip install pycryptodome`の行と、それ以後の行を同じセルに入力しているからですね。\n\n`pip install pycryptodome`だけを単独のセルに入力して、`from Crypto.Util import\nnumber`以後の内容を次のセルに分けて入力し、順番に実行すれば問題無く動作します。\n\nなお一応、`pip install pycryptodome`の行は、頭に`!`を入れて`!pip install\npycryptodome`としておきましょう。",
"comment_count": 0,
"content_licen... | 94247 | 94263 | 94263 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "Pchartを使っており、ローカルで実行するとうまく表示できますが、VPSサーバにアップすると綺麗にchartが表示されません。 \n何か現在がわかりますか。よろしくお願い致します。\n\n[](https://i.stack.imgur.com/IM7Wn.jpg)",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-19T16:39:36.117",
"favorite_count": 0,
"id": "94248",
"last_activity_date": "2023-03-20T02:03:52.457",
"last_edit_date": "2023-03-20T02:03:52.457",
"last_editor_user_id": "3060",
"owner_user_id": "57598",
"post_type": "question",
"score": 0,
"tags": [
"cakephp",
"pchart"
],
"title": "pchart のグラフが綺麗に表示されない",
"view_count": 31
} | [] | 94248 | null | null |
{
"accepted_answer_id": "94253",
"answer_count": 2,
"body": "どのようにプログラムを組み立てたらよいか、概略をご教示いただきたく質問いたしました。\n\n### 実現したいこと\n\n「ichiran.xlsx」ファイルと「kyou.xlsx」ファイルがあります。\n\n「ichiran.xlsx」ファイルに「kyou.xlsx」ファイルの内容を反映させることを実現したいと考えています。\n\n### 試したこと\n\n以下を試しましたが、2つのファイルに同じbangouがあっても、同じセルにないと認識されませんでした。\n\n```\n\n import openpyxl as excel\n import pandas as pd\n import numpy as np\n \n wb1 = excel.load_workbook(r'kinou.xlsx')\n wb2 = excel.load_workbook(r'kyou.xlsx')\n \n ws1 = wb1.active\n ws2 = wb2.active \n \n for row in ws1:\n for cell in row:\n if ws1[cell.coordinate].value != ws2[cell.coordinate].value:\n print(cell.coordinate)\n \n```\n\nそこで以下のようにプログラムの立て方を考えました。しかしこれでは何かが不足していると思います。 \nどのようにプログラムを組み立てたらいいかご教示いただきたくお願いいたします。\n\n### プログラムの組み立て方\n\n * 「ichiran.xlsx」ファイルと「kyou.xlsx」ファイルを読み込む。\n * 「ichiran.xlsx」ファイルと「kyou.xlsx」ファイルそれぞれに関し、1行分を辞書にしてリストをfor文で格納する。\n * if文で「ichiran.xlsx」ファイルのbangouと「kyou.xlsx」ファイルのbangouが一致すればkaishusuとkanryosuを「ichiran.xlsx」ファイルに上書きする。\n * 「ichiran.xlsx」ファイルのbangouと「kyou.xlsx」ファイルのbangouが一致しなければ「ichiran.xlsx」ファイルにその行を最後に追加する。\n\n### 対象のExcelファイル\n\nichiran.xlsxファイル \n[](https://i.stack.imgur.com/T4G5E.png)\n\nkyou.xlsx \n[](https://i.stack.imgur.com/QvLGD.png)",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-19T17:21:36.533",
"favorite_count": 0,
"id": "94249",
"last_activity_date": "2023-03-23T12:25:15.213",
"last_edit_date": "2023-03-20T01:07:33.410",
"last_editor_user_id": "3060",
"owner_user_id": "57596",
"post_type": "question",
"score": 0,
"tags": [
"python",
"アルゴリズム"
],
"title": "PythonでExcelファイルを比較し更新箇所を上書きするプログラムの組み立て方を教えてください",
"view_count": 333
} | [
{
"body": "もっと効率的なやり方はあると思いますが、このような形で作れます。\n\nichiran.xlsx->data.xlsx \nkyou.xlsx->data01.xlsx \nとし、カラム名は、番号、改修、完了と置き換え、番号列をデータキーとして判断しています。 \nシート名が同じであるという前提条件も入れています。 \nオリジナルデータにない、シート名、カラム名は無視されることになります。 \n更新/追記を伴って、番号列はソートされて新しいエクセルファイルが生成されるようにしています。 \nカラムをもと通りの順にするのは、面倒で省略してしまいました。\n\n```\n\n im... | 94249 | 94253 | 94253 |
{
"accepted_answer_id": "94257",
"answer_count": 1,
"body": "DELLのDell EMC PowerEdge T150というハードを使用しています。 \nOSはWindows Server 2019をインストール済みです。\n\nサーバー機をWake on LANで起動させることは珍しいかもしれませんが、諸事情により必要な状況です。 \nBIOSの設定画面にはWake on LANのEnable/Disableの設定があり、Enableにしています。 \n[https://www.dell.com/support/manuals/ja-\njp/poweredge-t150/pet150_bios_ism_pub/%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0-bios?guid=guid-\ncf672af3-f0e7-4b34-9ccc-304720ffa838&lang=ja-\njp](https://www.dell.com/support/manuals/ja-\njp/poweredge-t150/pet150_bios_ism_pub/%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0-bios?guid=guid-\ncf672af3-f0e7-4b34-9ccc-304720ffa838&lang=ja-jp)\n\nWOLのパケットは送る側からですが、送っていることをWiresharkで確認済みです。 \nしかし起動しません...\n\n万策尽きた状態のため、こちらに質問させていただきました。\n\n何か考えられる原因がありますでしょうか。 \n※そもそもサーバー用途の機器(LANアダプタ)でWake on Lanは機能しない?",
"comment_count": 3,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-20T10:30:59.740",
"favorite_count": 0,
"id": "94256",
"last_activity_date": "2023-03-20T11:42:21.900",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "12388",
"post_type": "question",
"score": 0,
"tags": [
"network"
],
"title": "サーバー機でWake on Lanは機能しないのでしょうか?",
"view_count": 213
} | [
{
"body": "私自身は実際に使用したことが無く、あくまで今回調べた範囲での回答になります。\n\n * リンク先のマニュアルには Wake on LAN に関する記載が見当たらないように見えます。\n\n * WoL を利用するには BIOS 設定だけでなく、対応する NIC (ネットワークカード) や OS 上での設定も必要となります。Dell 製品の場合は以下リンク先も参照してみてください。\n\n[Dell製システムでWake On LAN(WoL)をセットアップする方法](https://www.dell.com/support/kbdoc/ja-\njp/000175283/%E3%82%BB%... | 94256 | 94257 | 94257 |
{
"accepted_answer_id": "94272",
"answer_count": 1,
"body": "「DefWindowProc()」の動作についていくつか質問があります。既知のメッセージごとに「DefWindowProc()」のすべての動作を正確に説明する集中管理された\nMSDN ドキュメントはありますか?\n\nプログラマーは、インターネットコミュニティで検索したり、Windows API をテストしたりせずに、その影響をどのように知ることができますか?\n\nたとえば、「WM_MOUSEMOVE」ページ (<https://learn.microsoft.com/en-\nus/windows/win32/inputdev/wm-mousemove>)\nを見てみましょう。他のほとんどすべてのメッセージの説明と同様に、多くの質問が寄せられます:\n\n 1. 「DefWindowProc()」の呼び出しを省略した場合、エディタは新しいマウス カーソルの位置を無視しますか? (以下のコードを参照)\n``` if (Msg == WM_MOUSEMOVE) return 0; // No call to\n\"DefWindowProc()\", what is the effect?\n\n \n```\n\n 2. 「lParam」の値を変更して、コンポーネントへの影響をカスタマイズできますか? (以下のコードを参照)\n``` if (Msg == WM_MOUSEMOVE) {\n\n \n int new_X = my_translator_x(GET_X_LPARAM(lParam));\n int new_Y = my_translator_y(GET_Y_LPARAM(lParam));\n \n lParam = MAKELPARAM(new_X, new_Y);\n \n return DefWindowProc(hWnd, Msg, wParam, lParam); // I modified the lParam, is it supported?\n \n }\n \n```\n\n 3. アプリケーションがメッセージを処理する場合、アプリケーションは「return zero」を実行する必要があると言われています。これは明らかですが、\"DefWindowProc()\" を呼び出す必要があるかどうかの手がかりにはなりません。 メッセージの処理と \"DefWindowProc()\" の呼び出しの両方を行う場合、何を「return」する必要がありますか? (以下のコードを参照)\n``` if (Msg == WM_MOUSEMOVE) {\n\n \n custom_actions_before_the_standard_behaviour(hWnd);\n \n LRESULT res = DefWindowProc(hWnd, Msg, wParam, lParam);\n \n custom_actions_after_the_standard_behaviour(hWnd);\n \n return res; // I feel natural to return the result of DefWindowProc, but I processed the message, should I rather return zero to be documentation-conformant?\n \n }\n \n```\n\nもちろん、誰かがこれらの特定の質問に答えてくれたらうれしいですが、確かにインターネットのどこかにすでに良い答えがありますが、これらのような質問は他にもたくさんあります.\nこれが、この件に関するより完全なドキュメントを探している理由です。 標準的なメッセージ動作の完全なリストはどこかにありますか?\n\nヒントをお寄せいただきありがとうございます。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-20T20:08:51.157",
"favorite_count": 0,
"id": "94258",
"last_activity_date": "2023-03-22T09:23:02.273",
"last_edit_date": "2023-03-21T00:35:53.393",
"last_editor_user_id": "54819",
"owner_user_id": "54819",
"post_type": "question",
"score": 1,
"tags": [
"c",
"winapi"
],
"title": "「DefWindowProc()」のすべての動作は何ですか?",
"view_count": 226
} | [
{
"body": "わかる範囲で答てみます。\n\n(A)「DefWindowProc()」のすべての動作を正確に説明する集中管理された MSDN ドキュメントはありますか? \n=>無いという認識です。 \n各メッセージにDefWindowProcに渡された場合の動作について説明されている場合があります。 \n説明されている例)WM_SETTEXT、説明されていない例)WM_QUIT 等\n\n(B)1.「DefWindowProc()」の呼び出しを省略した場合、・・・ \n=>誤ったコードです。 \nデフォルトの処理を無視する必要がある場合、を除いて、 \n全てのメッセージをデフォルトプロシージャに... | 94258 | 94272 | 94272 |
{
"accepted_answer_id": null,
"answer_count": 3,
"body": "Pythons初心者ですので、質問が不作法の場合ご容赦くださいませ。\n\n## 環境\n\n * Windows 11\n * Pyhton 3.11.2\n * openpyxl 3.1.2\n\n## 質問\n\n 1. Pythonのコードで、エクセルで(ALT+ENTER)で改行されているセルの値を改行なしに変換。\n 2. 1.と同様にセル内に全角と半角のスペースを削除。\n 3. セル内の値は左詰め。\n\n問題点の指摘とコードの改善をご指導いただけますと幸甚です。\n\nコードは以下の通りです。\n\n```\n\n import openpyxl\n from tkinter import Tk\n from tkinter.filedialog import askopenfilename\n \n Tk().withdraw()\n filename = askopenfilename()\n \n wb = openpyxl.load_workbook(filename)\n ws = wb.active\n \n for row in ws.iter_rows():\n for cell in row:\n if cell.value and isinstance(cell.value, str): \n print(repr(cell.value))\n cell.value = cell.value.replace('\\n', '').replace(' ', '').replace(' ', '')\n cell.alignment = openpyxl.styles.Alignment(horizontal='left') \n \n new_filename = filename.replace('.xlsx', '-改行解除.xlsx')\n wb.save(new_filename)\n \n```",
"comment_count": 4,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-20T23:37:58.173",
"favorite_count": 0,
"id": "94259",
"last_activity_date": "2023-03-23T03:11:21.880",
"last_edit_date": "2023-03-22T01:48:33.020",
"last_editor_user_id": "3060",
"owner_user_id": "57612",
"post_type": "question",
"score": 0,
"tags": [
"python",
"python3",
"openpyxl"
],
"title": "Excel のセル内の改行文字を Python のコードで削除したい",
"view_count": 843
} | [
{
"body": "「(ALT+ENTER)で改行されているセル」と同等の内容と思われるCSVファイルからExcelで変換して作成した.xlsxファイルに対して質問のスクリプトを実行すると、スクリプト中の`print(repr(cell.value))`の表示では`_x000D_`(もしくは`_x000D_\\n`?)という文字列が入っています。\n\nそれで検索すると以下のような記事が見つかります。 \n[エクセルファイルに _x000D_\nという文字列が挿入されるトラブルと解決法](https://oshiete.goo.ne.jp/qa/11892517.html) \n[ディクレ サポートBBS - ... | 94259 | null | 94279 |
{
"accepted_answer_id": "94266",
"answer_count": 2,
"body": "提示コードの`///`コメント部内部のコードなのですが、上の`Component`を親クラスとして子クラス`Renderer`クラスを生成したいのですが以下のエラーが出ますこれはなぜでしょうか?\n\n##### 試したこと\n\nコメント部内部のように実験\n\n##### エラー\n\n```\n\n FrameWork.js:46 Uncaught ReferenceError: Component is not defined\n at FrameWork.js:46:38\n (anonymous) @ FrameWork.js:46\n Script.js:4 Uncaught TypeError: Cannot read properties of undefined (reading 'GameObject')\n at Script.js:4:32\n (anonymous) @ Script.js:4\n Script.js:33 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'GameObject')\n at setup (Script.js:33:27)\n at p5._setup (p5.js:62985:27)\n at p5._start (p5.js:62908:25)\n at new p5 (p5.js:63261:22)\n at _globalInit (p5.js:62189:17)\n setup @ Script.js:33\n _setup @ p5.js:62985\n _start @ p5.js:62908\n p5 @ p5.js:63261\n _globalInit @ p5.js:62189\n Promise.then (async)\n 280.../core/main @ p5.js:62214\n o @ p5.js:34\n (anonymous) @ p5.js:38\n 267../accessibility/color_namer @ p5.js:54831\n o @ p5.js:34\n r @ p5.js:51\n (anonymous) @ p5.js:55\n (anonymous) @ p5.js:18\n (anonymous) @ p5.js:20\n \n```\n\n```\n\n \"use strict\"\n \n var FrameWork = \n {\n \n \n \n /*##########################################################\n # GameObject\n 説明\n シーンに存在するオブジェクト\n ############################################################*/\n GameObject : class GameObject \n {\n constructor()\n {\n \n } \n },\n \n /*##########################################################\n # Component\n 説明\n シーンに存在するオブジェクト\n ############################################################*/\n Component : class Component\n {\n constructor()\n {\n \n } \n \n Update()\n {\n alert('オーバーライドされていません。');\n \n }\n },\n \n /////////////////////////////////////////////////////////////////////////////////////////////////\n /*##########################################################\n # Renderer\n 説明\n レンダリング\n ############################################################*/\n Renderer: class Renderer extends Component\n //Renderer: class Renderer extends Component.Component\n //Renderer: class Renderer extends FrameWork.Component.Component\n {\n constructor()\n {\n super();\n }\n \n \n \n \n },\n ////////////////////////////////////////////////////////////////////////////////////////////////\n \n /*##########################################################\n # Transform\n 説明\n 座標、回転、スケール\n ############################################################*/\n Transform : class Transform\n {\n constructor()\n {\n this.position = \n {\n x: 0,\n y: 0,\n }; \n \n this.scale = \n {\n x: 1.0,\n y: 1.0,\n }; \n \n this.rotate = 0.0;\n \n } \n }\n };\n \n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-21T14:22:01.013",
"favorite_count": 0,
"id": "94265",
"last_activity_date": "2023-03-22T13:21:58.727",
"last_edit_date": "2023-03-21T15:32:33.233",
"last_editor_user_id": "55177",
"owner_user_id": "55177",
"post_type": "question",
"score": 0,
"tags": [
"javascript"
],
"title": "javascript 変数の中で継承を行う方法が知りたい。",
"view_count": 191
} | [
{
"body": "一般化すると「オブジェクトリテラルの中でプロパティを定義するとき、同一オブジェクトの他のプロパティを参照するには?」ということなのですが、現在の\nJavaScript ではできないようです。何らかの方法で遅延させる必要があります。\n\n一番簡単なのは、いったんオブジェクトリテラルを閉じて、プロパティを代入することでしょう。\n\n```\n\n const framework = {\n Component: class {\n constructor() {}\n Update() {}\n },\n // Rendererは... | 94265 | 94266 | 94275 |
{
"accepted_answer_id": null,
"answer_count": 2,
"body": "こちらにあるFFTアナライザを実装したいと考えているのですが上手くいきません。\n\n<https://github.com/TE-YoshinoriOota/Spresense_fftanalyzer_sample>\n\nSubcore1とMaincoreのコンパイルとSpresense書き込み自体は、error無く出来ているのですが \n実装後、ディスプレイへメニューが表示されません。\n\nその前の手順での間違いがあるのかと考えております。\n\n1.DSPコーデックをインストール \nArduino IDE\nを起動して、メニュー「Example」>「Audio」>「dsp_installer」>「src_installer」にある「src_installer」を開きます。 \nskecth をコンパイルし、Spresense にフラッシュします。 \nコンソールを開き、DSP コーデックをインストールする宛先 (SD カード/フラッシュ) を選択します。そして、それをインストールします。 \n→こちら、コンソールを開きコーデックインストール先を選択ですが \nArduinoIDEのシリアルモニタを起動しても選択先が選べず\n\n 2. Arduino_Json ライブラリを取得する \nこの github でArduino_Jsonをダウンロードします。 \nこれを Arduino ライブラリ ディレクトリにドロップします。 \n→読んで字のごとく、C:\\Users\\conso\\OneDrive\\ドキュメント\\Arduino\\libraries\\ArduinoJson-6.x-spresenseへドロップしましたが、これで合っているのでしょうか?\n\n 3. リソース ファイルをストレージにコピーする \nDocuments/json内のリソースファイルをSpresense 上の SD カード/Flash のルートにコピーします。 \n→AA000.txtなどが入ったフォルダをSDカードルートへコピー\n\nご教示お願い致します。\n\n下記ディスプレイマイクキットを使用 \n<https://akizukidenshi.com/catalog/g/gM-16589/>",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-21T23:21:27.477",
"favorite_count": 0,
"id": "94267",
"last_activity_date": "2023-03-27T05:27:41.003",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "56255",
"post_type": "question",
"score": 1,
"tags": [
"spresense"
],
"title": "spresense FFTアナライザの実装について",
"view_count": 143
} | [
{
"body": "GitHubのissueチケットを作成して提供者本人に聞いた方が適切な回答がもらえるのでは?\n\n<https://github.com/TE-YoshinoriOota/Spresense_fftanalyzer_sample/issues>",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-22T01:39:26.070",
"id": "94268",
"last_activity_date": "2023-03-22T01:39:2... | 94267 | null | 94341 |
{
"accepted_answer_id": null,
"answer_count": 2,
"body": "PythonまたはRで以下のCSVファイルを読み込んで、クロス集計を行いたいのですが、うまくいきません。 \n男性┗肉のようにクロス軸を二次元にする事は出来るのですが、一次元にする事が出来ません。\n\n**CSVデータイメージ** \n[](https://i.stack.imgur.com/7dTcM.png)\n\n****クロス集計イメージ**** \n[](https://i.stack.imgur.com/i0Gxd.png)\n\nChatGPTで質問したところ以下の回答でしたが、主力イメージが意図した結果になりませんでした。 \nご教示いただけますと幸いです。宜しくお願いいたします。\n\n**[](https://i.stack.imgur.com/Ps4rR.png)**\n\n```\n\n # CSVファイルの読み込み\n df = pd.read_csv('ファイル名.csv')\n \n # クロス集計の実行\n cross_tab = pd.crosstab(index=[df['性別'], df['設問1']],\n columns=df['設問2'], margins=True, margins_name='合計')\n \n # 列の順番を設定\n column_order = ['合計', 'TOYOTA', 'HONDA', 'BMW']\n cross_tab = cross_tab.reindex(columns=column_order)\n \n # 行の順番を設定\n index_order = [('全体', ''), ('男性', ''), ('女性', ''), ('肉', ''), ('魚', ''), ('合計', '')]\n cross_tab = cross_tab.reindex(index=index_order)\n \n # 結果の出力\n print(cross_tab)\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-22T04:00:55.283",
"favorite_count": 0,
"id": "94269",
"last_activity_date": "2023-03-28T04:36:46.470",
"last_edit_date": "2023-03-22T04:03:38.367",
"last_editor_user_id": "3060",
"owner_user_id": "57628",
"post_type": "question",
"score": 1,
"tags": [
"python",
"r"
],
"title": "PythonまたはRでクロス集計をしたい",
"view_count": 136
} | [
{
"body": "性別と設問1を別個に集計して結合します。\n\n```\n\n import pandas as pd\n \n # CSVファイルの読み込み\n df = pd.read_csv('data.csv')\n \n # クロス集計\n cross_tab = pd.concat([\n df.pivot_table(index='性別', columns='設問2', aggfunc='size', fill_value=0),\n df.pivot_table(index='設問1', columns='設問2', aggf... | 94269 | null | 94270 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "MSAL for pythonを使っています。 \nAADB2Cでテナントを作成し、ユーザーとしてhogeを追加、アプリの登録を済ませてあります。\n\n```\n\n app = msal.ConfidentialClientApplication(client_id=CLIENT_ID, authority=AUTHORITY, client_credential=CLIENT_SECRET, token_cache=cache)\n \n```\n\nと定義して、\n\n```\n\n app1.get_authorization_request_url([], state=None, redirect_uri=REDIRECT_PATH)\n \n```\n\nで得られたURLからログイン画面に遷移、そこからhogeさんにログインしてもらってアプリに帰ってきます。 \nURLのqueryからcodeを受け取り、そのcodeでトークンを得、キャッシュをシリアライズしました。\n\n```\n\n token = app.acquire_token_by_authorization_code(code=code['code'], scopes=SCOPE, redirect_uri=REDIRECT_PATH)\n cache = cache.serialize()\n \n```\n\nここから質問なのですが…\n\n * 以下のようにacquire_token_silentを使用したのですが、何も返ってきませんがこれは正常な動作でしょうか?\n\n```\n\n result = app1.acquire_token_silent(scopes=SCOPE, account=None)\n print(result)\n None\n \n```\n\n * その後さらに、cacheをデシリアライズしたものを使用してConfidentialClientApplicationをインスタンス化し、get_accounts()を使用しましたが、home_account_idやlocal_account_idなどはuser:taroの情報が正しく表示されますが、usernameのみ空が返ってきてしまいます。何が原因で、どうすればtaroのusernameが返ってくるのでしょうか?\n\n```\n\n cca = msal.ConfidentialClientApplication(client_id=CLIENT_ID, authority=AUTHORITY, client_credential=CLIENT_SECRET, token_cache=acache)\n accounts = cca.get_accounts()\n print(accounts[0])\n \n {\n \"home_account_id\": \"xxxx-xxxx-xxxx(hogeさんとして登録されてるい値)\", \n \"environment\": \"xxxxxx.b2clogin.com\",\n \"username\": \"\",\n \"authority_type\": \"MSSTS\",\n \"local_account_id\": \"xxxx-xxxx-xxxx(hogeさんとして登録されている値)\",\n \"realm\": \"xxxxxx.onmicrosoft.com\"\n }\n \n```\n\nよろしくお願いいたします。",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-22T07:29:24.633",
"favorite_count": 0,
"id": "94271",
"last_activity_date": "2023-03-22T07:29:24.633",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57631",
"post_type": "question",
"score": 1,
"tags": [
"python",
"azure"
],
"title": "MSAL for pythonのget_accounts()メソッドでusernameだけが空になって返ってくる",
"view_count": 73
} | [] | 94271 | null | null |
{
"accepted_answer_id": "94277",
"answer_count": 2,
"body": "Visual Studio 2022において、クラスのメンバ関数として、例えば次のように複数の仮引数をもつ仮想関数を実装しようとしているのですが、\n\n```\n\n virtual double func(bool a, int b, double c){}\n \n```\n\n現在は「引数が関数の本体部で一度も参照されない」というvisual\nstudioのC4100警告の回避のためだけの処理を、基底クラスの関数定義に次のように書き、\n\n```\n\n virtual double func(bool a, int b, double c)\n {\n if (a == TRUE)\n {\n // * 0.0によって0.0が返るようにするなど、なにかしら意味のない処理にする\n return static_cast<double>(b) * c * 0.0;\n }\n \n return 0.0;\n }\n \n```\n\n継承クラスの仮想関数オーバーライドで本来欲しい処理を書いています。\n\nこの仮想関数を必要とした条件は以下の通りです。\n\n * 基底クラスポインタに、複数ある別種類の派生クラスポインタのどれかを代入してコンテナに入れ、この仮想関数によってそれぞれのポインタでの挙動を変えたいので、基底クラスにこの仮想関数を実装する必要がある。\n * 複数ある別種類の派生クラスでは、必ずしも仮想関数をオーバーライドするとは限らず、基底クラスの別のメンバ変数のフラグによってこの仮想関数を実行するかどうか分岐する構造にしている。\n * コンテナ内のすべてのポインタに対して行いたい処理が他にもあるので、この仮想関数を実行するポインタかどうかでコンテナを分けず、フラグで分岐する構造にした。\n\n基底クラスで純粋仮想関数にすると、派生クラスでまた同じC4100警告が出る可能性があることと、この仮想関数をオーバーライドしない派生クラスでこの仮想関数を意識したくないと思ったため、警告回避のため基底クラスに本来欲しい処理とは違う処理を書きましたが、このC4100警告を回避する他の方法があれば教えてほしいです。\n\nよろしくお願いします。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-22T20:02:06.480",
"favorite_count": 0,
"id": "94276",
"last_activity_date": "2023-05-07T03:24:45.707",
"last_edit_date": "2023-03-23T01:21:04.310",
"last_editor_user_id": "3060",
"owner_user_id": "57637",
"post_type": "question",
"score": 2,
"tags": [
"c++",
"visual-studio"
],
"title": "C++ Visual Studio で C4100 警告を回避したい",
"view_count": 276
} | [
{
"body": "C++17以降であれば\n[`[[maybe_unused]]`属性](https://cpprefjp.github.io/lang/cpp17/maybe_unused.html)\nが使えます。こちらはC++標準ですので他のコンパイラーでも同様に警告が抑止されることが期待できます。\n\n```\n\n double func([[maybe_unused]] bool a, [[maybe_unused]] int b, [[maybe_unused]] double c) {}\n \n```\n\n従来の方法としてはVisual C++では `UNREFERENCED_P... | 94276 | 94277 | 94277 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "現在のJavaでnull安全にするためには`@Nullable`/`@NonNull`をいちいち設定しなければいけませんが、IDE(今回の場合はIntelliJ\nIDEA)にはデフォルトで`@Nullable`として扱う設定があります。 \n[](https://i.stack.imgur.com/9ZyiZ.png) \nしかし、自分では書き換えられない外部ライブラリに対しても適用されてしまうため、エラーと表示するようにすると問題のないプログラムでもエラーがあるように見えてしまいます。 \n「スコープ」を「プロジェクトファイル」のみにすれば解決できるかとも思いましたがダメでした。\n\n外部ライブラリに対しては`@Nullable`として扱わないように設定する方法は無いでしょうか。あるいはこれ以外の方法でデフォルトでnull安全を実現する方法は無いでしょうか。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-23T04:44:15.600",
"favorite_count": 0,
"id": "94282",
"last_activity_date": "2023-03-23T08:55:04.240",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "816",
"post_type": "question",
"score": 2,
"tags": [
"java",
"intellij-idea",
"java-null-safety"
],
"title": "IntelliJ IDEAで外部ライブラリを除きデフォルトでnull安全を設定する方法",
"view_count": 113
} | [
{
"body": "> 外部ライブラリに対しては@Nullableとして扱わないように設定する方法は無いでしょうか。\n\nIntelliJ IDEAを調べてみましたが、そのような方法は見つかりませんでした。おそらくないのだと思います。\n\n> あるいはこれ以外の方法でデフォルトでnull安全を実現する方法は無いでしょうか。\n\nnull安全を必要としているならば、設定はこのままで呼び出し側で一つ一つnullチェックをするのがよいと思います。\n\n**対象とするコードの例**\n\n```\n\n InputStream stream = socket.getInputStream();\n \n... | 94282 | null | 94284 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "Node.jsのMongoDBドライバーでレプリカセットに接続し、ChangeStreamでコレクションの監視を行っております。プライマリノードをダウンさせた際に、MongoClientは新しいプライマリノードに自動的に再接続しているようなのですが、ChangeStreamがダウンしたプライマリノードに対して再接続のエラー(MongoServerSelectionError)を上げてきます。再接続が発生してもコレクションの監視を継続したいのですがエラーが発生して監視が継続できずに困っています。ダウンしたプライマリに対する再接続エラーを回避するにはどうすればいいでしょうか。\n\n以下はコードになります。\n\n```\n\n const { MongoClient } = require('mongodb');\n const express = require('express');\n \n const app = express();\n \n app.get('/start', async(req, res)=>{\n try {\n const uri = 'mongodb://127.0.0.1:27017,127.0.0.1:27018,127.0.0.1:27019/test?replicaSet=test';\n const options = { useNewUrlParser: true, useUnifiedTopology: true};\n \n const client = new MongoClient(uri, options);\n await client.connect();\n \n const changeStream = client.watch( [ { $match: { operationType: 'insert' } } ] );\n \n changeStream.on('change', (change) =>{\n console.log(change);\n });\n \n changeStream.on('error', (error) => {\n console.log(error);\n //エラーになった時点のchangeStreamが持つMongoClientの情報を見る限り、新しいプライマリノードに接続できている\n changeStream.parent.db('test').admin().serverStatus().then((result) => {\n console.log(result.host);\n console.log(result.repl);\n })\n .catch((error) => {\n console.log(error);\n });\n });\n res.send('OK');\n }\n catch(error){\n console.error(error);\n res.status(500).send('ERROR');\n }\n });\n \n app.listen(3000, ()=>{\n console.log('start server');\n });\n \n```\n\n27017で起動するプライマリをダウンさせると、しばらくして以下のような再接続のタイムアウトでエラーとなります。\n\n```\n\n MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout._onTimeout (/etc/test/node_modules/mongodb/lib/sdam/topology.js:277:38)\n at listOnTimeout (internal/timers.js:557:17)\n at processTimers (internal/timers.js:500:7) {\n reason: TopologyDescription {\n type: 'ReplicaSetWithPrimary',\n servers: Map(3) {\n '127.0.0.1:27017' => [ServerDescription],\n '127.0.0.1:27018' => [ServerDescription],\n '127.0.0.1:27019' => [ServerDescription]\n },\n stale: false,\n compatible: true,\n heartbeatFrequencyMS: 10000,\n localThresholdMS: 15,\n setName: 'test',\n maxElectionId: new ObjectId(\"7fffffff0000000000000003\"),\n maxSetVersion: 5,\n commonWireVersion: 0,\n logicalSessionTimeoutMinutes: 30\n },\n code: undefined,\n [Symbol(errorLabels)]: Set(0) {}\n }\n \n```\n\nまた、エラーの際に出しているchangeStreamが持つMongoClientの情報は以下のようになります。これを見る限り、新しいプライマリの27018に接続できているように見えるのですが、ダウンしたプライマリノードへの再接続エラーが上がってくるのがどうしてなのかが分かりません。\n\n```\n\n localhost.localdomain:27018\n {\n topologyVersion: { processId: new ObjectId(\"641bd8d18822f6cac079f2ef\"), counter: 6 },\n hosts: [ '127.0.0.1:27017', '127.0.0.1:27018', '127.0.0.1:27019' ],\n setName: 'test',\n setVersion: 5,\n isWritablePrimary: true,\n secondary: false,\n primary: '127.0.0.1:27018',\n me: '127.0.0.1:27018',\n electionId: new ObjectId(\"7fffffff0000000000000006\"),\n lastWrite: {\n opTime: { ts: new Timestamp({ t: 1679546778, i: 1 }), t: 6 },\n lastWriteDate: 2023-03-23T04:46:18.000Z,\n majorityOpTime: { ts: new Timestamp({ t: 1679546778, i: 1 }), t: 6 },\n majorityWriteDate: 2023-03-23T04:46:18.000Z\n },\n primaryOnlyServices: {\n TenantMigrationDonorService: { state: 'running', numInstances: 0 },\n TenantMigrationRecipientService: { state: 'running', numInstances: 0 }\n },\n rbid: 1\n }\n \n \n```\n\n動作環境は以下になります。 \nOS:CentOS8 \nMongoDB:5.0.15 \nMongoDB Node Driver:5.1.0 \nNode.js:14.21.3",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-23T05:09:53.317",
"favorite_count": 0,
"id": "94283",
"last_activity_date": "2023-03-23T05:47:04.240",
"last_edit_date": "2023-03-23T05:47:04.240",
"last_editor_user_id": "19027",
"owner_user_id": "19027",
"post_type": "question",
"score": 1,
"tags": [
"node.js",
"mongodb"
],
"title": "MongoDBのChangeStreamのレプリカセットでの挙動",
"view_count": 69
} | [] | 94283 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "C++プログラムでディレクトリを作成するためにboost::filesystemライブラリを使用しようとしています。以下が実際のコードです:\n\n```\n\n boost::filesystem::path dir(path);\n if (!boost::filesystem::exists(dir)) {\n boost::filesystem::create_directory(dir);\n }\n \n```\n\n**エラーメッセージ:**\n\n```\n\n boost::filesystem::create_directory: Illegal byte sequence [system:92]: \"@��l\"\n \n```\n\nこのエラーの原因がよくわかりません。使っているパスが正しいことは確認しました、M1\nMacでプログラムを実行しています。何が問題で、どうすれば解決できるのでしょうか?\n\nパスを短いものに変えてみましたがダメで、boost::filesystem::path::codecvt()でパスを変換してみましたが、こちらもダメでした。またboostへのリンクも確認しました",
"comment_count": 3,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-23T08:59:36.870",
"favorite_count": 0,
"id": "94285",
"last_activity_date": "2023-03-24T23:23:52.043",
"last_edit_date": "2023-03-23T10:48:48.097",
"last_editor_user_id": "3060",
"owner_user_id": "57643",
"post_type": "question",
"score": 0,
"tags": [
"c++",
"boost",
"encoding"
],
"title": "\"Boost filesystem create_directory() throws illegal byte sequence error even with correct file path encoding\"",
"view_count": 182
} | [
{
"body": "「boost::filesystem::exists」も同じ理由で失敗するに違いない。\n\nここで「boost::filesystem::create_directory」が「mkdir()」を呼び出していることがわかります: \n<https://www.boost.org/doc/libs/1_81_0/libs/filesystem/src/operations.cpp>\n\nまた、「boost::filesystem::path」は「char」サイズの魔法です: \n<https://www.boost.org/doc/libs/1_81_0/boost/filesystem/p... | 94285 | null | 94302 |
{
"accepted_answer_id": "94291",
"answer_count": 1,
"body": "公式LINEで質問したことをwebhookを介してchatGPTが回答してくれるチャットボットを作成しています。 \n現状、メッセージを受信して自動返信することはできるのですが、受信したメッセージに対して全く見当違いな返信をします。下記のコードが受信したメッセージをchatGPTで処理し、LINEに送信するコードです。 \nこれは、モデルが\"davinci\"だからなのでしょうか、それともコードが悪いのでしょうか。ご教授お願いします。 \n※情報不足なところがあればご指摘お願いします。\n\n```\n\n #メッセージを受け取った後にどんな処理を行うかを記述\n @handler.add(MessageEvent, message=TextMessage)\n def handle_message(event):\n prompt =event.message.text\n \n response = openai.Completion.create(\n engine=\"davinci\",\n prompt=prompt,\n max_tokens=256,\n )\n messages = response.choices[0].text.strip()\n \n print(messages)\n \n line_bot_api.reply_message(\n event.reply_token,\n TextSendMessage(text=messages))\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-23T13:29:05.520",
"favorite_count": 0,
"id": "94287",
"last_activity_date": "2023-06-18T07:17:31.347",
"last_edit_date": "2023-06-18T07:17:31.347",
"last_editor_user_id": "7347",
"owner_user_id": "57475",
"post_type": "question",
"score": 0,
"tags": [
"python",
"line",
"chatgpt"
],
"title": "chatGPTのモデル\"davinci\"では正確に返答されないのでしょうか。",
"view_count": 211
} | [
{
"body": "これだと **\" 続けて相手が言いそうなこと\"** もしくは **\" その続きに書いてありそうなこと\"** を生成するだけです。\n\nチャットをさせたいなら、プロンプトとパラメータは公式exampleのチャットの例 \n<https://platform.openai.com/examples/default-friend-chat> \nに倣って\n\n```\n\n prompt = f'You: {event.message.text}\\nFriend:'\n response = openai.Completion.create(\n model... | 94287 | 94291 | 94291 |
{
"accepted_answer_id": "94289",
"answer_count": 1,
"body": "値の左から順に同じグループになります。 \n例えば、group1では、Aのaの1が一つのグループで、また別に、Aのaの2、Bのaの2、Cのbの1、Dのaの1、Dのaの3、Dのbの3となり、7つのグループが存在することになります。\n\n```\n\n dict1 = {\"group1\":[\"A\",\"A\",\"B\",\"D\",\"C\",\"D\",\"D\"],\"group2\":[\"E\",\"F\",\"G\",\"H\",\"I\"],\"group3\":[\"J\",\"N\",\"K\",\"L\",\"K\",\"M\",\"N\"]}\n dict2 = {\"group1\":[\"a\",\"a\",\"a\",\"b\",\"b\",\"a\",\"a\"],\"group2\":[\"a\",\"a\",\"a\",\"a\",\"a\"],\"group3\":[\"a\",\"a\",\"a\",\"a\",\"a\",\"b\",\"b\"]}\n dict3 = {\"group1\":[\"1\",\"2\",\"2\",\"3\",\"1\",\"1\",\"3\"],\"group2\":[\"1\",\"1\",\"2\",\"3\",\"4\"],\"group3\":[\"1\",\"1\",\"1\",\"2\",\"2\",\"2\",\"2\"]}\n \n```\n\n以下がdict1,dict2,dict3という辞書に対して行いたい処理です。\n\nそれぞれのgroupの中で値を照合 \nアルファベットの小文字を基に数値を比べ、同じ大文字がどれくらいあるか判別(group1の中では、aの1はA,Dがあり、aの2ではAがあるので、同じ大文字のAを抜き出す。 \nまた、aの1はA,Dがあり、aの3ではDがあるので、同じ大文字のDを抜き出す。しかし、aの1はA,Dがあり、bの3ではDがあるが、aとbが違うので比較しない。)し、 \nそれぞれのグループごとにアルファベットの大文字を書き出す。 \n結果を立て並びに出力する \n以下のように出力したいです。\n\n```\n\n result =\n \n group1\n a 1 , a 2 A #dict2,dict3,dict1の情報を示します\n a 1 , a 3 D\n a 2 , a 3\n b 1 , b 3 \n \n group2\n a 1 , a 2 \n a 1 , a 3 \n a 1 , a 4 \n a 2 , a 3 \n a 2 , a 4 \n a 3 , a 4 \n \n group3\n a 1 , a 2 K\n \n```\n\n知識不足ながらプログラム案を考えてみましたが、組み合わせをして、共通のものを取り出すことができません。ご教示お願い致します。\n\n```\n\n from itertools import groupby\n \n \n keyfunc = lambda x: x[:2]\n result_ctype = [(g, {k: [i[-1] for i in v]\n for k, v in groupby(sorted(zip(dict3[g], dict2[g], dict1[g]), key=keyfunc), key=keyfunc)})\n for g in dict1.keys()]\n \n #出力\n [('group1', {('a', '1'): ['A', 'D'], ('a', '2'): ['A', 'B'], ('a', '3'): ['D'], ('b', '1'): ['C'], ('b', '3'): ['D']}), ('group2', {('a', '1'): ['E', 'F'], ('a', '2'): ['G'], ('a', '3'): ['H'], ('a', '4'): ['I']}), ('group3', {('a', '1'): ['J', 'N', 'K'], ('a', '2'): ['L', 'K'], ('b', '2'): ['M', 'N']})]\n \n```",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-23T17:56:35.877",
"favorite_count": 0,
"id": "94288",
"last_activity_date": "2023-03-23T19:58:23.483",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57218",
"post_type": "question",
"score": 0,
"tags": [
"python"
],
"title": "Python 辞書での組み合わせと重複について",
"view_count": 147
} | [
{
"body": "```\n\n from itertools import groupby, combinations\n \n dict1 = {\"group1\":[\"A\",\"A\",\"B\",\"D\",\"C\",\"D\",\"D\"],\"group2\":[\"E\",\"F\",\"G\",\"H\",\"I\"],\"group3\":[\"J\",\"N\",\"K\",\"L\",\"K\",\"M\",\"N\"]}\n dict2 = {\"group1\":[\"a\",\"a\",\"a\",\"b\",\"b\",\"a\",\"a\"],\"g... | 94288 | 94289 | 94289 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "```\n\n WidgetsBinding.instance.addPostFrameCallback((_) {\n showDialog(\n context: context,\n builder: (context) => Hoge()\n barrierDismissible: false,\n );\n });\n \n```\n\nでHogeを呼び出す。 \nHogeの中では`PageView`を利用しており、PageViewのページが変わるたびにshowDialogが呼び出されてしまうものの改善方法を教えてください。",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-24T10:14:55.273",
"favorite_count": 0,
"id": "94295",
"last_activity_date": "2023-03-24T10:14:55.273",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57658",
"post_type": "question",
"score": 0,
"tags": [
"flutter",
"dart"
],
"title": "FlutterでWidgetsBinding.instance.addPostFrameCallbackを1度しか実行を許さない方法。",
"view_count": 117
} | [] | 94295 | null | null |
{
"accepted_answer_id": "94299",
"answer_count": 1,
"body": "##### 質問内容\n\n入力欄に表示したい文字を入力して`submit`ボタンを押すと`script.js`の変数`lists`配列にその値が挿入されるのですがその文字を表示させたいのですが`.push()`を使っても画面が更新されません。\n\n##### 提示コードの内容\n\n入力欄とボタンと配列の中身を出力するプログラムです。\n\n##### 知りたいこと\n\nscript.jsのlists変数の値を再表示する方法が知りたい\n\n##### 実現したいこと\n\n入力欄に表示したい文字を入力して`submit`ボタンを押すと画面の下に入力した値が追加されて表示される。\n\n##### 現状\n\n##### 調べたこと\n\n1,ページの再ロードを試しましたがページを再読み込みしたいわけではないので違いました。 \n2,`script.js`の変数`lists`に値が入っていることを確認\n\n##### 参考サイト\n\npush(): <https://qiita.com/_masa_u/items/f9076777b044673eea2a>\n\n##### 環境\n\nOS: windows10 \n言語: javascript \nライブラリ: vue.js\n\n##### index.html\n\n```\n\n <!DOCTYPE html>\n <html lang=\"ja\">\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n <meta charset=\"UTF-8\">\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n </head>\n <body>\n <script type=\"importmap\">\n {\n \"imports\": {\n \"vue\": \"https://cdn.jsdelivr.net/npm/vue@3.2/dist/vue.esm-browser.prod.js\"\n }\n }\n </script>\n \n <!-- #################################################################### -->\n \n <div id=\"app\">\n \n <input type=\"text\" id=\"text\">\n <button type=\"button\" v-on:click=\"onClick\">submit</button>\n \n <ul>\n <li v-for=\"result in lists\"> {{ result }}</li>\n </ul>\n \n </div>\n \n \n \n \n \n \n \n <!-- #################################################################### -->\n \n <script src=\"script.js\"></script>\n \n <script type=\"module\">\n import { createApp } from 'vue';\n \n createApp(sample()).mount('#app');\n \n </script>\n </body>\n </html>\n \n```\n\n##### script.js\n\n```\n\n \"use strict\"\n \n function sample()\n {\n \n let lists = [\"aaa\",\"bbbb\"];\n \n return{\n data()\n {\n return {\n lists\n }\n },\n \n methods:\n {\n onClick: function(e)\n {\n \n console.log(\"onClick\");\n console.log(document.querySelector(\"#text\").value);\n \n lists.push(document.querySelector(\"#text\").value);\n } \n }\n \n \n \n }\n };\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-24T10:27:18.893",
"favorite_count": 0,
"id": "94296",
"last_activity_date": "2023-03-25T05:13:08.690",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "55177",
"post_type": "question",
"score": 0,
"tags": [
"vue.js"
],
"title": "vue.jsを用いて配列に追加で入れた値を描画する方法が知りたい。",
"view_count": 55
} | [
{
"body": "`lists` が別になってたものをまとめ, `this` を付けたコード\n\n * (リアクティブな) データは 辞書(オブジェクト)形式で, 名前と内容のペアであること\n * Vueは `push` メソッドによる変更にも対処できるが, それは先のデータ (`$data`) に関するもので, 別経由でアクセスすると変更をキャッチ(?)できない\n\n```\n\n function sample()\n {\n \n //let lists = [\"aaa\",\"bbbb\"];\n \n return{\n ... | 94296 | 94299 | 94299 |
{
"accepted_answer_id": "94310",
"answer_count": 2,
"body": "(具体的なコードに変更しました) \nPowerShellで`HashTable`の派生クラスを作ろうとしています。\n\n```\n\n class DerivedHT : HashTable{\n [ScriptBlock]$GetKeyBlock\n \n DerivedHT():base(){\n $this.GetKeyBlock = { $args[0] }\n }\n \n Add([object]$elem){\n if( $null -eq $this[$elem] ){\n $this[$elem] = @()\n }\n $this[$elem] += $elem\n }\n \n [int]OccurrencesOf([object]$elem){\n return(($this[$elem]).Count)\n }\n \n [object]Includes([object]$elem){\n return( $null -ne $this[$elem])\n }\n }\n \n \n```\n\nこのようなクラスを定義すると、プロパティ`GetKeyBlock`が自動的に`HashTable`の`Key`として扱われてしまうのですが、これを回避する方法はないでしょうか?\n\n```\n\n $dht = [DerivedHT]::new()\n \n @(1,3,5,7,9).foreach{ $dht.Add($_) }\n @(3,7).foreach{ $dht.Add($_) }\n \n '----- keys -----' | Write-Host\n $dht.Keys | Write-Host\n \n '----- Values -----' | Write-Host\n $dht.Values | Write-Host\n \n```\n\n実行結果 \n\\----- keys ----- \n**GetKeyBlock** \n9 \n7 \n5 \n3 \n1 \n\\----- Values ----- \n**$args[0]** \n9 \n7 7 \n5 \n3 3 \n1",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-24T10:32:58.473",
"favorite_count": 0,
"id": "94297",
"last_activity_date": "2023-03-25T06:05:58.733",
"last_edit_date": "2023-03-25T03:25:55.180",
"last_editor_user_id": "57660",
"owner_user_id": "57660",
"post_type": "question",
"score": 0,
"tags": [
"powershell"
],
"title": "HashTableの派生クラスを作ると、追加した変数がHashTableのKeyとして扱われる。これの回避方法は?",
"view_count": 94
} | [
{
"body": "さしあたり(問題含みですが)現象を回避する方法を見つけたので自己回答しておきます。なお、この方法以外のもっと良い方法をご存知でしたら是非ご教授ください。\n\nHashTableのKeysに対するアクセッサをオーバーライドすることで、Keysに対するアクセス結果に干渉できる。\n\n```\n\n [System.Collections.ICollection]get_Keys(){\n $keys =([HashTable]$this).get_keys()\n return([System.Collections.ICollection]... | 94297 | 94310 | 94310 |
{
"accepted_answer_id": null,
"answer_count": 2,
"body": "AtCoderのABC294-Cの問題を解くためのコードを書いたのですが、入力を以下の様にすると、16回行われるはずのループが4回で止まってしまいます。\n\n**入力:**\n\n```\n\n 3 3\n 1 2 3\n 4 5 6\n 7 8 9\n \n```\n\n**作成したコード:**\n\n```\n\n require 'set'\n h,w=gets.chomp.split(\" \").map(&:to_i)\n board=[]\n h.times do |i|\n board[i]=gets.chomp.split(\" \").map(&:to_i)\n end\n sets=[]\n 2**(h+w-2).times do |i|\n # printf(\"%04b\\n\",i)\n count=0\n (h+w-2).times do |k|\n if i[k]==1\n count+=1\n end\n end\n unless count==h-1\n next\n end\n flag=true\n pos=[0,0]\n s=Set.new\n s.add(board[0][0])\n (h+w-2).times do |j|\n dir=[0,0]\n if i[j]==1\n dir=[1,0]\n else\n dir=[0,1]\n end\n pos[0]+=dir[0]\n pos[1]+=dir[1]\n d=board[pos[0]][pos[1]]\n if s.include?(d)\n flag=false\n break\n else\n s.add(d)\n end\n end\n if flag==true\n sets.push(s)\n end\n end\n puts sets.size\n \n```",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-25T01:33:11.733",
"favorite_count": 0,
"id": "94304",
"last_activity_date": "2023-03-25T05:34:50.057",
"last_edit_date": "2023-03-25T05:34:50.057",
"last_editor_user_id": "3060",
"owner_user_id": "54984",
"post_type": "question",
"score": 0,
"tags": [
"ruby"
],
"title": "Rubyでループが途中で止まってしまう",
"view_count": 85
} | [
{
"body": "詳細は見ていないのですが、ぱっと見た感じ `2**(h+w-2).times do |i|` の `2**`\nの意味がなさそうなのが気になったので、括弧が不足しているのが原因ではないでしょうか。\n\n```\n\n 2**1.times{p _1} #=> 0\n (2**1).times{p _1} #=> 0 1\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-25T01:51:08.647",
"id... | 94304 | null | 94306 |
{
"accepted_answer_id": "94320",
"answer_count": 1,
"body": "##### 質問内容\n\n提示コードのコメント部内部の`A,b`部ですが`Typedoc Error `部のようなエラーが大量に発生します。 \nこれはどうやってエラーを解消したらいいのでしょうか?実行自体はできるのですが。`Typedoc`によるエラーが発生してしまいドキュメントが作成できません。\n\n##### 現状\n\n1,実行可能 \n2,ドキュメント作成のためtypedocが提示のようなエラーになります。(一部抜粋) \n3,tsconfig.jsonは生成してから触っていません\n\n##### コード内容\n\nWebGLを使って立方体を描画\n\n##### 調べたこと\n\nTypeScript型: <https://qiita.com/uhyo/items/e2fdef2d3236b9bfe74a> \nany型について: <https://typescriptbook.jp/reference/values-types-variables/any>\n\n##### 環境\n\nOS: windows 10 \n言語: TypeScript \n利用ライブラリ: WebGL2 \nその他: node.js\n\n##### tsconfig.json\n\n```\n\n {\n \"compilerOptions\": {\n /* Visit https://aka.ms/tsconfig to read more about this file */\n \n /* Projects */\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\n \n /* Language and Environment */\n \"target\": \"es2016\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\n // \"lib\": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */\n // \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\n // \"experimentalDecorators\": true, /* Enable experimental support for legacy experimental decorators. */\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\n \n /* Modules */\n \"module\": \"commonjs\", /* Specify what module code is generated. */\n // \"rootDir\": \"./\", /* Specify the root folder within your source files. */\n // \"moduleResolution\": \"node10\", /* Specify how TypeScript looks up a file from a given module specifier. */\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\n // \"paths\": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\n // \"types\": [], /* Specify type package names to be included without being referenced in a source file. */\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\n // \"allowImportingTsExtensions\": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */\n // \"resolvePackageJsonExports\": true, /* Use the package.json 'exports' field when resolving package imports. */\n // \"resolvePackageJsonImports\": true, /* Use the package.json 'imports' field when resolving imports. */\n // \"customConditions\": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */\n // \"resolveJsonModule\": true, /* Enable importing .json files. */\n // \"allowArbitraryExtensions\": true, /* Enable importing files with any extension, provided a declaration file is present. */\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\n \n /* JavaScript Support */\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\n \n /* Emit */\n // \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */\n // \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\n // \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\n // \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\n // \"outDir\": \"./\", /* Specify an output folder for all emitted files. */\n // \"removeComments\": true, /* Disable emitting comments. */\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\n // \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */\n // \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\n // \"newLine\": \"crlf\", /* Set the newline character for emitting files. */\n // \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\n \n /* Interop Constraints */\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\n // \"verbatimModuleSyntax\": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */\n // \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. */\n \n /* Type Checking */\n \"strict\": true, /* Enable all strict type-checking options. */\n // \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\n \n /* Completeness */\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\n \"skipLibCheck\": true /* Skip type checking all .d.ts files. */\n }\n }\n \n \n```\n\n##### Vscodeによるエラー画面\n\n[](https://i.stack.imgur.com/XgCGV.png)\n\n##### Typedoc Error\n\n```\n\n >npx typedoc script/Main.ts\n script/FrameWork.ts:31:5 - error TS7034: Variable 'context' implicitly has type 'any' in some locations where its type cannot be determined.\n \n 31 let context = null; //コンテキスト\n ~~~~~~~\n \n script/FrameWork.ts:32:5 - error TS7034: Variable 'buffer' implicitly has type 'any' in some locations where its type cannot be determined.\n \n 32 let buffer = null; //バッファー\n ~~~~~~\n \n script/FrameWork.ts:45:15 - error TS18047: 'canvas' is possibly 'null'.\n \n 45 context = canvas.getContext('webgl'); //webcontextコンテキストを作成\n ~~~~~~\n \n script/FrameWork.ts:45:22 - error TS2339: Property 'getContext' does not exist on type 'Element'.\n \n 45 context = canvas.getContext('webgl'); //webcontextコンテキストを作成\n ~~~~~~~~~~\n \n script/FrameWork.ts:191:17 - error TS7005: Variable 'context' implicitly has an 'any' type.\n \n 191 const buf = context.createBuffer();\n ~~~~~~~\n \n \n```\n\n##### script.ts\n\n```\n\n import * as glm from \"gl-matrix\";\n \n \n \"use strict\";\n \n //モデルの情報\n let model = \n {\n Translate:\n {\n x: 0,\n y: 0,\n z: -4,\n },\n \n Rotate:\n {\n x: 0,\n y: 0,\n z: 0,\n },\n \n Scale:\n {\n x: 1,\n y: 1,\n z: 1,\n },\n };\n \n //A\n ////////////////////////////////////////////////////////////\n let canvas; //キャンバス\n let context; //コンテキスト\n let buffer; //バッファー\n /////////////////////////////////////////////////////////////\n \n let programInfo = { attribLocations: {vertexPosition:null},uniformLocations: {projectionMatrix: null,position:null,scale:null,rotate:null},shaderProgram: null }; //プログラム\n \n \n //\n // エントリーポイント\n //\n export function main() \n {\n \n \n canvas = document.querySelector('#glCanvas'); //キャンバスを取得\n //B\n /////////////////////////////////////////////////////////////////////////////////////\n context = canvas.getContext('webgl2'); //webcontextコンテキストを作成\n /////////////////////////////////////////////////////////////////////////////////////\n \n //webcontextコンテキストの作成に失敗した時\n if (!context) \n {\n alert(\"webcontextコンテキストの作成失敗\");\n }\n \n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // 頂点シェーダーコード\n const vsSource = `\n attribute vec4 aVertexPosition; //\n \n uniform mat4 uProjectionMatrix; //\n \n uniform mat4 uPosition; //\n uniform mat4 uScale; //\n uniform mat4 uRotate; //\n \n void main() {\n \n mat4 model = uPosition * uRotate * uScale; //\n \n gl_Position = (uProjectionMatrix * model) * aVertexPosition;\n }\n \n `;\n \n // フラグメントシェーダー\n const fsSource = `\n void main() {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);\n }\n `;\n \n \n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n \n \n //シェーダープログラムオブジェクトを作成\n const shaderProgram = CreateShaderProgram(vsSource,fsSource);//シェーダープログラムを作成\n \n programInfo.shaderProgram = shaderProgram;\n programInfo.attribLocations.vertexPosition = context.getAttribLocation(shaderProgram,'aVertexPosition');\n programInfo.uniformLocations.projectionMatrix = context.getUniformLocation(shaderProgram,'uProjectionMatrix');\n \n programInfo.uniformLocations.position = context.getUniformLocation(shaderProgram,'uPosition');\n programInfo.uniformLocations.scale = context.getUniformLocation(shaderProgram,'uScale');\n programInfo.uniformLocations.rotate = context.getUniformLocation(shaderProgram,'uRotate');\n \n buffer = GetBuffer(); //バッファーを作成\n \n \n \n document.body.addEventListener(\"keydown\",event => \n {\n //スペースキー\n if(event.key == \" \")\n {\n //alert(\"キーが押されました。\");\n console.log(\"Space\");\n }\n else if(event.key == \"ArrowLeft\")\n {\n //alert(\"キーが押されました。\");\n console.log(\"Left\");\n // model.Translate.x += 10;\n model.Translate.x += -1.0 / 640.0;\n \n \n console.log(model.Translate.x);\n \n }\n else if(event.key == \"ArrowRight\")\n {\n //alert(\"キーが押されました。\");\n console.log(\"Right\");\n model.Translate.x += 1 / 640;\n \n }\n else if(event.key == \"ArrowUp\")\n {\n //alert(\"キーが押されました。\");\n console.log(\"Up\");\n }\n else if(event.key == \"ArrowDown\")\n {\n //alert(\"キーが押されました。\");\n console.log(\"Down\");\n }\n \n });\n \n \n \n \n // ######### 毎フレーム #########\n \n \n //window.requestAnimationFrame(() =>{ Draw(); Update(); });\n \n function callback() \n {\n Draw();\n Update();\n // ここに繰り返したい処理を書く。\n window.requestAnimationFrame(callback); // 毎回呼び出す必要あり。\n }\n \n window.requestAnimationFrame(callback); // 実行を開始。\n \n }\n \n \n //Update()\n function Update()\n {\n InputKey();\n \n \n }\n \n //Draw\n function Draw()\n {\n Render();\n //window.requestAnimationFrame(Draw);\n \n }\n \n \n \n \n //キー入力\n function InputKey()\n {\n \n \n }\n \n \n \n //バッファを初期化\n function GetBuffer() \n {\n // 正方形の位置用のバッファを作成します。\n const buf = context.createBuffer();\n \n //バッファを適用\n context.bindBuffer(context.ARRAY_BUFFER,buf);\n \n //正方形の頂点の配列\n const positions = \n [\n 1.0,1.0,0.0,\n -1.0,1.0,0.0,\n 1.0,-1.0,0.0,\n -1.0,-1.0,0.0\n ];\n \n //バッファーオブジェクトのデータストアを初期化\n context.bufferData(context.ARRAY_BUFFER,new Float32Array(positions),context.STATIC_DRAW);\n \n return buf;\n \n }\n \n //シーンを描画\n function Render() \n {\n context.clearColor(0.0, 0.0, 0.0, 1.0); // カラーバッファを初期化\n context.clearDepth(1.0); // 深度バッファを初期化\n context.enable(context.DEPTH_TEST); // 深度テスト\n context.depthFunc(context.LEQUAL); // 深度比較する値を設定\n \n //キャンバスに描画を開始する前に、キャンバスをクリア\n context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT);\n \n //パースペクティブマトリックスを作成します\n const fieldOfView = 45 * Math.PI / 180; // in radians\n const aspect = context.canvas.clientWidth / context.canvas.clientHeight;\n const zNear = 0.1;\n const zFar = 100.0;\n \n //射形行列\n const projectionMatrix = glm.mat4.create();\n glm.mat4.perspective(projectionMatrix,fieldOfView,aspect,zNear,zFar);\n \n //平行移動\n let translate = glm.mat4.create();\n glm.mat4.translate(translate,translate,[model.Translate.x,model.Translate.y,model.Translate.z]); \n \n //回転\n let rotation = glm.mat4.create();\n glm.mat4.rotate(rotation,rotation,0,[model.Rotate.x,model.Rotate.y,model.Rotate.z]); \n \n //拡大縮小\n let scale = glm.mat4.create();\n glm.mat4.scale(scale,scale,[model.Scale.x,model.Scale.y,model.Scale.z]); \n \n context.bindBuffer(context.ARRAY_BUFFER, buffer); //バッファーを適用\n \n context.vertexAttribPointer(programInfo.attribLocations.vertexPosition,3,context.FLOAT,false,0,0); //バッファーの頂点属性を統合\n context.enableVertexAttribArray(programInfo.attribLocations.vertexPosition); //バッファーの頂点属性を有効化\n \n //シェーダーを使う\n context.useProgram(programInfo.shaderProgram);\n \n // uniform 変数を設定\n context.uniformMatrix4fv(programInfo.uniformLocations.projectionMatrix,false,projectionMatrix);\n context.uniformMatrix4fv(programInfo.uniformLocations.position,false,translate);\n context.uniformMatrix4fv(programInfo.uniformLocations.scale,false,scale);\n context.uniformMatrix4fv(programInfo.uniformLocations.rotate,false,rotation);\n \n context.drawArrays(context.TRIANGLE_STRIP, 0, 4); //描画\n \n }\n \n //シェーダーを作成\n function CreateShaderProgram(vsSource,fsSource) \n {\n const vertexShader = LoadShader(context.VERTEX_SHADER, vsSource);\n const fragmentShader = LoadShader(context.FRAGMENT_SHADER, fsSource);\n \n //シェーダープログラムを作成\n const shaderProgram = context.createProgram();\n \n //アタッチ\n context.attachShader(shaderProgram, vertexShader);\n context.attachShader(shaderProgram, fragmentShader);\n context.linkProgram(shaderProgram);\n \n // もしシェーダープログラムの作成に失敗したら\n if (!context.getProgramParameter(shaderProgram, context.LINK_STATUS)) \n {\n alert('シェーダープログラム作成に失敗: ' + context.getProgramInfoLog(shaderProgram));\n \n return null;\n }\n \n return shaderProgram;\n }\n \n //シェーダーをロード\n function LoadShader(type, source) \n {\n const shader = context.createShader(type);\n \n // ソースをシェーダーオブジェクトに送信します\n context.shaderSource(shader, source);\n \n // コンパイルシェーダー\n context.compileShader(shader);\n \n // コンパイルが成功したかどうか?\n if (!context.getShaderParameter(shader, context.COMPILE_STATUS)) \n {\n alert('An error occurred compiling the shaders: ' + context.getShaderInfoLog(shader));\n context.deleteShader(shader);\n \n return null;\n }\n \n return shader;\n }\n \n window.onload = main; //実行\n \n```",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-25T04:58:01.860",
"favorite_count": 0,
"id": "94309",
"last_activity_date": "2023-03-26T09:56:40.300",
"last_edit_date": "2023-03-26T09:56:40.300",
"last_editor_user_id": "7347",
"owner_user_id": "55177",
"post_type": "question",
"score": 0,
"tags": [
"typescript"
],
"title": "プログラムは実行できるがTypedocがエラーになる原因が知りたい。",
"view_count": 223
} | [
{
"body": "\"tsconfig.json\"で`strict`が真に設定されており、かつ、`noImplicitAny`が設定されていません。`strict`が真である場合で、個別に`noImplicitAny`を指定しない場合、`noImplicitAny`は真になります。`noImplicitAny`が真の場合は、[暗黙のany](https://typescriptbook.jp/reference/values-\ntypes-variables/any#%E6%9A%97%E9%BB%99%E3%81%AEany)が禁止されます。\n\n質問のソースコードでは暗黙のanyが使用されています。その... | 94309 | 94320 | 94320 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "Visual Basic のFormで、現dirからcsvファイルを読み込んで、図形を描くコードの作成をしています。\n\n初心者のため、csvファイルの入出力が分かりませんので、 \n最初に座標nodeと要素element(node番号を線分で接続)するFormを以下のように作成しました。 \n動作は正しく動きました。\n\n以下のコードで、Point部分に①のnode.csvからx、y座標を読み込んで、 \n②elementのように2点のnodeを線分で繋いで図を作成したいのですが、 \n初心者のため躓いていました。\n\nご知見を頂けますと有難く存じます。\n\n```\n\n Public Class Form1\n Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles MyBase.Paint\n \n Dim point1 As New Point(200, 400) 'node1\n Dim point2 As New Point(200, 100) 'node2\n \n e.Graphics.DrawLine(Pens.Blue, point1, point2) 'elem1\n \n Dim point11 As New Point(650, 400) 'node11\n Dim point12 As New Point(650, 100) 'node12\n \n e.Graphics.DrawLine(Pens.Blue, point11, point12) 'elem2\n \n Dim point3 As New Point(250, 100) 'node3\n Dim point4 As New Point(300, 100) 'node4\n Dim point5 As New Point(350, 100) 'node5\n Dim point6 As New Point(400, 100) 'node6\n Dim point7 As New Point(450, 100) 'node7\n Dim point8 As New Point(500, 100) 'node8\n Dim point9 As New Point(550, 100) 'node9\n Dim point10 As New Point(600, 100) 'node10\n \n e.Graphics.DrawLine(Pens.Blue, point2, point3) 'elem3\n e.Graphics.DrawLine(Pens.Blue, point3, point4) 'elem4\n e.Graphics.DrawLine(Pens.Blue, point4, point5) 'elem5\n e.Graphics.DrawLine(Pens.Blue, point5, point6) 'elem6\n e.Graphics.DrawLine(Pens.Blue, point6, point7) 'elem7\n e.Graphics.DrawLine(Pens.Blue, point7, point8) 'elem8\n e.Graphics.DrawLine(Pens.Blue, point8, point9) 'elem9\n e.Graphics.DrawLine(Pens.Blue, point9, point10) 'elem10\n e.Graphics.DrawLine(Pens.Blue, point10, point12) 'elem11\n \n End Sub\n \n End Class\n \n```\n\n①node.csv\n\n```\n\n 200 400\n 200 100\n 250 100\n 300 100\n 350 100\n 400 100\n 450 100\n 500 100\n 550 100\n 600 100\n 650 400\n 650 100\n \n```\n\n②element.csv\n\n```\n\n 1 2\n 11 12\n 2 3\n 3 4\n 4 5\n 5 6\n 6 7\n 7 8\n 8 9\n 9 10\n 10 12\n \n```",
"comment_count": 5,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-25T06:21:24.627",
"favorite_count": 0,
"id": "94311",
"last_activity_date": "2023-03-25T06:25:28.863",
"last_edit_date": "2023-03-25T06:25:28.863",
"last_editor_user_id": "26370",
"owner_user_id": "50731",
"post_type": "question",
"score": 0,
"tags": [
"vb.net"
],
"title": "Visual Basic のFormで、現dirからcsvファイルを読み込んで図形を描く",
"view_count": 108
} | [] | 94311 | null | null |
{
"accepted_answer_id": "94318",
"answer_count": 1,
"body": "##### 質問内容\n\n提示コードの上部のインポート文ですが`fs`を読み込んで`fs.readFile()`関数を使いたいのですが \n色々なやり方を試しても以下のようなエラーが出るのですがこれなぜなのでしょうか?\n\n[](https://i.stack.imgur.com/IRCtA.png)\n\n##### 知りたいこと\n\n`fs.readFile()`が見つからない原因が知りたい。\n\n##### 試したこと\n\n1,提示コードのように色々実験 \n2,`npm install fs` `npm install fs/promises`等をインストール \n3,`npm parcel index.html --open `コマンドを使って実行 \n4,自動補完の候補にも表示されます。 \n5,上の提示画像のように関数のリファレンスが読み込まれています。\n\n##### 環境\n\nOS: windows10 \nライブラリ:node.js,paracel \n言語: TypeScript\n\n##### 参考サイト\n\nファイルを読み込む: <https://jsprimer.net/use-case/nodecli/read-file/> \nfs: <https://www.delftstack.com/ja/howto/typescript/read-text-file-in-\ntypescript/> \n実行環境構築に参考にしたサイト: <https://ics.media/entry/190325/>\n\n##### コンソールログ\n\n```\n\n fs [object Object]\n Main.ts:9 fs.promises [object Object]\n Main.ts:10 fsPromises [object Object]\n Main.ts:11 fs.promises.readFile undefined\n Main.ts:13 fsNode [object Object]\n Main.ts:16 Uncaught TypeError: _fs.readFile is not a function\n at test (Main.ts:16:8)\n at cSHfb../FrameWork (Main.ts:27:1)\n at newRequire (index.21089774.js:71:24)\n at index.21089774.js:122:5\n at index.21089774.js:145:3\n \n```\n\n##### TypeScript.ts\n\n```\n\n import { main } from \"./FrameWork\";\n import * as fs from \"fs\";\n import * as fsPromises from \"fs.promises\";\n import * as fsNode from \"node:fs\";\n function test() \n {\n \n console.log(\"fs \" + fs); \n console.log(\"fs.promises \" + fs.promises); \n console.log(\"fsPromises \" + fsPromises); \n console.log(\"fs.promises.readFile \" + fs.promises.readFile); \n \n console.log(\"fsNode \" + fsNode); \n \n \n fs.readFile(\"asset/shader/BasicColor.vert\",'utf-8',(err,data) => {console.log(data);} );\n fsNode.readFile(\"asset/shader/BasicColor.vert\",'utf-8',(err,data) => {console.log(data);} );\n \n \n \n \n \n }\n \n \n \n test();\n \n \n \n \n main();\n \n```",
"comment_count": 3,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-25T07:46:57.750",
"favorite_count": 0,
"id": "94312",
"last_activity_date": "2023-03-25T17:22:22.467",
"last_edit_date": "2023-03-25T12:54:54.230",
"last_editor_user_id": "55177",
"owner_user_id": "55177",
"post_type": "question",
"score": 0,
"tags": [
"typescript"
],
"title": "Error: [ Uncaught TypeError: _fs.readFile is not a function ]の原因が知りたい",
"view_count": 214
} | [
{
"body": "> npm parcel index.html --open コマンドを実行しています\n\n`index.html` から `TypeScript.ts` を呼んでいるということですよね。 \n基本的に、ブラウザでは `fs` は動きません。それはサーバ側で使うものです。\n\nですが、[percel には `fs.readFileSync()`\nをエミュレートする機能がある](https://parceljs.org/features/node-emulation/#inlining-\nfs.readfilesync)ようです。",
"comment_count": 2,
... | 94312 | 94318 | 94318 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "以下のサイトを参考にしてFlutterの環境構築を行い、:wqで上書き保存を行った後に \n`which flutter` コマンドを入力後に \"flutter not found\"と表示され、パスが表示されません。\n\nnot found と表示されてしまう原因が分かる方がいらっしゃいましたらアドバイスお願いします。\n\n[Flutterの環境構築(Mac編)](https://zenn.dev/kboy/books/ca6a9c93fd23f3/viewer/5232dc)",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-25T08:35:07.093",
"favorite_count": 0,
"id": "94313",
"last_activity_date": "2023-03-28T09:03:02.580",
"last_edit_date": "2023-03-25T08:40:38.313",
"last_editor_user_id": "3060",
"owner_user_id": "54140",
"post_type": "question",
"score": 0,
"tags": [
"flutter"
],
"title": "flutterの環境構築をしようとしたところ、「flutter not found」となってしまって先に進めない",
"view_count": 137
} | [
{
"body": "`.zshrc`(もしくは `.bashrc`)を編集するだけでは駄目で、編集した内容を反映する(読み込む)必要があります。\n\nターミナルを一旦終了させ起動し直す、というのが簡単でわかりやすい反映方法かと考えます。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-28T09:03:02.580",
"id": "94355",
"last_activity_date": "2023-03-28T09:03:02.580",
"l... | 94313 | null | 94355 |
{
"accepted_answer_id": "94319",
"answer_count": 1,
"body": "##### 質問内容\n\n提示コードのスクリプト部ですがfetch関数を使ってテキストファイルの中身を表示させたいのですが正しいパスを指定してもなぜか実行時のエントリーポイントのindex.htmlの中身が表示されてしまうのですがこれはなぜでしょうか?原因がわかりません。\n\n##### 試したこと\n\n1,`tsc script/Main.ts`を実行して`npx paracel index.html --open`を実行 \n2,提示コードのようにファイルパスの間違えを疑いいくつかのパスで実行\n\n##### 参考サイト\n\nfetch(テキストファイルを読み込む 見出し部): <https://gray-code.com/javascript/load-file-with-\nfetch-api/#section2>\n\n##### 環境\n\nOS: windows10 \n言語: TypeScriopt\n\n##### テキストファイル内容\n\n```\n\n attribute vec4 aVertexPosition; //\n \n uniform mat4 uProjectionMatrix; //\n \n uniform mat4 uPosition; //\n uniform mat4 uScale; //\n uniform mat4 uRotate; //\n \n void main() \n {\n \n mat4 model = uPosition * uRotate * uScale; //\n \n gl_Position = (uProjectionMatrix * model) * aVertexPosition;\n }\n \n \n```\n\n##### コンソール\n\n```\n\n <!DOCTYPE html>\n <html lang=\"ja\">\n <head>\n <meta charset=\"utf-8\">\n <title>テスト</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/style.e308ff8e.css\">\n <script src=\"/style.e308ff8e.js\"></script></head> \n \n <body>\n \n <!-- スクリプト -->\n \n <canvas id=\"glCanvas\" width=\"640\" height=\"480\"></canvas>\n \n <script src=\"/Main.ddd9b095.js\" type=\"module\"></script>\n \n </body>\n \n </html>\n \n Main.ts:4 <!DOCTYPE html>\n <html lang=\"ja\">\n <head>\n <meta charset=\"utf-8\">\n <title>テスト</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/style.e308ff8e.css\">\n <script src=\"/style.e308ff8e.js\"></script></head> \n \n <body>\n \n <!-- スクリプト -->\n \n <canvas id=\"glCanvas\" width=\"640\" height=\"480\"></canvas>\n \n <script src=\"/Main.ddd9b095.js\" type=\"module\"></script>\n \n </body>\n \n </html>\n \n \n```\n\n##### script.ts\n\n```\n\n //fetch(\"../asset/shader/BasicColor.vert\").then((res)=>{return res.text();}).then((data) =>{ console.log(data); });\n fetch(\"asset/BasicColor.vert\").then((res)=>{return res.text();}).then((data) =>{ console.log(data); });\n fetch(\"asset/shader/BasicColor.vert\").then((res)=>{return res.text();}).then((data) =>{ console.log(data); });\n \n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-25T13:33:40.263",
"favorite_count": 0,
"id": "94315",
"last_activity_date": "2023-03-26T17:19:08.977",
"last_edit_date": "2023-03-26T17:19:08.977",
"last_editor_user_id": "-1",
"owner_user_id": "55177",
"post_type": "question",
"score": 0,
"tags": [
"typescript",
"parceljs"
],
"title": "fetch関数を使ってテキストファイルの中身を表示するとなぜかindex.htmlの中身が表示される原因が知りたい。",
"view_count": 159
} | [
{
"body": "Parcelのビルド(build)や開発サーバー(serve)では、次のファイルしか生成や公開の対象になりません。\n\n * エントリーポイントとして指定された各ファイル\n * エントリーポイントから再帰的に読み込まれる各ファイル、読み込まれる例は下記を参照 \n * HTML等での`src`や`href`属性等を用いて読み込まれれたりリンクが張ってあるHTML、CSS、JavaScript、画像等のファイル\n * CSS等での`@import`や`url()`による読み込み\n * JavaScript等での`import`または`require`による読み込みや、... | 94315 | 94319 | 94319 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "phpMyAdminでTableを作成、または列を増やしたりすると、添付のエラーが大量に出ます。 \n画像ではなく、文字をそのままとのことでしたので、各バージョンはとエラー内容は以下の通りとなります。 \nまた、エラーですが、最初の”ColumnsDefinition.php#171”から最後の数字が5づつ増えていき、最後の数字は#424となります。 \nどうぞよろしくお願いいたします。\n\nPHP:8.2.0 \nphpMyAdmin:5.2.0 \nサーバの種類: MySQL \nサーバのバージョン: 5.7.39 - MySQL Community Server (GPL)\n\nエラー内容:\n\n```\n\n Deprecation Notice in ./libraries/classes/Table/ColumnsDefinition.php#171\n Using ${var} in strings is deprecated, use {$var} instead\n \n Backtrace\n \n ClassLoader.php#571: include(./libraries/classes/ErrorHandler.php)\n ClassLoader.php#428: Composer\\Autoload\\includeFile(string '/Applications/MAMP/bin/phpMyAdmin5/vendor/composer/../../libraries/classes/Table/ColumnsDefinition.php')\n CreateController.php#165: Composer\\Autoload\\ClassLoader->loadClass(string 'PhpMyAdmin\\\\Table\\\\ColumnsDefinition')\n Routing.php#192: PhpMyAdmin\\Controllers\\Table\\CreateController->__invoke(\n ,\n array,\n )\n index.php#44: PhpMyAdmin\\Routing::callControllerForRoute(\n ,\n string '/table/create',\n ,\n ,\n )\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-26T05:53:46.353",
"favorite_count": 0,
"id": "94321",
"last_activity_date": "2023-03-27T06:56:08.800",
"last_edit_date": "2023-03-27T06:56:08.800",
"last_editor_user_id": "3060",
"owner_user_id": "57679",
"post_type": "question",
"score": 0,
"tags": [
"phpmyadmin"
],
"title": "phpMyAdminでテーブルの操作をするとエラーが大量に表示される",
"view_count": 122
} | [] | 94321 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "EC2で運用していく予定のWEBアプリにドメインを紐づけたいのですが、取得したドメインでアクセスできません。\n\n以下は試した内容です。\n\n * EIPでのアクセスは可能。\n\n * Route53でホストゾーンを再作成し、[Amazon Registrar](https://registrar.amazon.com/whois)でName Serverを確認した上でレコードを変更した。 \n([Route 53 を DNS サービスとして使用している際に発生する NXDOMAIN\nレスポンスをトラブルシューティングするにはどうすればよいですか?](https://repost.aws/ja/knowledge-\ncenter/route-53-troubleshoot-nxdomain-\nresponses)より、「ネームサーバーが同一でない場合は、ドメインレジストラでネームサーバーを更新する必要があります。ドメインが Route 53\nに登録されている場合は、「ドメインのネームサーバーおよびグルーレコードの追加あるいは変更」を参照してください」の記述を読んで、レコードを変更しました)\n\n * VPCホストの「ドメイン名」「DNS解決」を「有効」に変更した。\n\n * digでは status: SERVFAIL が返ってくる\n\n * nslookupでは server can't find ドメイン: NXDOMAIN が返ってくる\n\n知見が浅いため、この他必要な情報があればお伝えいたします。\n\n* * *\n\n参考にした記事\n\n * [Route53でホストゾーン作成時にSERVFAILとなる](https://qiita.com/kaikusakari/items/628fa099d25392e7e7db)\n * [Route53で取得したドメインでアクセスしてみよう](https://note.com/standenglish/n/n8f18cb21ac3d#23a9389d-108a-4e0d-9b81-80c0c89803bd)\n * [DNS 設定を変更したが、変更が適用されていない](https://docs.aws.amazon.com/ja_jp/Route53/latest/DeveloperGuide/troubleshooting-new-dns-settings-not-in-effect.html)",
"comment_count": 4,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-26T07:08:46.323",
"favorite_count": 0,
"id": "94324",
"last_activity_date": "2023-04-11T22:55:05.893",
"last_edit_date": "2023-04-11T22:55:05.893",
"last_editor_user_id": "4236",
"owner_user_id": "57681",
"post_type": "question",
"score": 0,
"tags": [
"aws",
"amazon-route53"
],
"title": "Route53で取得したドメインでEC2インスタンスに名前解決できない",
"view_count": 209
} | [
{
"body": "相変わらず何の操作を行ったのか具体性がなく読み取れません。\n\nRoute53において、 **取得したドメインでEC2インスタンスに名前解決** までに必要な操作を並べておきます。\n\n * EIP \n * アドレスを仮に 192.0.2.1 とします。\n * Public HostedZone \n * **作成する際のホストゾーン名は 取得したドメイン example.com を指定する**\n * 作成すると Name Servers に複数(概ね4個)のサーバーが設定される\n * **Aレコードを作成し、EIPのアドレス 192.0.2.1 を設定す... | 94324 | null | 94492 |
{
"accepted_answer_id": "94327",
"answer_count": 2,
"body": "##### 質問内容\n\n提示コードですが`await Promise.all();`の行以降のコードが実行されないのですがこれなぜでしょうか?\n\n##### 調べたこと\n\n1,コメント部`//let t = new Date().getTime() -\ntime.getTime();`でエラーが起きている可能性を考えコメントアウト \n2,`let pros = []` を`let pros = new Array()`に変更して実験 \n3,`await Promise.all();`以外の可能性を考えこれをコメントアウト \n4,`then()`の処理に`console.log()`を追加して検証 \n5,`pros.push()`を一個にして実験しましたが同じ場所で処理が進みません\n\n##### 参考サイト\n\n(全件一括(allAtOnce)部): <https://qiita.com/tonio0720/items/6f9319e4cce53256b4c9> \n公式リファレンス:\nhttps://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Promise\n\n##### 実現したいこと\n\n非同期でfetchを用いたファイルロードを行い同期との場合で処理速度の違いを確かめる処理を作成中で \nとりえず非同期を作成中\n\n##### 環境\n\nOS: windows10 \n言語: typescript\n\n##### コンソール\n\n```\n\n Main.js:45 配列に格納完了\n Main.js:46 1 test\n Main.js:47 2 test\n Main.js:48 3 test\n Main.js:49 4 test\n \n```\n\n```\n\n //let pros = [];\n let pros = new Array();\n \n const textPath = new URL(\"./sample.txt\", import.meta.url);\n \n \n \n async function Async_Fun()\n {\n \n \n \n \n \n \n pros.push( new Promise(() => { fetch(textPath).then( (response) => response.text() ).then( (data) => console.log(\"1 \" + data)); } ));\n pros.push( new Promise(() => { fetch(textPath).then( (response) => response.text() ).then( (data) => console.log(\"2 \" + data)); } ));\n pros.push( new Promise(() => { fetch(textPath).then( (response) => response.text() ).then( (data) => console.log(\"3 \" + data)); } ));\n pros.push( new Promise(() => { fetch(textPath).then( (response) => response.text() ).then( (data) => console.log(\"4 \" + data)); } ));\n console.log(\"配列に格納完了\");\n \n let time = new Date();\n \n await Promise.all(pros);\n //let t = new Date().getTime() - time.getTime();\n \n \n //console.log(\"time: \" + t);\n console.log(\"time: \");\n \n \n \n \n } \n \n Async_Fun();\n \n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-26T08:33:22.097",
"favorite_count": 0,
"id": "94325",
"last_activity_date": "2023-03-26T09:51:30.327",
"last_edit_date": "2023-03-26T09:30:04.490",
"last_editor_user_id": "55177",
"owner_user_id": "55177",
"post_type": "question",
"score": 0,
"tags": [
"typescript"
],
"title": "await Promise.all();以降の処理が実行されない原因が知りたい。",
"view_count": 169
} | [
{
"body": ">\n```\n\n> new Promise(() => { fetch(textPath).then( (response) => response.text()\n> ).then( (data) => console.log(data)); })\n> \n```\n\nと書かれていますが、 `fetch()` が完了したかどうか、 `response.text()`\nが完了したかどうか、を`console.log`等で確認されると止まっている個所が見えてくると思います。\n\n* * *\n\n環境が異なるため参考情報でしかありませんが、Google\nChrome上で同一... | 94325 | 94327 | 94327 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "flutterのchromeで実行をできていたのですが、画像を入れた途端に実行ができなくなり \ncannot launch without an active deviceと表示されます。 \n何回かやり直しましたが、必ず画像を表示する段階でエラーが起こります。何が原因かお分かりの方ご教授ください。よろしくお願いいたします!",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-26T10:42:36.307",
"favorite_count": 0,
"id": "94328",
"last_activity_date": "2023-03-26T10:42:36.307",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57687",
"post_type": "question",
"score": 0,
"tags": [
"画像",
"flutter",
"chrome-extension"
],
"title": "flutterの画像 エラー",
"view_count": 37
} | [] | 94328 | null | null |
{
"accepted_answer_id": "94333",
"answer_count": 2,
"body": "##### 質問内容\n\n提示コードの`test1(){}`,`test2(){}`関数ですが内部のようにPromiseを使って複数のファイルを非同期で読み込みたいのですがファイルの中身をpros[0]で見てみても中身がファイルの内容ではありません。これはどうすればいいのでしょうか?\n\n##### 知りたいことA\n\n非同期でファイルを読み込みたい\n\n##### 調べたこと\n\n`fetch()`の戻り値がPromiseで`then`をした`(res) => res.Text()`も非同期 \n`test1()`,`test2()`二つの関数を実験\n\n##### 参考サイト\n\n公式リファレンス:\n<https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise> \nqiita: <https://qiita.com/cheez921/items/41b744e4e002b966391a> \nブログ: <https://techplay.jp/column/581> \nfecth: <https://breezegroup.co.jp/202004/javascript-fetch/>\n\n##### ファイルの中身\n\n```\n\n test\n \n```\n\n##### コンソール\n\n```\n\n new Promise()\n Main.js:46 成功 resolve()\n Main.js:81 Promise {<fulfilled>: undefined}\n \n```\n\n##### ソースファイル\n\n```\n\n async function test1()\n {\n pros.push(fetch(textPath));\n pros.push(fetch(textPath));\n pros.push(fetch(textPath));\n \n await Promise.all(pros);\n \n console.log(pros[0]);\n }\n \n \n async function test2()\n {\n pros.push(fetch(textPath).then((res) =>{ res.text(); }));\n pros.push(fetch(textPath).then((res) =>{ res.text(); }));\n pros.push(fetch(textPath).then((res) =>{ res.text(); }));\n \n await Promise.all(pros);\n \n console.log(pros[0]);\n }\n \n \n test2();\n \n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-26T11:09:21.640",
"favorite_count": 0,
"id": "94330",
"last_activity_date": "2023-03-29T13:26:18.210",
"last_edit_date": "2023-03-29T13:26:18.210",
"last_editor_user_id": "7347",
"owner_user_id": "55177",
"post_type": "question",
"score": 0,
"tags": [
"typescript",
"promise"
],
"title": "fetch()関数を使って複数のファイルを非同期で読み込む処理を作りたい",
"view_count": 254
} | [
{
"body": "##### 知りたいことAについて (原因)\n\n`pros`配列は`Promise`を入れる配列のためそれを出力しても中身は`Promise`のため知りたい結果である`res.text();`の中身でありません。 \nよって\n\n##### 対処方法\n\n`Promise.all`の戻り値を利用する\n\n```\n\n let t = await Promise.all(pros);\n console.log(t[0]);\n \n```\n\n```\n\n async function test2()\n {\n pros.push(... | 94330 | 94333 | 94333 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "## 問題\n\ndockerのAlmalinux8コンテナの一般ユーザでcurlが失敗します。 \nrootユーザではcurlコマンドが成功するので、どこが悪さをしているのかがわかりません。 \n調査すべき点等あれば、ご教授頂きたいです。\n\n```\n\n [fuga@hoge ~]$ curl ipinfo.io\n curl: (7) Failed to connect to ipinfo.io port 80: Connection timed out\n \n```\n\n```\n\n [root@hoge /]# curl inet-ip.info\n XXX.XXX.XXX.XXX\n \n```\n\n## マシンの概要\n\n### ホストOS\n\n```\n\n cat /etc/issue\n Ubuntu 20.04.6 LTS\n \n```\n\n### dockerのバージョン\n\n```\n\n docker --version\n Docker version 23.0.1, build a5ee5b1\n \n```\n\n### コンテナ上のOS\n\n```\n\n cat /etc/system-release\n AlmaLinux release 8.7 (Stone Smilodon)\n \n```\n\n### curlのバージョン\n\n```\n\n curl --version\n curl 7.61.1 (x86_64-redhat-linux-gnu) libcurl/7.61.1 OpenSSL/1.1.1k zlib/1.2.11 nghttp2/1.33.0\n Release-Date: 2018-09-05\n Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp\n Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy\n \n```",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-27T00:39:21.953",
"favorite_count": 0,
"id": "94334",
"last_activity_date": "2023-03-27T00:39:21.953",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "56109",
"post_type": "question",
"score": 1,
"tags": [
"linux",
"docker",
"curl"
],
"title": "dockerのAlmalinux8コンテナの一般ユーザでcurlが失敗する",
"view_count": 75
} | [] | 94334 | null | null |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "現在、AWSのLambda(python)からSNSを利用して携帯電話へSMSを送信しようとしております。\n\n下記の参考サイトを参考に、トピックを作成したりポリシーを作成したり下記のコードを組んだのですが、どちらのコードも実行するとtimed\noutになりSMSを送信することができません。\n\nLambdaの当該の関数の「設定」→「アクセス権限」→「(当該ロール名)」→「許可を追加」→「ポリシーをアタッチ」で「AmazonSNSFullAccess」の許可を追加しております。\n\nまた【コード2】の実行時は、IAMで新規にユーザを追加した際に表示されるアクセスキーやシークレットアクセスキーをコード中で指定してあります。\n\nタイムアウトの時間もデフォルトの10秒から30秒に増やしてみましたが、それでも30秒後にタイムアウトになります。\n\nコードの問題なのか、トピックやポリシー、アクセス権限の問題なのかも特定できておりません。タイムアウトせずにLambdaからSMSを送信するには、どのように修正すればよいでしょうか?何卒よろしくお願い申し上げます。\n\n**参考サイト** \n<https://qiita.com/is_ryo/items/582656e41ffc7a8dbb5c> \n<https://business.ntt-east.co.jp/content/cloudsolution/column-try-29.html> \n<https://hacknote.jp/archives/42947/> \nなど\n\n**コード1**\n\n```\n\n import boto3\n \n def lambda_handler(event, context):\n print('before client.')\n sns = boto3.client('sns')\n \n print('before publish.')\n \n # 以下の処理でタイムアウト\n sns.publish(\n PhoneNumber='+8190XXXXXXXX', #自分の携帯電話番号\n Message='Test Message'\n )\n \n # timed outになりここまで処理が到達しない\n print('after publish.')\n # (以下略)\n \n```\n\n**コード2**\n\n```\n\n import boto3\n \n def lambda_handler(event, context):\n print('before client.')\n sns2 = boto3.client(\n 'sns',\n aws_access_key_id='アクセスキーID',\n aws_secret_access_key='シークレットアクセスキー',\n region_name='ap-northeast-1'\n )\n \n print('before publish.')\n \n # 以下の処理でタイムアウト\n sns2.publish(\n PhoneNumber='+8190XXXXXXXX', #自分の携帯電話番号\n Message='Test Message'\n )\n \n # ここまで処理が到達しない\n print('after publish.')\n # (以下略)\n \n```\n\n**Function Logs**\n\n```\n\n START RequestId: 3edaa607-eac2-4ea1-ac85-f83968212922 Version: $LATEST\n before client.\n before publish.\n 2023-03-27T00:44:55.781Z 3edaa607-eac2-4ea1-ac85-f83968212922 Task timed out after 30.03 seconds\n \n END RequestId: 3edaa607-eac2-4ea1-ac85-f83968212922\n REPORT RequestId: 3edaa607-eac2-4ea1-ac85-f83968212922 Duration: 30032.62 ms Billed Duration: 30000 ms Memory Size: 128 MB Max Memory Used: 65 MB Init Duration: 362.01 ms\n \n```",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-27T01:10:05.420",
"favorite_count": 0,
"id": "94335",
"last_activity_date": "2023-03-27T01:31:17.573",
"last_edit_date": "2023-03-27T01:31:17.573",
"last_editor_user_id": "3060",
"owner_user_id": "57343",
"post_type": "question",
"score": 0,
"tags": [
"flutter",
"aws-lambda",
"amazon-sns"
],
"title": "AWS LambdaからSMSを送信したいがtimed outになる",
"view_count": 166
} | [] | 94335 | null | null |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "ローソク足ごとに更新する必要があり、時にリペイントすることもあります。 \n修正お願いします。\n\n```\n\n #property indicator_chart_window\n #property indicator_buffers 4\n #property indicator_color1 Black\n #property indicator_color2 Black\n #property indicator_color3 Blue\n #property indicator_color4 Red\n \n #include <WinUser32.mqh>\n //---- input parameters\n extern int FastEMA=14;\n extern int SlowEMA=21;\n extern int RSIPeriod=12;\n extern bool Alerts=false;\n extern bool PlaySound=true;\n //---- buffers\n double ExtMapBuffer1[];\n double ExtMapBuffer2[];\n double ExtMapBuffer3[];\n double ExtMapBuffer4[];\n //double rsi_sig[];\n //---- variables\n int sigCurrent=0;\n int sigPrevious=0;\n double pipdiffCurrent=0;\n double pipdiffPrevious=0;\n //+------------------------------------------------------------------+\n //| Custom indicator initialization function |\n //+------------------------------------------------------------------+\n int init()\n {\n //---- indicators\n SetIndexStyle(0,DRAW_NONE);\n SetIndexBuffer(0,ExtMapBuffer1);\n SetIndexStyle(1,DRAW_NONE);\n SetIndexBuffer(1,ExtMapBuffer2);\n SetIndexStyle(2,DRAW_ARROW,1,2);\n SetIndexArrow(2,233);\n SetIndexBuffer(2,ExtMapBuffer3);\n SetIndexEmptyValue(2,0.0);\n SetIndexStyle(3,DRAW_ARROW,1,2);\n SetIndexArrow(3,234);\n SetIndexBuffer(3,ExtMapBuffer4);\n SetIndexEmptyValue(3,0.0);\n //----\n return(0);\n }\n //+------------------------------------------------------------------+\n //| Custom indicator deinitialization function |\n //+------------------------------------------------------------------+\n int deinit()\n {\n //----\n \n //----\n return(0);\n }\n //+------------------------------------------------------------------+\n //| Custom indicator iteration function |\n //+------------------------------------------------------------------+\n int start()\n {\n int limit;\n int counted_bars=IndicatorCounted();\n double rsi_sig=0;\n bool entry=false;\n double entry_point=0;\n \n //---- check for possible errors\n if(counted_bars<0) return(-1);\n //---- last counted bar will be recounted\n if(counted_bars>0) counted_bars--;\n limit=Bars-counted_bars;\n \n //---- main loop\n for(int i=0; i<limit; i++)\n {\n //---- ma_shift set to 0 because SetIndexShift called abowe\n ExtMapBuffer1[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i);\n ExtMapBuffer2[i]=iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);\n rsi_sig = iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, i);\n \n pipdiffCurrent=(ExtMapBuffer1[i]-ExtMapBuffer2[i]);\n \n \n if (pipdiffCurrent>0 && rsi_sig>50) \n {\n sigCurrent = 1; //Up\n }\n else if (pipdiffCurrent<0 && rsi_sig<50)\n {\n sigCurrent = 2; //Down\n }\n /*\n if (pipdiffCurrent>0) \n {\n sigCurrent = 1; //Up\n }\n else if (pipdiffCurrent<0)\n {\n sigCurrent = 2; //Down\n }\n */ \n \n if (sigCurrent==1 && sigPrevious==2)\n {\n ExtMapBuffer4[i-1] = High[i-1]+8*Point;\n //ExtMapBuffer3[i] = Ask;\n entry=true;\n entry_point=Ask;\n } \n else if (sigCurrent==2 && sigPrevious==1)\n {\n ExtMapBuffer3[i-1] = Low[i-1]-8*Point;\n //ExtMapBuffer4[i] = Bid;\n entry=true;\n entry_point=Bid;\n }\n \n \n sigPrevious=sigCurrent;\n pipdiffPrevious=pipdiffCurrent;\n }\n \n //----\n if(Alerts && entry)\n {\n PlaySound(StringSubstr(Symbol(),0,6)+\".wav\");\n if (sigPrevious==1)\n {\n MessageBox(\"Entry point: buy at \"+entry_point+\"!!\", \"Entry Point\", MB_OK);\n }\n else if (sigPrevious==2)\n {\n MessageBox(\"Entry point: sell at \"+entry_point+\"!!\", \"Entry Point\", MB_OK);\n }\n \n entry=false;\n }\n RefreshRates();\n \n //----\n return(0);\n }\n //+------------------------------------------------------------------+\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-27T01:51:13.530",
"favorite_count": 0,
"id": "94336",
"last_activity_date": "2023-03-27T02:05:15.157",
"last_edit_date": "2023-03-27T02:05:15.157",
"last_editor_user_id": "3060",
"owner_user_id": "57693",
"post_type": "question",
"score": 0,
"tags": [
"mql4"
],
"title": "mql4サインインジケーターのコードについて",
"view_count": 40
} | [] | 94336 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "### 解決したいこと\n\nExcel VBA 他シートの抽出したデータ内容が反映されない\n\n### 発生している問題・エラー\n\n他のシートからエクセルシートのデータ抽出を行いたいのですが、‘=’を用いたデータの反映が行われません。同一セルの中に他のデータを入れているのが問題なのでしょうか。\n\n**実際のコード:**\n\n```\n\n BASEDATE >= TO_DATE(‘元のシート!G7’,‘YYYY/MM/DD’)\n \n```\n\n### 自分で試したこと\n\n * シングルクォーテーションを外す\n\nどなたか解決の糸口が欲しいです。ご協力お願いします。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-27T03:52:07.020",
"favorite_count": 0,
"id": "94338",
"last_activity_date": "2023-03-28T08:52:34.180",
"last_edit_date": "2023-03-27T04:29:51.060",
"last_editor_user_id": "3060",
"owner_user_id": "57702",
"post_type": "question",
"score": 0,
"tags": [
"vba",
"excel"
],
"title": "Excel VBA 他シートの内容が反映されない",
"view_count": 108
} | [
{
"body": "```\n\n Dim BASEDATE As Date\n Dim TO_DATE As Date\n BASEDATE = #2023/03/31# '日付型の値を代入\n TO_DATE = CDate(Sheets(\"元のシート\").Range(\"G7\").Value) '文字列を日付型に変換\n If BASEDATE >= TO_DATE Then\n 'BASEDATEがTO_DATE以上ならば何らかの処理を行う\n End If\n \n```",
"comment_count": 0,
"conte... | 94338 | null | 94354 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "leafonyのAVR MCU + BLE Sugar でBLE通信を試しております。\n\n下記URLのサンプルプログラムは動作するのを確認したのですが、 \n次の段階として、ゲートウェイにBLEでデータを送信することを検討しております。 \n(サンプルプログラムURL) \n<https://docs.leafony.com/docs/examples/advanced/1_p/basic/webbluetooth_iot/>\n\nサンプルプログラムはどうやらGATT通信で書かれているようですが、 \n送信先のゲートウェイがGATT通信に対応しておりません。 \nアドバタイズで通信したいのですが、どのようにプログラムを書き換えればよいでしょうか。 \nご回答よろしくお願いいたします。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-27T05:09:01.323",
"favorite_count": 0,
"id": "94339",
"last_activity_date": "2023-03-27T05:09:38.857",
"last_edit_date": "2023-03-27T05:09:38.857",
"last_editor_user_id": "57704",
"owner_user_id": "57704",
"post_type": "question",
"score": 0,
"tags": [
"bluetooth-lowenergy"
],
"title": "leafonyのBLE アドバタイズの方法について",
"view_count": 32
} | [] | 94339 | null | null |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "WooCommerceの「Points and Rewards for WooCommerce」というプラグインで \n表示される文字を英語から日本語に変更したいのですが、日本語に変更すると表示されません。\n\n```\n\n <div class=\"woocommerce-message\" id=\"wps_wpr_order_notice\" style=\"background-color: <?php echo esc_html( $wps_wpr_notification_color ); ?>\">\n <?php esc_html_e( 'この部分', 'points-and-rewards-for-woocommerce' );\n \n```\n\nどうやれば表示できるか教えて下さい。よろしくお願いします。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-27T07:26:16.463",
"favorite_count": 0,
"id": "94342",
"last_activity_date": "2023-03-28T02:38:20.097",
"last_edit_date": "2023-03-28T02:38:20.097",
"last_editor_user_id": "3060",
"owner_user_id": "57708",
"post_type": "question",
"score": 0,
"tags": [
"php",
"wordpress"
],
"title": "WP関数 の esc_html_e()で、英語から日本語への変換が行われない",
"view_count": 53
} | [] | 94342 | null | null |
{
"accepted_answer_id": null,
"answer_count": 2,
"body": "初心者で質問の仕方が悪いかもしれませんがよろしくお願いいたします。\n\ncsvファイルをPythonで特定の列だけ結合したいです。1枚目のスクショのように「姓」と「名」のセルが分かれていますが、2枚目のように「姓名」のように結合させてその下のセルも自動で結合する方法を教えていただきたいです。 \nスクショは2行しかないですが、何十行、何百行も増えるので自動で姓と名をくっつけてくれるやり方を教えていただけたら幸いです。\n\n結合後の姓と名の間は半角でも全角でもどちらでも大丈夫です。\n\n[](https://i.stack.imgur.com/C13EM.png)\n\n[](https://i.stack.imgur.com/i5XzB.png)\n\n```\n\n import pandas as pd\n df = pd.read_csv('./offerlist.csv', encoding='cp932')\n df2 = df[[\"メールアドレス\", \"姓\", \"名\", \"住所\"]]\n print(df2)\n df2.to_csv('./output.csv',header=True,index=False)\n \n```\n\nよろしくお願いいたします!",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-27T08:54:44.037",
"favorite_count": 0,
"id": "94343",
"last_activity_date": "2023-03-28T03:00:56.617",
"last_edit_date": "2023-03-28T03:00:56.617",
"last_editor_user_id": "57710",
"owner_user_id": "57710",
"post_type": "question",
"score": 0,
"tags": [
"python",
"csv"
],
"title": "Pythonでcsvファイル内の特定の列だけ結合がしたい",
"view_count": 161
} | [
{
"body": "以下のように単純に列を足しあわせればよいと思います。\n\n```\n\n import pandas as pd\n \n df = pd.DataFrame({'メール':['a@example.com','b@example.com'],'姓':['tanaka','sato'],'名':['taro','hanako'],'値':[1,2]})\n df['姓名'] = df['姓'] + ' ' + df['名']\n df = df[['メール','姓名','値']]\n print(df)\n # メール ... | 94343 | null | 94344 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "# やりたいこと\n\nQt3D(Qt6.4.2)で,QGeometryやQGeometryRendererを継承したLineMeshを作成し,表示したいです.\n\n# 問題\n\n実行時に以下のようなエラーがアプリケーション出力に表示されラインは描画されません.\n\n```\n\n clientcore\\windows\\dwm\\dwmapi\\attribute.cpp(157)\\dwmapi.dll!00007FFBBAA437B1: (caller: 00007FFB4F8D610B) LogHr(1) tid(3084) 80070006 ハンドルが無効です。\n clientcore\\windows\\dwm\\dwmapi\\attribute.cpp(178)\\dwmapi.dll!00007FFBBAA43657: (caller: 00007FFB4F8D612D) ReturnHr(1) tid(3084) 80070057 パラメーターが間違っています。\n \n```\n\n```\n\n D3D11 ERROR: ID3D11Device::CreateInputLayout: The provided input signature expects to read an element with SemanticName/Index: 'TEXCOORD'/1, but the declaration doesn't provide a matching name. [ STATE_CREATION ERROR #163: CREATEINPUTLAYOUT_MISSINGELEMENT]\n \n```\n\n```\n\n Exception at 0x7ffbbd32cd29, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) in d3d11!D3DKMTWaitForVerticalBlankEvent\n Failed to create input layout: Error 0x80070057: ?p?????[?^?[??????????????B\n Qt3D.Renderer.RHI.Backend: Failed to build graphics pipeline: Creation Failed\n \n```\n\n1つ目と3つ目の出力はデバックモードで表示されます. \n2つ目の出力はリリースモードでも表示されます. \nまた,アプリケーションを終了する(ウィンドウを閉じる)とcrashします.\n\n# コード\n\n```\n\n LineGeometry::LineGeometry(Qt3DCore::QNode *parent)\n : Qt3DCore::QGeometry(parent)\n , _origin(QVector3D(0.0f, 0.0f, 0.0f))\n , _direction(QVector3D(10.0f, 10.0f, 10.0f))\n , positionAttribute(new Qt3DCore::QAttribute(this))\n , indexAttribute(new Qt3DCore::QAttribute(this))\n , positionBuffer(new Qt3DCore::QBuffer(this))\n , indexBuffer(new Qt3DCore::QBuffer(this))\n {\n positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName());\n positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float);\n positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute);\n positionAttribute->setBuffer(positionBuffer);\n positionAttribute->setVertexSize(3); //(x,y,z)\n positionAttribute->setByteStride(3 * sizeof(float)); //(x,y,z) * float\n positionAttribute->setCount(2); //{start,end}\n \n positionArray.resize(3 * 2 * sizeof(float)); //(x,y,z) * {start,end} * float\n \n indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedShort);\n indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute);\n indexAttribute->setBuffer(indexBuffer);\n indexAttribute->setCount(2); //{start,end}\n \n QByteArray indexArray;\n indexArray.resize(2 * sizeof(unsigned short)); //(x,y,z) * {start,end} * unsigned short\n unsigned short *i = reinterpret_cast<unsigned short*>(indexArray.data());\n *i++ = 0;\n *i++ = 1;\n indexBuffer->setData(indexArray);\n \n addAttribute(positionAttribute);\n addAttribute(indexAttribute);\n \n updatePositionData();\n }\n \n void LineGeometry::updatePositionData()\n {\n const QVector3D end = _origin + _direction;\n \n float *p = reinterpret_cast<float*>(positionArray.data());\n \n *p++ = _origin.x();\n *p++ = _origin.y();\n *p++ = _origin.z();\n \n *p++ = end.x();\n *p++ = end.y();\n *p++ = end.z();\n \n positionBuffer->setData(positionArray);\n }\n \n LineGeometryView::LineGeometryView(Qt3DCore::QNode *parent)\n : Qt3DCore::QGeometryView(parent)\n {\n LineGeometry *geometry = new LineGeometry(this);\n \n connect(geometry, &LineGeometry::originChanged, this, &LineGeometryView::originChanged);\n connect(geometry, &LineGeometry::directionChanged, this, &LineGeometryView::directionChanged);\n \n setGeometry(geometry);\n \n setPrimitiveType(Qt3DCore::QGeometryView::PrimitiveType::Lines);\n }\n \n LineMesh::LineMesh(Qt3DCore::QNode *parent)\n : Qt3DRender::QGeometryRenderer(parent)\n {\n LineGeometryView *geometry = new LineGeometryView(this);\n \n connect(geometry, &LineGeometryView::originChanged, this, &LineMesh::originChanged);\n connect(geometry, &LineGeometryView::directionChanged, this, &LineMesh::directionChanged);\n \n setView(geometry);\n \n setPrimitiveType(Qt3DRender::QGeometryRenderer::Lines);\n }\n \n```\n\n```\n\n SceneWindow::SceneWindow()\n : Qt3DExtras::Qt3DWindow()\n {\n /* ``` 省略 ``` */\n \n Qt3DCore::QEntity *lineEntity = new Qt3DCore::QEntity(rootEntity);\n Qt3DExtras::QPhongMaterial = new Qt3DExtras::QPhongMaterial(lineEntity);\n Qt3DCore::QTransform *lineTransform = new Qt3DCore::QTransform(lineEntity);\n LineMesh *lineMesh = new LineMesh(lineEntity);\n lineEntity->setParent(rootEntity);\n lineEntity->addComponent(lineMaterial);\n lineEntity->addComponent(lineTransform);\n lineEntity->addComponent(lineMesh);\n \n /* ``` 省略 ``` */\n }\n \n```\n\n# その他\n\nコードはqtのリポジトリにあるextrasを見ながら参考に書きました. \nもちろん,このLineをシーンに追加しなければこのようなエラーは起こりませんでした.\n\n# 環境\n\nWindows Qt6.4.2 MSVC2019 64bit",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-27T14:00:58.373",
"favorite_count": 0,
"id": "94346",
"last_activity_date": "2023-03-27T14:00:58.373",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57715",
"post_type": "question",
"score": 2,
"tags": [
"c++",
"qt"
],
"title": "Qt3Dでカスタムメッシュで線を表示したいが,エラーログが出て描画されない",
"view_count": 63
} | [] | 94346 | null | null |
{
"accepted_answer_id": "94353",
"answer_count": 1,
"body": "とても長いので一部抜粋ですが、タイトル通り \nPygameでrect.centerで幅500高さ187の画像を500x500ウィンドウの真ん中に表示したい。 \nのですが良い案が浮かばずあまりプログラミング知識も浅いため検索もできず \n困っています。どうしたらよいでしょうか?\n\n```\n\n #ゲームオーバー画面の表示について\n if gameover:\n mixer.music.load('musics/carcrush.wav')\n mixer.music.play()\n \n screen.blit(crash, crash_rect)\n \n \n gvgamen = pygame.image.load(\"gameovermoto2-3.png\")\n gvgamen_rect = gvgamen.get_rect()\n gvgamen_rect.center = (\"\")\n screen.blit(gvgamen, gvgamen_rect)\n \n \n pygame.display.update()\n \n```",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-27T17:01:35.763",
"favorite_count": 0,
"id": "94348",
"last_activity_date": "2023-03-28T07:28:41.507",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "47754",
"post_type": "question",
"score": 0,
"tags": [
"python",
"pygame"
],
"title": "Pygameでrect.centerで幅500高さ187の画像を500x500ウィンドウの真ん中に表示したい。",
"view_count": 148
} | [
{
"body": "`gvgamen_rect.center`を`screen.get_rect().center`に合わせることで画像の中央をスクリーンの中央に合わせることができます。\n\nご質問のコードにある`gvgamen_rect.center = (\"\")`を、`gvgamen_rect.center =\nscreen.get_rect().center`に変更してください。\n\n**サンプルコード**\n\n```\n\n import pygame\n import sys\n \n pygame.init()\n screen = pygame.display... | 94348 | 94353 | 94353 |
{
"accepted_answer_id": null,
"answer_count": 2,
"body": "1枚目の写真のcsvファイルであれば「メールアドレス」「姓」「名」「住所」だけを抽出して、さらに2枚目の写真のように「姓」と「名」の列のセルを結合して表示させたいと思っています。 \n写真では2行ですがもっと増えていくので、行が増えればcsvファイルで自動で特定の列を抽出して、特定のセルも結合して表示させる方法を教えていただきたいです。\n\n[](https://i.stack.imgur.com/1WXzR.png)\n\n[](https://i.stack.imgur.com/S9S0b.png)",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-28T03:34:52.233",
"favorite_count": 0,
"id": "94350",
"last_activity_date": "2023-03-28T10:12:18.230",
"last_edit_date": "2023-03-28T04:01:08.937",
"last_editor_user_id": "57710",
"owner_user_id": "57710",
"post_type": "question",
"score": 0,
"tags": [
"python",
"csv"
],
"title": "csvファイルをPythonで特定の列だけを抽出して、さらに抽出した列の中で特定の列だけセル結合したい",
"view_count": 281
} | [
{
"body": "Polarsライブラリー使う方法\n\n```\n\n import polars as pl\n import io\n csv_file = io.StringIO('''\n メール,姓,名,出身地,住所\n a@example.com,tanaka,taro,北海道,東京都1-1-1\n b@example.com,sato,hanako,大阪府,神奈川県1-1-2\n c@example.com,takahasi,jiro,大阪府,千葉県1-1-3\n d@example.com,cat,tama,,埼玉県1-1-4\n e@exa... | 94350 | null | 94352 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "ローカルNW環境に設置しているWindowsServer(固定IP)が、約10分間隔でDHCP Discoverパケットを送信し続ける動作に悩んでいます。 \nなぜIPアドレスが確定しているのにも関わらずDiscoverを送信するのでしょうか?\n\nこの動作の原因とDiscoverの送信を停止する方法を教えていただきたいです。\n\n#### 条件 / 環境\n\n * WindowsServer 2022, 2019で同じ動作を確認\n * WindowsServer自身にAD、DHCPサーバ機能を設定済み\n * ローカルNWでIPアドレスは固定のIPv4アドレス\n\n#### 確認した動作\n\n * 約10分間隔でDiscoverパケットを送信する \n(複数回再送を繰り返してまた10分後に送信が始まる)\n\n * DiscoverのソースIPは0.0.0.0、宛先はリミテッドブローキャスト\n * DHCPパケットはDiscoverのみ",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-28T13:05:11.700",
"favorite_count": 0,
"id": "94358",
"last_activity_date": "2023-03-29T01:44:38.640",
"last_edit_date": "2023-03-29T01:44:38.640",
"last_editor_user_id": "3060",
"owner_user_id": "57730",
"post_type": "question",
"score": 0,
"tags": [
"windows",
"network",
"windows-server"
],
"title": "WindowsServerが固定IPアドレスに設定されている状態で、DHCP DiscoverをWindowsServerが送信する動作を停止する方法",
"view_count": 95
} | [] | 94358 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "Rをインストール済みのWindowsPCでバッチファイルからRを実行したいと考えております。 \n2行の短いプログラムなので、プログラムファイルは別に置かずに、バッチファイル内にコードを記述する方法を探していますが見つかりません。 \n(バッチファイルからRプログラムを実行する方法は見つかるのですが。) \n対応できる方法はありますでしょうか。ご教示いただけますと幸いです。\n\nどうぞよろしくお願いいたします。",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-28T14:09:41.400",
"favorite_count": 0,
"id": "94359",
"last_activity_date": "2023-05-22T04:03:33.620",
"last_edit_date": "2023-03-28T15:37:16.510",
"last_editor_user_id": "3060",
"owner_user_id": "12457",
"post_type": "question",
"score": 0,
"tags": [
"r",
"batch-file"
],
"title": "Rをバッチファイルのみで実行する方法",
"view_count": 110
} | [
{
"body": ".R のスクリプトをコマンドラインから実行するには `Rscript` コマンドを使用します。\n\n```\n\n Rscript ~/myscript.R\n \n```\n\nのように書くだけで大丈夫です。\n\nRscript コマンド自体がインストールされているか確認するには \n`which Rscript` とタイプしてみてください",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-05-22T04:03:33.620",
"i... | 94359 | null | 94935 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "初書き込みです、よろしくお願いいたします。\n\n普段使用しているWindowsPCを使用してUSB-C接続の外部SSDへUbuntuをインストールしました。 \nその後より端末起動時に \n①Ubuntu=USB-Cを接続しているときはgrubのOS選択画面が \n➁Ubuntu=USB-Cを接続していないときには\"Minimal BASH-like line editing is\nsupported.....\"と言った文言とともにgrubコンソール画面が表示されるようになりました。\n\n①の場合は選択したOSがそれぞれ起動するので良いのですが \n➁の場合はgrubコンソールにて二回exitと入力することでwindowsが起動する事になっており、少々手間です。\n\nやりたいことは➁のUSB-C接続していないときにgrubコンソール画面を表示させずにいままで通りにwindowsの起動をさせたいと思っています。\n\n色々とgrub周りの情報を調べたのですが、解決策が見当たらず。 \n/etc/default/grubの設定でどうにかなるのでしょうか? \nお教え頂ければ幸いです。\n\n追記 \nありがとうざございます。 \nコメントで結果を上手く表示できないのでこちらで表記します。\n\n```\n\n hajime@hajime-MB-K690:~$ sudo cat /boot/efi/EFI/ubuntu/grub.cfg\n [sudo] hajime のパスワード: \n search.fs_uuid aebf0b9e-caff-497c-adf4-3b35ee4d5620 root hd1,gpt1 \n set prefix=($root)'/boot/grub'\n configfile $prefix/grub.cfg\n \n```\n\nそして/boot/grub/grub.cfgのmenuentryがこちらです。\n\n```\n\n hajime@hajime-MB-K690:~$ grep -e \"^\\(menuentry\\)\\|\\(submenu\\)\" /boot/grub/grub.cfg\n menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-aebf0b9e-caff-497c-adf4-3b35ee4d5620' {\n submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-aebf0b9e-caff-497c-adf4-3b35ee4d5620' {\n menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option 'osprober-efi-2C18-BC38' {\n menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {\n \n```",
"comment_count": 6,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-28T15:33:31.413",
"favorite_count": 0,
"id": "94360",
"last_activity_date": "2023-03-28T18:20:29.713",
"last_edit_date": "2023-03-28T18:20:29.713",
"last_editor_user_id": "57731",
"owner_user_id": "57731",
"post_type": "question",
"score": 1,
"tags": [
"windows",
"ubuntu",
"grub"
],
"title": "ubuntuを外部ストレージにインストール後に表示されるようになったgrubコンソール画面を出ないようにしたい",
"view_count": 125
} | [] | 94360 | null | null |
{
"accepted_answer_id": "94369",
"answer_count": 1,
"body": "私はflutterアプリをcodemagicで自動ビルドし、Firebase App\nDistributionを利用してテスターに配布したいのですが、公開がうまくいっておらず悩んでいます。 \ncodemagicの設定でDistributionの欄からFirebase App Distributionは正しく設定してあります。 \nこちらがPublishing欄のコマンドラインです。\n\n```\n\n == Gathering artifacts ==\n \n == Publishing artifacts ==\n \n Publishing artifact app-release.aab\n Publishing artifact mapping.txt\n Publishing artifact Runner.app.zip\n Skip publishing Ios to Firebase App Distribution: no matching artefacts found.\n Skip publishing to Firebase App Distribution: no matching artefacts found.\n Skip publishing Android to Firebase App Distribution: no matching artefacts found.\n Skip publishing to Firebase App Distribution: no matching artefacts found.\n \n```\n\nandroid,iosどちらもエラーなく完了しています。 \nこの問題を解決させる方法をご存じの方教えていただきたいです。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-28T15:34:25.423",
"favorite_count": 0,
"id": "94361",
"last_activity_date": "2023-03-29T06:07:43.570",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "53335",
"post_type": "question",
"score": 0,
"tags": [
"flutter"
],
"title": "codemagicでのビルドでFirebase App Distributionの公開がスキップされる。",
"view_count": 90
} | [
{
"body": "Distribution欄にて、Android code signing及び、iOS code signingの項目も有効にする必要があるかと思います。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-29T06:07:43.570",
"id": "94369",
"last_activity_date": "2023-03-29T06:07:43.570",
"last_edit_date": null,
"last_e... | 94361 | 94369 | 94369 |
{
"accepted_answer_id": "94365",
"answer_count": 1,
"body": "bandという辞書型配列があり、1つのキーが複数の値を持っています。 \nこの配列の各キー(Band 1, Band 2, Band 3)について、そのキーが持つ値の合計を算出したいです。出力したい結果のイメージを以下に示します。\n\n```\n\n BandNum : Total\n Band 1 : 57468\n Band 2 : 65377\n Band 3 : 62070\n \n```\n\nsum関数を用いて算出しようとしたのですが、以下のようなエラーが出ました。\n\n```\n\n TypeError: unsupported operand type(s) for +: 'int' and 'list'\n \n```\n\n\"intとlist同士で+演算子を使っている\"という意のエラーだと思うのですが、この解決方法が分かりません。 \nご教授のほどお願いいたします。\n\nコードを以下に示します。\n\n```\n\n import pandas as pd\n \n df = pd.read_fwf('Histogram1.txt', header=None, names=['Band', 'DN', 'Npts', 'Total', 'Percent', 'Acc Pct'])\n band = df.query('Band != \"Histogram\"').ffill().astype({'DN': int, 'Npts': int, 'Total': int, 'Percent': float, 'Acc Pct': float})\\\n .groupby('Band').apply(lambda x: x['DN'].repeat(x['Npts']).to_list()).to_dict()\n \n print(band)\n \n result = sum(band.values())\n \n print(result)\n \n```\n\n初めに読み込んでいる\"Histogram1.txt\"ファイルを以下に示します。\n\n```\n\n Histogram DN Npts Total Percent Acc Pct\n Band 1 178 1 1 0.3322 0.3322\n 179 2 3 0.6645 0.9967\n 180 3 6 0.9967 1.9934\n 181 6 12 1.9934 3.9867\n 182 8 20 2.6578 6.6445\n 183 10 30 3.3223 9.9668\n 184 10 40 3.3223 13.2890\n 185 11 51 3.6545 16.9435\n 186 10 61 3.3223 20.2658\n 187 21 82 6.9767 27.2425\n 188 25 107 8.3056 35.5482\n 189 26 133 8.6379 44.1860\n 190 23 156 7.6412 51.8272\n 191 20 176 6.6445 58.4718\n 192 20 196 6.6445 65.1163\n 193 9 205 2.9900 68.1063\n 194 8 213 2.6578 70.7641\n 195 13 226 4.3189 75.0831\n 196 19 245 6.3123 81.3953\n 197 11 256 3.6545 85.0498\n 198 12 268 3.9867 89.0365\n 199 12 280 3.9867 93.0233\n 200 6 286 1.9934 95.0166\n 201 3 289 0.9967 96.0133\n 202 6 295 1.9934 98.0066\n 203 4 299 1.3289 99.3355\n 204 2 301 0.6645 100.0000\n \n Histogram DN Npts Total Percent Acc Pct\n Band 2 208 1 1 0.3322 0.3322\n 209 4 5 1.3289 1.6611\n 210 9 14 2.9900 4.6512\n 211 12 26 3.9867 8.6379\n 212 28 54 9.3023 17.9402\n 213 38 92 12.6246 30.5648\n 214 11 103 3.6545 34.2193\n 215 24 127 7.9734 42.1927\n 216 24 151 7.9734 50.1661\n 217 23 174 7.6412 57.8073\n 218 12 186 3.9867 61.7940\n 219 15 201 4.9834 66.7774\n 220 16 217 5.3156 72.0930\n 221 15 232 4.9834 77.0764\n 222 18 250 5.9801 83.0565\n 223 10 260 3.3223 86.3787\n 224 17 277 5.6478 92.0266\n 225 13 290 4.3189 96.3455\n 226 4 294 1.3289 97.6744\n 227 3 297 0.9967 98.6711\n 228 4 301 1.3289 100.0000\n \n Histogram DN Npts Total Percent Acc Pct\n Band 3 193 1 1 0.3322 0.3322\n 194 3 4 0.9967 1.3289\n 195 3 7 0.9967 2.3256\n 196 7 14 2.3256 4.6512\n 197 9 23 2.9900 7.6412\n 198 17 40 5.6478 13.2890\n 199 6 46 1.9934 15.2824\n 200 12 58 3.9867 19.2691\n 201 26 84 8.6379 27.9070\n 202 20 104 6.6445 34.5515\n 203 15 119 4.9834 39.5349\n 204 15 134 4.9834 44.5183\n 205 14 148 4.6512 49.1694\n 206 16 164 5.3156 54.4850\n 207 18 182 5.9801 60.4651\n 208 14 196 4.6512 65.1163\n 209 13 209 4.3189 69.4352\n 210 8 217 2.6578 72.0930\n 211 16 233 5.3156 77.4086\n 212 7 240 2.3256 79.7342\n 213 14 254 4.6512 84.3854\n 214 16 270 5.3156 89.7010\n 215 6 276 1.9934 91.6944\n 216 4 280 1.3289 93.0233\n 217 7 287 2.3256 95.3488\n 218 2 289 0.6645 96.0133\n 219 2 291 0.6645 96.6777\n 220 3 294 0.9967 97.6744\n 221 2 296 0.6645 98.3389\n 222 0 296 0.0000 98.3389\n 223 2 298 0.6645 99.0033\n 224 3 301 0.9967 100.0000\n \n```\n\n辞書型配列bandを以下に示します(長いので一部省略しています)\n\n```\n\n {'Band 1': [178, 179, 179, 180, 180, 180, 181, 181, 181,・・・省略・・・, 204, 204], 'Band 2': [208, 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, 210, 210, 210,・・・省略・・・, 228, 228, 228], 'Band 3': [193, 194, 194, 194, 195, 195, 195, 196, 196, 196, 196, 196, 196, 196, 197, 197, ・・・省略・・・, 224, 224, 224]}\n \n```",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-28T21:22:12.720",
"favorite_count": 0,
"id": "94363",
"last_activity_date": "2023-03-29T02:27:13.890",
"last_edit_date": "2023-03-29T01:51:29.107",
"last_editor_user_id": "55619",
"owner_user_id": "55619",
"post_type": "question",
"score": 0,
"tags": [
"python"
],
"title": "Pythonで同じキーの値(value)を足し算する方法",
"view_count": 118
} | [
{
"body": "```\n\n import pandas as pd\n \n df = pd.read_fwf('Histogram1.txt', header=None, names=['Band', 'DN', 'Npts', 'Total', 'Percent', 'Acc Pct'])\n band = df.query('Band != \"Histogram\"').ffill().astype({'DN': int, 'Npts': int, 'Total': int, 'Percent': float, 'Acc Pct': float})\\\n ... | 94363 | 94365 | 94365 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "GoogleCalendarAPIを利用してGoogleカレンダーの \n設定と共有>マイカレンダーの設定>予定のアクセス権限>(組織名)で利用できるようにする \nの設定をGASなどで対象者を一括で変更する方法はありますか?\n\nイベントではなくマイカレンダーの設定を変更する方法があれば教えてください。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-29T02:20:40.500",
"favorite_count": 0,
"id": "94366",
"last_activity_date": "2023-03-29T02:20:40.500",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57432",
"post_type": "question",
"score": 0,
"tags": [
"google-apps-script",
"google-calendar-api",
"google-workspace"
],
"title": "Googleカレンダーのマイカレンダーの設定をGoogleCalendarAPIで対象者を一括で変更する方法",
"view_count": 57
} | [] | 94366 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "# やりたいこと\n\nWindows環境下のQEMUでDebian10を実行したい。\n\n## 環境\n\nCPU:Intel Corei7-8700 3.2GHz \nMemory:16GB \nOS:Windows10 Pro、Ubuntu20.04LTS デュアルブートで起動時選択 \nQEMU:version 7.2.0 (v7.2.0-11948-ge6523b71fc-dirty)\n\n# やったこと\n\n```\n\n > qemu-system-x86_64.exe -enable-kvm -m 2G (ターゲットOS).qcow2\n \n```\n\n上記コマンドを \n1)ホストOS;Ubuntu 20.04LTSで実行:問題なく実行できた。 \n2)ホストOS:Windows10 Pro で実行:「invalid accelerator kvm」と表示され起動できない。 \n3)ホストOS:Windows10 Pro でenable-kvmなしで実行:起動はするが、遅くてマウスがまともに移動できない。\n\nできれば、デュアルブートせず、ホストをWindows10 Proのまま使用したいです。",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-29T02:34:31.000",
"favorite_count": 0,
"id": "94367",
"last_activity_date": "2023-03-29T02:47:12.557",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "32891",
"post_type": "question",
"score": 1,
"tags": [
"windows-10",
"qemu"
],
"title": "Windows環境でのQEMUで、enable-kvmオプションを指定するとエラーとなる",
"view_count": 103
} | [
{
"body": "自己解決してしまいました。\n\n参考記事 \n[Accelerating QEMU on Windows with HAXM](https://www.qemu.org/2017/11/22/haxm-\nusage-windows/)\n\n必要なこと \n・Hyper-Vを無効化 \n・HAXMをインストール \n・以下のコマンドに変更\n\n```\n\n qemu-system-x86_64.exe -m 2G -hda (ターゲットOS).qcow2 -accel hax\n \n```",
"comment_count": 0,
"content... | 94367 | null | 94368 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "\"remotepath\": \"/home/ice888/siteof.net/public_html/mosya\",\n\nこのmosyaの階層にアップロードしたいのですが、上のリモートパスでも、ice888の階層にアップロードされてしまいます。\n\n文字列を変えたりして試行錯誤しましたが、変わりません。\n\n独自ドメインが、siteof.netなのですが、ドメインの設定が原因で下の階層にアップロードされないのでしょうか?。サーバーへの紐づけはきちんとされています。\n\n誰かわかる方教えてください。\n\nご回答よろしくお願いします。",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-29T11:36:09.927",
"favorite_count": 0,
"id": "94372",
"last_activity_date": "2023-04-10T05:09:30.723",
"last_edit_date": "2023-03-29T13:42:51.410",
"last_editor_user_id": "7347",
"owner_user_id": "56858",
"post_type": "question",
"score": 2,
"tags": [
"vscode",
"sftp"
],
"title": "vscodeのSFTPでアップロードすると、かなり上の階層にアップロードされてしまいます。独自ドメイン以下の層にアップロードしたいです。",
"view_count": 120
} | [
{
"body": "# 原因\n\n質問に提示されている設定では、 `remotepath` のようにすべて小文字になっています。しかし、該当の拡張機能のドキュメントでは、\n`remotePath` のように `P` が大文字になっています。\n\n接続やファイルのアップロードは正常に出来ているにも関わらずファイルの書き込み先が違うという問題から、この大文字小文字の間違いを拡張機能側が気づいていない(ため、\n`remotePath` が設定されていないと認識して、デフォルトの場所にアップロードしている)と思われます。\n\n```\n\n {\n \"name\": \"Profile Na... | 94372 | null | 94466 |
{
"accepted_answer_id": "94377",
"answer_count": 1,
"body": "Pythonで関数内の `if` 内で定義された変数の処理に困っています。\n\n以下のようなプログラムを作っています。\n\n**目的:** \n同階層フォルダ、もしくは1つ下の階層のフォルダの中にあるpngファイル名の変更\n\n * TKinterのラジオボタンを使って、指定階層を【同階層】【1つ下の階層】と切り替え\n * ウィジェット変数を使ってフォルダのパスを取得\n * `/*.png` と `/*/*.png` をくっつけてglobでまとめて取得\n\n初心者ゆえとりあえず思いついたものいろいろやってみたのですが、何も取得できず困ってます。\n\n**問題のコード** \nこちらのpathがおそらく取得できておらず空の状態になっています。 \nどのようにしたらいいでしょうか。 \nラジオボタンの値取得などは正常に動作しているようですが、filelistを確認しても何も入っていませんでした。\n\n```\n\n def list_create():\n def get_file_path():\n path = ''\n folder_path = folder.get()\n if rename_type.get() == 1: \n path = folder_path + '/*.png'\n elif rename_type.get() == 2: \n path = folder_path + '/*/*.png'\n return path\n \n path = get_file_path()\n filelist = glob.glob(path)\n \n```\n\n下記に関係ありそうな部分を抽出しています。folderやrename_typeはこちらにあります。\n\n```\n\n #ウィジット変数\n folder = tkinter.StringVar()\n rename_type = tk.StringVar(value=\"ファイル名変更\")\n \n #フレームに入れる\n frame = tk.Frame(window)\n frame.pack(side=tk.TOP, pady=10)\n part_rename_radiobutton = tk.Radiobutton(frame, text=\"個々\", variable=rename_type, value=1)\n export_rename_radiobutton = tk.Radiobutton(frame, text=\"まとめて\", variable=rename_type, value=2)\n \n```",
"comment_count": 3,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-30T02:44:15.527",
"favorite_count": 0,
"id": "94376",
"last_activity_date": "2023-03-30T09:14:39.360",
"last_edit_date": "2023-03-30T09:14:39.360",
"last_editor_user_id": "7347",
"owner_user_id": "57743",
"post_type": "question",
"score": 0,
"tags": [
"python",
"python3"
],
"title": "関数内のifで定義された変数の処理について",
"view_count": 154
} | [
{
"body": ">\n```\n\n> rename_type = tk.StringVar(value=\"ファイル名変更\")\n> \n```\n\nこれは文字列型では無いでしょうか? \n`if` 文の分岐では数値で判断しているのであてはまらず、`path` の中身が空のままになります\n\n文字列で比較して分岐させるか、数値に変換して分岐させればいかがでしょうか",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-30T03:04:40.337",
... | 94376 | 94377 | 94377 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "ローカルではメールが届いているが、デプロイして本番にあげた途端届かない事象が起きました。\n\nvercelのログを見ると200は返してるので送信自体は成功しているっぽい。けど実際にメールが届かない...\n\nsendgridのActivity見ても反映されていない...basic認証かけてたせいかと思ったけど無くしても意味なく...\n\n同じ現象に遭遇した方いませんか?\n\n一応参考にしたサイト \n<https://zenn.dev/aono/articles/fc4fa8863134ac>",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-30T03:31:00.587",
"favorite_count": 0,
"id": "94378",
"last_activity_date": "2023-03-30T05:47:53.623",
"last_edit_date": "2023-03-30T05:47:53.623",
"last_editor_user_id": "57745",
"owner_user_id": "57745",
"post_type": "question",
"score": 0,
"tags": [
"reactjs",
"next.js"
],
"title": "sendgridを利用したお問い合わせがvercelにデプロイすると送信されない",
"view_count": 64
} | [] | 94378 | null | null |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "タイトルが分かりにくくて申し訳ありません。\n\nuseStateのセット関数で更新した値をすぐに参照したのですが、更新前の値が取れてしまいます。 \nuseStateの更新はすぐに実行されないというのは知っています。\n\n### やりたいこと\n\nイベント内でuseStateの更新後の値をすぐに参照したいです。\n\n### 概要\n\nイベント内でリストを再取得し、再取得後のリスト件数(multipleList.length)で判定をしたいです。 \n今は更新前の値が取れる為、1ステップ処理が遅れている状態です。\n\n### コード\n\n```\n\n const [ multipleList, setMultipleList ] = useState<selectAddressList[]>([])\n \n // ★1\n useEffect(() => {\n const setNewSelAddrList = () => {\n if (selAddressList && selAddressList.length > 0){\n const newList = [...selAddressList]\n \n // ここで更新後の住所リストが格納されているのは確認済\n setMultipleList(newList);\n }\n }\n setNewSelAddrList();\n }, [selAddressList])\n \n // コンボボックス変更イベント\n const onChangeAddr3 = async(rowData:string) => {\n \n // rowDataには、郵便番号が入っている\n if (rowData != ''){\n \n // 郵便番号から住所一覧を取得\n await dispatch(fetchAsyncSelectedAddressList(rowData.toString())) // ★2\n \n // ★更新された住所リストの件数で判定したい★\n if (multipleList.length == 0){\n XXXXXXX\n }\n \n }\n };\n \n```\n\n### 補足\n\n★1 住所リスト(selAddressList)が変更されたタイミングでイベント発火。 \nfetchAsyncSelectedAddressListでselAddressListが更新されます。 \n★2 ReduxのSliceを通して、APIからデータ取得し、住所リスト(selAddressList)を更新している\n\n宜しくお願い致します。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-30T06:41:04.920",
"favorite_count": 0,
"id": "94379",
"last_activity_date": "2023-04-05T02:34:34.300",
"last_edit_date": "2023-04-05T02:34:34.300",
"last_editor_user_id": "3060",
"owner_user_id": "57747",
"post_type": "question",
"score": 1,
"tags": [
"javascript",
"reactjs",
"redux"
],
"title": "ReduxでdispatchしpayloadからのuseEffectを実行しその中のuseStateのセット関数で更新した値で判定する方法",
"view_count": 42
} | [] | 94379 | null | null |
{
"accepted_answer_id": "94390",
"answer_count": 1,
"body": "##### 質問内容\n\n提示コードの`<!-- ここに置きました\n-->`ですがこの場所に提示コード下部のコード`<!--########-->`部のコードを置いたのですが。プログラムは実行でき`dialog`タグが`Javascript`を通して画面に表示されるのですがその後閉じるタグである`<button`タグのクリックしても閉じません。しかし`<!--########-->`の場所にコードを移動して実行すると閉じることができした。これなぜでしょうか?\n\n##### 知りたいこと\n\ndialogタグのコードを置く場所の理由が知りたい\n\n##### 参考サイト\n\nリファレンスサイト: https://developer.mozilla.org/ja/docs/Web/HTML/Element/dialog\n\n##### script.js\n\n```\n\n var dialog = document.querySelector(\"dialog\");\n \n console.log(dialog?.close);\n var btn_close = document.getElementById(\"modal_Close\");\n \n btn_close?.addEventListener('click',function()\n {\n console.log(\"close\");\n dialog!.open = false;\n \n dialog?.close();\n console.log(\"end\");\n \n \n },false);\n \n \n \n \n /*########################################################################\n # ポップアップウインドウを表示\n ##########################################################################*/\n function PopUpWindow_Show()\n { \n dialog?.showModal(); \n \n }\n \n \n \n```\n\n##### index.html\n\n```\n\n <!DOCTYPE html>\n <html>\n <head>\n <title>test</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n </head>\n \n <body>\n <table>\n <tr>\n <th>2023</th>\n <th>朝・午前 1</th>\n <th>朝・午前 2</th>\n <th>朝・午前 3</th>\n <th>朝・午前 4</th>\n \n <th>夜間・午後 1</th>\n <th>夜間・午後 2</th>\n <th>夜間・午後 3</th>\n <th>夜間・午後 4</th>\n </tr>\n \n <tr>\n \n \n <!-- 日付表示 -->\n <td>\n <div class=\"item\">\n <div><span>aaa</span></div>\n <div><span>bbb</span></div>\n <div style=\"border: none\"><span>ccc</span></div>\n </div>\n </td>\n \n <!-- 入力データ モーダルウインドウ -->\n <td onclick=\"PopUpWindow_Show()\">\n 内容 \n \n <!-- ここに置きました -->\n </td>\n \n \n </tr>\n \n </table>\n \n <!-- ############################################## -->\n <dialog id=\"modalWindow\">\n <p>sample</p>\n <button id=\"modal_Close\">モードレスダイアログを閉じる</button>\n </dialog>\n <!-- ############################################## -->\n \n <script type=\"text/javascript\" src=\"script.js\"></script>\n </body>\n \n </html>\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-30T10:22:02.430",
"favorite_count": 0,
"id": "94381",
"last_activity_date": "2023-03-31T13:33:15.040",
"last_edit_date": "2023-03-30T13:21:13.650",
"last_editor_user_id": "-1",
"owner_user_id": "55177",
"post_type": "question",
"score": 1,
"tags": [
"typescript"
],
"title": "dialogタグを配置場所の理由が知りたい。",
"view_count": 142
} | [
{
"body": "ダイアログは閉じようとしていますが、そのあとすぐに開いているだけです。\n\n`<td onclick=\"PopUpWindow_Show()\">`の中に`<dialog\nid=\"modalWindow\">`が有り、そのまた中に`モードレスダイアログを閉じる'が有る形になります。阻止を明示しない限り、clickイベントは親要素への伝播するため、ボタンが押されると次のような動作になります。\n\n 1. `<button>`に対してclickイベントが発生します。 \n 1. `addEventListener`で紐付けられた関数が実行されます。\n 2. 関数内の処理で、... | 94381 | 94390 | 94390 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "ものすごく初歩的な質問、かつ抽象的な質問となり大変恐縮です。\n\n現在開発を行っているシステムにて、とある遅い処理のリクエストをサーバーへ行うと、 \n他の全く関係のリクエストたちも一斉に遅くなってしまいます。\n\napacheを使用し、PHPのAPIをよびだしております。サーバーはCentOSです。 \nDBは見ておらず、apacheの設定の問題かと思っているのですが、こういった場合、まず何を疑うべきでしょうか。\n\n関係あるかはわかりませんが、プロセスは複数立ち上がっているようです。\n\n```\n\n $ ps agx | grep httpd\n 1032 ? Ss 0:00 /usr/sbin/httpd -DFOREGROUND\n 1033 ? S 0:00 /usr/sbin/httpd -DFOREGROUND\n 1034 ? Sl 0:02 /usr/sbin/httpd -DFOREGROUND\n \n```\n\n何かアドバイスだけでもいただけると大変助かります。 \nよろしくお願いいたします。",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-30T14:50:49.763",
"favorite_count": 0,
"id": "94382",
"last_activity_date": "2023-03-30T14:50:49.763",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "55965",
"post_type": "question",
"score": 0,
"tags": [
"php",
"apache"
],
"title": "遅い処理を行うリクエストをすると、他のリクエストも遅くなる",
"view_count": 121
} | [] | 94382 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "文書タブの上を右クリックで「右をすべて閉じる」などのメニューをよく使っていたのですが、最近の更新が走ってから出なくなりました。バグでしょうか?",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-31T00:59:58.143",
"favorite_count": 0,
"id": "94383",
"last_activity_date": "2023-03-31T03:24:12.997",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57758",
"post_type": "question",
"score": 1,
"tags": [
"emeditor"
],
"title": "文書タブの上を右クリックでメニューがでなくなった",
"view_count": 72
} | [
{
"body": "v22.2.919 と v22.2.8 でタブで右クリック メニューが表示されない不具合がありましたが、v22.2.920 で修正されています。 \n<https://jp.emeditor.com/forums/topic/emeditor-v22-3-beta-22-2-901/>",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-31T03:24:12.997",
"id": "94384",
"last_activity_date"... | 94383 | null | 94384 |
{
"accepted_answer_id": "94387",
"answer_count": 1,
"body": "# 環境\n\nホストOS:Windows10 pro \nVMS:VMware Player15 \nゲストOS:Debian10\n\n# やりたいこと\n\nとあるWEBサービスにかかわる開発環境を再現するため、VMware上でDebian10を使用します。 \n80ポートを使用したく、Debian10デフォルトで起動されるWEBサービスを停止したいです。 \nLinuxは詳しくありません。 \nUbuntuのほうが使用頻度が高いのですが、Debianはほぼ触れたことがありません。 \n80ポートを使用してるサービスを停止するにはどうすればよいでしょうか?\n\n# やったこと\n\ndefaultではDebian10でApache2が稼働しており、TCP:80ポートが使用されておりました。\n\n * apache2の停止・無効化 \napache2を停止し、サービスを無効にしました。しかし、TCP:80ポートは使用されたままでした。ゲストOSは再起動しました。\n\n * /etc/inetd.confの確認 \n特に80ポートを使用するような設定ではありません。\n\n * httpdの確認 \npsコマンドで確認しましたが、当該デーモンは起動していません。\n\n * netstat -l -p -tの確認\n\n## netstat -l -p -t結果\n\n```\n\n netstat -l -p -t \n (一部のプロセスが識別されますが, 所有していないプロセスの情報は\n 表示されません。それら全てを見るにはルートになる必要があります.)\n 稼働中のインターネット接続 (サーバのみ)\n Proto 受信-Q 送信-Q 内部アドレス 外部アドレス 状態 PID/Program name \n tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN - \n tcp 0 0 localhost:postgresql 0.0.0.0:* LISTEN - \n tcp 0 0 localhost:smtp 0.0.0.0:* LISTEN - \n tcp6 0 0 [::]:http [::]:* LISTEN - \n tcp6 0 0 localhost:postgresql [::]:* LISTEN - \n tcp6 0 0 localhost:smtp [::]:* LISTEN - \n \n```\n\n## psコマンド結果\n\n```\n\n ps -e --sort cmd\n PID TTY TIME CMD\n 1188 ? 00:00:00 (sd-pam)\n 531 ? 00:00:00 ModemManager\n 525 ? 00:00:00 NetworkManager\n 506 ? 00:00:00 VGAuthService\n 1260 tty2 00:00:00 Xwayland\n 515 ? 00:00:00 accounts-daemon\n 720 ? 00:00:00 alsactl\n 1265 ? 00:00:00 at-spi-bus-laun\n 1272 ? 00:00:00 at-spi2-registr\n 150 ? 00:00:00 ata_sff\n 517 ? 00:00:00 avahi-daemon\n 548 ? 00:00:00 avahi-daemon\n 2213 pts/0 00:00:00 bash\n 920 ? 00:00:00 colord\n 14 ? 00:00:00 cpuhp/0\n 15 ? 00:00:00 cpuhp/1\n 516 ? 00:00:00 cron\n 31 ? 00:00:00 crypto\n 524 ? 00:00:00 dbus-daemon\n 1207 ? 00:00:00 dbus-daemon\n 1270 ? 00:00:00 dbus-daemon\n 1421 ? 00:00:00 dconf-service\n 35 ? 00:00:00 devfreq_wq\n 639 ? 00:00:00 dhclient\n 34 ? 00:00:00 edac-poller\n 1427 ? 00:00:00 evolution-addre\n 1502 tty2 00:00:00 evolution-alarm\n 1361 ? 00:00:00 evolution-calen\n 1307 ? 00:00:00 evolution-sourc\n 1168 ? 00:00:00 exim4\n 255 ? 00:00:00 ext4-rsv-conver\n 331 ? 00:00:00 fusermount\n 1576 ? 00:00:00 fwupd\n 1183 ? 00:00:00 gdm-session-wor\n 1205 tty2 00:00:00 gdm-wayland-ses\n 583 ? 00:00:00 gdm3\n 1201 ? 00:00:00 gnome-keyring-d\n 1209 tty2 00:00:00 gnome-session-b\n 1240 tty2 00:00:04 gnome-shell\n 1303 ? 00:00:00 gnome-shell-cal\n 1503 tty2 00:00:01 gnome-software\n 2208 ? 00:00:01 gnome-terminal-\n 1313 ? 00:00:00 goa-daemon\n 1326 ? 00:00:00 goa-identity-se\n 1376 tty2 00:00:00 gsd-a11y-settin\n 1383 tty2 00:00:00 gsd-clipboard\n 1380 tty2 00:00:00 gsd-color\n 1387 tty2 00:00:00 gsd-datetime\n 1517 tty2 00:00:00 gsd-disk-utilit\n 1388 tty2 00:00:00 gsd-housekeepin\n 1389 tty2 00:00:00 gsd-keyboard\n 1393 tty2 00:00:00 gsd-media-keys\n 1395 tty2 00:00:00 gsd-mouse\n 1347 tty2 00:00:00 gsd-power\n 1348 tty2 00:00:00 gsd-print-notif\n 1409 tty2 00:00:00 gsd-printer\n 1350 tty2 00:00:00 gsd-rfkill\n 1352 tty2 00:00:00 gsd-screensaver\n 1354 tty2 00:00:00 gsd-sharing\n 1362 tty2 00:00:00 gsd-smartcard\n 1371 tty2 00:00:00 gsd-sound\n 1364 tty2 00:00:00 gsd-wacom\n 1363 tty2 00:00:00 gsd-xsettings\n 1334 ? 00:00:00 gvfs-afc-volume\n 1339 ? 00:00:00 gvfs-goa-volume\n 1327 ? 00:00:00 gvfs-gphoto2-vo\n 1343 ? 00:00:00 gvfs-mtp-volume\n 1316 ? 00:00:00 gvfs-udisks2-vo\n 1247 ? 00:00:00 gvfsd\n 1252 ? 00:00:00 gvfsd-fuse\n 1281 tty2 00:00:00 ibus-daemon\n 1285 tty2 00:00:00 ibus-dconf\n 1447 tty2 00:00:00 ibus-engine-moz\n 1286 tty2 00:00:00 ibus-extension-\n 1293 ? 00:00:00 ibus-portal\n 1290 tty2 00:00:00 ibus-x11\n 669 ? 00:00:00 inetd\n 88 ? 00:00:00 ipv6_addrconf\n 162 ? 00:00:00 irq/16-vmwgfx\n 56 ? 00:00:00 irq/24-pciehp\n 57 ? 00:00:00 irq/25-pciehp\n 58 ? 00:00:00 irq/26-pciehp\n 59 ? 00:00:00 irq/27-pciehp\n 60 ? 00:00:00 irq/28-pciehp\n 61 ? 00:00:00 irq/29-pciehp\n 62 ? 00:00:00 irq/30-pciehp\n 63 ? 00:00:00 irq/31-pciehp\n 64 ? 00:00:00 irq/32-pciehp\n 65 ? 00:00:00 irq/33-pciehp\n 66 ? 00:00:00 irq/34-pciehp\n 67 ? 00:00:00 irq/35-pciehp\n 68 ? 00:00:00 irq/36-pciehp\n 69 ? 00:00:00 irq/37-pciehp\n 70 ? 00:00:00 irq/38-pciehp\n 71 ? 00:00:00 irq/39-pciehp\n 72 ? 00:00:00 irq/40-pciehp\n 73 ? 00:00:00 irq/41-pciehp\n 74 ? 00:00:00 irq/42-pciehp\n 75 ? 00:00:00 irq/43-pciehp\n 76 ? 00:00:00 irq/44-pciehp\n 77 ? 00:00:00 irq/45-pciehp\n 78 ? 00:00:00 irq/46-pciehp\n 79 ? 00:00:00 irq/47-pciehp\n 80 ? 00:00:00 irq/48-pciehp\n 81 ? 00:00:00 irq/49-pciehp\n 82 ? 00:00:00 irq/50-pciehp\n 83 ? 00:00:00 irq/51-pciehp\n 84 ? 00:00:00 irq/52-pciehp\n 85 ? 00:00:00 irq/53-pciehp\n 86 ? 00:00:00 irq/54-pciehp\n 87 ? 00:00:00 irq/55-pciehp\n 518 ? 00:00:00 irqbalance\n 254 ? 00:00:00 jbd2/sda1-8\n 22 ? 00:00:00 kauditd\n 33 ? 00:00:00 kblockd\n 28 ? 00:00:00 kcompactd0\n 20 ? 00:00:00 kdevtmpfs\n 30 ? 00:00:00 khugepaged\n 25 ? 00:00:00 khungtaskd\n 32 ? 00:00:00 kintegrityd\n 29 ? 00:00:00 ksmd\n 9 ? 00:00:00 ksoftirqd/0\n 17 ? 00:00:00 ksoftirqd/1\n 98 ? 00:00:00 kstrp\n 37 ? 00:00:00 kswapd0\n 2 ? 00:00:00 kthreadd\n 55 ? 00:00:00 kthrotld\n 5 ? 00:00:00 kworker/0:0-rcu_par_gp\n 6 ? 00:00:00 kworker/0:0H-kblockd\n 13 ? 00:00:00 kworker/0:1-events\n 160 ? 00:00:00 kworker/0:1H-kblockd\n 24 ? 00:00:00 kworker/0:2-cgroup_destroy\n 157 ? 00:00:00 kworker/0:3-rcu_par_gp\n 18 ? 00:00:00 kworker/1:0-ata_sff\n 19 ? 00:00:00 kworker/1:0H-kblockd\n 23 ? 00:00:00 kworker/1:1-events\n 212 ? 00:00:00 kworker/1:1H-kblockd\n 156 ? 00:00:00 kworker/1:2-ata_sff\n 208 ? 00:00:00 kworker/1:3-events\n 7 ? 00:00:00 kworker/u256:0-events_unbound\n 89 ? 00:00:00 kworker/u256:1-events_unbound\n 155 ? 00:00:00 kworker/u256:2-events_unbound\n 249 ? 00:00:00 kworker/u257:0\n 709 ? 00:00:00 lighttpd\n 12 ? 00:00:00 migration/0\n 16 ? 00:00:00 migration/1\n 8 ? 00:00:00 mm_percpu_wq\n 1453 tty2 00:00:00 mozc_server\n 149 ? 00:00:00 mpt/0\n 148 ? 00:00:00 mpt_poll_0\n 21 ? 00:00:00 netns\n 26 ? 00:00:00 oom_reaper\n 792 ? 00:00:06 packagekitd\n 550 ? 00:00:00 polkitd\n 609 ? 00:00:00 postgres\n 633 ? 00:00:00 postgres\n 634 ? 00:00:00 postgres\n 635 ? 00:00:00 postgres\n 636 ? 00:00:00 postgres\n 637 ? 00:00:00 postgres\n 638 ? 00:00:00 postgres\n 2252 pts/0 00:00:00 ps\n 1276 ? 00:00:00 pulseaudio\n 11 ? 00:00:00 rcu_bh\n 3 ? 00:00:00 rcu_gp\n 4 ? 00:00:00 rcu_par_gp\n 10 ? 00:00:00 rcu_sched\n 520 ? 00:00:00 rsyslogd\n 751 ? 00:00:00 rtkit-daemon\n 151 ? 00:00:00 scsi_eh_0\n 153 ? 00:00:00 scsi_eh_1\n 210 ? 00:00:00 scsi_eh_2\n 152 ? 00:00:00 scsi_tmf_0\n 154 ? 00:00:00 scsi_tmf_1\n 211 ? 00:00:00 scsi_tmf_2\n 1 ? 00:00:01 systemd\n 1187 ? 00:00:00 systemd\n 295 ? 00:00:00 systemd-journal\n 521 ? 00:00:00 systemd-logind\n 508 ? 00:00:00 systemd-timesyn\n 318 ? 00:00:00 systemd-udevd\n 1500 tty2 00:00:00 tracker-miner-a\n 1518 tty2 00:00:03 tracker-miner-f\n 1515 ? 00:00:00 tracker-store\n 159 ? 00:00:00 ttm_swap\n 522 ? 00:00:00 udisksd\n 560 ? 00:00:00 unattended-upgr\n 783 ? 00:00:00 upowerd\n 333 ? 00:00:00 vmhgfs-fuse\n 510 ? 00:00:00 vmtoolsd\n 1519 tty2 00:00:00 vmtoolsd\n 315 ? 00:00:00 vmware-vmblock-\n 36 ? 00:00:00 watchdogd\n 529 ? 00:00:00 wpa_supplicant\n 27 ? 00:00:00 writeback\n \n```",
"comment_count": 5,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-31T06:08:43.470",
"favorite_count": 0,
"id": "94385",
"last_activity_date": "2023-03-31T08:30:55.817",
"last_edit_date": "2023-03-31T08:19:58.603",
"last_editor_user_id": "32891",
"owner_user_id": "32891",
"post_type": "question",
"score": 2,
"tags": [
"debian"
],
"title": "Debian10でTCP:80ポートを占有しているサービスを停止したい",
"view_count": 136
} | [
{
"body": "自己解決できたので、記載します。\n\nnetstat -l -p\n-t結果から、自分自身で起動したpostgresqlに対してもPIDの記述がなかったことから、サービス稼働の可能性があるとわかりました。\n\n# 稼働中サービスの確認\n\n## コマンド\n\n```\n\n systemctl list-units --type=service\n \n```\n\n## 結果\n\n```\n\n UNIT LOAD ACTIVE SUB DESCRIPTION ... | 94385 | 94387 | 94387 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "`components/Heading1.vue`はレイアウトに組み込まれています。 \n`pages/page.vue`から`composable/useOperation.vue`を経由して`components/Heading1.vue`のタイトルの値を変更したいのですが`タイトル初期値`のまま変わりません。\n\n`pages/page.vue`から`h1Text`を呼び出すと`表示したいタイトル`が取得できます。 \n他のコンポーネントからの変更は受け取れないのでしょうか? \n`components/Heading1.vue`の`h1Text`の宣言をrefにしてみてもダメでした。\n\n``\n\nlayout/default.vue\n\n```\n\n <template lang=\"pug\">\n v-app\n Heading1\n slot\n </template>\n \n \n```\n\npages/page.vue\n\n```\n\n <template lang=\"pug\">\n NuxtLayout\n | ページ本体\n \n </template>\n \n <script lang=\"ts\" setup>\n import { useOperationInsurance } from '~/composables/useOperation'\n \n const { setHeading } = useOperationInsurance()\n const title = '表示したいタイトル'\n setHeading(title)\n </script>\n \n```\n\ncomponents/Heading1.vue\n\n```\n\n <template lang=\"pug\">\n .heading\n h1 {{h1Text}}\n </template>\n \n <script lang=\"ts\" setup>\n import { ref } from 'vue'\n import { useOperationInsurance } from '~/composables/useOperation'\n \n const useOperation = useOperationInsurance()\n const { h1Text } = useOperation\n </script>\n \n```\n\ncomposable/useOperation.vue\n\n```\n\n import { reactive, Ref, toRefs } from 'vue'\n import { Operation } from '~/types/operation'\n \n export const useOperationInsurance = (): {\n h1Text: Ref<string>\n setHeading: (title: string, breadcrumbs: Breadcrumb[]) => void\n } => {\n const state: Operation = reactive({\n h1Text: 'タイトル初期値',\n })\n \n const setHeading = (title: string) => {\n state.h1Text = title\n }\n \n return {\n ...toRefs(state),\n setHeading,\n }\n }\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-31T06:50:50.153",
"favorite_count": 0,
"id": "94386",
"last_activity_date": "2023-04-17T02:27:25.620",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "16768",
"post_type": "question",
"score": 1,
"tags": [
"javascript",
"vue.js",
"nuxt.js"
],
"title": "nux3でcomposableの値を取得したい",
"view_count": 31
} | [
{
"body": "setHeadingを外に出さないといけないようです。\n\n```\n\n import { reactive, Ref, toRefs } from 'vue'\n import { Operation } from '~/types/operation'\n \n const setHeading = (title: string) => {\n state.h1Text = title\n }\n \n export const useOperationInsurance = ... | 94386 | null | 94543 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "AndroidアプリをリリースするためConsoleにファイルを上げたら、セキュリティと信頼性タブで「アプリに、漏洩した Google Cloud\nPlatform(GCP)API キーが含まれています。」というエラーが発生してしまいました。\n\n<https://support.google.com/faqs/answer/9287711> \nここリンクの2を参考にAPIキーを制限したのですが、エラーは解消されません。\n\nアプリ側で何か修正が必要な個所などあるのでしょうか。",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-03-31T11:02:37.710",
"favorite_count": 0,
"id": "94389",
"last_activity_date": "2023-03-31T11:02:37.710",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "56224",
"post_type": "question",
"score": 1,
"tags": [
"android",
"firebase",
"google-play-console"
],
"title": "「アプリに、漏洩した Google Cloud Platform(GCP)API キーが含まれている」警告アラート",
"view_count": 131
} | [] | 94389 | null | null |
{
"accepted_answer_id": "94395",
"answer_count": 1,
"body": "##### 質問内容\n\n提示コードの`///`コメント部内部のコードの最上部の`import`文ですが`npx tsc -w\n`コマンドを実行して動作を確認すると以下のエラーが出るのですが原因がわかりません。調べてると`module`や`target`等を変更するようですが \n変更してもエラーが出ます。これは何をどう変更させればいいのでしょうか?\n\n##### 試したこと\n\n1,参考サイトBにように`<script>`タグに`tpye=\"module\"`と設定するとエラーが以下のようになります。`TypeError:\nFailed to resolve module specifier \"fs\". Relative references must start with\neither \"/\", \"./\", or \"../\".` \n2,`tsconfig`の`module,target`を色々変更\n\n##### Error\n\n```\n\n Uncaught SyntaxError: Cannot use import statement outside a module (at script.js:2:1)\n \n```\n\n##### 参考サイト\n\nA:https://stackoverflow.com/questions/58211880/uncaught-syntaxerror-cannot-\nuse-import-statement-outside-a-module-when-import\n\nB:https://flaviocopes.com/fix-cannot-use-import-outside-module/\n\n##### tsconfig\n\n```\n\n {\n \"compilerOptions\": {\n \n \"allowJs\": true,\n /* Visit https://aka.ms/tsconfig to read more about this file */\n //\"allowJs\": true,\n /* Projects */\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\n \n /* Language and Environment */\n \"target\": \"ES2022\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\n // \"lib\": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */\n // \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\n // \"experimentalDecorators\": true, /* Enable experimental support for legacy experimental decorators. */\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\n \n \"allowSyntheticDefaultImports\": true,\n //\"esModuleInterop\": true,\n \n /* Modules */\n //\"lib\": [\"es2020\"],\n //\"module\": \"commonjs\", /* Specify what module code is generated. */\n \"module\": \"ESNext\", /* Specify what module code is generated. */\n //\"module\": \"amd\", /* Specify what module code is generated. */\n //\"rootDir\": \"./\", /* Specify the root folder within your source files. */\n // \"moduleResolution\": \"node10\", /* Specify how TypeScript looks up a file from a given module specifier. */\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\n // \"paths\": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\n // \"types\": [], /* Specify type package names to be included without being referenced in a source file. */\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\n // \"allowImportingTsExtensions\": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */\n // \"resolvePackageJsonExports\": true, /* Use the package.json 'exports' field when resolving package imports. */\n // \"resolvePackageJsonImports\": true, /* Use the package.json 'imports' field when resolving imports. */\n // \"customConditions\": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */\n // \"resolveJsonModule\": true, /* Enable importing .json files. */\n // \"allowArbitraryExtensions\": true, /* Enable importing files with any extension, provided a declaration file is present. */\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\n \n /* JavaScript Support */\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\n \n /* Emit */\n // \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */\n // \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\n // \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\n // \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\n // \"outDir\": \"./\", /* Specify an output folder for all emitted files. */\n // \"removeComments\": true, /* Disable emitting comments. */\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\n // \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */\n // \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\n // \"newLine\": \"crlf\", /* Set the newline character for emitting files. */\n // \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\n \n /* Interop Constraints */\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\n // \"verbatimModuleSyntax\": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */\n // \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. */\n \n /* Type Checking */\n \"strict\": true, /* Enable all strict type-checking options. */\n // \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\n \n /* Completeness */\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\n \"skipLibCheck\": true /* Skip type checking all .d.ts files. */\n }\n }\n \n \n```\n\n##### ソースコード\n\n```\n\n //////////////////////////////\n import fs from \"fs\";\n //////////////////////////////\n // 月の最後の日を取得\n function GetLastDay(year:number,month:number)\n {\n let d = new Date(year,month);\n return d.getDate();\n }\n \n //曜日を取得\n function GetDayOfWeek(year:number,month:number,day:number)\n {\n let week = [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]; \n \n let d = new Date(year,(month + 1),day + 2);\n \n return week[d.getDay()];\n }\n \n \n /*########################################################################\n # 要素 作成\n ##########################################################################*/\n function CreateElement(elementName:string,text:string,className:string)\n { \n let e = document.createElement(elementName);\n e.textContent = text;\n e.className = className;\n \n return e;\n }\n \n /*########################################################################\n # ポップアップウインドウを表示\n ##########################################################################*/\n function PopUpWindowShow_Event()\n { \n //dialog?.showModal(); \n }\n \n /////////////////////////////////////////////////////////\n console.log(fs.readFileSync(\"./WorkData.html\"));\n /////////////////////////////////////////////////////////\n \n let div = document.getElementsByClassName(\"workData_js\");\n //div[0].innerHTML = fil;\n \n \n /*\n var dialog = document.querySelector(\"dialog\");\n var btn_close = document.getElementById(\"modal_Close\");\n \n btn_close?.addEventListener('click',function()\n {\n console.log(\"close\");\n dialog!.open = false;\n \n dialog?.close();\n console.log(\"end\");\n \n },false);\n */\n \n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-01T01:55:21.597",
"favorite_count": 0,
"id": "94392",
"last_activity_date": "2023-04-03T00:05:14.530",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "55177",
"post_type": "question",
"score": 1,
"tags": [
"typescript"
],
"title": "Error: Cannot use import statement outside a module の対処方法が知りたい",
"view_count": 666
} | [
{
"body": "以前の質問「[Error: [ Uncaught TypeError: _fs.readFile is not a function\n]の原因が知りたい](https://ja.stackoverflow.com/questions/94312/error-uncaught-\ntypeerror-fs-readfile-is-not-a-\nfunction-%e3%81%ae%e5%8e%9f%e5%9b%a0%e3%81%8c%e7%9f%a5%e3%82%8a%e3%81%9f%e3%81%84)」と理由は同じです。ブラウザで実行するコードでは\nfs は使えません。\n\n`fetc... | 94392 | 94395 | 94395 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "Pythonのpymatgenにはcifのデータを読み込むモジュールがあります。 \nこのpymatgenを使ってcifの項目の一つ `_atom_site_label`\nを読み込ませようとしました。ここで、`_atom_site_label`\nは結晶内の各原子を結合の状況によって区別できるようにラベリングしたものです。このため、結晶内の単位格子の全ての原子の数よりは通常少ないです。しかし、結晶内の全ての原子は必ず、`_atom_site_label`\nのどれかにはあてはまります。\n\n今、問題なのは、`_atom_site_label` の各要素を単位格子内の原子と対応する形で取得できないということです。\n\n以下がBiNiO3.cifの内容になります。\n\n```\n\n loop_\n _atom_type_symbol\n _atom_type_oxidation_number\n Bi3+ 3\n Ni3+ 3\n O2- -2\n loop_\n _atom_site_label\n _atom_site_type_symbol\n _atom_site_symmetry_multiplicity\n _atom_site_Wyckoff_symbol\n _atom_site_fract_x\n _atom_site_fract_y\n _atom_site_fract_z\n _atom_site_U_iso_or_equiv\n _atom_site_occupancy\n Bi1 Bi3+ 2 i 0.0063(6) 0.0486(5) 0.2315(4) 0.0051(8) 1.\n Bi2 Bi3+ 2 i 0.5105(6) 0.4426(6) 0.7242(4) 0.0051(8) 1.\n Ni1 Ni3+ 1 d 0.5 0 0 0.0096(6) 1.\n Ni2 Ni3+ 1 c 0 0.5 0 0.0096(6) 1.\n Ni3 Ni3+ 1 f 0.5 0 0.5 0.0096(6) 1.\n Ni4 Ni3+ 1 g 0 0.5 0.5 0.0096(6) 1.\n O1 O2- 2 i -0.1410(9) 0.4708(8) 0.2521(6) 0.0066(6) 1.\n O2 O2- 2 i 0.3949(9) 0.0780(7) 0.7549(6) 0.0066(6) 1.\n O3 O2- 2 i 0.8332(8) 0.1748(7) -0.0327(6) 0.0066(6) 1.\n O4 O2- 2 i 0.3166(8) 0.3359(7) 0.0836(6) 0.0066(6) 1.\n O5 O2- 2 i 0.2129(8) 0.7709(7) 0.4114(6) 0.0066(6) 1.\n O6 O2- 2 i 0.6737(8) 0.6868(7) 0.5465(6) 0.0066(6)\n \n```",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-01T05:08:35.643",
"favorite_count": 0,
"id": "94393",
"last_activity_date": "2023-04-06T08:33:17.180",
"last_edit_date": "2023-04-06T08:33:17.180",
"last_editor_user_id": "3060",
"owner_user_id": "57777",
"post_type": "question",
"score": 0,
"tags": [
"python"
],
"title": "pymatgenを使ってICSDの発行したcifから_atom_site_labelの部分を読み出そうとしても全ての原子に対応する形で取得できない",
"view_count": 114
} | [] | 94393 | null | null |
{
"accepted_answer_id": "94574",
"answer_count": 1,
"body": "グーグルの MARKER API を使わずみせなくちゃいけないんですが \nこれが問題になっちゃったんですけど、マーカーの位置がちょっとだけ間違っていると見えまして \nこの LOGIC の問題じゃないかと思います。\n\n下のリストはやってたことです\n\n 1. window.onmousemove, google.addEventListener(\"drag\")で移動前後の中心座標の違いを比較し、\"px\"の値を取得する方法です。\n 2. 左上隅のlatとlngに基づいてマップ上のマーカーの値をドラッグ毎、またはマウス移動イベント毎に計算する方法です。\n\n描かれたマーカーは、Google map api を使用して描かれたマーカーとまったく同じように移動する必要があります。\n\n正確にベクトルを得る方法を教えてください",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-03T00:57:21.870",
"favorite_count": 0,
"id": "94396",
"last_activity_date": "2023-04-19T09:53:35.820",
"last_edit_date": "2023-04-06T08:28:02.090",
"last_editor_user_id": "29826",
"owner_user_id": "57794",
"post_type": "question",
"score": 0,
"tags": [
"javascript",
"google-maps"
],
"title": "グーグルのapiのマーカーを使わずvector2Dを得る方法",
"view_count": 88
} | [
{
"body": "center_changedをイベントを使用すると正常に動作します\n\ndrag, mousemove, center_changedイベントは \n発生時点が似ているように見えますが、結果的には少しずつ違いました",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-19T09:53:35.820",
"id": "94574",
"last_activity_date": "2023-04-19T09:53:35.820",
"l... | 94396 | 94574 | 94574 |
{
"accepted_answer_id": "94400",
"answer_count": 1,
"body": "集計したIPアドレスを第3オクテットでグループ化して集計したいです。\n\n仮に集計したアドレスが送信元IPに記載されていれば、以下のように指定すれば集計できると思いますが、この方法だと逐一第三オクテットまで自分で記述しなければならず、煩雑だと考えます。\n\n```\n\n df.groupby(\"送信元IP\"==\"172.168.10.***\").count()\n \n```\n\n他にどのような方法があるかご教示お願い致します。\n\nなお、イメージとしては以下のような集計済みのデータに対して、第3オクテットでグループ化した集計を行いたいと考えております。\n\n送信元IP | 宛先IP | 宛先ポート番号 | TCP/UDP | 合計 \n---|---|---|---|--- \n1.1.1.1 | 3.3.3.3 | 53 | 6 | 1 \n1.1.1.2 | 3.3.3.3 | 57 | 17 | 1 \n2.2.2.2 | 9.9.9.9 | 54 | 17 | 1 \n2.2.2.3 | 9.9.9.9 | 59 | 6 | 1 \n4.4.4.4 | 10.10.10.10 | 56 | 6 | 2",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-03T01:55:33.483",
"favorite_count": 0,
"id": "94397",
"last_activity_date": "2023-04-03T09:53:27.420",
"last_edit_date": "2023-04-03T09:53:27.420",
"last_editor_user_id": "3060",
"owner_user_id": "57568",
"post_type": "question",
"score": 0,
"tags": [
"python",
"python3"
],
"title": "IPアドレスの集計を/24で行いたい",
"view_count": 197
} | [
{
"body": "> 宛先Ipや宛先ポートのコラムを残して集計する\n```\n\n import pandas as pd\n import io\n \n csv_data = '''\n 送信元IP,宛先IP,宛先ポート番号,TCP/UDP,合計\n 1.1.1.1,3.3.3.3,53,6,1\n 1.1.1.2,3.3.3.3,57,17,1\n 2.2.2.2,9.9.9.9,54,17,1\n 2.2.2.3,9.9.9.9,59,6,1\n 4.4.4.4,10.10.10.10,56,6,2\n '''\n df = pd.... | 94397 | 94400 | 94400 |
{
"accepted_answer_id": "94401",
"answer_count": 1,
"body": "Debian10をベースとしたOSを搭載した組込み機器内で実行されるPythonアプリがあり、 \nそれをVMware上でエミュレートする環境を構築中です。 \nVMware上でPythonアプリを実行すると、とあるパッケージの関数がないというエラーで、おそらくパッケージバージョンなどの違いがあると推測しています。\n\n組込み機器内では、正常にPythonスクリプトが動いています。 \n組込み機器内でのPythonパッケージが確認できません。\n\n# 確認したこと\n\npip3 list:pip3が存在していません。 \npython3 -m pip list:pipがありません。 \npython3 -m pip3 list:pipがありません。\n\n/usr/local/lib/python3.7/dist-packagesにパッケージが存在しているようです。 \nしかし、確信がありません。上記で問題としたパッケージ自体が存在していないためです。\n\nなぜpipがなくパッケージが存在しているのでしょうか? \n適用されるパッケージの一覧を調べるためにはどうすればよいでしょうか?",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-03T02:20:59.730",
"favorite_count": 0,
"id": "94399",
"last_activity_date": "2023-04-03T05:52:11.867",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "32891",
"post_type": "question",
"score": 1,
"tags": [
"python",
"debian"
],
"title": "組込み機器内 DebianでのPython3パッケージの確認方法",
"view_count": 105
} | [
{
"body": "「Debian10をベースとしたOS」での Pythonパッケージの確認方法, について\n\nまず, OS(システム)側で Pythonを利用する環境 (*NIX環境ではよくある) では \nOS側のパッケージ管理システムで管理されていることがあり, pip利用は控えたほうがよいでしょう \nシステム側で利用しているパッケージを上書きするとシステムが不安定になるので\n\nPythonパッケージのバージョンは, APT系パッケージ管理システムなら以下のように \n(`--installed` 指定なら インストール済み だけ, オプションなしならすべて)\n\n```\n\n $ ... | 94399 | 94401 | 94401 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "<https://github.com/AntixK/PyTorch-VAE> \nの説明の通り\n\n```\n\n $ git clone https://github.com/AntixK/PyTorch-VAE\n $ cd PyTorch-VAE\n $ pip install -r requirements.txt\n \n```\n\nで、インストール。\n\n```\n\n $ cd PyTorch-VAE\n $ python run.py -c configs/<config-file-name.yaml>\n \n```\n\nで、実行してみましたが、以下のようなエラーを吐かれました。\n\n```\n\n Traceback (most recent call last):\n File \"/content/PyTorch-VAE/run.py\", line 7, in <module>\n from experiment import VAEXperiment\n File \"/content/PyTorch-VAE/experiment.py\", line 7, in <module>\n from utils import data_loader\n File \"/content/PyTorch-VAE/utils.py\", line 1, in <module>\n import pytorch_lightning as pl\n File \"/usr/local/lib/python3.9/dist-packages/pytorch_lightning/__init__.py\", line 20, in <module>\n from pytorch_lightning.callbacks import Callback # noqa: E402\n File \"/usr/local/lib/python3.9/dist-packages/pytorch_lightning/callbacks/__init__.py\", line 14, in <module>\n from pytorch_lightning.callbacks.base import Callback\n File \"/usr/local/lib/python3.9/dist-packages/pytorch_lightning/callbacks/base.py\", line 26, in <module>\n from pytorch_lightning.utilities.types import STEP_OUTPUT\n File \"/usr/local/lib/python3.9/dist-packages/pytorch_lightning/utilities/__init__.py\", line 18, in <module>\n from pytorch_lightning.utilities.apply_func import move_data_to_device # noqa: F401\n File \"/usr/local/lib/python3.9/dist-packages/pytorch_lightning/utilities/apply_func.py\", line 30, in <module>\n from torchtext.legacy.data import Batch\n ModuleNotFoundError: No module named 'torchtext.legacy'\n \n```\n\n原因が分からないため、教えていただきたいです。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-03T06:39:58.870",
"favorite_count": 0,
"id": "94402",
"last_activity_date": "2023-04-03T06:40:26.400",
"last_edit_date": "2023-04-03T06:40:26.400",
"last_editor_user_id": "57796",
"owner_user_id": "57796",
"post_type": "question",
"score": 0,
"tags": [
"google-colaboratory",
"pytorch",
"pip",
"import"
],
"title": "torchtext におけるapply_func.py: from torchtext.legacy.data import Batchのimportエラー",
"view_count": 61
} | [] | 94402 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "[OpenAI\nAPIを使ってPythonでChatGPT遊びするための最初の三歩くらい](https://dev.classmethod.jp/articles/openai-\napi-chat-python-first-step/)\n\n上記サイトを参照してChatGPTの実験を行うとしていたのですが、2つ目のコードである `export OPENAI_API_KEY=\"sk-xxxx\"`\nでエラーが出てしまい、自分なりに試行錯誤をしましたが、先に進むことができませんでした。 \n解決策を教えて頂けないでしょうか。\n\n**エラーメッセージ:**\n\n```\n\n File \"<ipython-input-32-ecb861a59886>\", line 1\n export OPENAI_API_KEY=\"sk-xxxx\"\n ^\n SyntaxError: invalid syntax\n \n```\n\n[](https://i.stack.imgur.com/0tAdQ.png)",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-03T07:39:07.240",
"favorite_count": 0,
"id": "94403",
"last_activity_date": "2023-06-18T07:20:42.753",
"last_edit_date": "2023-06-18T07:20:42.753",
"last_editor_user_id": "7347",
"owner_user_id": "57798",
"post_type": "question",
"score": 0,
"tags": [
"python",
"jupyter-notebook",
"chatgpt"
],
"title": "Jupyter Notebook 内で環境変数を設定するため export を実行すると SyntaxError: invalid syntax エラーになる",
"view_count": 366
} | [
{
"body": "Jupyter Notebook 内で環境変数を設定するには、マジックコマンドの `%env` または `%set_env` を使います。\n\n**例:**\n\n```\n\n %env ENV=test\n \n```\n\n質問の内容にあわせると、以下のようになりそうです。\n\n```\n\n %env OPENAI_API_KEY=sk-xxxx\n \n```\n\n参考: \n<https://stackoverflow.com/q/37890898/2322778>",
"comment_count": 0,
"content_lice... | 94403 | null | 94404 |
{
"accepted_answer_id": "94409",
"answer_count": 1,
"body": "# 質問\n\n添付画像のメニューを非表示にしたいです。 \nどの様にすればよいでしょうか?\n\n# 環境\n\n * EmEditor Professional (64Bit) Version 22.2.10\n * Windows 11 64 Bit 21H2 (Build 22000.1455)\n\n[](https://i.stack.imgur.com/gZJot.png)",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-03T14:01:00.810",
"favorite_count": 0,
"id": "94407",
"last_activity_date": "2023-04-03T15:18:13.560",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "34546",
"post_type": "question",
"score": 0,
"tags": [
"emeditor"
],
"title": "Emeditor右クリックメニュー「EmEditorでファイルから検索」を非表示にしたい",
"view_count": 104
} | [
{
"body": "[ツール] メニューから [カスタマイズ] を選択し、[ショートカット] ページを選択し、[エクスプローラのコンテキスト メニューにショートカットを追加]\nチェック ボックスをクリアします。もしコンピューター毎にインストールされているため、このチェック\nボックスが無効になっていてチェックできない場合には、一度、EmEditor をアンインストールしてください。再びインストールする際、[カスタム]\nインストールを選択すると、コンテキスト メニューを無効にすることができます。\n\n引用先: [エクスプローラで右クリックした時に表示されるコンテキスト メニューに EMEDITOR\nが表示され... | 94407 | 94409 | 94409 |
{
"accepted_answer_id": "94415",
"answer_count": 1,
"body": "RubyのメソッドをCで定義しようとしたところ、下記のエラーが発生しました。 \nこちらのエラーが発生する原因と解消方法が知りたいです。\n\n```\n\n $ rake compile \n cd tmp/x86_64-linux/mandoc/2.7.7\n /home/gemmaro/.guix-profile/bin/make\n compiling ../../../../ext/mandoc/mandoc.c\n ../../../../ext/mandoc/mandoc.c: In function ‘rb_mparse_initialize’:\n ../../../../ext/mandoc/mandoc.c:28:57: error: type of formal parameter 2 is incomplete\n 28 | struct mparse* parse = mparse_alloc(NUM2INT(options), (enum mandoc_os)(NUM2INT(oe_e)), StringValueCStr(os_s));\n | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n make: *** [Makefile:245: mandoc.o] Error 1\n rake aborted!\n Command failed with status (2): [/home/gemmaro/.guix-profile/bin/make...]\n /gnu/store/...-ruby-rake-compiler-1.1.1/lib/ruby/vendor_ruby/gems/rake-compiler-1.1.1/lib/rake/extensiontask.rb:167:in `block (2 levels) in define_compile_tasks'\n /gnu/store/...-ruby-rake-compiler-1.1.1/lib/ruby/vendor_ruby/gems/rake-compiler-1.1.1/lib/rake/extensiontask.rb:166:in `block in define_compile_tasks'\n Tasks: TOP => compile => compile:x86_64-linux => compile:mandoc:x86_64-linux => copy:mandoc:x86_64-linux:2.7.7 => tmp/x86_64-linux/mandoc/2.7.7/mandoc.so\n (See full trace by running task with --trace)\n \n```\n\n※`/gnu/store/<ハッシュ値>`のハッシュ値は冗長のため`...`としました。\n\n背景として、Rubyで[libmandoc](https://mandoc.bsd.lv/man/mandoc.3.html)のC拡張ライブラリを書こうとしており、現在`mparse_alloc`関数をRubyのメソッド用に定義しようとしています(対応するメソッドは`Mandoc::Mparse#initialize`)。 \n`mparse_alloc`関数のシグネチャを以下に示します。\n\n```\n\n struct mparse *\n mparse_alloc(int options, enum mandoc_os oe_e, char *os_s);\n \n```\n\nここで第2引数の型`mandoc_os`は`roff.h`に定義されており、以下の定義となっています。\n\n>\n```\n\n> enum mandoc_os {\n> MANDOC_OS_OTHER = 0,\n> MANDOC_OS_NETBSD,\n> MANDOC_OS_OPENBSD\n> };\n> \n```\n\n作成中の`ext/mandoc/mandoc.c`を以下に示します。 \nこのように、列挙型の値を期待している関数の呼び出しでその列挙型の値を使ったときに今回のエラー(`rb_mparse_initialize`関数内部の1行目)が発生していることがわかります。\n\n```\n\n #include <ruby.h>\n #include <mandoc.h>\n #include <mandoc_parse.h>\n #include <roff.h>\n \n void rb_mparse_free(void* data)\n {\n mparse_free((struct mparse*)data);\n free(data);\n }\n \n static const rb_data_type_t mparse_type = {\n .wrap_struct_name = \"mparse\",\n .function = {\n .dfree = rb_mparse_free,\n },\n .flags = RUBY_TYPED_FREE_IMMEDIATELY,\n };\n \n VALUE rb_mparse_alloc(VALUE self)\n {\n struct mparse* data = malloc(sizeof(struct mparse*));\n return TypedData_Wrap_Struct(self, &mparse_type, data);\n }\n \n VALUE rb_mparse_initialize(VALUE self, VALUE options, VALUE oe_e, VALUE os_s)\n {\n struct mparse* parse = mparse_alloc(NUM2INT(options), (enum mandoc_os)(NUM2INT(oe_e)), StringValueCStr(os_s));\n DATA_PTR(self) = parse;\n return self;\n }\n \n void Init_mandoc(void)\n {\n VALUE mMandoc = rb_define_module(\"Mandoc\");\n \n VALUE cMparse = rb_define_class_under(mMandoc, \"Mparse\", rb_cObject);\n rb_define_alloc_func(cMparse, rb_mparse_alloc);\n rb_define_method(cMparse, \"initialize\", rb_mparse_initialize, 3);\n }\n \n```\n\nなお、エラーメッセージで検索したところ[stack overflow > How to fix \"type of formal parameter 1 is\nincomplete\" in\nC](https://stackoverflow.com/q/45423191)やこれに類する質問がありましたが、今回の場合は要素数が不定になりうる配列とは状況が違うように思われました。\n\n試したこととして、実際にmandocで`mparse_alloc`関数が使用されているところを参考に第2引数を定数 (`MANDOC_OS_OTHER`)\nに置き換えましたが、同一のエラーが発生しました。 \n以下に`cgi.c`からの抜粋を示します。\n\n>\n```\n\n> mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1 |\n> MPARSE_VALIDATE, MANDOC_OS_OTHER, req->q.manpath);\n> \n```\n\nバージョンは以下です。 \nmandocのバージョンは1.14.6です。\n\n```\n\n $ ruby --version \n ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-linux]\n \n $ gcc --version \n gcc (GCC) 12.2.0\n Copyright (C) 2022 Free Software Foundation, Inc.\n This is free software; see the source for copying conditions. There is NO\n warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n \n```\n\n※上記で引用したコード片は[mandoc](https://mandoc.bsd.lv/)のISCライセンスにしたがいます。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-03T15:01:15.593",
"favorite_count": 0,
"id": "94408",
"last_activity_date": "2023-04-04T12:58:32.267",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "57802",
"post_type": "question",
"score": 1,
"tags": [
"ruby",
"c"
],
"title": "RubyのC拡張でメソッドを定義するとコンパイル時にエラー「error: type of formal parameter 2 is incomplete」が出る",
"view_count": 113
} | [
{
"body": "試せる環境が手元に無いので推測ですが、ヘッダーファイルのインクルード順を変更するとコンパイルできないでしょうか。\n\n```\n\n #include <roff.h> // enum mandoc_osが定義されているこれを<mandoc_parse.h>より前に持ってくる\n #include <mandoc.h>\n #include <mandoc_parse.h> // mparse_allocのプロトタイプ宣言が書かれている\n \n```\n\nネットで調べた範囲だと、`enum\nmandoc_os`を前方宣言または定義する前に`mparse_alloc... | 94408 | 94415 | 94415 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "こちらの動画でQt Creatorを勉強中です。\n\n[PYTHON and QT QUICK - Custom Buttons With QML And JavaScript\n(YouTube)](https://youtu.be/JhPXOcmXf8I?list=PLfQ7GQSrl0_v1T4Pe_NW4GLaynBfydFy-&t=416)\n\n動画同様に以下のコードを入力したところ、`QtGraphicalEffects 1.15`の部分が \"QML module not found\"\nになってしまいます。\n\n環境構築がうまくいっていないのか、原因は不明です。 \nQtのバージョンは5.15.2です。 \nどなたかお知恵を貸していただけますと幸いです。\n\n```\n\n import QtQuick 2.15\n import QtQuick.Controls 2.15\n import QtGraphicalEffects 1.15\n Item {\n \n }\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-03T17:06:09.330",
"favorite_count": 0,
"id": "94410",
"last_activity_date": "2023-04-04T00:56:44.590",
"last_edit_date": "2023-04-04T00:56:44.590",
"last_editor_user_id": "3060",
"owner_user_id": "57803",
"post_type": "question",
"score": 0,
"tags": [
"python",
"qt",
"cmake"
],
"title": "Qt Creator にて QML module not found エラーが出てしまう",
"view_count": 108
} | [] | 94410 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "swiftuiでmacos用のvideoplayerを作っています。 \n\"https~\"から始まるurlにはアクセスできますが、ローカルパスをfile:///~のurlで打ち込んでも動画が再生できません。 \nNSOpenPanelを使った場合はローカルパスにアクセスできますが、直接打ち込んで再生できるようにしたいです。\n\n```\n\n import AVKit\n import SwiftUI\n \n struct ContentView: View {\n @State var player = AVPlayer()\n var videoUrl: String = \"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4\"\n \n // var videoUrl = URL(fileURLWithPath: \"/Users~.mp4\")\n \n var body: some View {\n VideoPlayer(player: player)\n .onAppear(){\n player = AVPlayer(url: URL(string: videoUrl)!)\n }\n }\n }\n \n```\n\n@zunda\n\n回答ありがとうございます。 \nNSOpenPanelを使って選択したファイルのボタンリストを作り、選択してみました。 \nimageの方は任意のファイルを表示できますがビデオはやはり読み込めません。\n\n```\n\n @State private var ContentsList : [String] = []\n @State var ContentName = \"content\"\n @State var player = AVPlayer()\n \n var body: some View {\n VStack {\n if ContentsList.isEmpty == false{\n HStack{\n AsyncImage(url: URL(string: ContentName)){ image in\n image.resizable()\n }placeholder: {\n ProgressView()\n }\n VideoPlayer(player: player)\n .onAppear() {\n player = AVPlayer(url: URL(string: ContentName)!)\n }\n }\n }\n \n HStack{\n Button(\"select item\"){\n let panel = NSOpenPanel()\n panel.canChooseDirectories = true\n panel.canChooseFiles = true\n panel.allowsMultipleSelection = true\n panel.allowedFileTypes = [\"jpg\",\"jpeg\",\"png\",\"mp4\",\"mov\"]\n panel.message = \"open files\"\n if panel.runModal() == .OK{\n for url in panel.urls{\n ContentsList.append(url.absoluteString)\n }\n }\n }\n List(ContentsList, id: \\.self){ item in\n let path = NSString(string: String(item))\n Button(path.lastPathComponent){\n ContentName = String(item)\n }\n }\n .frame(width: 400,height: 300)\n Text(ContentName)\n }\n }\n \n }\n } \n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-04T07:50:24.623",
"favorite_count": 0,
"id": "94414",
"last_activity_date": "2023-04-06T06:23:15.060",
"last_edit_date": "2023-04-06T06:23:15.060",
"last_editor_user_id": "22647",
"owner_user_id": "22647",
"post_type": "question",
"score": 1,
"tags": [
"xcode",
"macos",
"swiftui"
],
"title": "swiftuiのvideoplayerでmacのデスクトップなどのローカルパスのビデオファイルを再生する方法を知りたい",
"view_count": 155
} | [
{
"body": "`file://`を先頭につけることでうまくいかないですか?\n\n```\n\n struct ContentView: View {\n let filePath = URL(fileURLWithPath: \"file:///Users/okd/Desktop/okdtest.mp4\")\n \n var body: some View {\n let player = AVPlayer(url: filePath)\n VideoPlayer(player: player)\n }\n }\n ... | 94414 | null | 94422 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "Laravel 8.83.27で開発中のプロジェクトです。 \n以前は普通に動いていたのですが、POSTすると419が出るようになってしまいました。\n\n### 動かなくなる前にやったこと\n\n#### 1点目\n\nパフォーマンス改善のためにdocker-syncを使おうとしたのですが動かなくて辞めました。\n\n**エラーメッセージ:**\n\n```\n\n /var/lib/gems/2.7.0/gems/docker-sync-1.0.5/lib/docker-sync/sync_strategy/unison.rb:233:in `block in start_container': Failed to start unison container in time, try to increase max_attempt (currently 10) in your configuration. See https://github.com/EugenMayer/docker-sync/wiki/2.-Configuration for more informations (RuntimeError)\n \n```\n\ndocker-sync.ymlに `max_attempt:100` を書いても改善されなかったので `docker-sync clean`\nして消しました。\n\n#### 2点目\n\n`php artisan config:cache` を開発環境なのにしてしまった。 \nこれのせいな気がしたのですべてを白紙に戻すためにローカルもDokcerコンテナも全て消してgitでクローンしなおしましたが直らず。\n\n### 試した・確認したこと\n\n 1. @csrfが入っているか\n 2. ブラウザのキャッシュ・coockieクリア\n 3. Docker内ファイルのパーミッションが制限されていないか\n\nApp\\Http\\Kernel.php内の\n\n```\n\n \\App\\Http\\Middleware\\VerifyCsrfToken::class,\n \n```\n\nをコメントアウトしたら一回ログインはできてるようですが、 \nログインユーザー認証がうまくいっていないのかログイン画面に戻ってきてしまいます。 \n完成間際なのでログイン認証を今から外すことは正直手間ですし複数人でgit管理して開発しているのであまりいじりたくない気持ちもあります。 \n(ログイン認証周りはlaravel/jetstream,sanctumを使っています。)\n\nエラーログも出ないのでどうすればいいか分かりません。 \n何か教えていただけると幸いです。",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-04T20:45:48.323",
"favorite_count": 0,
"id": "94416",
"last_activity_date": "2023-04-05T03:03:25.150",
"last_edit_date": "2023-04-05T02:37:25.037",
"last_editor_user_id": "3060",
"owner_user_id": "57819",
"post_type": "question",
"score": 1,
"tags": [
"docker",
"laravel"
],
"title": "Laravel 8 で 419 PAGE EXPIRED が出るようになりました",
"view_count": 252
} | [
{
"body": ".envの下記の一文をコメントアウトしたら動きました…\n\n```\n\n SESSION_DOMAIN=\".http://localhost\"\n \n```\n\naxiosでAPIを使うときに追記したものでしたがすっかり忘れてました。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-05T03:03:25.150",
"id": "94418",
"last_activity_date": "2023-04-05T0... | 94416 | null | 94418 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "実機でアプリを起動しようとすると、\n\n```\n\n Could not launch \"\" failed to get the task for process \n \n```\n\nとエラーが発生してbuildすることができません。\n\n<https://ios-docs.dev/process-launch-failed/> \n上記の記事を参考に、Edit Scheme画面を開き、メニューバーのProduct > Scheme > EditSchemeにおいて \nDebug executableのチェックを外したんですが、このままだとbreak pointが止まりません。\n\nなので、本質的な解決を行いたいです。\n\n回答をよろしくお願いします。",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-05T01:07:19.717",
"favorite_count": 0,
"id": "94417",
"last_activity_date": "2023-04-05T01:07:19.717",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "42008",
"post_type": "question",
"score": 0,
"tags": [
"swift",
"xcode"
],
"title": "実機でアプリを起動しようとするとCould not launch \"\" failed to get the task for process とエラーが出てbuildすることができない",
"view_count": 113
} | [] | 94417 | null | null |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "先日IE11ブラウザでゲートウェイサーバにSSL-VPN接続した際(L2フォワーディング方式)、ブラウザに\n\n```\n\n 接続されていません。プロキシサーバは応答していません\n \n```\n\nと表示されました。\n\nLAN設定にある \n「プロキシサーバを使用する」 \nのチェックを外すことでゲートウェイサーバにSSL-VPN接続ができました。\n\nしかし、なぜプロキシサーバを使用しないことでSSL-VPN接続ができるのか理由がよくわかっておりません。 \n原因として証明書が絡んだりするものなのでしょうか?\n\n初歩的な質問で大変恐縮ではありますがご教示いただけますと幸いです。 \nよろしくお願いいたします。",
"comment_count": 5,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-05T04:40:52.297",
"favorite_count": 0,
"id": "94419",
"last_activity_date": "2023-04-05T04:40:52.297",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "49430",
"post_type": "question",
"score": 0,
"tags": [
"vpn",
"proxy"
],
"title": "プロキシサーバを使用しないことでSSL-VPN接続ができる理由がよくわかりません",
"view_count": 84
} | [] | 94419 | null | null |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "現在、GoogleDriveの特定の共有ドライブの管理者権限を持つアカウントで作業をしています。 \nそのアカウントでは、手動では他の管理者ユーザを追加や削除する事が出来ています。 \nGASプログラムからは追加は可能ですが、共有ドライブから他の管理者の削除ができません。\n\n手動での削除方法は下記です \n「共有ドライブ」→「特定の共有ドライブ」→「メンバーを管理」→「アクセス権の削除」 \nで管理者を削除する事は出来ます。\n\nGASから共有ドライブの管理者ユーザを削除したいのですが、削除ができません。 \n管理者権限のユーザを追加することは出来ます。 \nまた、スプレッドシートの投稿者や閲覧者の追加や削除は出来ます。\n\n削除した場合のエラーは下記2通りです。\n\n1.`Error:GoogleJsonResponseException: API call to drive.permissions.list\nfailed with error: The requesting user does not have the administrator\nprivileges required to access shared drive .`\n\n2.`権限削除に失敗しました。:GoogleJsonResponseException:\n次のエラーが発生し、drive.permissions.delete の呼び出しに失敗しました: File not found: role,,value,\nxxxxxxx@xxxxxx,type,domain`\n\n【スクリプトの内容】\n\n```\n\n function deleteDrivePermissions2023(){\n \n // ファイル名情報\n var spName = SpreadsheetApp.getActiveSpreadsheet().getName();\n // シート情報\n var sheet2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"XXX\"); \n // シートからID情報\n var mainId = sheet2.getRange(\"B2\").getValue();\n var driveFolder = DriveApp.getFolderById(mainId);\n var driveFile = DriveApp.getFolderById(mainId);\n \n // 各データ情報\n var data = sheet2.getRange( \"A5:D\" + sheet2.getLastRow()).getValues();\n for (var i = 0; i < data.length; i++) {\n var name = data[i][0];\n var email = data[i][1];\n var permission = data[i][2];\n var action = data[i][3];\n var log = []; \n \n // 権限を削除、追加、変更 \n \n if (action === \"削除\") {\n if (email === \"YYY@ZZZ\"){\n log.push(email + \"の権限は削除できません。\");\n sheet2.getRange(i + 5, 5).setValue( email + \"権限は削除できません。\")\n continue; \n }\n //対象の共有ドライブからメンバーを削除\n try {\n \n Drive.Permissions.remove(mainId, email, { \n 'sendNotificationEmails' : false, //trueとすると通知が飛んでしまいます\n 'supportsAllDrives' : true //共有ドライブサポートを有効化する }\n });\n \n var newPermission1 = { \n \"role\" : \"organizer\", //organizer 管理者権限になります \n \"type\" : \"user\",\n \"value\" : email \n };\n \n var removeOptions = {\n sendNotificationEmails : false,\n supportsAllDrives: true,\n supportsTeamDrives: true,\n useDomainAdminAccess: true\n };\n Drive.Permissions.remove(newPermission1, driveFolder.getId(),removeOptions);\n \n \n sheet2.getRange(i + 5, 5).setValue( name + \"権限を削除しました。\")\n } catch (e) {\n sheet2.getRange(i + 5, 5).setValue( name + \"権限削除に失敗しました。:\" + e ); \n }\n }\n }\n }\n \n```\n\nどのように対応したらよろしいでしょうか。 \nご教授いただければ幸いです。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-05T05:03:30.403",
"favorite_count": 0,
"id": "94420",
"last_activity_date": "2023-04-10T07:51:40.047",
"last_edit_date": "2023-04-10T07:51:40.047",
"last_editor_user_id": "3060",
"owner_user_id": "57824",
"post_type": "question",
"score": 0,
"tags": [
"google-apps-script"
],
"title": "GASで共有ドライブの管理者ユーザ削除ができません",
"view_count": 153
} | [] | 94420 | null | null |
{
"accepted_answer_id": "94426",
"answer_count": 1,
"body": "新しい Pandas で `melt` を使用すると、日付のタイムゾーンが変わりました。 \n不具合でしょうか。\n\n```\n\n !pip3 install pandas\n !pip3 list | grep pandas\n \n import pandas as pd\n \n df = pd.DataFrame(data=[\n {'type': 'A0', 'start_date': pd.Timestamp('2023/03/01', tz='Asia/Tokyo'), 'end_date': pd.Timestamp('2023/03/10', tz='Asia/Tokyo')},\n {'type': 'A1', 'start_date': pd.Timestamp('2023/03/01', tz='Asia/Tokyo'), 'end_date': pd.Timestamp('2023/03/11', tz='Asia/Tokyo')},\n ], index=['aaaa', 'bbbb'])\n display(df)\n \n df = df.melt(id_vars=['type'], value_vars=['start_date', 'end_date'], var_name='start/end', value_name='date')\n display(df)\n \n```\n\n[](https://i.stack.imgur.com/rvTaQ.png)",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-05T15:49:31.060",
"favorite_count": 0,
"id": "94425",
"last_activity_date": "2023-04-06T00:42:27.723",
"last_edit_date": "2023-04-06T00:42:27.723",
"last_editor_user_id": "3060",
"owner_user_id": "35267",
"post_type": "question",
"score": 0,
"tags": [
"python",
"python3",
"pandas"
],
"title": "Pandas 2.0 の melt メソッドでタイムゾーンが変わってしまう",
"view_count": 97
} | [
{
"body": "問題の箇所は以下です。\n\n[melt() in melt.py](https://github.com/pandas-\ndev/pandas/blob/main/pandas/core/reshape/melt.py#L143)\n\n```\n\n if frame.shape[1] > 0:\n mdata[value_name] = concat(\n [frame.iloc[:, i] for i in range(frame.shape[1])]\n ).values\n else:\n ... | 94425 | 94426 | 94426 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "コードは以下の通りです。\n\n```\n\n import SwiftUI\n let layout2: [GridItem] = Array(repeating: .init(.flexible(minimum: 40, maximum: 75)), count: 5)\n struct ContentView: View {\n @State var scores: [Int] = [1,3,4,3,2, 2,3,3,4,3]\n var body: some View {\n // Text(\"\\(scores.count)\") = 10\n // ScrollView {\n \n HStack {\n LazyVGrid(columns: layout2, spacing: 1) {\n ForEach(scores, id: \\.self) { num in\n ZStack {\n Rectangle()\n .foregroundColor(.accentColor)\n .frame(height: 45)\n Text(\"\\(num)\")\n .foregroundColor(.white)\n } // ZStack\n \n } // ForeEach\n } // LazyVGrid\n } // HStack\n // } // ScrollView\n } // body\n } // ContentView\n \n struct ContentView_Previews: PreviewProvider {\n static var previews: some View {\n ContentView()\n }\n }\n \n```\n\n[](https://i.stack.imgur.com/FHJar.png)",
"comment_count": 2,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-05T23:55:32.040",
"favorite_count": 0,
"id": "94428",
"last_activity_date": "2023-04-06T05:21:57.647",
"last_edit_date": "2023-04-06T00:41:03.027",
"last_editor_user_id": "3060",
"owner_user_id": "57706",
"post_type": "question",
"score": 0,
"tags": [
"swift"
],
"title": "iPhoneアプリをswiftで作成しています。LazyVGridで作成したのですが思う結果がでません。何か間違っているのかわかりません。",
"view_count": 72
} | [
{
"body": "ログにエラーの内容が出ているはずです。\n\n```\n\n LazyVGridLayout: the ID 3 is used by multiple child views, this will give undefined results!\n LazyVGridLayout: the ID 2 is used by multiple child views, this will give undefined results!\n LazyVGridLayout: the ID 4 is used by multiple child views, this will gi... | 94428 | null | 94431 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "xcodeでアプリの開発を行っています。 \nMain.storyboard(base)から、いつのタイミングからかiPadが無くなりました。 \niPadのViewは復元できるのでしょうか。\n\nxcodeのバージョンは14.1です。\n\n[](https://i.stack.imgur.com/ABNGm.png)",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-06T01:21:27.227",
"favorite_count": 0,
"id": "94429",
"last_activity_date": "2023-05-25T06:44:31.217",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "37089",
"post_type": "question",
"score": 0,
"tags": [
"swift",
"xcode"
],
"title": "xcodeのストーリーボードからiPadのViewが消えた",
"view_count": 101
} | [
{
"body": "Xcode14.3ですが、おそらく`Destination`にiPadが追加されていないからだと思います。\n\nXcode上でProjectファイルを開き、\n\n`General` > `Supported Destinations` > `Destination`\n\nを参照しiPadが追加されているかどうか確認してみてください。\n\nもし、追加されていなければ追加して、再度ビルドするとStoryboardに追加されていると思います。\n\n以下の画像は、追加されている状態のProjectファイルとStoryboardです。\n\n[![DestinationにiPadを追加された状態... | 94429 | null | 94973 |
{
"accepted_answer_id": "94434",
"answer_count": 3,
"body": "C言語でオリジナルのプログラミング言語を作成したいと考えているのですが、そのようなことは可能でしょうか。 \n可能な場合はどのような手順で作れば良いのか教えて下さい。\n\n試したこと\n\n * 検索してみた(実際に検索するとC#とかC++とか少し違う言語が出てきました)",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-07T02:17:30.067",
"favorite_count": 0,
"id": "94432",
"last_activity_date": "2023-04-07T08:01:26.783",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "56895",
"post_type": "question",
"score": 2,
"tags": [
"c",
"プログラミング言語"
],
"title": "C言語でオリジナルのプログラミング言語を作ることはできますか。",
"view_count": 384
} | [
{
"body": "[プログラミング言語を作る](http://kmaebashi.com/programmer/devlang/)が参考になるでしょう。 \nC言語でオリジナルのプログラミング言語をじっさいに作る手順が記載されています。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-07T02:56:32.117",
"id": "94433",
"last_activity_date": "2023-04-07T02:56:32.117",
"... | 94432 | 94434 | 94433 |
{
"accepted_answer_id": "94439",
"answer_count": 1,
"body": "# 質問内容\n\n組込みDebian10環境下で、後述するようなパッケージインストール状態でした。 \n同じように再現するために、どのようにPythonパッケージを確認・インストールするのでしょうか?\n\n# aptパッケージの確認\n\n以下のようにPythonに関するパッケージは以下のようでした。 \npipが存在していません。しかし、Pythonインタプリタでは、パッケージインストール先にあるパッケージがimportできます。\n\n```\n\n apt list python* --installed\n \n python3-minimal/now 3.7.3-1 armhf [installed,local]\n python3-six/now 1.12.0-1 all [installed,local]\n python3.7-minimal/now 3.7.3-2+deb10u2 armhf [installed,local]\n python3.7/now 3.7.3-2+deb10u2 armhf [installed,local]\n python3/now 3.7.3-1 armhf [installed,local]\n \n```\n\n# パッケージのインストール先\n\n```\n\n /usr/local/lib/python3.7/dist-packages/\n \n```\n\n# 参考資料\n\n前の質問 \n[組込み機器内\nDebianでのPython3パッケージの確認方法](https://ja.stackoverflow.com/questions/94399/%e7%b5%84%e8%be%bc%e3%81%bf%e6%a9%9f%e5%99%a8%e5%86%85-debian%e3%81%a7%e3%81%aepython3%e3%83%91%e3%83%83%e3%82%b1%e3%83%bc%e3%82%b8%e3%81%ae%e7%a2%ba%e8%aa%8d%e6%96%b9%e6%b3%95) \n参考URL \n[The reason cause different location of python\npackages](https://stackoverflow.com/questions/54234344/the-reason-cause-\ndifferent-location-of-python-packages)\n\n# 試したこと\n\n他サイトに紹介されていたようなaptパッケージでのインストールを試みました。\n\n```\n\n sudo apt install python3-(パッケージ名)\n sudo apt install python3.7-(パッケージ名)\n \n```\n\nPillow、django、flower、redis等がインストールされているのですが、上記の方法ではインストールできません。\n\n# 追記\n\n情報が不足していたので、追記します。\n\n## 状況\n\nDebian10の組込み機器を開発するためにVMwareでOSイメージが提供されています。 \nそれを使用して、開発・ブートイメージ作成→実機適用という流れです。 \n他の人が作成した組込み機器は既に動作済みのアプリ等が動いております。 \nただし、それを作製した開発環境がなく、実機から動いているものから再現を試みています。手元のVMwareのOSイメージはデフォルト状態になっています。 \n実機にログインして、手元のVMware上との違いを探りつつ再現している状態です。\n\n## 実機内での調査\n\n上記のaptパッケージ確認とは、実機にTeraTermログインしてコマンドラインで得た結果です。 \nまた、パッケージの確認方法は、あたりをつけて、インストールフォルダをWinSCPで確認しました。さらに、実機内でPythonを起動して、各パッケージが実際にimportできることを確認しております。 \nこの実機内でaptでもなく、pipもない状況でなぜPythonパッケージがインストールされているのかが分からないです。",
"comment_count": 8,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-07T07:48:30.880",
"favorite_count": 0,
"id": "94437",
"last_activity_date": "2023-04-07T11:39:21.510",
"last_edit_date": "2023-04-07T08:35:40.140",
"last_editor_user_id": "32891",
"owner_user_id": "32891",
"post_type": "question",
"score": 0,
"tags": [
"python",
"debian"
],
"title": "Debian環境のPython3でpipを使用せずにパッケージをインストールする方法",
"view_count": 117
} | [
{
"body": "ソースコードを持ってくれば、中に`setup.py`というスクリプトがあるはずなので、それを実行してインストールできます。\n\n```\n\n python3 setup.py install\n \n```\n\nただし、\n\n * インストールされるのはそのパッケージのみで、依存しているパッケージはインストールされません。一つ一つインストールする必要があります。\n * 拡張モジュール(C言語などで書かれたもの)を含むパッケージは、C言語の開発環境が必要です。(pipでのインストールでも場合によっては同じですが、この場合 **必ず** です)\n\nめんどくさいですよね。... | 94437 | 94439 | 94439 |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "伺いたいことがあります(内容変更)。\n\nComboBox1のリストを選択しても、Form1からForm2に初期値の値しか渡りませんでした。\n\nMessageBox.Show(idx)を実施したところ、数字に変化がありませんでした。\n\nMe.ComboBox1.SelectedIndex = 0\n\nこの部分を1,2に変化させコンパイルすると、Form2で正しく動きました。ComboBox1のリストで選択した際に、idxも0~2に変化し、その結果、nsf値が1~3に変化させたいのですが、初期値の0のまま動きません。\n\nどのようにすれば成功するかご知見を頂けますと有難く存じます。\n\n①Form1\n\n```\n\n Public Class Form1\n \n Public nsf As Integer\n \n Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load\n \n Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList\n \n With Me.ComboBox1\n \n .Items.Add(\"1:A\")\n .Items.Add(\"2:B\")\n .Items.Add(\"3:C\")\n \n End With\n \n Me.ComboBox1.SelectedIndex = 0\n \n Dim idx As Integer = Me.ComboBox1.SelectedIndex\n \n nsf = idx + 1\n \n End Sub\n \n \n Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click\n \n Dim f2 As New Form2\n \n f2.nsf = Me.nsf\n \n f2.Show()\n \n End Sub\n \n End Class\n \n```",
"comment_count": 9,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-07T12:34:47.523",
"favorite_count": 0,
"id": "94440",
"last_activity_date": "2023-04-08T06:18:49.377",
"last_edit_date": "2023-04-08T06:18:49.377",
"last_editor_user_id": "50731",
"owner_user_id": "50731",
"post_type": "question",
"score": 0,
"tags": [
"vb.net",
"winforms"
],
"title": "違うFormにコンボボックスから得られた数値を渡す",
"view_count": 222
} | [] | 94440 | null | null |
{
"accepted_answer_id": null,
"answer_count": 0,
"body": "# Overview\n\n* * *\n\n行おうとしたことを簡単に書きます:\n\n 1. pd.DataFrameに入ったテキストデータをsentence transfomerに入力し,sentence embeddingを得る.\n 2. そのsentence embeddingをemb_listというlist型にappend()で追加.\n 3. そのlistをpickle.dump()でpickleファイルに保存\n 4. そのpickleファイルを読み込もうとpickle.load()で読み込み\n\n4.を実行すると`EOFError: Ran out of input`が発生.\n\n# Details\n\n* * *\n\nここから詳細に入りますが,その前にDataFrameの準備から:\n\n```\n\n from urllib.request import urlretrieve\n import pandas as pd\n \n # Download the parquet table\n table_url = f'https://huggingface.co/datasets/poloclub/diffusiondb/resolve/main/metadata.parquet'\n urlretrieve(table_url, 'metadata.parquet')\n \n # Read the table using Pandas\n df_2m = pd.read_parquet('metadata.parquet')\n \n```\n\ndf_2m['prompt']の各行には,次のようにstr型のオブジェクトが入っています:\n\n```\n\n 1 a portrait of a female robot made from a cloud...\n 2 only memories remain, trending on artstation \n 3 dream swimming pool with nobody \n 4 a dog doing weights. epic oil painting. \n ... \n 1999995 david bowie giving a piggy back ride to ziggy ...\n 1999996 david bowie giving a piggy back ride to ziggy ...\n 1999997 funny computer \n 1999998 hilarious witty computing machine \n 1999999 hilarious witty computing machine, lichtenstien \n Name: prompt, Length: 2000000, dtype: object\n \n```\n\n以下,行おうとしたこと1~3:\n\n```\n\n import sys\n from sentence_transformers import SentenceTransformer, models\n \n # pathの追加\n sys.path.append('./sentence-transformers-2-2-2/sentence-transformers')\n \n # sentence transformerの読み込み\n st_model = SentenceTransformer('./sentence-transformers-2-2-2/all-MiniLM-L6-v2')\n \n emb_list = []\n for i, row in df_2m.iterrows():\n # 1.sentence embeddingを出力\n emb = st_model.encode(row['prompt'])\n # 2. sentence embeddingをemb_listに追加\n emb_list.append(emb)\n if ((i+1) % 1000)==0:\n print(f'Saved at {i+1} prompts.')\n # 3. pickleファイルに保存\n with open('./SD2GPT2/2M/embedding_2M_0.pickle', 'wb') as f:\n pickle.dump(emb_list, f)\n \n```\n\n4.pickleファイルの読み込み:\n\n```\n\n with open('./SD2GPT2/2M/embedding_2M_0.pickle', 'rb') as f:\n print(f)\n emb_list0 = pickle.load(f)\n \n```\n\n読み込めず,エラー:\n\n```\n\n ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n │ in <module> │\n │ │\n │ 1 with open('./SD2GPT2/2M/embedding_2M_0.pickle', 'rb') as f: │\n │ ❱ 2 │ emb_list1 = pickle.load(f) │\n │ 3 │\n ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n EOFError: Ran out of input\n \n```\n\n# Question\n\n* * *\n\nファイルが空でないことは確認しました.\n\n * なぜこのエラーが発生したのか\n * どうすれば読み込めるようになるか\n\nをお教えください.\n\n# P.S.\n\n* * *\n\n1000行だけ,次に10000行だけ,そして100000行だけでファイルへの保存と読み込みを行ったところ,読み込みができるようになりました. \nデータ量のせい?もしくは何か他に原因がある? \npickleの仕様をあとで調べてみます.",
"comment_count": 3,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-07T17:05:46.180",
"favorite_count": 0,
"id": "94442",
"last_activity_date": "2023-04-07T21:39:40.203",
"last_edit_date": "2023-04-07T21:39:40.203",
"last_editor_user_id": "39908",
"owner_user_id": "39908",
"post_type": "question",
"score": 0,
"tags": [
"python"
],
"title": "pickleファイルを読み込もうとした際に発生したEOFErrorについて",
"view_count": 168
} | [] | 94442 | null | null |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "お世話になります。Laravel初心者です。 \n別で作成されたLaravel8のプログラムを改修しています。 \nDBで既存のdtb_productというテーブルがあり\n\nphp artisan make:model DtbProduct\n\nでModelを作成しました。 \nコントローラーで\n\nuse App\\Models\\DtbProduct;\n\nを追加し、\n\n```\n\n $product = DtbProduct::find(1022);\n \n```\n\nと実行したところ\n\n**SQLSTATE[42S02]: Base table or view not found: 1146 Table\n'shareef_dev.dtb_products' doesn't exist**\n\nとエラーが出ます。 \n試しに\n\n```\n\n $product = \\DB::table('dtb_product')->find(1022);\n \n```\n\nとしたところ問題なくテーブルの内容が取得されます。\n\n問題点は \n**dtb_product → dtb_productsとsがついてしまう**\n点なのですが、Laravelの全ファイルを調べてもdtb_productsとsがついている部分はありませんでした。\n\nどの辺を確認すればよいかもわからないため、お分かりの方教えていただけないでしょうか。 \nよろしくお願いいたします。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-08T02:34:10.580",
"favorite_count": 0,
"id": "94443",
"last_activity_date": "2023-04-10T01:32:11.010",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "23604",
"post_type": "question",
"score": 0,
"tags": [
"laravel"
],
"title": "laravel既存テーブルのModelを作成するとテーブル名にsがつく",
"view_count": 105
} | [
{
"body": "自己解決しました。\n\n[Laravelのドキュメント](https://laravel.com/docs/8.x/eloquent#table-names) の Eloquent\nModel Conventions > Table Names にありました。 \nModel の dtb_product.php に以下の記述を追加することでうまくいきました。\n\n```\n\n protected $table = 'dtb_ptoduct';\n \n```",
"comment_count": 0,
"content_license": "CC BY-SA... | 94443 | null | 94447 |
{
"accepted_answer_id": "94618",
"answer_count": 1,
"body": "「Yahoo!メールでは不正な利用を防ぐためSMTPだけ有効にすることを許可していません」と掲載されていますが、SMTPだけを有効にするとどうして不正利用できるのですか? \nSMTPだけ有効にすることは×なのに、SMTPとIMAPを有効にすることは〇なのはなぜですか?\n\n> ・Yahoo!メールでは不正な利用を防ぐために、SMTPだけ有効にすることを許可していません。\n\n[Yahoo!メールヘルプ](https://support.yahoo-net.jp/PccMail/s/article/H000007321)\n\n> SMTPだけ有効にすることはできません \n> Yahoo!メールでは不正な利用を防ぐため、SMTPだけ有効にすることは許可していません。SMTPを含めすべて無効にし、「Yahoo! \n> JAPAN公式サービスを利用したアクセスのみ有効にする」に設定を変更しますか?\n\n[IMAP/POP/SMTPアクセス](https://mail.yahoo.co.jp/u/pc/f/)",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-08T02:49:23.483",
"favorite_count": 0,
"id": "94444",
"last_activity_date": "2023-04-22T23:45:29.803",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "7886",
"post_type": "question",
"score": 1,
"tags": [
"mail"
],
"title": "SMTPだけを有効にすると、どうして不正な利用をできるのですか?",
"view_count": 209
} | [
{
"body": "認証を必須にすれば、SMTPだけでも不正利用は防げるはずです。\n\nYahooの記述は、認証に [POP(IMAP) before\nSMTP](https://ja.wikipedia.org/wiki/POP_before_SMTP)\nのみを使用していた頃のなごりだと想像します。今でも認証方法がこれなのかも知れません。",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-22T23:45:29.803",
"id": "94618",
... | 94444 | 94618 | 94618 |
{
"accepted_answer_id": "94446",
"answer_count": 1,
"body": "「*.dll」や「lib*.so」は共有ライブラリとのことですが、それぞれ仕様はありますか? \n例えば「*.dll」として仕様があり「HTML5仕様」のように「*.dll仕様」としてどこかで公開されていますか? \nそれとも「*.dll」は単にこの拡張子を共有ライブラリとしてみなすという意味でしかなく、それぞれの仕様は、同じ「*.dll」でもそれぞれのプロジェクトごとに異なるのですか?",
"comment_count": 1,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-08T02:50:24.743",
"favorite_count": 0,
"id": "94445",
"last_activity_date": "2023-04-10T08:48:45.927",
"last_edit_date": "2023-04-10T08:48:45.927",
"last_editor_user_id": "7886",
"owner_user_id": "7886",
"post_type": "question",
"score": 1,
"tags": [
"dll"
],
"title": "「*.dll」や「lib*.so」は共有ライブラリとのことですが、それぞれ仕様はありますか?",
"view_count": 211
} | [
{
"body": ".dllはWindowsで使われる共有ライブラリの拡張子です。Portable Executableフォーマットで定義されているようです。 \n[Wikipedia: Portable\nExecutable](https://ja.wikipedia.org/wiki/Portable_Executable) \n[PE(Portable\nExecutable)ファイルフォーマットの概要](http://shopping2.gmobb.jp/htdmnr/www08/mcc/doc/pe.html) \n[Microsoft: PE 形式](https://learn.microsof... | 94445 | 94446 | 94446 |
{
"accepted_answer_id": null,
"answer_count": 1,
"body": "##### 質問内容\n\n提示コードですが以下の`kintone`のポータル画面をカスタマイズしたいのですがローカルファイルのアップロードを自動で行ってほしいのですが`appID`なるものが必要でその`ID`がわかりません。提示コードのように画面にコンソール出力させましたが`null`という表示されています。これはどうしたらいいのでしょか?\n\n##### 知りたいこと\n\nkintonのポータル画面でのappIDの取得方法 \nもしくはポータル画面の編集で自動でローカルファイルをアップロードして更新してくれる仕組みを導入する方法が知りたい。\n\n##### 試したこと\n\n提示の`upload-\nmanifest.json`の`app`のところにブラウザ上でのポータル画面でのURLに`k`,`#`などと書いてあっため`k,#,あと0,null,\"\"`等を入れて試しましたが設定できません。\n\n##### アップロードコマンド\n\n```\n\n npx kintone-customize-uploader ./upload-manifest.json --watch\n \n```\n\n##### コンソールログ\n\n```\n\n Hello World\n Hello World\n Hello World\n null\n \n```\n\n##### upload-manifest.json\n\n```\n\n {\n \"app\": \"0\",\n \"scope\": \"ALL\",\n \"desktop\": {\n \"js\": [\n \"./Index.js\"\n ],\n \"css\": []\n },\n \"mobile\": {\n \"js\": []\n }\n }\n \n```\n\n##### Index.js\n\n```\n\n \"use strict\";\n (() => {\n console.log(\"Hello World\");\n console.log(\"Hello World\");\n console.log(\"Hello World\");\n \n kintone.events.on('portal.show', () => \n {\n console.log(kintone.app.getId());\n });\n \n kintone.events.on(\"app.record.create.show\", (event) => {\n const appId = event.appId;\n const recordId = event.recordId;\n });\n })();\n \n \n```",
"comment_count": 0,
"content_license": "CC BY-SA 4.0",
"creation_date": "2023-04-08T08:36:49.100",
"favorite_count": 0,
"id": "94448",
"last_activity_date": "2023-04-08T08:48:59.447",
"last_edit_date": null,
"last_editor_user_id": null,
"owner_user_id": "55177",
"post_type": "question",
"score": 0,
"tags": [
"javascript"
],
"title": "Kintoneカスタマイズでポータル画面のappIDが知りたい",
"view_count": 104
} | [
{
"body": "「kintone appid 確認」でGoogle検索すると以下の記事がヒットします。\n\n[kintone連携\nアプリIDの確認](https://support.kincone.com/hc/ja/articles/4411880749081-kintone%E9%80%A3%E6%90%BA-%E3%82%A2%E3%83%97%E3%83%AAID%E3%81%AE%E7%A2%BA%E8%AA%8D)\n\n> kintoneのアプリ画面を開き、URLを確認してください。 \n> 「https://[サブドメイン].cybozu.com/k/」に続いて表示されている末尾の数字が... | 94448 | null | 94449 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.