2019年4月26日 星期五

J1900 Performance

J1900

J3455 Comparison


J3455 ESXi 6.7 + Windows 10 1GB on SSD datastore reads at 60MB/s while DSM 6.1 2GB with ASMedia passthrought gives max speed at 110MB/s to J1900 over Netgear R6400.

Windows 10


BareMetal Windows 10 files read at 110MB/s.
After Hyper-V installed, dropped to 60MB/s.
Hyper-V supports only DSM5.2 but not DSM 6.1 so no nfs mounting allowed.

BareMetal Windows + Virtual Box 6 installed still reads at 110MB/s with no performance loss. Virtual Box 6 supports DSM 6.1 but even though using Virtual Box raw disk, DSM 6.1 writes speed at only 20MB/s and fluctuates from 5MB/s to 30MB/s.

DSM 6.1


BareMetal DSM 6.1 reads at 110MB/s while sync data from J3455.
But DSM VMM Windows 10 reads at 15MB/s and Windows UI response slow.

ESXi 6.7


Uploading Windows 10 iso file 4GB to ESXi SSD datastore seems slow.
Windows 10 first installation feels slow.
Windows 10 2CPU 2GB on ESXi 6.7 SSD datastore reads J3455 at 55MB/s, not too bad.

2019年4月25日 星期四

Static and dynamic link ZeroMQ on Windows for Visual Studio 2017 x64




Static ZeroMQ (difficult setup)

cd /d C:\
mkdir Repos
cd /d C:\Repos\
git clone https://github.com/Microsoft/vcpkg
cd /d C:\Repos\vcpkg\
bootstrap-vcpkg.bat
cd /d C:\Repos\vcpkg\
vcpkg install zeromq:x64-windows-static

Visual Studio 2017 creates empty project and a.cpp
#include <zmq.h>
#include <iostream>

#ifdef _DEBUG
#pragma comment(lib,"libzmq-mt-sgd-4_3_2.lib")
#else
#pragma comment(lib,"libzmq-mt-s-4_3_2.lib")
#endif
#pragma comment(lib,"Ws2_32.lib")
#pragma comment(lib,"Iphlpapi.lib")
 
int main()
{
 int major = 0;
 int minor = 0;
 int patch = 0;
 zmq_version( &major, &minor, &patch );
 std::wcout << "Current 0MQ version is " << major << '.' << minor << '.' << patch << '\n';
}

Copy files to folder of a.cpp from
C:\Repos\vcpkg\packages\zeromq_x64-windows-static\include
zmq.h
zmq_utils.h
Copy from C:\Repos\vcpkg\packages\zeromq_x64-windows-static\lib\libzmq-mt-s-4_3_2.lib
C:\Repos\vcpkg\packages\zeromq_x64-windows-static\debug\lib\libzmq-mt-sgd-4_3_2.lib

Preprocessor Definitions:
ZMQ_STATIC

Debug Code Generation from /MDd to /MTd
Release Code Generation from /MD to /MT


Dynamic ZeroMQ (simpler setup)


cd /d C:\Repos\vcpkg\
vcpkg install zeromq:x64-windows

Visual Studio 2017 creates empty project and a.cpp
#include "zmq.h"
#include <iostream>

#ifdef _DEBUG
#pragma comment(lib,"libzmq-mt-sgd-4_3_2.lib")
#else
#pragma comment(lib,"libzmq-mt-s-4_3_2.lib")
#endif
#pragma comment(lib,"Ws2_32.lib")
#pragma comment(lib,"Iphlpapi.lib")
 
