1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  …

Some recursion for you

2010-03-23 11:00:22 — n0nst0p (programming,3d)


WinProbe

2009-05-10 21:14:30 — n0nst0p (programming,software,utility)
Current Version: 1.1
Built: 21:32 10-May-09

I made this little tool to figure out the window class name of some piece of software. Maybe someone else has a similar problem and finds this useful, you never know... :p

Download
==========
Download WinProbe-1.1.zip (binaries)
Download WinProbe-src-1.1.zip (source)


The metrics gathered by the Window Probe
==========

* The window class name (RegisterClass).
* The window caption.
* The thread ID of the process that owns the window.
* The position and size of the window.


ChangeLog
==========

1.1
+ Redesigned the interface (requested by nitraM).
+ Locking/unlocking now bound to the 'space' key.

I was converting one of my old shadowmapping implementations that used the fixed function pipeline to a more modern version that uses shaders and I ran into a little glitch that may be easy to miss for others as well.

In the old days you'd set the texture parameters for a depth texture to something like this:
 Code
  1. glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY);
  2. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
  3. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
 


Now if you carelessly left those in when converting your implementation to a Cg version then debugging the depth map by shader is impossible, since Cg's tex2D call will always do a shadow map lookup and compare (which will always result in getting a value of 1.0).

Just thought I'd record this somewhere for future reference.
-n0nst0p

A rewrite of the XChat-2 Winamp plugin with some added features.
Distributed under GPL. See COPYING in the source dist.

Download
==========
Download xcwinamp-1.0.zip (binaries)
Download xcwinamp-src-1.0.zip (source)

Features
==========
* Winamp access (/wa)
* Support for LastFM client (/fm)
* More compact output (requested)


Installation
=============

Put the xcwinamp.dll to the plugins directory under xchat install dir.
There already may be an xcwinamp.dll file. So you need to replace it.

Optionally you can change the output filename and load it as another
plugin. In such case it is strongly recommended to recompile the plugin
without Winamp support. Otherwise it will clash with the original
xcwinamp.dll.

To disable the "/wa" hook compile the plugin with DISABLE_WINAMP_ACCESS.

Ja mata ^^
-n0nst0p


Filler #4

2008-06-19 14:38:38 — n0nst0p (filler,programming)
A while back I made a program to generate a list of valid Estonian personal id numbers for a certain birth date and gender. It's quite useful for quering some databases and doing background checks with limited access to personal data. ;)
Yesterday I saw Tõnu Samuel's article in the AM magazine (page 77) and he mentioned the same algorithm, so I figured, I'll save people some time and make this code public.

The important bit is here:
 Language: cpp
  1. bool validate(unsigned char sn[11]) {
  2. int sum=0;
  3. for (int i=0; i<10; i++) {
  4. sum+=sn[i]*(i==9?1:(i+1));
  5. }
  6.  
  7. int mod=sum%11;
  8. if (mod<10 && mod==sn[10])
  9. return true;
  10.  
  11. if (mod==10) {
  12. sum = sn[0]*3 + sn[1]*4 + sn[2]*5 + sn[3]*6 + sn[4]*7 + sn[5]*8 +
  13. sn[6]*8 + sn[7]*1 + sn[8]*2 + sn[9]*3;
  14. mod=sum%11;
  15. if (mod<10 && mod==sn[10])
  16. return true;
  17. if (mod==10 && sn[10]==0)
  18. return true;
  19. }
  20. return false;
  21. }
 

You can get the whole source from here and here's the algorithm for the above validation process.

-n0nst0p