ホーム » 2017 (ページ 2)

年別アーカイブ: 2017

2024年5月
 1234
567891011
12131415161718
19202122232425
262728293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 81,257 アクセス



DS116 追加

1 年近く DS115j を使用してきたが,想定していた以上の利用になりちょっとパワー不足に.
特に,週末実行している Antivirus Essential が動き出すと DSM などもうまく入れないこともある.


DS116 と DS115j の比較性能を参考にして DS116 に.
データが全く同じではないので単純には比べられないが,26000 個のスキャン 6 時間が 15 分程度に.


DS115j から DS116 へのファイルのコピーでの状態.

DS115j では,CPU とメモリがボトルネックになっている様であるが,DS116 ではまだ余裕がありそう.


2017/09/29
ストレージや,DS116 では 40 ℃ 前後だが,DS115j の本体?の温度は 50 ℃ 位になっている.





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

CHttpFile を使用したアップロード

CHttpFile を使用したアップロードのコードを整理.
サーバ側は先日の php と同様.
https://jml.mish.work/index.php/i-tools/upload-htm-php.html


//*******************************************************************************
//	send request define
//	Create	:	2017/08/28
//*******************************************************************************
#define	C_CRLF			_T("\r\n") ;
#define	CT_ct_mp_fd_b_		_T("Content-Type: multipart/form-data; boundary=")
#define	CT_boundary__		_T("--")
#define	CD_cd_f_d_n_		_T("Content-Disposition: form-data; name=")
#define	CD_cd__fn_		_T("; filename=") ;
#define	CT_ct_a_o_s		_T("Content-Type: application/octet-stream")

//*******************************************************************************
//	make send data
//	Create	:	2017/08/28
//*******************************************************************************
inline	v_char	Make_send_data	(LPCTSTR upFile,LPCTSTR ___boundary)
{
	v_char	up_Data = v_c_Load (upFile) ;
	v_char	sndData ;
	{
		tstring	ct_boundary	= ___boundary ;
		tstring	file_img	= ::QuotM_Add(_T("file_img")) ;
		tstring	fileName	= ::QuotM_Add(::Path_GetName(upFile)) ;
		tstring	dataPre ;
		tstring	dataPst ;
		dataPre+=	CT_boundary__	+	ct_boundary				+	C_CRLF ;
		dataPre+=	CD_cd_f_d_n_	+	file_img	+	CD_cd__fn_	;
		dataPre+=							fileName	+	C_CRLF ;
		dataPre+=	T_ct_a_o_s								C_CRLF ;
		dataPre+=										C_CRLF ;
		dataPst+=										C_CRLF ;
		dataPst+=	CT_boundary__	+	 ct_boundary	+	CT_boundary__		C_CRLF ;
		v_char	vc_pref = ::To_v_char(::To__string(dataPre.c_str())) ;
		v_char	vc_post = ::To_v_char(::To__string(dataPst.c_str())) ;
		sndData.insert(sndData.end(),vc_pref.begin(),vc_pref.end()) ;
		sndData.insert(sndData.end(),up_Data.begin(),up_Data.end()) ;
		sndData.insert(sndData.end(),vc_post.begin(),vc_post.end()) ;
		}
	#ifdef	_DEBUG
	{
		::i_Dump(sndData,(::Path_GetName(upFile)+_T(".txt")).c_str()) ;
		}
	#endif
	return	sndData ;
	}

