ホーム » 2020 » 5月

月別アーカイブ: 5月 2020

2020年5月
 12
3456789
10111213141516
17181920212223
24252627282930
31  

カテゴリー

アーカイブ

ブログ統計情報

  • 80,343 アクセス



弦と矢と半径 – 3

JavaScript は html に埋め込んだ.

<!DOCTYPE html>
<html	lang="ja">
	<head>
		<meta	charset="UTF-8"	/>
		<meta	name="viewport"   	content="width=device-width,initial-scale=1.0">
		<title	>JavaScript</title>
		</head>
	<body>
		<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 ) ;		}

			document.write	("6 1 5") ; 	document.write	("<br/>\r\n") ;
			document.write	(r_cs(6,1)) ;	document.write	("<br/>\r\n") ;
			document.write	(s_rc(5,6)) ;	document.write	("<br/>\r\n") ;
			document.write	(c_rs(5,1)) ;	document.write	("<br/>\r\n") ;
			document.write	("") ;      	document.write	("<br/>\r\n") ;

			document.write	("8 2 5") ; 	document.write	("<br/>\r\n") ;
			document.write	(r_cs(8,2)) ;	document.write	("<br/>\r\n") ;
			document.write	(s_rc(5,8)) ;	document.write	("<br/>\r\n") ;
			document.write	(c_rs(5,2)) ;	document.write	("<br/>\r\n") ;
			document.write	("") ;      	document.write	("<br/>\r\n") ;

			</script>
		</body>
	</html>

動作は,
https://mish.myds.me/…/r_cs/3/
html に JavaScript を埋め込み

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

弦と矢と半径 – 2

今度は PHP からの呼び出し.

<?php

	echo	("call c++\n") ;
	system	("./a.out") ;

	echo	("call python\n") ;
	system	("python r_cs.py") ;

	?>

実際の動作を試すには,gcc と python が必要です.
cpp のコンパイルは
g++ -Wall r_cs.cpp
これで ./a.out が作成されます.
python の呼び出しは
python r_cs.py
r_cs.cpp のコンパイルと r_cs.py の実行
次の所で,同じ様な結果を表示します.
https://mish.myds.me/…/r_cs/2/

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

弦と矢と半径

次の様な計算を何かに使えないかと…

/*
https://ja.wikipedia.org/wiki/矢_(幾何学)
https://en.wikipedia.org/wiki/Circle#Sagitta
弦 c と 矢 s から 半径 r を求める
r  =	(c*c) / (8*s) + s/2

半径 r と 弦 c から 矢 s を求める
s  =	r - sqrt( r*r - (c/2)*(c/2) )

半径 r と 矢 s から 弦 c を求める
c  =	sqrt( r*r - (r-s)*(r-s) ) * 2

i_func.hxx
https://drive.google.com/file/d/1kHadFbhUi9QfGRovMXKYr2xHgcFJAqdZ/view
*/

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

弦 矢 半径
動作を確認するために 3,4,5 や 5,12,13 は知っていたが次のキーワードで検索.
三平方の定理 整数 組み合わせ
https://ja.wikipedia.org/wiki/ピタゴラスの定理


先ず C++ で書いたもの.

#include	<cmath>

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

#include	<iostream>

int main(void){
	std::cout << "6 1 5"   << std::endl ;
	std::cout << r_cs(6,1) << std::endl ;
	std::cout << s_rc(5,6) << std::endl ;
	std::cout << c_rs(5,1) << std::endl ;
	std::cout << std::endl ;

	std::cout << "8 2 5"   << std::endl ;
	std::cout << r_cs(8,2) << std::endl ;
	std::cout << s_rc(5,8) << std::endl ;
	std::cout << c_rs(5,2) << std::endl ;
	std::cout << std::endl ;

	return  0 ;
	}

次の所に貼り付けて動作確認できます.
https://paiza.io/ja/
https://wandbox.org/
https://ideone.com/


次は JavaScript

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 ) ;		}


	console.log	("6 1 5") ;
	console.log	(r_cs(6,1)) ;
	console.log	(s_rc(5,6)) ;
	console.log	(c_rs(5,1)) ;
	console.log	("") ;

	console.log	("8 2 5") ;
	console.log	(r_cs(8,2)) ;
	console.log	(s_rc(5,8)) ;
	console.log	(c_rs(5,2)) ;
	console.log	("") ;

