http://gdlinks.hut.ru/cdfaq/
http://www.wildbunny.co.uk/blog/2011/04/20/collision-detection-for-dummies/
http://www.wildbunny.co.uk/blog/2011/05/12/how-to-make-angry-birds-part-1/
Tuesday, March 20, 2012
Monday, March 5, 2012
Panasonic HM-TA2
Absolutely love this mini camcorder! Although there are no manual settings you can adjust except for video resolution (fullhd, 720p25, iFrame) and turn on/off LED light.
iFrame mode produces big files suitable for editing with maximum quality.
I use 720p mode and the video is really awsome clear and detailed when outdoors. Stereo sound quality is also way better than any smartphone's.
I'll publish sample video as soon as something interesting gets into sight.
iFrame mode produces big files suitable for editing with maximum quality.
I use 720p mode and the video is really awsome clear and detailed when outdoors. Stereo sound quality is also way better than any smartphone's.
I'll publish sample video as soon as something interesting gets into sight.
Saturday, February 11, 2012
C++ vs FPC vs Java vs C# benchmarking
There were a lot of microbenchmarks etc. in the net to prove which solution is better -- Java or .NET, yet I decided to write a simple yet useful program (An image processing tool we use in developing games for OpenGL ES devices) and port it to several languages. I've put it into a public repo under
https://github.com/exhu/alimg
My results were so that the fastest solution under Linux was in Java (7 secs), then C++ and FreePascal (11-10 secs average). Yes, C++ slower here, of course you can optimize C++ into unreadable code and get most of the hardware, but the code will be unmaintainable and cryptic, while now it's a balanced solution, and still Java sources are the most user-friendly.
Mono was 4 times slower than Java under Linux (28-30 secs), and .NET was as fast as Java under Windows XP 32-bit under VirtualBox (both do the job for about 17 secs), yet the FreePascal version was even faster than both of them (10 secs -- about the same speed in the VirtualBox as on the real Linux).
Linux:
1) Java (OpenJDK 6)
2) C++, FPC
4) Mono
Windows (under Linux VirtualBox):
1) FPC
2) Java (Oracle Java 6), .NET 4
Assume C++ version would be the fastest under Windows too.
I also need to note that .NET 4 offline installation was rather hard to complete under Windows XP 32-bit SP2, it required several downloads for Windows Installer, Windows Imaging and took 20 minutes to install. Meanwhile Java offline installer (~20 megs) was easy and fast and did not require restarting the OS.
To sum up I would pick FPC for native small to medium applications and Java for cross-platform medium to complex applications. Although Java is surprisingly fast on netbooks it's too memory hungry.
https://github.com/exhu/alimg
My results were so that the fastest solution under Linux was in Java (7 secs), then C++ and FreePascal (11-10 secs average). Yes, C++ slower here, of course you can optimize C++ into unreadable code and get most of the hardware, but the code will be unmaintainable and cryptic, while now it's a balanced solution, and still Java sources are the most user-friendly.
Mono was 4 times slower than Java under Linux (28-30 secs), and .NET was as fast as Java under Windows XP 32-bit under VirtualBox (both do the job for about 17 secs), yet the FreePascal version was even faster than both of them (10 secs -- about the same speed in the VirtualBox as on the real Linux).
Linux:
1) Java (OpenJDK 6)
2) C++, FPC
4) Mono
Windows (under Linux VirtualBox):
1) FPC
2) Java (Oracle Java 6), .NET 4
Assume C++ version would be the fastest under Windows too.
I also need to note that .NET 4 offline installation was rather hard to complete under Windows XP 32-bit SP2, it required several downloads for Windows Installer, Windows Imaging and took 20 minutes to install. Meanwhile Java offline installer (~20 megs) was easy and fast and did not require restarting the OS.
To sum up I would pick FPC for native small to medium applications and Java for cross-platform medium to complex applications. Although Java is surprisingly fast on netbooks it's too memory hungry.
Thursday, January 26, 2012
HDD power off disable for HP 6510b
sudo hdparm -B 254 /dev/sda
That prevents drive parking at sec interval when running on battery.
That prevents drive parking at sec interval when running on battery.
Tuesday, January 3, 2012
OpenGL tutorials
http://ogldev.atspace.co.uk/index.html
http://www.arcsynthesis.org/gltut/index.html -- book
http://www.arcsynthesis.org/gltut/index.html -- book
Thursday, December 29, 2011
GCC vector intrinsics example
typedef int v4si __attribute__ ((vector_size(16)));
typedef int RGBA[4];
void diff(const RGBA & a, const RGBA & b, RGBA & out) {
#if 0
for(int i = 0; i < 4; ++i)
out[i] = a[i] - b[i];
for(int i = 0; i < 4; ++i) {
int v = out[i];
if (v < 0) v =0;
if (v > 255) v = 255;
out[i] = v;
}
#else
v4si va = *(v4si*)a;//{a[0], a[1], a[2], a[3]};
v4si vb = *(v4si*)b;//{b[0], b[1], b[2], b[3]};
v4si vr;
vr = __builtin_ia32_psubd128(va, vb);
*(v4si*)(&out[0]) = vr;
#endif
}
typedef int RGBA[4];
void diff(const RGBA & a, const RGBA & b, RGBA & out) {
#if 0
for(int i = 0; i < 4; ++i)
out[i] = a[i] - b[i];
for(int i = 0; i < 4; ++i) {
int v = out[i];
if (v < 0) v =0;
if (v > 255) v = 255;
out[i] = v;
}
#else
v4si va = *(v4si*)a;//{a[0], a[1], a[2], a[3]};
v4si vb = *(v4si*)b;//{b[0], b[1], b[2], b[3]};
v4si vr;
vr = __builtin_ia32_psubd128(va, vb);
*(v4si*)(&out[0]) = vr;
#endif
}
Wednesday, December 28, 2011
Subscribe to:
Posts (Atom)