//*******************************************************************************
//	upload
//	Create	:	2017/08/28
//*******************************************************************************
inline	bool	UploadFile	(LPCTSTR svrName,LPCTSTR php,LPCTSTR upFile)
{
	{
		if (::File_IsNothing(upFile))			{	return	false ;		}
	//	if (::File_GetSize  (upFile) > 2048*1024)	{	return	false ;		}
		}
	tstring	head ;
	v_char	sndData ;
	{
		tstring	___boundary = _T("-----UpFile__2017_08_30") ;
			___boundary = _T("-----") + ::Path_GetName(_T(__FILE__)) + _T("__") + ::Now_Format(_T("%H%M%S")) ;
		head	= CT_ct_mp_fd_b_	+ ___boundary ;
		sndData = Make_send_data(upFile,  ___boundary.c_str()) ;
		}
	tstring	serverN = svrName ;
	tstring	portStr ;
	{
		v_tstring	strAry = ::String_Split(svrName,false,_T(":")) ;
		if (strAry.size() >= 2) {
			serverN = strAry[0] ;
			portStr = strAry[1] ;
			}
		}
	INTERNET_PORT	nPort = 0 ;
			nPort = ::ttou2(portStr) ;
	tstring		userAgent = _T("drop_up") ;
			userAgent = ::Path_GetName(_T(__FILE__)).c_str() ;
	#ifdef	_WIN32
	{
		userAgent = ::Path_GetName(::i_GetModuleFileName()) ;
		{
			tstring	osVer	= _T("Windows NT ") + ::To_tstring_rz(::GetWinVer_exe()) ;
				osVer	+=  tstring(_T(" "))+ Bracket_Add(::GetWinVerStr_exe(),_T('(')).c_str() ;
			userAgent += _T(" ") + osVer ;
			userAgent += EXE_AddVerBuildStr() ;
			}
		}
	#endif
	CInternetSession	session(userAgent.c_str()) ;
	CHttpConnection*	pServer = NULL ;
	CHttpFile*		pFile = NULL ;
	DWORD			dwStatus = 0 ;
	try	{
				pServer = session.GetHttpConnection(serverN.c_str(),nPort) ;
				if (pServer == NULL)				{	return	false ;		}
			{
				CString	headStr = head.c_str() ;
				pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST,	php) ;
				if (pFile == NULL)				{	return	false ;		}
				pFile->SendRequest(headStr,(LPVOID)(&sndData[0]),DWORD(sndData.size())) ;
				pFile->QueryInfoStatusCode(dwStatus) ;
				}
			{
				delete	(pFile) ;
				delete	(pServer) ;
				}
		}
	catch	(CInternetException* e) {
		CString	errMsg ;
		e->GetErrorMessage(errMsg.GetBuffer(1024),1024) ;
		errMsg.ReleaseBuffer() ;
		std::tout << LPCTSTR(errMsg) << std::endl ;
		return	false ;
		}
	session.Close() ;
	return	true ;
	}

//*******************************************************************************
//	upload files
//	Create	:	2017/08/29
//*******************************************************************************
inline	bool	UploadFiles	(c_v_tstring& upFiles)
{
	v_tstring	svr_php = ::UF_get_server_php() ;
	tstring		serverN = svr_php[0] ;
	tstring		phpName = svr_php[1] ;
	for (size_t index=0 ; index<upFiles.size() ; index++) {
		tstring	upFile = upFiles[index] ;
		if (::File_IsNothing(upFile))		{	continue ;		}
		if (!::UploadFile(serverN.c_str(),phpName.c_str(),upFile.c_str()))	{
			return	false ;
			}
		}
	return	true ;
	}

UploadFile


これらを使用したツールは以下にあります.
http://i_tools.mish.work/2019/10/up-htm.html


2020/09
日本語を含むファイル名のアップロード

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

データ送信 htm , php

html で複数のファイルを指定,php でそれを move_upload_file .


up_data.htm


<form enctype="multipart/form-data" action="up_data.php" method="POST">
    upload file:<br/>
    <input name="file_1" type="file" /><br/>
    <input name="file_2" type="file" /><br/>
    <input type="submit" value="send" />
    </form>


up_data.php


<?php
    if (!file_exists("./data")) {
        mkdir("./data") ;
        }
    foreach ($_FILES as $keys => $values) {
        $file_e = $values ;
        $tempfile =                $file_e[‘tmp_name’] ;
        $filename = ‘./data/’ .  $file_e[‘name’] ;
        if (is_uploaded_file($tempfile)) {
            move_uploaded_file($tempfile,$filename) ;
            }
        }
    $scan_f = scandir("./data") ;
    foreach ($scan_f as $key => $value) {
        echo $value . "<br/>\r\n" ;
        }
    ?>


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

