ホーム » 2020 » 6月

月別アーカイブ: 6月 2020

2020年6月
 123456
78910111213
14151617181920
21222324252627
282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 79,201 アクセス



AS5202T Debian 10 と VC

VC で ASUSTOR NAS Linux Center の Debian 10 Desktop を使用するための設定.


SSH 接続を可能にして gcc などをインストールしておく必要がある.
Linux development with C++ in Visual Studio


VC の「ツール」-「オプション」,「クロスプラットフォーム」-「接続マネージャー」-「追加」.
Debian 10 への接続の設定
SSH 接続する時の情報を設定する.
追加後「接続マネージャー」-「リモートヘッダー…」で「更新」するとエラー.
エラーが発生しました。Could not start the ‘rsync’ command on the remote host, please install it using your system package manager. Please see https://aka.ms/AA23jat for troubleshooting。詳細については、C:\Users\Iwao\AppData\Local\Temp\vslinux_header_update_log.txt を参照してください。トラブルシューティングを行うには、https://aka.ms/AA23jat をご覧ください。
エラーが発生しました。Could not start the 'rsync' command on the remote host, please install it using your system package manager.
この部分の対応方法はよくわからない.


VC のプロジェクトの設定を「lxcdebian10」に.
VC リモートビルドマシンを「lxcdebian10」に設定


これでビルドすれば大丈夫なはずだが,何故かエラー.
VC を再起動したり,プロジェクトを読み直したりしていたら通る様になった.
AS5202T Debuan 10 VC ビルド

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

AS5202T Debian 10

以前 インストールしてそのままになっていた環境.
その時わからなかったのが「タイムゾーン」の設定.
次の所を参考にさせてもらって設定.
Debian 10 busterをインストールして最初に行う設定と確認 10項目
Linux Center Debian 10 タイムゾーンの設定


共通のソースなどを参照するために…
Linux から Windows 環境への接続
Linux Center Debian 10 mount
接続先は,最終的には変更する予定.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

弦と矢と半径 – 11

JavaScript 版で Canvas を使用する様にしてみた.
弦と矢と半径 JavaScript Canvas
https://mish.myds.me/Test/blog/r_cs/b/

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

AS5202T に mono インストール

Synology NAS にもあるので気になっていた mono
以前 MonoDevelop をインストールして少しは試したことがある.
それで,どこまでのものとして入るかをやってみた.
AS5202T App Central Mono

Iwao@AS5202T:/volume1/home/Iwao/test/mono $ ls /usr/local/AppCentral/mono/bin/
al*                        gacutil2*                  mono-api-info*             nunit-console2*
al2*                       genxs*                     mono-boehm*                nunit-console4*
asp-state*                 httpcfg*                   mono-cil-strip*            pdb2mdb*
asp-state2*                ikdasm*                    mono-configuration-crypto* pedump*
asp-state4*                ilasm*                     mono-find-provides*        permview*
caspol*                    illinkanalyzer*            mono-find-requires*        peverify*
cccheck*                   installvst*                mono-gdb.py                resgen*
ccrewrite*                 lc*                        mono-heapviz*              resgen2*
cert-sync*                 macpack*                   mono-package-runtime*      secutil*
cert2spc*                  makecert*                  mono-service*              setreg*
certmgr*                   mconfig*                   mono-service2*             sgen*
chktrust*                  mcs*                       mono-sgen*                 sgen-grep-binprot*
crlupdate*                 mdassembler*               mono-sgen-gdb.py           signcode*
csc*                       mdbrebase*                 mono-shlib-cop*            sn*
csc-dim*                   mdoc*                      mono-symbolicate*          soapsuds*
csharp*                    mdoc-assemble*             mono-test-install*         sqlmetal*
csi*                       mdoc-export-html*          mono-xmltool*              sqlsharp*
dbsessmgr*                 mdoc-export-msxdoc*        monodis*                   svcutil*
dbsessmgr2*                mdoc-update*               monodocer*                 vbc*
dbsessmgr4*                mdoc-validate*             monodocs2html*             wsdl*
disco*                     mdvalidater*               monodocs2slashdoc*         wsdl2*
dmcs*                      mkbundle*                  monograph*                 xbuild*
dtd2rng*                   mod*                       monolinker*                xsd*
dtd2xsd*                   mod-mono-server*           monop*                     xsp*
fastcgi-mono-server*       mod-mono-server2*          monop2*                    xsp2*
fastcgi-mono-server2*      mod-mono-server4*          mozroots*                  xsp4*
fastcgi-mono-server4*      mono@                      mprof-report*
gacutil*                   mono-api-html*             nunit-console*
Iwao@AS5202T:/volume1/home/Iwao/test/mono $                      

