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: prismwebrtc.tk prismrtc.tk prismrtc.ga Status in morning of Jul.8 Ping: prismwebrtc.tk × prismrtc.tk × prismrtc.ga ○ Conclusion .tk takes more time?

Show fps in Javascript

Github github.com Sample tmlife.net

Python(Library) Install

Library download: Python Extension Packages for Windows - Christoph Gohlke Working Flow: www.amelt.net

NanovoltmeterとPCの通信に関して

結構悩んでました。 PCにポートが足りないためRS232+USBで通信を取ってる。 よく落ちるのでやっぱりRS232で直接に繋がらないとなぁって思ってた。 最近気づいたのは、Nanovoltmeterを一旦Remote Controlの状態になると、PCとの通信が落ちるってこと。その時…

One Algorithm to Generate Gaussian Distribution in C

MD

#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 = </math.h></stdlib.h>…

Win32 API绘图避免闪烁

首先在创建窗口时候设置背景为NULL wc.hbrBackground = NULL; 然后在WM_CREATE中 hdc = GetDC(hWnd); //获取设备 hdcBuffer = CreateCompatibleDC(hdc); //给设备分配一个内存空间 hBitMap = CreateCompatibleBitmap(hdc, 1200, 700); //创建一个cxClient, c…

Win32API窗口输出浮点数

使用TextOut()在窗口中输出数值时一般的方式是,先将数值存到字符数组,再打印出来: wsprintf(szData, TEXT("Data = %d"), data); TextOut(hdc, x, y, szData, lstrlen(szData)); 有一个问题是, wsprintf()这个函数无法处理浮点数。这里需要将其替换成spri…

Real Loop in Win32 Program

To introduce real loop in Win32 program. “GetMessage()” need to be replaced by “PeekMessage()” The traditional GetMessage loop looks like: while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0) { if (bRet == -1) { break; } else { TranslateMess…

(Microsoft VC++ Express)LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

There are several "cvtres.exe" in C disk, maybe installed by .NET Framework. Replace the old one in VC/bin by the first one(new?) in C disk. 连接器LNK是通过调用cvtres.exe完成文件向coff格式的转换的,所以出现这种错误的原因就是cvtres.exe出现…

Loopback Test for Serial Port

http://www.ni.com/example/29318/en/

マウスで円を描くコード

「猫でもわかるWindowsプログラミング」より ↓こんな感じ。 #include <windows.h> LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); ATOM InitApp(HINSTANCE); BOOL InitInstance(HINSTANCE, int); void DrawRect(HWND, POINTS, POINTS); TCHAR szClassName[] = </windows.h>…

Use of Macro Definitions to Simplify MD Code

MD

C supports the use of macro definitions that can simplify the code considerably. #define Sqr(x) ((x)*(x)) #define Cube(x) ((x)*(x)*(x)) #define VSub(v1, v2, v3) (v1).x = (v2).x - (v3).x, (v1).y = (v2).y - (v3).y The above definition will s…

Win 32 API使ってみた。

一番簡単なやつを使ってみた。 #include "windows.h" void main(){ MessageBox(NULL,"Hello!","My First WinAPI",MB_YESNO); }

Wait Until Next ms Multiple vs Wait (ms)

"Wait Until Next ms Multiple"と"Wait (ms)"の違いについての説明は以下。 日本語版 "Wait (ms)"と "Wait Until Next ms Multiple"の違いはなんですか? - National Instruments 英語版 The Difference Between the Wait (ms) Function and the Wait Until N…

はてな始めました。

技術ブログとして始めましたが、趣味や思いついた事も書いて行きます。