データ送信 CHttpFile

送信するデータの中身をどの様に指定するかわかってないので,CHttpFile でもう一度やり直し.
MSDN CHttpFile クラスにあるサンプルのコードで,前回と同様にデータが送れることは確認.


content.txt を用意して,あればそれを読込んで送る様に変更.
   CString strData = _T(“Some very long data to be POSTed here!”);
   {
     CString dataFile = _T(“./content3.txt”) ;
     if (::File_IsExist(dataFile)) {
       strData = ::LoadText(dataFile).c_str() ;
       }
     }


Content-Type: multipart/form-data; boundary=—-WebKitFormBoundaryHQUnqULNgae5Y5HW
——WebKitFormBoundaryHQUnqULNgae5Y5HW
Content-Disposition: form-data; name=”file_imo”; filename=”up_Cube.imo”
Content-Type: application/octet-stream

v 0 0 -5
v 0 0 0
v 0 5 0
v 0 5 -5
v 5 0 -5
v 5 5 -5
v 5 0 0
v 5 5 0
f 1 2 3 4
f 5 1 4 6
f 7 5 6 8
f 2 7 8 3
f 3 8 6 4
f 2 1 5 7

——WebKitFormBoundaryHQUnqULNgae5Y5HW
Content-Disposition: form-data; name=”file_htm”; filename=”up_Cube.htm”
Content-Type: application/octet-stream
 
<!DOCTYPE html>
<html lang=”ja” >
<head >
<meta charset=”UTF-8″ />
< script src=”/_lib/js/webgl/threejs/r84/build/three.js”> </script>
< script src=”/_lib/js/webgl/threejs/r84/examples/js/Detector.js”> </script>
< script src=”/_lib/js/webgl/threejs/r84/examples/js/controls/OrbitControls.js”> </script>
< script src=”/_lib/js/webgl/threejs/r84/examples/js/loaders/MTLLoader.js”> </script>
< script src=”/_lib/js/i_lib/threejs/r84/IMOLoader.js”> </script>
< script src=”/_lib/js/i_lib/threejs/r84/c_3js_4.js”> </script>
< script src=”/_lib/js/i_lib/2017.03/filePath.js”> </script>
</head>
<body>

var imoFile=’up_Cube.imo’;
ThreeStart3 (imoFile,5,5,5) ;

</body>
</html>
 
——WebKitFormBoundaryHQUnqULNgae5Y5HW–
 


データは送られているが,PHP の $_FILES にうまく設定されていない.
   $str = var_export($_FILES,true) ;
ヘッダ部分の指定が間違っていたみたいで,
   CString strHead ;
   {
     CString dataFile = _T(“./content3.txt”) ;
     if (::File_IsExist(dataFile)) {
       strData = ::LoadText(dataFile).c_str() ;
       {
         v_tstring strAry = ::String_SplitLine(strData) ;
         if (strAry.size() > 0) {
           strHead = strAry[0].c_str() ;
           strAry.erase(strAry.begin()) ;
           strData = ::String_Join_Line(strAry).c_str() ;
           }
         }
       }
     }
送信部分も,SendRequestEx から SendRequest に変更.
   pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST, _T(“/…/t_mfc_h/t_mfc_h.php”)) ;
   pFile->SendRequest(strHead,(LPVOID)LPCTSTR(strData),strData.GetLength()) ;
   pFile->QueryInfoStatusCode(dwStatus) ;


2017/09/04 CHttpFile を利用したアップロード
UpFile.hxx
UpFile.hxx

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

データの送信 socket

3D データをアップするのに,複数のファイルを指定するのが面倒
調べてみると socket でいけそう?


利用するのは Win AP なので,MFC で良いかと思い調べると
CAsyncSocket や CSocket は適切ではないとのこと.
プログラミング Visual C++.NET Vol.2 活用編
 第28章 インターネット通信の基礎 313 ページ
 28.3.2 MFC の Winsock クラス