AS5202T AppCentral mono bin
mono 使い方」で検索.
mcs test.cs でコンパイル,mono test.exe で実行できるみたい.


2020/06/24
phpinfo() を見てみると mod_mono が読み込まれている.
AS5202T phpinfo() apache2handler mod_mono


mcs で出来上がった exe は Windows のコマンドプロンプトで実行できる.
Mono 環境でできた exe を実行

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

弦と矢と半径 – 10

JavaScript 数値入力で更新.

	<body>

<pre>
c : <input  type='number'  id='in__c'  value='8'  style='width:100px;'  step='any' /> <span  id='out_c'> </span>  <br />
s : <input  type='number'  id='in__s'  value='2'  style='width:100px;'  step='any' /> <span  id='out_s'> </span>  <br />
r : <input  type='number'  id='in__r'  value='5'  style='width:100px;'  step='any' /> <span  id='out_r'> </span>  <br />
</pre>
		<img	src='r_cs.png'	width='300px'>

		<script>

			function	r_cs	(c , s)		{	return	(        ( c*c )  / ( 8*s )  +  s/2 ) ;		}
			function	s_rc	(r , c)		{	return	( r-Math.sqrt(r*r - (c/2)*(c/2) )   ) ;		}
			function	c_rs	(r , s)		{	return	(   Math.sqrt(r*r - (r-s)*(r-s) )*2 ) ;		}

			function	f_c_rs	() {
				var	oc = document.querySelector("#out_c") ;
				var	os = document.querySelector("#out_s") ;
				var	or = document.querySelector("#out_r") ;
				var	ic = document.querySelector("#in__c") ;
				var	is = document.querySelector("#in__s") ;
				var	ir = document.querySelector("#in__r") ;
				var	fc = parseFloat(ic.value) ;
				var	fs = parseFloat(is.value) ;
				var	fr = parseFloat(ir.value) ;
				oc.textContent = "" ;
				os.textContent = "" ;
				or.textContent = "" ;
				os.textContent = s_rc(fr,fc) ;
				or.textContent = r_cs(fc,fs) ;
				}
		//	...
			{
				var	ec = document.getElementById("in__c") ;
				var	es = document.getElementById("in__s") ;
				var	er = document.getElementById("in__r") ;
				ec.addEventListener("keyup",f_c_rs, false) ;
				es.addEventListener("keyup",f_s_rc, false) ;
				er.addEventListener("keyup",f_r_cs, false) ;
				}

			</script>

		</body>

弦と矢と半径 JavaScript 版
https://mish.myds.me/…/r_cs/a/

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

弦と矢と半径 – 9

JavaScript で.