Python

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 )

print	("6 1 5")
print	(r_cs(6,1))
print	(s_rc(5,6))
print	(c_rs(5,1))
print	("")

print	("8 2 5")
print	(r_cs(8,2))
print	(s_rc(5,8))
print	(c_rs(5,2))
print	("")

2020/05/30
r_cs.py の r_cs で「浮動小数点数」として扱われていなかったので修正.
def r_cs (c , s) : return ( ( c*c ) / ( 8.*s ) + s/2. )

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

AS5202T 温度

最近気温が少し高くなってきたので,ちょっと気になる ASUSTOR NAS の温度.
HDD の温度が Synology NAS と比べると高い.
Synology NAS では 40℃前後.AS5202T は 50℃前後になっている.
AS5202T の温度
CPU温度は ASUSTOR NAS の場合は問題ないらしい.
UNISTAR のサポート情報  CPU温度が70度というのは正常ですか?
ここを読むと,ファン速度を「自動」にしている限りは HDD の温度の許容範囲ということか?
ファン速度は 770 RPM なので「低速」の状態.
手動で「中速」や「高速」にすると,それぞれ 2590 RPM と 4280 RPM .


今も使用している WD Cloud も 50℃前後.
以前 WD Cloud に大量のデータをコピーしていたら 55℃を超えた位からコピー速度が遅くなった.
この動作は WD Cloud によるのか WD Red によるものなのかは不明.
WD Red は PC でも使用しているが,こちらは十分冷却されているので遅くなったと感じたことはない.

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

VirtualBox 6.1.8 に

前から VirtualBox の 6.1 があるのは知っていたが…
6.0.20 から上げてみた.


PC へのインストール手順はいつもと同じだが,前バージョンのアンインストールに時間がかかっていた.
6.1.8 に更新後「保存」状態だった仮想マシンを起動すると,


仮想マシン”Test10″のセッションを開けませんでした。
pci#0: Device vga/0 failed to respond to region #0 size/type changing from 0x0000000002000000/0x8 to 0x0000000002000000/0x0: VERR_SSM_LOAD_CONFIG_MISMATCH [ver=4 pass=final] (VERR_SSM_LOAD_CONFIG_MISMATCH).
終了コード : E_FAIL (0x80004005)
コンポーネント: ConsoleWrap
インターフェース: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
仮想マシン"Win10"のセッションを開けませんでした。


Win7 も同様.Linux の仮想マシンは問題なかった.
Windows の仮想マシンは「破棄」して「起動」させれば OK .


Win10 IP 環境の 2004 への更新は,相変わらず.
Win10 IP 環境の 2004 への更新 86%
86% で再起動した時に失敗してしまう.
Win10 IP 2004 インストールの修復を試みています...

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

AP がうまく動作しない?

作成した AP がうまく動作しなくなってしまった.
AP がうまく動作しない フリーズ?する
起動はするがメニューの「ファイル」の部分を選択したりするとフリーズ?する.
ハッキリわからないが「オーナードローメニュー」か?


PC を再起動することで動作する様にはなったが,原因などが絞れていないのでメモ.


2020/07/07 同じ現象が発生.
サインアウトして入り直しではダメで,PC の再起動の必要がある.

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

Win10 2004 インストール

Win10 Ver.2004 があったので VirtualBox 仮想マシンにインストールしてみた.
使用したのは ja_windows_10_business_editions_version_2004_x64_dvd_ee7b2698.iso .


最初,何も考えずにインストールしたら「Microsoft アカウント」と結びついたものになってしまった.
インストール途中で「ローカル アカウント」にする方法は気がつかなかった.


そのため,もう一度やり直し.ネットワークを切断した状態でインストール
今度はうまくいった.
Win10 2004 「ローカルアカウント」でインストール


2020/08/31
ローカルアカウントでインストールするための選択画面
ローカルアカウントでインストールするための選択画面
左下の「オフライン アカウント」を選択する.


2020/09/20
次の画面の場合は「代わりにドメインに参加する」を選択.
Win10 LTSC 2019 「ローカルアカウント」の入力に

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

VS 2019 16.6 への更新で失敗

VS 2019 のアップデートがあったので,いつもの様に更新したら何故か失敗.
インストール動作の半分位の所でエラーになってしまった.
実際はアンインストールしてインストールとなるので,アンインストール中かも?