int main()
{
 int major = 0;
 int minor = 0;
 int patch = 0;
 zmq_version( &major, &minor, &patch );
 std::wcout << "Current 0MQ version is " << major << '.' << minor << '.' << patch << '\n';
}
Copy to folder beside a.cpp from
C:\Repos\vcpkg\packages\zeromq_x64-windows\include
zmq.h
zmq_utils.h
C:\Repos\vcpkg\packages\zeromq_x64-windows\debug\lib\libzmq-mt-gd-4_3_2.lib
C:\Repos\vcpkg\packages\zeromq_x64-windows\lib\libzmq-mt-4_3_2.lib
C:\Repos\vcpkg\packages\zeromq_x64-windows\debug\bin\libzmq-mt-gd-4_3_2.dll
C:\Repos\vcpkg\packages\zeromq_x64-windows\bin\libzmq-mt-4_3_2.dll

Static ZeroMQ (Original full version)



https://joshuaburkholder.com/wordpress/2018/05/25/build-and-static-link-zeromq-on-windows/









Build and static link ZeroMQ on Windows


ZeroMQ ( http://zeromq.org and https://github.com/zeromq/libzmq ) is a library that allows code to communicate between threads, processes, or computers in just a few lines and uses simple, composable patterns (like publish-subscribe and broadcast).
In this post, we’ll build ZeroMQ on Windows as a static library (to take advantage of the “static linking exception” in its license: http://zeromq.org/area:licensing ) and then bake that static library into a simple Windows executable.  There are many posts around the web that show you how to do this … here’s one more:

Steps:

  1. Build Vcpkg ( https://github.com/Microsoft/vcpkg )
  2. Use vcpkg to build ZeroMQ ( vcpkg install zeromq:x64-windows-static )
  3. Build an executable that statically links ZeroMQ

Step 1: Build Vcpkg ( https://github.com/Microsoft/vcpkg )

Notes:
  • Vcpkg does not manage pre-built binaries (like NuGet or Homebrew)
  • Vcpkg manages source code and builds that source code on Windows, Linux, and MacOS.
  • At the time of this post, the documentation for Vcpkg was located here:
    https://docs.microsoft.com/en-us/cpp/vcpkg
In a Visual Studio 2017 developer command prompt (with Git installed), execute the following commands:
cd /d C:\
mkdir Repos
cd /d C:\Repos\
git clone https://github.com/Microsoft/vcpkg
cd /d C:\Repos\vcpkg\
bootstrap-vcpkg.bat
… now, C:\Repos\vcpkg\vcpkg.exe should exist.

Step 2: Use vcpkg to build ZeroMQ ( vcpkg install zeromq:x64-windows-static )

Note:
  • On purpose … to make things more explicit and more difficult in Step 3, we do not execute the following command:
vcpkg integrate install
Now that C:\Repos\vcpkg\vcpkg.exe exists, execute the following commands:
cd /d C:\Repos\vcpkg\
vcpkg install zeromq:x64-windows-static
… now, we should have the following:
  • ZeroMQ source code folder: C:\Repos\vcpkg\buildtrees\zeromq\src
  • ZeroMQ debug build folder: C:\Repos\vcpkg\buildtrees\zeromq\x64-windows-static-dbg
  • ZeroMQ release build folder: C:\Repos\vcpkg\buildtrees\zeromq\x64-windows-static-rel
  • ZeroMQ target folder: C:\Repos\vcpkg\packages\zeromq_x64-windows-static
  • ZeroMQ target include folder: C:\Repos\vcpkg\packages\zeromq_x64-windows-static\include
  • ZeroMQ target debug lib folder: C:\Repos\vcpkg\packages\zeromq_x64-windows-static\debug\lib
    • At the time of this post, the static library built was: libzmq-mt-sgd-4_3_1.lib
    • Note: The mt and d in libzmq-mt-sgd-4_3_1.lib means multi-threaded debug (requiring the debug executable in the next step to be compiled using /MTd)
  • ZeroMQ target release lib folder: C:\Repos\vcpkg\packages\zeromq_x64-windows-static\lib
    • At the time of this post, the static library built was: libzmq-mt-s-4_3_1.lib
    • Note: The mt in libzmq-mt-s-4_3_1.lib means multi-threaded (requiring the release executable in the next step to be compiled using /MT)

Step 3: Build an executable that statically links ZeroMQ

In Visual Studio 2017, do the following:
  • File / New / Project…



     
  • Add / New Item…

     
  • Paste the following code into Source.cpp:
    #include <zmq.h>
    #include <iostream>
     
    int main()
    {
     int major = 0;
     int minor = 0;
     int patch = 0;
     zmq_version( &major, &minor, &patch );
     std::wcout << "Current 0MQ version is " << major << '.' << minor << '.' << patch << '\n';
    }
  • Change the Solution Platform to x64:

     
  • Select the “ZeroMQ-Version” project, select Project / Properties, change the Configuration to “All Configurations“, select Configuration Properties / C/C++ / General, and then add the following include folder to “Additional Include Directories“:
    C:\Repos\vcpkg\packages\zeromq_x64-windows-static\include



     
  • Next, for “All Configurations“, select Configuration Properties / C/C++ / Preprocessor, and then add the following preprocessor definition to “Preprocessor Definitions“:
    ZMQ_STATIC

     
  • Next, change the Configuration to “Debug“, select Configuration Properties / C/C++ / Code Generation, and then change the “Runtime Library” to “Multi-threaded Debug (/MTd)“:



     
  • Next, change the Configuration to “Release“, select Configuration Properties / C/C++ / Code Generation, and then change the “Runtime Library” to “Multi-threaded (/MT)“:



     
  • Next, we’ll add the static libraries … and while we could break these up into separate lib folder and lib file entries, I’ll just use each lib’s full file path here.
  • First, switch the Configuration back to “Debug“, select Configuration Properties / Linker / Input, and then add the following entries to “Additional Dependencies“:
    C:\Repos\vcpkg\packages\zeromq_x64-windows-static\debug\lib\libzmq-mt-sgd-4_3_1.lib
    Ws2_32.lib
    Iphlpapi.lib



     
  • Second, switch the Configuration back to “Release“, select Configuration Properties / Linker / Input, and then add the following entries to “Additional Dependencies“:
    C:\Repos\vcpkg\packages\zeromq_x64-windows-static\lib\libzmq-mt-s-4_3_1.lib
    Ws2_32.lib
    Iphlpapi.lib



     
  • Build / Rebuild Solution:

     
  • Debug / Start Without Debugging:

     
Note:
  • When building for Debug, my Output window reads:
    1>------ Rebuild All started: Project: ZeroMQ-Version, Configuration: Debug x64 ------
    1>Source.cpp
    1>ZeroMQ-Version.vcxproj -> C:\Repos\ZeroMQ-Version\x64\Debug\ZeroMQ-Version.exe
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
  • When building for Release, my Output window reads:
    1>------ Rebuild All started: Project: ZeroMQ-Version, Configuration: Release x64 ------
    1>Source.cpp
    1>Generating code
    1>All 3752 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
    1>Finished generating code
    1>ZeroMQ-Version.vcxproj -> C:\Repos\ZeroMQ-Version\x64\Release\ZeroMQ-Version.exe
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Hope This Helps!
Tagged on: 

2019年4月23日 星期二

Esxi "Relocating modules and starting up the kernel"

http://dq.tieba.com/p/6099253984

安装esxi时出现以下,解决方案
Shutting down firmware services...
Relocating modules and starting up the kernel...
第一种方法
问题的原因是Headless模式不能设定. 解决办法是添加 ignoreHeadless=TRUE 参数
1. 在ESXi安装开始前有一个倒计时, 这时按下 Shift + O, 在显示的命令后添加 ignoreHeadless=TRUE, 回车, 安装就能正常进行
2. 以下的步骤是把这个参数值写入配置, 不会随重启丢失
3. 当ESXi启动后, 点击F2, 登录
4. 在System Customization下, 进入Troubleshooting Options
5. 启用ESXi Shell, 然后一路按ESC返回
6. 在主界面下, 按Alt + F1 访问控制台
7. 登录, 输入并执行以下命令
esxcfg-advcfg --set-kernel "TRUE" ignoreHeadless
8. 输入exit, 退出控制台登录
9. 点击 Alt+F2 返回 ESXi 主界面
10. 最后别忘了禁用 ESXi Shell.
第二种方法
在WEB界面中,打开管理-服务 中启用 esxi shell 各SSH 用shell软件连接进入以下命令

esxcfg-advcfg --set-kernel "TRUE" ignoreHeadless

再输入以下命令

esxcfg-advcfg --get-kernel ignoreHeadless

若出现以下

ignoreHeadless=TRUE

证明已写 入,重启esxi 正常进入


我是直接装在16g msata 中的,正常启动了

2019年4月16日 星期二

Making MFC Ribbon bitmap file with Pixelformer



In short, use Pixelformer instead of mspaint.exe for Windows C++ Ribbon bmp file



http://programmingnode.blogspot.com/2016/04/making-mfc-ribbon-bitmap-file.html

___________________________________________________________________________



Tuesday, April 5, 2016

Making MFC Ribbon bitmap file.

Despite there are lots of programming framework these days, it seems MFC never improve its capability regarding UI components since Visual Studio 6.0.
But I was wrong, Microsoft provided nice new UI features since Visual Studio 2010 release.
One of them is the Ribbon feature.
I am satisfied with usability of Ribbon and easy to use, actually easy to program.

When I tried to change default bitmap image for Ribbon, soon I found there was not enough description about it. Ribbon couldn't display my modified bmp file or show background black.
Here I wrote down simple recipe how to make bitmap file for MFC Ribbon.

The bitmap file format used in Ribbon is 32-bit ARGB format.
The ARGB means that each pixel consists of 4 bytes of color values, Alpha, Red, Green, Blue. The Alpha value affects transparency of a pixel.
The ARGB bitmap isn't popular format because this format doesn't support compression unlike PNG or GIF format. Only few editors can produce 32-bit ARGB format that the Ribbon can recognize.

After minutes of googling, I found very good graphic editor called Pixelformer.
I want to set setting icon beside of button in Panel within a Category contained in a MFCRibbonBar. So I need to draw setting icon in default bitmap file, called writesmall.bmp.

The first step is to open writesmall.bmp file in res folder of my project.


The Ribbon uses alpha value for transparency instead of mask RGB value.
So I needed to change colors of pixel and alpha values of pixel accordingly.

Surprisingly Pixelformer supply a way of that. There were menu for  Normal, Color Only, Alpha Only in View menu. User can change alpha value manually.

The second step is to get 16x16 setting image.
I got a free PNG image file for setting icon from https://www.iconfinder.com/.

The third step is to place setting image on to writesmall.bmp.
To copy the image it need to import the file into the writesmall.bmp editing through the menu, Image/Import.


And copy whole image and then paste it on the writesmall.bmp.
I think pasting should be done in the Normal view mode. I deleted area of pixels in the place where I put new image before pasting.

The forth step is to save as ARGB bitmap.
After image edit done, I exported it back to ARGB bitmap file.
It can be done through Image/Export menu. I show 32-bit ARGB option.

Windows C++ MFC Tiles-View List Control

http://codexpert.ro/blog/2013/10/05/tiles-view-list-control/

Introduction


In Visual Studio Community 2017, create a new project of Visual C++ > MFC/ATL > MFC Application > MFCApplication1.

Choose "Single Document", Advanced features: uncheck all except "Common Control Manifest", uncheck all "Advnaced frame panes", choose Generated Classes's Be class: CListView.










F


Core Code:



private:
CImageList m_imageList;
CImageList m_imageListSmall;
BOOL _SetTilesViewLinesCount(int nCount) {
CListCtrl& listCtrl = GetListCtrl();

LVTILEVIEWINFO lvtvwi = { 0 };
lvtvwi.cbSize = sizeof(LVTILEVIEWINFO);
lvtvwi.dwMask = LVTVIM_COLUMNS;
lvtvwi.cLines = nCount;

return listCtrl.SetTileViewInfo(&lvtvwi);
}
BOOL _SetTilesViewTileFixedWidth(int nWidth) {
CListCtrl& listCtrl = GetListCtrl();

LVTILEVIEWINFO lvtvwi = { 0 };
lvtvwi.cbSize = sizeof(LVTILEVIEWINFO);
lvtvwi.dwMask = LVTVIM_TILESIZE;

lvtvwi.dwFlags = LVTVIF_FIXEDWIDTH;
lvtvwi.sizeTile.cx = nWidth;
lvtvwi.sizeTile.cy = 0;

return listCtrl.SetTileViewInfo(&lvtvwi);
}
BOOL _SetItemTileLines(int iItem, UINT* parrColumns, UINT nCount) {
CListCtrl& listCtrl = GetListCtrl();

LVTILEINFO lvti = { 0 };
lvti.cbSize = sizeof(LVTILEINFO);
lvti.cColumns = nCount;
lvti.iItem = iItem;
lvti.puColumns = parrColumns;

return listCtrl.SetTileInfo(&lvti);
}

void CMFCApplication1View::OnInitialUpdate()
{
CListView::OnInitialUpdate();

CListCtrl& listCtrl = GetListCtrl();
listCtrl.SetExtendedStyle(LVS_EX_GRIDLINES);

ASSERT(NULL == m_imageList.m_hImageList);      // init only once
ASSERT(NULL == m_imageListSmall.m_hImageList); // init only once

CWinApp* pApp = AfxGetApp();
VERIFY(m_imageList.Create(128, 128, ILC_COLOR32, 0, 0));
VERIFY(m_imageListSmall.Create(48, 48, ILC_COLOR32, 0, 0));

m_imageList.Add(pApp->LoadIcon(IDR_MAINFRAME));
m_imageList.Add(pApp->LoadIcon(IDR_MAINFRAME));
m_imageList.Add(pApp->LoadIcon(IDR_MAINFRAME));

m_imageListSmall.Add(pApp->LoadIcon(IDR_MAINFRAME));
m_imageListSmall.Add(pApp->LoadIcon(IDR_MAINFRAME));
m_imageListSmall.Add(pApp->LoadIcon(IDR_MAINFRAME));

listCtrl.SetImageList(&m_imageList, LVSIL_NORMAL);
listCtrl.SetImageList(&m_imageListSmall, LVSIL_SMALL);
listCtrl.SetExtendedStyle(LVS_EX_GRIDLINES);

listCtrl.InsertColumn(0, _T("Name"), LVCFMT_LEFT, 100, 0);
listCtrl.InsertColumn(1, _T("Age"), LVCFMT_RIGHT, 100, 1);
listCtrl.InsertColumn(2, _T("Owner"), LVCFMT_LEFT, 150, 2);
listCtrl.InsertColumn(3, _T("City, Country"), LVCFMT_LEFT, 200, 3);

listCtrl.InsertItem(0, _T("Martafoi"), 0);
listCtrl.InsertItem(1, _T("Zdreanta"), 1);
listCtrl.InsertItem(2, _T("Jumbo"), 2);

listCtrl.SetItemText(0, 1, _T("8 months"));
listCtrl.SetItemText(1, 1, _T("7 years"));
listCtrl.SetItemText(2, 1, _T("35 years"));

listCtrl.SetItemText(0, 2, _T("John Doe"));
listCtrl.SetItemText(1, 2, _T("Brigitte Bardot"));
listCtrl.SetItemText(2, 2, _T("Hannibal Barcas"));

listCtrl.SetItemText(0, 3, _T("New York, USA"));
listCtrl.SetItemText(1, 3, _T("Paris, France"));
listCtrl.SetItemText(2, 3, _T("Barcelona, Spain"));

VERIFY(_SetTilesViewLinesCount(3));
VERIFY(_SetTilesViewTileFixedWidth(250));

UINT arrColumns[3] = { 1, 2, 3 };
VERIFY(_SetItemTileLines(0, arrColumns, 3));
VERIFY(_SetItemTileLines(1, arrColumns, 3));
VERIFY(_SetItemTileLines(2, arrColumns, 3));

listCtrl.SetView(LV_VIEW_TILE);
}

Optional Code


// Message mandlers
protected:
DECLARE_MESSAGE_MAP()
    afx_msg void OnViewLargeicon() {
GetListCtrl().SetView(LV_VIEW_ICON);
}
    afx_msg void OnViewSmallicon() {
GetListCtrl().SetView(LV_VIEW_SMALLICON);
}
    afx_msg void OnViewList() {
GetListCtrl().SetView(LV_VIEW_LIST);
}
    afx_msg void OnViewDetails() {
GetListCtrl().SetView(LV_VIEW_DETAILS);
}
    afx_msg void OnViewTile() {
GetListCtrl().SetView(LV_VIEW_TILE);
}
    afx_msg void OnUpdateViewLargeicon(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_ICON == GetListCtrl().GetView());
}
    afx_msg void OnUpdateViewSmallicon(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_SMALLICON == GetListCtrl().GetView());
}
    afx_msg void OnUpdateViewList(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_LIST == GetListCtrl().GetView());
}
    afx_msg void OnUpdateViewDetails(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_DETAILS == GetListCtrl().GetView());
}
    afx_msg void OnUpdateViewTile(CCmdUI *pCmdUI) {
pCmdUI->SetCheck(LV_VIEW_TILE == GetListCtrl().GetView());
}