<body>
	c : <input	type='number'	id='in__c'	value='80.0'	size='10'	step='any'	/><input	type='submit'	value='c_rs'	id='c_rs'	/>	<span	id='out_c'> </span>	<br />
	s : <input	type='number'	id='in__s'	value='20.0'	size='10'	step='any'	/><input	type='submit'	value='s_rc'	id='s_rc'	/>	<span	id='out_s'> </span>	<br />
	r : <input	type='number'	id='in__r'	value='50.0'	size='10'	step='any'	/><input	type='submit'	value='r_cs'	id='r_cs'	/>	<span	id='out_r'> </span>	<br />
	<img	src='r_cs.png'	width='300px'>

	<script>
		function	r_cs	(c , s)		{	return	(        ( c*c )  / ( 8*s )  +  s/2 ) ;		}
		function	s_rc	(r , c)		{	return	( r-Math.sqrt(r*r - (c/2)*(c/2) )   ) ;		}
		function	c_rs	(r , s)		{	return	(   Math.sqrt(r*r - (r-s)*(r-s) )*2 ) ;		}

		function	f_c_rs	() {
			var	oc = document.querySelector("#out_c") ;
			var	os = document.querySelector("#out_s") ;
			var	or = document.querySelector("#out_r") ;
			var	ic = document.querySelector("#in__c") ;
			var	is = document.querySelector("#in__s") ;
			var	ir = document.querySelector("#in__r") ;
			var	fc = parseFloat(ic.value) ;
			var	fs = parseFloat(is.value) ;
			var	fr = parseFloat(ir.value) ;
			oc.textContent = "" ;
			os.textContent = "" ;
			or.textContent = "" ;
			oc.textContent = c_rs(fr,fs) ;
			}
		//	...
		{
			var	ec = document.getElementById("c_rs") ;
			var	es = document.getElementById("s_rc") ;
			var	er = document.getElementById("r_cs") ;
			ec.addEventListener("click",f_c_rs, false) ;
			es.addEventListener("click",f_s_rc, false) ;
			er.addEventListener("click",f_r_cs, false) ;
			}
		</script>
	</body>

R S C JavaScript
https://mish.myds.me/…/r_cs/9/

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

弦と矢と半径 – 8

Python を使用しないで PHP のみで.

<?php
	function	r_cs	($c , $s)	{	return	(    ( $c*$c )  / ( 8 *$s )   +  $s/2 ) ;	}
	function	s_rc	($r , $c)	{	return	( $r-sqrt($r*$r - ($c/2)*($c/2) )     ) ;	}
	function	c_rs	($r , $s)	{	return	(    sqrt($r*$r - ($r-$s)*($r-$s) )*2 ) ;	}
	?>

PHP のみで実装
https://mish.myds.me/…/r_cs/8/

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

AS5202T VirtualBox – 2

AS5202T の CPU 温度を見るといつもより高い.
「プロセス」情報を見ると VirtualBox が消費している.
AS5202T の「プロセス」状態
VNC で接続すると TiWorker.exe が CPU を食っている.
DevX  TiWorker.exe
丁度 Windows Update のタイミングみたい.
VNC 接続の仮想マシンは遅くて操作できないが,接続しているクライアントからソースなどは見える.
TiWorker が CPU を食っている
前回 の様なネットワークが途切れる状態にはまだなっていない.


「リモートデスクトップ」であれば仮想マシンも操作できた.
落ち着くまでそのままにしておくしかなさそう.


その後「再起動」待ちになっていたので仮想マシンを再起動.
また止まったような表示.
Windows Update の再起動で,止まったような状態?
CPU は食っているのでこのまま様子見.


2020/06/11
そのまま変わらないので,仮想マシンの「電源オフ」.
PC の VirtualBox で再起動.
2020/06 Windows Update
Windows Update での再起動がうまく動作しないのか?


AS5202T VirtualBox の仮想マシンとして起動した時,いつもより時間がかかることがある.
また,ネットワークがうまく接続されていないこともあり.
安定するまで何度か再起動の必要があるのかもしれない.
起動時止まった様に見えても 30 分程度はそのままにして様子を見た方が良さそう.
仮想マシンの CPU や HDD などのリソースへのアクセス状況が見えると良いのに…

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

FBX SDK 2020.1

FBX SDK の脆弱性」の記事を先日読んでいた.
それで SDKダウンロード する所を見ると,対応版と思われる 2020.1 があった.
FBX SDK 2020.1


「追加のインクルードディレクトリ」と「追加のライブラリディレクトリ」を 2020.1 に.
追加のインクルードディレクトリ
追加のライブラリディレクトリ
ビルドすると大量の warning .