もう一度「スタート」-「Visual Studio Installer」を起動して更新.
「スタート」-「Visual Studio Installer」
一通りのインストールは終わって「再起動」.
VS 2019 インストール   PC 再起動
更新できたみたい.


VirtualBox に入れた Win10 IP の 2004 への更新.
何度か再起動後の 86% の所でエラーとなった.
Win10 IP  2004 への更新で失敗

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

サイトがダウンしています

メールをチェックしていると,


サイトがダウンしています
Iwao Dev が読み込めませんでした (Jetpack 2020年5月20日 (水) 8:30 AM時点)
サイトのアクティビティログを確認すると、この問題の原因になっている可能性のある最近の変更に関する詳細がわかります。サイトに変更を加えていない場合はホスティングサービスに連絡し、追加のサポートを受けてください。
サイトが再びオンラインになったことをJetpackが検出したときに、こちらから別のメールを送信します。
サポートが必要ですか ? ご心配はいりません。
このメールは、サイトでダウンタイムモニタリングが有効にされているため、送信されました。サポートにご連絡いただく場合は、リファレンス番号 [136721373/intermittent] をお知らせください。
これらのアラートはセキュリティ設定でカスタマイズできます。
Automattic, Inc.
60 29th St. #343, San Francisco, CA 94110, USA
WordPress.com のメール設定を管理します。
サイトがダウンしています


DS116 のログを見みると,DSM のアップデートがかかった.
普段であれば更新後うまく動作すると思うが…
DDNS の更新通知がうまく機能していなかった?
「コントロール パネル」-「外部アクセス」-「DDNS」で「今すぐアップデートする」で更新.
これでうまくアクセスできるようになった.

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

AS5202T VirtualBox

以前よりは良くなってきたと思うが,昨夜からまた調子が…


昨夜 ASUSTOR NAS の OS ADM のアップデートがあったので更新した.
ASUSTOR NAS ADM 3.5.0.R5D3
ADM 更新後 VirtualBox も問題なく起動してうまく動作していると思ったが…
仮想マシン DevX がネットワークから見えない.
リモートデスクトップでは開けるが,VNC ではつながらない.
DevX を再起動すると,途中で止まってしまうことも…


今回試したこと.
AppCentral の VirtualBox 5.2.22.r08 を一度 OFF にして ON に.
仮想マシンの設定は変更していない.


これでうまく起動したが,何度か再起動させると止まってしまった.
AS5202T VirtualBox
もう一度 AppCentral で OFF にして ON に.
これで起動したのでそのままに.


2020/09/21
6.1.12 に更新.安定している.

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

AS5202T 再セットアップ – 9

Linux Center を入れて Debian 10 Desktop をインストール.
AS5202T Linux Center
次のページを参考にさせてもらって日本語化.
https://www.server-world.info/query?os=Debian_10&p=japanese
WSLのDebian環境を日本語化する
sudo apt -y install task-japanese locales-all
sudo apt -y install task-japanese-desktop
再起動させて日本語になった.
AS5202T Debian 10 Desktop 日本語化


2020/05/05
gcc のインストール.
sudo apt install build-essential
glut のインストール.
sudo apt install freeglut3 freeglut3-dev
他によく使う tree のインストール.
sudo apt install tree
AS5202T Debian glut
https://dev.mish.work/wordpress/2019/08/16/glut-install/
https://jml.mish.work/index.php/cpp/install-glut.html
https://jml.mish.work/index.php/cpp/glut.html


2020/05/06
Debian の環境の実体は以下に存在している.
/volume1/.@plugins/AppCentral/linux-center/containers/debian10/rootfs/home/admin
AS5202T Linux Center  Debian10 rootfs

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

Windows の資格情報マネージャー

久しぶりに Win7 環境から NAS に接続して ??? と思ったのでちょっと調べてみた.


以前 Win7 から NAS に接続する時,いつも面倒と思っていたこと.
Windows で特定の宛先に対して使用する資格情報を資格情報マネージャーに記憶しているにもかかわらず、再度、資格情報の入力を要求される
Win7 は「Iwao」でログインすると入れるが,PC の再起動後などにまた要求される.
Win7 ログオン情報入力
次の様にユーザ名を「…\Iwao」と入力する必要がある.
Win7 ログオン情報入力
Win7 資格情報


Win10 ではちょっと違うみたいだが,はっきりした記述は見つけられなかった.
Win10 資格情報

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