Resize video in html5
var videos_resize=function(){ var videos=document.getElementById("videos"); videos.style.width = window.innerWidth + "px"; } videos_resize(); window.onresize = videos_resize;
Status of Free Domain Application(Freenom)
Applied in afternoon of Jul. 7:
Status in morning of Jul.8
Ping:
prismwebrtc.tk ×
prismrtc.tk ×
prismrtc.ga ○
Conclusion
.tk takes more time?
Python(Library) Install
One Algorithm to Generate Gaussian Distribution in C
#include <stdlib.h> #include <math.h> double gaussrand() { static double V1, V2, S; static int phase = 0; double X; if ( phase == 0 ) { do { double U1 = (double)rand() / RAND_MAX; double U2 = (double)rand() / RAND_MAX; V1 = 2 * U1 - 1; V2 = 2 * U2 - 1; S = V1 * V1 + V2 * V2; } while(S >= 1 || S == 0); X = V1 * sqrt(-2 * log(S) / S); } else X = V2 * sqrt(-2 * log(S) / S); phase = 1 - phase; return X; }
Win32 API绘图避免闪烁
首先在创建窗口时候设置背景为NULL
wc.hbrBackground = NULL;
然后在WM_CREATE中
hdc = GetDC(hWnd); //获取设备 hdcBuffer = CreateCompatibleDC(hdc); //给设备分配一个内存空间 hBitMap = CreateCompatibleBitmap(hdc, 1200, 700); //创建一个cxClient, cyClient大小并且适应DC设备环境的位图 ReleaseDC(hWnd, hdc); SelectObject(hdcBuffer, hBitMap); //将位图设置为hdcBuffer的画刷
在WM_PAINT函数中画图
PatBlt(hdcBuffer, 0, 0, 1200, 700, WHITENESS); {Draw something;} BitBlt(hdc, 0, 0, 1200, 700, hdcBuffer, 0, 0, SRCCOPY);
参考