LibXml2-MD.lib(buf.obj) : warning LNK4099: PDB 'libxml2-md.pdb' が 'LibXml2-MD.lib(buf.obj)' で、または 'c:\Temp\...\Debug.141\Win32\libxml2-md.pdb' に見つかりません。デバッグ情報がないものとして、オブジェクトにリンクします。
Zlib-MD.lib(adler32.obj) : warning LNK4099: PDB 'zlib-md.pdb' が 'Zlib-MD.lib(adler32.obj)' で、または 'c:\Temp\...\Debug.141\Win32\zlib-md.pdb' に見つかりません。デバッグ情報がないものとして、オブジェクトにリンクします。
LibFbxSDK-MD.lib(OArchive.cpp.obj) : warning LNK4099: PDB 'alembic-md.pdb' が 'LibFbxSDK-MD.lib(OArchive.cpp.obj)' で、または 'c:\Temp\...\Debug.141\Win32\alembic-md.pdb' に見つかりません。デバッグ情報がないものとして、オブジェクトにリンクします。

FBX SDK 2020.1 で LNK4099
どこか,プロジェクトの設定を間違えたか?


2021/04/29
LNK4099 のエラーは,pdb がないため.
FBX SDK 2020.1.1 以降であれば用意されているので,それぞれにあったものをインストールする.
FBX SDK 2020.1.1 pdb

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

Win10 インストール 用 USB 作成

Win10 インストール用の USB を作成しようと思い調べていたら


Windows 用のインストール メディアを作成する
その先の「Windows 10 のダウンロード」に入り「ツールを今すぐダウンロード」.
ダウンロードしたファイル MediaCreationTool2004.exe を起動.
ライセンス条項に「同意」して,実行する操作を選択.
実行する操作を選択
Windows の種類を選択.
Windows の種類を選択
メディアを選択.
メディアを選択
ドライブを選択.
ドライブを選択
Windows 10 をダウンロード.
Windows 10 をダウンロード
USB メモリに書き込み.メディアの作成時間は 15 分位.
メディアの作成


作成される Windows のバージョンにはご注意ください.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

弦と矢と半径 – 7

input タグで number を使用している部分.
step=’0.001′ などとすれば小数値を入力できるが,欲しい動作ではない.
例えば 1.23456789 など任意の値を入力可能にしたかった.
step=’any’ と指定することで小数部を入力できるようになる.
<input type=’number’ name=’c’ value=’1.234567890′ size=’15’ step=’any’ />
https://mish.myds.me/…/r_cs/7/
弦と矢と半径 7

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

PHP escapeshellarg

以前から気にはなっていた PHP の escapeshellarg を調べてみた.


次の様なコードがうまくない.

<?php
	$param  = ($_REQUEST['input']) ;
	$cmd_to = "cal " . $param ;
	system	( $cmd_to ) ;
	?>

次の様な入力を意図しているが,
…/cal/?input=2020
cal 2020
後ろに次のコマンドを付加されるとうまくない.
…/cal/?input=2020;ls -l
cal 2020 ; ls -l
cal 2020 が表示された後 ls -l が動作している.
コマンドインジェクション」と呼ぶらしく,検索するといろいろと出てくる.


コマンドの引数にあたる部分に escapeshellarg を使用するか,$param をチェックするする必要がある.

	$cmd_to  = "cal " . escapeshellarg ( $param ) ;
Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

弦と矢と半径 – 6

Python のコードを修正して「結果のみ」を出力する様に変更.

import	sys
import	math

def	r_cs	(c , s)	:	return	(        ( c*c )  / ( 8 *s ) +  s/2 )
def	s_rc	(r , c)	:	return	( r-math.sqrt(r*r - (c/2)*(c/2) )   )
def	c_rs	(r , s)	:	return	(   math.sqrt(r*r - (r-s)*(r-s) )*2 )

cmd =       sys.argv[1]
p1  = float(sys.argv[2])
p2  = float(sys.argv[3])

#print	(cmd + " " + str(p1) + " " + str(p2))

if  	cmd == "r_cs"	:	print	(r_cs(p1,p2))
elif	cmd == "s_rc"	:	print	(s_rc(p1,p2))
elif	cmd == "c_rs"	:	print	(c_rs(p1,p2))
#else	            	:	print	("error")

