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('-----------');
 

2017年9月21日 星期四

javascript delphi

WebBrowser1.OleObject.Document.ParentWindow.execScript('alert("Hello")');
Edit: I found SpiderMonkey for Delphi. It supports 64 bit but there is no 64 bit dll provided. "js64.dll" that is.
Here is the 64 bit build. It works perfect with delphi-javascript





A memory manager for Delphi and C++ Builder with powerful debugging facilities

fastmm4

https://github.com/pleriche/FastMM4
A memory manager for Delphi and C++ Builder with powerful debugging facilities


Fast Memory Manager
Description: A fast replacement memory manager for Embarcadero Delphi applications that scales well under multi-threaded usage, is not prone to memory fragmentation, and supports shared memory without the use of external .DLL files.
Advantages:
  • Fast
  • Low overhead. FastMM is designed for an average of 5% and maximum of 10% overhead per block.
  • Supports up to 3GB of user mode address space under Windows 32-bit and 4GB under Windows 64-bit. Add the "$SetPEFlags $20" option (in curly braces) to your .dpr to enable this.
  • Highly aligned memory blocks. Can be configured for either 8-byte or 16-byte alignment.
  • Good scaling under multi-threaded applications
  • Intelligent reallocations. Avoids slow memory move operations through not performing unneccesary downsizes and by having a minimum percentage block size growth factor when an in-place block upsize is not possible.
  • Resistant to address space fragmentation
  • No external DLL required when sharing memory between the application and external libraries (provided both use this memory manager)
  • Optionally reports memory leaks on program shutdown. (This check can be set to be performed only if Delphi is currently running on the machine, so end users won't be bothered by the error message.)
  • Supports Delphi 4 (or later), C++ Builder 4 (or later), Kylix 3.

TCMalloc : Thread-Caching Malloc memory manager

http://goog-perftools.sourceforge.net/doc/tcmalloc.html

TCMalloc : Thread-Caching Malloc


TCMalloc is faster than the glibc 2.3 malloc (available as a separate library called ptmalloc2) and other mallocs that I have tested. ptmalloc2 takes approximately 300 nanoseconds to execute a malloc/free pair on a 2.8 GHz P4 (for small objects). The TCMalloc implementation takes approximately 50 nanoseconds for the same operation pair. Speed is important for a malloc implementation because if malloc is not fast enough, application writers are inclined to write their own custom free lists on top of malloc. This can lead to extra complexity, and more memory usage unless the application writer is very careful to appropriately size the free lists and scavenge idle objects out of the free listTCMalloc also reduces lock contention for multi-threaded programs. For small objects, there is virtually zero contention. For large objects, TCMalloc tries to use fine grained and efficient spinlocks. ptmalloc2 also reduces lock contention by using per-thread arenas but there is a big problem with ptmalloc2's use of per-thread arenas. In ptmalloc2 memory can never move from one arena to another. This can lead to huge amounts of wasted space. For example, in one Google application, the first phase would allocate approximately 300MB of memory for its data structures. When the first phase finished, a second phase would be started in the same address space. If this second phase was assigned a different arena than the one used by the first phase, this phase would not reuse any of the memory left after the first phase and would add another 300MB to the address space. Similar memory blowup problems were also noticed in other applications.
Another benefit of TCMalloc is space-efficient representation of small objects. For example, N 8-byte objects can be allocated while using space approximately 8N * 1.01 bytes. I.e., a one-percent space overhead. ptmalloc2 uses a four-byte header for each object and (I think) rounds up the size to a multiple of 8 bytes and ends up using 16N bytes.

OmniThreadLibrary The Ultimate Delphi Threading Library

http://www.omnithreadlibrary.com/tutorials.htm

OmniThreadLibrary

The Ultimate Delphi Threading Library


What Is OmniThreadLibrary?

OmniThreadLibrary is simple to use threading library for Delphi. Currently, versions 2007, 2009, 2010, XE, XE2, XE3, XE4, XE5, XE6, XE7, XE8, 10 Seattle, 10.1 Berlin, and 10.2 Tokyo are supported. OmniThreadLibrary is an open source project. It lives on GitHub and is licensed under the BSD license.
This is not the first threading framework I've written. There are, however, few big differences between the OTL (OmniThreadLibrary) and previous projects. All previous projects were closed source, used only for the in-house programming. They were all designed from the bottom. And they all had big problems when used in some real-life cases. Still, they were an important research tools. I learned a lot from them - what works, what doesn't and, most important, what kind of threading issues are appearing in the real life applications. 


Presentations

ITDevCon 2010

FastMM in Depth – presentation (ppspdf), code (zip)
Parallel Programming Made Easy – presentation (ppspdf), code (zip)
Building Multithreaded Solutions with OmniThreadLibrary – presentation (ppspdf), code (zip)

VDUG webinar 2010

Parallel Programming with OmniThreadLibrary -  presentation (pdf), video (flashmp4)

ADUG 2011

Getting Full Speed with Delphi - presentation (pps), handouts (pdf), code (zip)

ITDevCon 2011

Multithreading Made Simple with OmniThreadLibrary - presentation (ppspdf), code (zip)

ITDevCon 2012

Parallel Programming with OmniThreadLibrary - presentation (ppspdf), code (zip)

delphi Socket Components


DelphiA variety of SocketComponents of the model and the model

Assembly
Unit
Dependence
Pattern
Model
WebApp/CGI
sockapp.pas
Indy
Blocking or non blocking
select
Indy


Blocking or non blocking
select
ICS
OverbyteIcsWSocket.pas

Non blocking
WMAsyncSelect
TTcpServer/TTcpClient
sockets.pas

Blocking or non blocking
Select
RealThinClient

The ICS variant
Non blocking
wsaasyncselect
synapse
blckSock.pas

Blocking or non blocking
Select
TServerSocket
TClientSocket
ScktComp.pas

Blocking or non blocking
WSAAsyncSelect
FastNet
psock.pas


WSAAsyncselect
TSocketConnection

TServerSocket
TClientSocket



From the table above can be seen, not a component using the following 4 models:
Blocking mode
Overlap port
Event selection
The completion port
Only to:
Select
WSAAsyncselect
These two kinds of models, and the use of WSAAsyncselect model, the inevitable need window, components used as service is not much. 
We will analyze various server program is what model: 
IOCP 
Apache
Legend
Mysql
Erlang
WSAEventSelect
TServerSocket 
...


By steven
2014-2-1
 

What Web Application Framework for Delphi is recommended?


https://stackoverflow.com/questions/3793112/what-web-application-framework-for-delphi-is-recommended

There has been some activity in the Web Application Framework area for Delphi (Win32) 
Delphi on Rails - for D2010
  • Elevate Web Builder
  • Smart Mobile Studio
  • uniGUI (unified Graphical User Interface) is a framework for developing AJAX Web Applications in classical WYSIWYG Delphi RAD  
    In a past job, I used webhub (http://www.href.com) with pretty satisfying results.
    Some time ago I used RTC, which was stable and very fast, the RTC Server-side code can be compiled to a Stand-alone Server and ISAPI Extension
    I never used g-framework but looks promising
    DelphiMVCFramework has been released as Open Source. Check this answer Web MVC framework for Delphi
    Kitto allows to create Rich Internet Applications based on a data model that can be mapped onto any database. The client-side part uses ExtJS (through the ExtPascal library) to create a fully AJAX application,  

2017年2月23日 星期四

Camera Serial interface csi

MIPI Camera Interface

 IP camera SOC:

S3LM IP Camera SoC MIPI: yes
Hi3516A MIPI: yes
Hi3518 MIPI: no
GM8139 - High-Performance Solution for H.264 IP Camera Application MIPI: yes
GM8138/8138S - Cost-Effective Solution for H.264 IP Camera Application MIPI: yes

GM8136S/8135S - Economic H.264 IP Camera Application MIPI: yes Mozart 330s Mozart 370s Mozart 385s Mozart 390s Mozart 395s - MIPI: unknown

R288C,R292C - H.264 Codec SoC with Dual Video Input Channel MIPI: yes

M388C,M392C - H.264 Encoder SoC with Integrated Fisheye Correction Function MIPI: yes FH8810 - FH8810 high performance SoC for HD IPC - MIPI: yes
FH8830 - 2M/3M High Performance Camera SoC - MIPI: yes

 FH8812 - High Performance SoC for IP Camera - MIPI: yes
FH8620 - Low-Power、High Performance Wireless Camera SoC
 FH8610 - FH8610: Low Cost、High Performance Wireless Camera SoC
FH8550M - High Performance 1080P ISP for CCTV - MIPI: yes


  http://mrfdsp.com/mipi-csi2/index.html


 Полная версия этой страницы: Как подключить MIPI CSI-2 камеру?

  http://electronix.ru/forum/lofiversion/index.php/t139475.html


MT9F001 MT9F002 1400 megapixel CMOS module 

Sensor Name: MT9F001 \ MT9F002
Sensor Pixels: 14 million, 4608 * 3288
Sensor Size: 1/2.3-inch (4:3)

2016年2月27日 星期六

package software management mac Next Article The state of package management on Mac OS X List of software package management systems


Next Article The state of package management on Mac OS X

http://www.slideshare.net/TomohikoHimura/ss-20115472
Mac OS X のパッケージ管理紹介/比較

広島Macユーザグループ 2013年4月の勉強会で使用したスライドです。 
Mac OS X のパッケージ管理システム Macports, Homebrew, Fink,

homebrew — Mac OS X 下新的软件包管理工具

The state of package management on Mac OS X

List of software package management systems
OS X
  • fink, for OS X, derives partially from dpkg/apt and partially from ports.
  • MacPorts, formerly called DarwinPorts, originated from the OpenDarwin project.
  • Homebrew, with close Git integration.
  • Mac App Store: Official digital distribution platform for OS X apps. Part of OS X 10.7 and available as an update for OS X 10.6.
  • Homebrew: Package manager for OS X, based on Git
  • Fink: A port of dpkg, it is one of the earliest package managers for OS X.
  • MacPorts: Formerly known as DarwinPorts, based on FreeBSD Ports (as is OS X itself)
  • Joyent: Provides a repository of 10,000+ binary packages for OS X based on pkgsrc[1]
  • Nix package manager: Provides atomic upgrades and rollbacks, side-by-side installation of multiple versions of a package, multi-user package management and easy setup of build environments
  • Zero Install (0install): Cross-platform packaging and distributions software. Uses GnuPG and GTK+ on OS X.
  • Steam: A cross-platform video game distribution, licensing and social gameplay platform, developed and maintained by Valve. Used to shop for, download, install, update, uninstall and back up video games. Works on Windows NT, OS X and Linux.