参考になるコードを探したが,その範囲でわかりやすかったのがここ.
http://www.katto.comm.waseda.ac.jp/~katto/
http://www.katto.comm.waseda.ac.jp/~katto/Class/GazoTokuron/code/socket.html
但し,そのままのコードではコンパイルエラーなどが少しあったので修正.
また,#ifdef _MSC_VER で一つのコードに.
sock_tcp.zip
VC 6 と DS115j でビルドし動作を確認.
ここまでの範囲では,クライアントからサーバに固定の文字列を送信.
LAN 内の PC と NAS などで相互に確認済み.


tcp_s.cpp のコードを一部修正.
 char buffer[BUFFER_SIZE+10]; // +10 の大きさに
 受信部分で
  while(1) {
    memset(&buffer,0,sizeof(buffer)) ; // バッファのクリアを追加
    numrcv = recv(dstSocket, buffer, BUFFER_SIZE, 0);
    …
    }


サーバ側の tcp_s.exe を実行.
次の様な html を用意して,ブラウザで開く.
 <!DOCTYPE html>
   <html lang=”ja” >
   <head >
    <meta charset=”UTF-8″ />
    </head>
   <body >
    <form action=”http://localhost:9876/” method=”post” enctype=”multipart/form-data”>
     <input type=”file” name=”fname”>
     <input type=”submit” value=”upload”>
     </form>
    </body>
   </html>
 何も指定せずに「upload」.