#print	("")

弦と矢と半径 スマートフォンからアクセス
PHP
あまり綺麗なコードでないので,ここには張り付けていません.リンク先を見てください.
PHP から Python の呼び出し
https://mish.myds.me/…/r_cs/6/

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

弦と矢と半径 – 5

PHP から Python の呼び出しで,Python のコマンドライン引数を使用する.

<?php

	echo	("call python\n") ;

	echo	("\n") ;
	system	("python r_cs.py r_cs 6 1") ;
	system	("python r_cs.py s_rc 5 6") ;
	system	("python r_cs.py c_rs 5 1") ;

	echo	("\n") ;
	system	("python r_cs.py r_cs 8 2") ;
	system	("python r_cs.py s_rc 5 8") ;
	system	("python r_cs.py c_rs 5 2") ;

	?>

Python のコードは,

import	sys
import	math

def	r_cs	(c , s)	:	return	(        ( c*c )  / ( 8 *s ) +  s/2 )
def	s_rc	(r , c)	:	return	( r-math.sqrt(r*r - (c/2)*(c/2) )   )
def	c_rs	(r , s)	:	return	(   math.sqrt(r*r - (r-s)*(r-s) )*2 )

cmd =       sys.argv[1]
p1  = float(sys.argv[2])
p2  = float(sys.argv[3])

print	(cmd + " " + str(p1) + " " + str(p2))

if  	cmd == "r_cs"	:	print	(r_cs(p1,p2))
elif	cmd == "s_rc"	:	print	(s_rc(p1,p2))
elif	cmd == "c_rs"	:	print	(c_rs(p1,p2))
else	            	:	print	("error")

print	("")

Python がよくわかっていないので,いろいろなエラーが…
PHP から Python の呼び出し コマンドライン引数
https://mish.myds.me/…/r_cs/5/

弦,矢,半径

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

弦と矢と半径 – 4

先日の Python コードのバグ(整数で計算されてしまうため結果が異なる).
原因はすぐわかるが,対応は悩む所.
コードを分解して動作を確認してみた.

def	r_cs_o	(c , s)	:	return	(        ( c*c )  / ( 8 *s )  +  s/2  )
def	r_cs_n	(c , s)	:	return	(        ( c*c )  / ( 8.*s )  +  s/2. )

print   (6*6)
print   (8*1)

print   (36/8)
print   (36/8.)

print   (1/2)
print   (1/2.)

print	("")
print   (36/8 +1/2 )
print   (36/8.+1/2.)

print	("")
print	(r_cs_o(6,1))
print	(r_cs_n(6,1))

Python での「浮動小数点数」の動作テスト
https://docs.python.org/ja/3/howto/pyporting.html?highlight=除算


Synology NAS DSM では Python 2.7 が標準で入っているみたい.
「パッケージ センター」で Python3 を追加できる.

C:\Program Files\Microsoft Office\Office14>cd C:\Users\Iwao\AppData\Local\Temp

C:\Users\Iwao\AppData\Local\Temp>ssh -l Iwao -p 2200 192.168.1.116
Iwao@192.168.1.116's password:
Iwao@DS116:~$ python3
Python 3.5.1 (default, Jan 29 2018, 14:16:30)
[GCC 4.9.3 20150311 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Iwao@DS116:~$ python2
Python 2.7.12 (default, May 12 2020, 04:48:57)
[GCC 4.9.3 20150311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Iwao@DS116:~$ python
Python 2.7.12 (default, May 12 2020, 04:48:57)
[GCC 4.9.3 20150311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Iwao@DS116:~$

Synology NAS DS116  python コマンド
ASUSTOR NAS ADM では入ってない.「App Central」でインストール可能.
ASUSTOR NAS Python


2020/11/20
QNAP NAS での Python3 は,他の NAS と異なるみたい.
opkg install python3 でインストールしなければならなかった.
https://mish.myds.me/wordpress/dev/2020/08/29/ts253d-setup-3-opkg/
https://mish.myds.me/wordpress/dev/2020/08/17/ts-253d-setup-7-python3/

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.