2018年4月30日 星期一

python 3d 統計圖表


https://matplotlib.org/index.html

https://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html

Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python scripts, the Python and IPython shells, the Jupyter notebook, web application servers, and four graphical user interface toolkits.

python 的 3d 表格工具 函式 庫 提供你快速 產出 3d的 統計圖表 有有許多變的樣式 ,可以 再多種 python script 上 或是主機上

5種 座標系統 平行軸

Delta 水母  Cartesian 龍門 polar coordinate system  極座標系 Scara 平行軸

Delta Cartesian polar Scara cylindrical

Cartesian coordinate system

cylindrical coordinate system Cartesian coordinate system Spherical Coordinates

Meshing Coordinate Global Coordinate Systems

2018年4月25日 星期三

捕捉DOS輸出



Thundax Output 


Кодировка из Win в DOS и из DOS в Win в Delphi 2010 
URL
google

function WinToDos(ASource: String): AnsiString;
var
Ch: PAnsiChar;
begin
Ch := AnsiStrAlloc(Length(ASource) + 1);
CharToOem(PChar(ASource), Ch);
Result := StrPas(Ch);
StrDispose(Ch)
end;

procedure WritelnDos(ASource: String);
begin
Writeln(WinToDos(ASource));
end;
function DosToWin(ASource: AnsiString): AnsiString;
var
Ch: PAnsiChar;
begin
Ch := AnsiStrAlloc(Length(ASource) + 1);
OemToAnsi(PAnsiChar(ASource), Ch);
Result := StrPas(Ch);
StrDispose(Ch)
end;

function DosToWin(ASource: AnsiString): String;
var
Ch: PChar;
begin
Ch := StrAlloc(Length(ASource) + 1);
OemToChar(PAnsiChar(ASource), Ch);
Result := StrPas(Ch);
StrDispose(Ch)
end;


function AsciiToAnsi(AsciiStr: string): string;
var AnsiStr: string;
begin
SetLength(AnsiStr, Length(AsciiStr));
if Length(AsciiStr) > 0 then OemToChar(PChar(AsciiStr), PChar(AnsiStr));
AsciiToAnsi:= AnsiStr;
end;

function AnsiToAscii(AnsiStr: string): string;
var AsciiStr: string;
begin
SetLength(AsciiStr, Length(AnsiStr));
if Length(AnsiStr) > 0 then CharToOem(PChar(AnsiStr), PChar(AsciiStr));
AnsiToAscii:= AsciiStr;
end;

取得系統時間 效能量測

http://codingdelphi.blogspot.tw
Win32 Performance Measurement Options


The five Win32 timing functions provided by the base API (as implemented in KERNEL32.dll) are

GetTickCount,
GetSystemTime()
GetSystemTimeAsFileTime()
QueryPerformanceCounter(),
GetThreadTimes()
GetProcessTimes()
timeGetTime()

References
Java 2 Performance and Idiom Guide, Craig Larman & Rhett Guthrie, Prentice-Hall PTR, 2000.
More Effective C++, Scott Meyers, Addison-Wesley, 1996.
More Exceptional C++, Herb Sutter, Addison-Wesley, 2002.

rtc base timeer timegettime setwaitabletimer ... 最後一頁

GetTickCount function
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408%28v=vs.85%29.aspx


https://msdn.microsoft.com/en-us/library/windows/desktop/ms724411%28v=vs.85%29.aspx
timeGetTime function
https://msdn.microsoft.com/en-us/library/dd757629.aspx
ntquerytimerresolution NtSetTimerResolution
NtQuerySystemInformation function
https://msdn.microsoft.com/zh-tw/library/windows/desktop/ms724509(v=vs.85).aspx
Articles » Languages » C / C++ Language » General Timers Tutorial
https://www.codeproject.com/Articles/1236/WebControls/?fid=2345&df=90&mpp=25&sort=Position&view=Normal&spc=Relaxed&fr=101&prof=True




Acquiring high-resolution time stamps
QueryPerformanceCounter (QPC)
System.Diagnostics.Stopwatch
QueryPerformanceFrequency
Timestamp Cycle Counter (TSC) - Intel® Developer ... 64-bit register present on all x86 processors since the Pentium.

2018年4月16日 星期一

檔案鏈結 鏡像 備份 同步

mklink  Winodws  建立 symbolic link


Mklink Examples.
mklink [[/d] | [/h] | [/j]]  
File and Directory Linking



Junction v1.07

Windows Sysinternals

mklink

byte 2 bin byte array

var
  a: byte;
  MASK: byte;
  arr : Array[0..7] of byte;
  iindex : byte;
begin
  a:= random($ff);
  MASK := ($80-1);// ($1 shl (sizeof(a)*7) )-1
  //writeln(MASK);
  write('a= ');
  write(a);
  write('= ');
  write(a div 16 );
  write(',');
  write(a mod 16 );
  writeLn('');

//msb 1 byte  to 8byte
  for iindex := 7 downto 0 do
  begin
    if a > MASK then arr[iindex]:=1 else arr[iindex]:=0;
    a:= a shl 1;
    write(arr[iindex]);
  end;
  //writeLn('-----------');