C:\…\Iwao>”C:\…\tcp\tcp_s\Release\tcp_s.exe”
Waiting for connection …
Connected from 127.0.0.1
received: POST / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, appli
cation/vnd.ms-xpsdocument, application/xaml+xml, application/vnd.ms-excel, application/ms
received: word, */*
Referer: http://ds115j/Test/test_up/test_up.htm
Accept-Language: ja
Content-Type: multipart/form-data; boundary=—————————7e13a71ce4098a
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows N
received: T 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Host: localhost:9876
Content-Length: 195
Connection: Keep-Alive
Cache-Control: no-cache
 
—————————
received: –7e13a71ce4098a
Content-Disposition: form-data; name=”fname”; filename=””
Content-Type: application/octet-stream
  
  
—————————–7e13a71ce4098a–
  
  
C:\…\Iwao>


ClassicASP や ASP.NET でのファイルのアップロード
 ASP を使用して Web サーバーにファイルをアップロードする方法
 IIS7 ファイルアップロード用ページを簡単に作成する方法
ASP.NET の方は動作確認済み.


http://www.geekpage.jp/
http://www.geekpage.jp/programming/winsock/

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

DS115j が見えない

DS115j が見えなくなった.192.168.0.x では開ける.
外からも問題なく見えている.


幾つか試したが,変化なし.
 「ネットワークアダプタ」の無効化,有効化.
 PC の再起動.
 2 つのルータの再起動.
DS115j も再起動したいが,DSM に入れない.


暫くわからなかったが,WLI-UC-AG300N を見るとランプがついてない.
指し直すと,ランプも点滅して,うまく動作するようになった.

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

ダイアログバーに CCheckListBox

通常のダイアログに CCheckListBox を追加するには,次のような手順.
  CCheckListBox の使い方
ダイアログバーでは,次の様にしてもデータが表示されない.

CCheckListBox*  clb = (CCheckListBox*)m_wndDlgBar.GetDlgItem(IDC_CHECK_LB) ;
clb->AddString("....") ;

以前作成した,オーナー描画のドロップダウンを思い出しコードを見ると,

CMainFrame に変数を追加して,サブクラス化している.
CMainFrame::OnCreate でダイアログバーを Create した後,
 m_ODCB.SubclassDlgItem(IDC_COMBO,&m_wndDlgBar) ;

このコードの最初は,2004/07.
手元にある幾つかの本を見たが見つからなかった.
何を参考にしたかは今となっては不明.


LBN_SELCHANGE で選択された状態がイマイチ.
 内容を更新(PostMessage)するとインデックス 0 の項目に薄い点線が付く.
SendMessage として更新後,選ばれていた項目を SetCurSel することで対応.

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

WSR-300HP 追加

先日,WLI-UC-AG300N を追加し「ワイヤレス ルーター」として設定したが,
 ちょっと不安定なのと,そこからは外を覗かない様にしたかったのであまり使えないでいた.
 どちらかと言うと,独立した AP として利用していた感じ.


「ホテルルーター」が良いかとも思ったが,発熱の問題や,長時間だと不安定になることがあるなどとあった.
いろいろ考え,やはり独立した「ルーター」が良さそうと思い量販店へ.
「安価なルーター」で「Wi-Fi や GIGA ビットはあればなお良い」と言うことで探してもらった.
それですすめてもらったのが WSR-300HP .価格的にも予定範囲内.


接続などは特に困ることもなく LAN 内は独立して意図した動作となった.
が,T5400 で「インターネット」接続が不安定なことは残っていた(前回あまり調べてなかった).
どうも「デフォルトゲートウェイ」の設定がよくなかったみたいで,追加した側の IP を固定に.


2017/07/11
固定 IP にすることだと,本来 DHCP サーバを使いたかったのでこのルーターを追加する意味が半減する.
さらに調べてみると,
  Windows 7 でネットワーク接続の優先順位を変更する方法

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

iframe を右下に

左上を指定して下や右をフィットさせるのが意外と面倒だったので…


<!DOCTYPE html>
<html	lang="ja">
	<head>
		<meta	charset="UTF-8"	/>
		<title	>iframe</title>
		<style>
			body {
				margin		:	auto auto	auto auto	;
				overflow	:	hidden	;
				}
			</style>
		</head>

	<body>
		Text<br/>
		<iframe	
			src='/3D_Data/three_js/ThreeIMO.htm'	
			name='ifrm'
			style='
				position	:	absolute ;
				width   	:	99% ;
				height  	:	90% ;
				bottom  	:	2pt ;
				margin-left	:	2pt ;
				margin-right	:	2pt ;
				'
			>
			</iframe>
		</body>
	</html>

//itl.mish.work/~Iwao/…/test6/


2017/07/10 さらに変更したもの
itl.mish.work/…/to_wgl/

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

DS115j PHP 動作してない

DS115j を再起動したら,index.php が動作しなくなった.
 index.php の内容がそのまま表示される.
php を認識しなくなった様ではあるが,何で?


「Web Station」の設定で,一度「未構成」にして,「PHP x.x」で動作する様になった.

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

IIS+PHP-3

さらに次の様な exe の起動.
   exec (change_sp(“./imotowgl”)) ;
あまり関係ないが php と同じ場所に imotowgl と IMOtoWGL.exe が存在する.


この指定では,DS115j ではうまく動作しているが IIS 環境では起動できないみたい.
次の様に exe を付けるか,大文字などファイル名を正しく指定する必要があるみたい.
   exec (change_sp(“./imotowgl.exe”)) ;
   exec (change_sp(“./IMOtoWGL”)) ;
change_exe 関数を追加することに.


php の動作を確認していて,何かうまく動作しない.
と思ったら,「既定のドキュメント」の設定.


change_exe は,
  function change_exe ($path) {
     $exe = $path ;
     if (DIRECTORY_SEPARATOR == ‘/’) { $exe = strtolower($exe) ; }
     else { $exe = $exe . “.exe” ; }
     $exe = str_replace (“/”,DIRECTORY_SEPARATOR,$exe) ;
     return $exe ;
     }


さらに実行ファイルの場所も,相対位置ではなく change_cmd 内で求める様に変更.
 <?php
   include ($_SERVER[“DOCUMENT_ROOT”] . “/…/i_lib.php”) ;
 // exec (change_sp(“./bin/DrawNow”)) ;
   exec (change_cmd(“DrawNow”)) ;
   readfile(“./drawnow.htm”) ;
   ?>
動作は,DrawNow

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

実行時のエラー OpenMP

普段通っているコードなのに,ある条件(操作)で実行時にエラー.
エラーの場所はある範囲(DelFileE への登録)ではあるが,固定されてない.
 CStringArray に CString の追加.
コールスタックを見ると MakeFace$omp$1 とある.


   ucrtbased.dll!__VCrtDbgReportA () 不明
   ucrtbased.dll!__CrtDbgReport () 不明
   mfc140ud.dll!AfxAssertFailedLine(const char * lpszFileName, int nLine) 行 333 C++
   mfc140ud.dll!CWnd::DestroyWindow() 行 1055 C++
   mfc140ud.dll!CToolTipCtrl::DestroyToolTipCtrl() 行 73 C++
   mfc140ud.dll!AFX_MODULE_THREAD_STATE::~AFX_MODULE_THREAD_STATE() 行 253 C++
   mfc140ud.dll!AFX_MODULE_THREAD_STATE::`scalar deleting destructor'(unsigned int) C++
   mfc140ud.dll!CThreadSlotData::DeleteValues(CThreadData * pData, HINSTANCE__ * hInst) 行 354 C++
   mfc140ud.dll!CThreadSlotData::DeleteValues(HINSTANCE__ * hInst, int bAll) 行 396 C++
   mfc140ud.dll!AfxTermLocalData(HINSTANCE__ * hInst, int bAll) 行 494 C++
   mfc140ud.dll!DllMain(HINSTANCE__ * hInstance, unsigned long dwReason, void * __formal) 行 663 C++
   mfc140ud.dll!dllmain_dispatch(HINSTANCE__ * const …, void * const reserved) 行 195 C++
   mfc140ud.dll!_DllMainCRTStartup(HINSTANCE__ * const …, void * const reserved) 行 248 C++
   ntdll.dll!_LdrpCallInitRoutine@16 () 不明
   ntdll.dll!_LdrShutdownProcess@0 () 不明
   ntdll.dll!_RtlExitUserProcess@4 () 不明
   kernel32.dll!_ExitProcessStub@4 () 不明
   ucrtbased.dll!__crt_hmodule_traits::close(struct HINSTANCE__ *) 不明
   ucrtbased.dll!__crt_hmodule_traits::close(struct HINSTANCE__ *) 不明
   ucrtbased.dll!__Exit () 不明
   ucrtbased.dll!_raise () 不明
   ucrtbased.dll!__acrt_lock_and_call<class <lambda_fe…55> >(enum __acrt_lock_id,class <…; &&) 不明
   ucrtbased.dll!___acrt_MessageWindowA () 不明
   ucrtbased.dll!__VCrtDbgReportA () 不明
   ucrtbased.dll!__CrtDbgReport () 不明
   mfc140ud.dll!AfxAssertFailedLine(const char * lpszFileName, int nLine) 行 333 C++
   mfc140ud.dll!CStringArray::SetSize(int nNewSize, int nGrowBy) 行 165 C++
   mfc140ud.dll!CStringArray::SetAtGrow(int …, const ATL::CStringT<wchar_t,… > & newElement) 行 265 C++
   mfc140ud.dll!CStringArray::Add(const ATL::CStringT<wchar_t, … > & newElement) 行 322 C++
   BlockIn.exe!DelFileE::Add(const wchar_t * fileName) 行 51 C++
   BlockIn.exe!CacheFile::GetCF_Name(const wchar_t * srcName, const unsigned int dibWidth) 行 415 C++
   BlockIn.exe!PartsA_To::ToIPX(const wchar_t * ipxName) 行 257 C++
   BlockIn.exe!PartsA_To::DumpDebug(const int delFE, const wchar_t * pre_) 行 297 C++
   BlockIn.exe!PartsA_To::DumpDebug(const wchar_t * pre) 行 47 C++
   BlockIn.exe!PartsA_Fnc_DebugDump(PartsA & partsAry, const wchar_t * pre) 行 818 C++
   BlockIn.exe!MaPat__DebugDump(const Parts & parts) 行 3293 C++
   BlockIn.exe!MaPat::MakePartsFace(const int makeEdge) 行 3481 C++
   BlockIn.exe!BAPat::MakePartsFace(const int makeEdge) 行 1508 C++
   BlockIn.exe!BAPat::GetPartsFace(const int makeEdge) 行 1935 C++
   BlockIn.exe!BlockInf::MakeFace(const int makeEdge) 行 3465 C++
> BlockIn.exe!BlockLay::MakeFace$omp$1() 行 4320 C++
   [外部コード]


次の様に #pragma omp critical を追加.
  BOOL DelFileE::Add (LPCTSTR fileName)
  {
     #ifdef _OPENMP
       #pragma omp critical (DelFileE_Add)
     #endif
     {
       CString filePath = ::FolderDelLastSP(fileName) ;
       DelFileName.Add(filePath) ;
       }
     return TRUE ;
     }

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

IIS+PHP-2

先日 php のインクルードなどに PHP_OS を利用していたが,
  $base = “/…/web” ;
  if (PHP_OS == ‘WINNT’) { $base = “c:/…/web” ; }
  else { $base = “/…/web” ; }
  include ($base . “/_lib/…/log.php”) ;
$_SERVER[“DOCUMENT_ROOT”] を見つけたので,
  include ($_SERVER[“DOCUMENT_ROOT”] . “/_lib/…/log.php”) ;


他に,実行ファイルは OS に合った指定が必要な様で,
 <?php
   include ($_SERVER[“DOCUMENT_ROOT”] . “/…/log.php”) ;
   logging () ;
   exec (change_sp(“./bin/DrawNow”)) ;
   // …
   ?>
Synology/DrawNow/

IIS 7/DrawNow/

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

DS115j 3D データ読込

今度は,imo(obj を拡張した 3D データ)の読込み.


次の様なコードで …/…imo  -nan -nan -nan となってしまう.
   GonsA ga = ::OBJ_ToGonsA(imoFile.c_str()) ;
   std::tout << imoFile << _T("\t") ;
   std::tout << ::V3_To_tstring(::GonsA_GetVolume(ga)) << std::endl ;


単純に読込んで,保存するのは OK .
   v_tstring txtAry = ::LoadTextFile(imoName.c_str()) ;
   ::SaveTextFile((imoName+_T(“.mox”)).c_str(),txtAry) ;
3D データとして取り込み,出力すると,全体的に -nan や nan となる.
   GonsA gt = ::OBJ_ToGonsA(imoName.c_str()) ;
   ::GonsA_ToOBJ(gt,_T(“./7_boxes.mox”)) ;


次の様にすると
   long v1 = ::ttoi4(_T(“10”)) ;
   long v2 = ::ttoi4(_T(“10 “)) ;
   long v3 = ::ttoi4(_T(“10.5”)) ;
   double f1 = ::ttof (_T(“10”)) ;
   double f2 = ::ttof (_T(“10 “)) ;
   double f3 = ::ttof (_T(“10.5”)) ;
   double d1 = ::ttod (_T(“10”)) ;
   double d2 = ::ttod (_T(“10 “)) ;
   double d3 = ::ttod (_T(“10.5”)) ;
   Vl3 v(v1,v2,v3) ;
   Vd3 f(f1,f2,f3) ;
   Vd3 d(d1,d2,d3) ;
   std::tout << ::V3_To_tstring(v) << std::endl ;
   std::tout << ::V3_To_tstring(f) << std::endl ;
   std::tout << ::V3_To_tstring(d) << std::endl ;
本来は,
  10 10 10
  10 10 10.5
  10 10 10.5
DS115j では,
  10 10 10
  0 0 0
  -nan -nan -nan


内部的に呼んでいるのは,strtol と strtod など.


2017/06/20
atof も同様.
sscanf を利用することで対応.
  double ttod_scan (LPCTSTR str) {
     double value = 0 ;
     sscanf(str,_T(“%lg”),&value) ;
     return value ;
     }
 
原因と言うか対応は次の内容と同じなのかとは思うが,
 個人的に理解できるレベルには達していない.
Armadillo-840でstrtodを使った浮動小数点文字列の変換が出来ない

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

WLI-UC-AG300N 追加

DS115j 用に WLI-UC-AG300N を追加.

DSM の「コントロールパネル」-「ネットワークマップ」には次の 3 つがある.
 ワイヤレス AP
 ワイヤレス ルーター
 ワイヤレス ネットワークに接続する
やりたかったのは,どちらかと言うと DHCP サーバ.
 「ワイヤレス ルーター」として,Android などからの接続を確認.


2017/06/19
以前購入して使ってなかった LAN-RPT01BK で子機として HUB に接続.
LAN 内は意図した動作となったが,Internet 接続が不安定になった.
はっきりわからないが「ネットワークの場所」が,増えてしまった影響か?
次の所を参考にさせてもらって,増えたものを削除.
  Windows 7の「ネットワークの場所」を結合・削除する

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

DSM 更新で…

DSM を更新した影響か? g++ などが通らなくなってしまった.


sudo -i
 
mkdir -p /volume1/@entware-ng/opt
ln -sf /volume1/@entware-ng/opt /opt
 
wget -O - http://pkg.entware.net/binaries/armv7/installer/entware_install.sh | /bin/sh
 
root@DS115j:/etc# cat rc.local
#!/bin/sh
#
/bin/ln -sf /volume1/@entware-ng/opt /opt
/opt/etc/init.d/rc.unslung start
#
 
/root/.profile
. /opt/etc/profile
 
reboot

sudo -i
opkg -v


また,更新してしばらく?は,何か動作が安定していない気がする.
php や c++ での動作が何か変?

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

IIS+PHP

先週まで DS115j 上の PHP と exe環境を作っていたが,今度は IIS 上の PHP .
次の所を参考にさせてもらった.
 Windows 8/7/Vista に PHP をインストール
 IIS での PHP Web サイトの構成
以前の Win7 に IIS を入れた環境に設定.


PHP がうまく動作しているかの確認は,
 コマンドプロンプトで,php -v や php -r “phpinfo() ;” .

 次の内容を php として保存し,ブラウザで開く.
  <?php phpinfo(); ?>


DS115j 上で動かしたものと同等の日時の表示は,何とか動作する様になった.
ほとんどが C++ のコードなので,今回の範囲ではあまり変更はなかった.
ただ exe を呼出す PHP のパスの指定や %TMP% にあたる部分がいろいろとありそう.
パス区切りは,’/’,’\’,’\\’ などで動作するみたいだが完全なのは ‘\\’ か?
ハードコードの部分は ‘/’ として PHP_OS により ‘\\’ に変換する関数を用意する.
 コードは次の様なもの.
   function Path_Normalize ($path_) {
     $path = $path_ ;
     if (PHP_OS == ‘WINNT’) {
       $path = str_replace (“/”,DIRECTORY_SEPARATOR,$path) ;
       }
     return $path ;
     }


単に,str_replace で良さそう.
  $path = str_replace (“/”,DIRECTORY_SEPARATOR,$path) ;
c の関数マクロの様な使い方はわからなかったので,change_sp($path) の関数とした.
さらに,php ファイルのインクルードは次の様な感じで振り分け.
   if (PHP_OS == ‘WINNT’) {
     include (“./lib.php”) ;
     }
   else {
     include (“/…/i_lib/2017.06/lib.php”) ;
     }


用途によっては,realpath でもいける?

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

T5400 …


C ドライブの空きが 10 GB 程度だったので,35 GB まで空けて様子見.
これで解消すると助かるのだが…

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

moto g5

MR03LN も 2 年になったのと,107SH の調子が…
内蔵メモリが足りなくて,AP の更新ができなかったり,SMS が受信できないなど.
それと丁度のタイミングで,3GB でもシェア SIM が利用できる様になったので,Moto G5 追加.


107SH だったこともあるが,やはり大きい.
今は当たり前なのかもしれないが,指紋認証センサの使い勝手が良い.
WebGL(three.js)のデータの表示が,思ったより遅い.
私の使い方では,バッテリーは 24 時間持つ.

moto g5

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

T5400 また …

戻ってきたらまた,

DSC_0195

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