BEGIN_MESSAGE_MAP(CMFCApplication1View, CListView)
ON_WM_CONTEXTMENU()
ON_WM_RBUTTONUP()
ON_COMMAND(ID_VIEW_LARGEICON, &CDemoListView::OnViewLargeicon)
ON_COMMAND(ID_VIEW_SMALLICON, &CDemoListView::OnViewSmallicon)
ON_COMMAND(ID_VIEW_LIST, &CDemoListView::OnViewList)
ON_COMMAND(ID_VIEW_DETAILS, &CDemoListView::OnViewDetails)
ON_COMMAND(ID_VIEW_TILE, &CDemoListView::OnViewTile)
ON_UPDATE_COMMAND_UI(ID_VIEW_LARGEICON, &CDemoListView::OnUpdateViewLargeicon)
ON_UPDATE_COMMAND_UI(ID_VIEW_SMALLICON, &CDemoListView::OnUpdateViewSmallicon)
ON_UPDATE_COMMAND_UI(ID_VIEW_LIST, &CDemoListView::OnUpdateViewList)
ON_UPDATE_COMMAND_UI(ID_VIEW_DETAILS, &CDemoListView::OnUpdateViewDetails)
ON_UPDATE_COMMAND_UI(ID_VIEW_TILE, &CDemoListView::OnUpdateViewTile)
END_MESSAGE_MAP()


MFCApplication1.rc


ID_VIEW_LARGEICON
ID_VIEW_SMALLICON
ID_VIEW_LIST
ID_VIEW_DETAILS
ID_VIEW_TILE









Result




FAQ


Question: What happens when below function calls return FALSE to indicate failure?

CListCtrl::SetTileViewInfo()
CListCtrl::SetTileInfo()

Answer: Using "Common Control Manifest" is a must for successful function calls above.

2023 Promox on Morefine N6000 16GB 512GB

2023 Promox on Morefine N6000 16GB 512GB Software Etcher 100MB (not but can be rufus-4.3.exe 1.4MB) Proxmox VE 7.4 ISO Installer (1st ISO re...