Thursday, March 15, 2012

Kbd++ released : Track global Toggle key events

Finally after a lot of development effort and study of OS internals, Kbd++ is being released.

Essentially it is ...........

An utility to track the toggle key(CAPS, NUM, SCROLL) status of keyboard. This is particularly useful for Wireless keyboard users as wireless keyboards have no LEDs. Status of the LEDs is indicated using three icons in the System Tray with Balloontips(optional). It is being developed on C++/Qt and will currently target Windows and Linux boxes. Platform specific code are implemented using Win32 and X11 APIs.

Currently it is only supporting MS Windows. Windows implementation is based on Named Pipes (for IPC ) and Windows Hooks (for capturing global events). Linux implementation is on way and hopefully will be completed shortly.

Make sure you run the correct binaries on the correct architecture (x86/amd64), else the explorer might hang.



It is freely available at :
Qt Apps Kbd++

The source is hosted on the mercurial based public repository at BitBucket:
Kbd++ Source

The Linux implementation is yet a gray area........ need more study on that. An easy way out is monitoring the key state at regular intervals. However that will increase the CPU utilization. Hence need to look for some system specific way to do it.

One major disappointment during the life of the project has been a strange runtime error while using QLocalSoket from the injected DLL, which in debug mode said :

warning: ASSERT failure in QWinEventNotifier::QWinEventNotifier(): "Cannot creat
e a win event notifier without a QEventDispatcherWin32", file kernel\qwineventno
tifier_p.cpp, line 74 



Qt Centre had a long discussion thread on this, which says its a probable Qt bug ...
Qt Centre discussion thread

I had too replace the entire named pipe client implementation in the injected DLL, using Win32 API s for the same.

Tuesday, March 13, 2012

Error while bulding 64 bit Qt lib 4.8.0 on Windows: “Perl not found in environment – cannot run syncqt”

Just encountered this error while trying to build the 64bit version of the Qt lib 4.8.0 on Windows:
The configure tools stopped saying : “Perl not found in environment – cannot run syncqt”"

If you do not want to install Perl, easy solution to this is just deleting the syncQt.bat from the $QtDir\bin directory and running configure again.

Sunday, March 11, 2012

Qt Creator Debugger problem on Windows

I got the following error message when trying to debug an application built using Qt Creator on Windows. The application started but no debugging could be done as Gdb was not installed on my system.

The preferred debugger for debugging binaries of type 'x86-windows-msvc-2008-pe-32bit' is not available.

The debugger engine 'Gdb engine' will be used as fallback.

Details: There is no CDB binary available for binaries in format 'x86-windows-msvc-2008-pe-32bit'

Finally, I figured out it was due to the absence of CDB.exe in the Presence of C:\Program Files\Debugging Tools for Windows directory. Qt Creator looks for the MS Windows debugger in that location. This problem can be solved by installing the right version of the debugger from the Windows SDK or DDK from

http://www.microsoft.com/download/en/details.aspx?id=8442

OR

http://msdn.microsoft.com/en-us/windows/hardware/gg463009

OR

http://msdn.microsoft.com/en-us/windows/hardware/gg487428

To get the debugger installed at the C:\Program Files\Debugging Tools launch the setup programs from the Debuggers directory in the WDK or DDK cd/dvd.

Tuesday, September 7, 2010

How to play online streaming videos (Youtube, Metcafe etc.) on Ubuntu 64 bit.

The 64-bit version of Ubuntu has issues playing youtube and other streaming videos from browser. Reason being the browser shipped with the OS is itself a 64-bit browser. The Adobe Flash player 64-bit plugin is still under development and yet not released. A beta version of the same was included in Karmic Koala, which has now been removed for further improvement. .

One workaround would be to install 32-bit Firefox from Mozillla repository and install the 32-bit Adobe fFash player plugin. The other way would be to install the beta version of the 64-bit Adobe Flash player which is now available from other repositories. Following are the steps:
1. Remove all other flash plugin intallations. Use the following shell script

#!/bin/bash
apt-get remove --purge flashplugin-installer
apt-get remove --purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash
apt-get remove --purge iceweasel-flashplugin mozilla-flashplugin firefox-flashplugin
apt-get remove --purge swfdec-mozilla libflashsupport nspluginwrapper iceape-flashplugin
apt-get remove --purge xulrunner-flashplugin midbrowser-flashplugin xulrunner-addons-flashplugin
rm -f ~/.mozilla/plugins/*flash*
rm -f /usr/lib/firefox-addons/plugins/*flash*
rm -f /usr/lib/firefox/plugins/*flash*
rm -f /usr/lib/iceape/plugins/flashplugin-alternative.so
rm -f /usr/lib/iceweasel/plugins/flashplugin-alternative.so
rm -f /usr/lib/iceweasel/plugins/npwrapper.libflashplayer.so
rm -f /usr/lib/midbrowser/plugins/flashplugin-alternative.so
rm -f /usr/lib/mozilla/plugins/*flash*
rm -f /usr/lib/xulrunner-addons/plugins/flashplugin-alternative.so
rm -f /usr/lib/xulrunner/plugins/flashplugin-alternative.so
rm -f /var/lib/flashplugin-nonfree/npwrapper.libflashplayer.so


Save the above script in a file say... remove_flash.sh and give it executable permission
$chmod u+x remove_flash.sh

Download

2. Add the following to the Software Sources:

http://ppa.launchpad.net/sevenmachines/flash/ubuntu lucid main

One way to do this is through Applications > Settings > Software Sources.
Once added issue the following command:
$ sudo apt-get update && sudo apt-get install flashplugin64-installer

Check opening firefox and opening up any youtube video.




Qt-Creator: Using native/platform specific library

Unfortunately, Qt-Creator so far does not provide for addition of native/platform specific dependencies from its UI. The only way to do it is by editing the .pro file manually.

An example:

If the Win32 API GetKeyState() contained in User32.dll is used in your code, append the following lines to the .pro file of your project:

win32 {

LIBS += User32.lib

}

Simlarly, an Unix specific dependency will go into a block like this&

unix{

LIBS += -L/usr/local/lib -lmath

}

Tuesday, June 22, 2010

C++ WholeNumber (BigInteger) container on way

Publishing something after quite some time…..

Well the new kid on the blog is a C++ container for a Whole Number (0 < n < ∞). This is much like the JAVA BigInteger class. It will enable you to perform mathematical operations on big positive integers/whole numbers with the ease of using a native data type. All mathematical and logical operators for supporting normal operations are being added.

Some examples for its use might be finding the results of:

100!

234^567

999777775558778115674556555555555555555555555/5678988909

No special operations are required, just use this class as a native datatype to achieve the above mentioned.

Insertion/Extraction operators have been overloaded too, enabling normal console I/O.

It is still under development, an initial working prototype is ready. Loads of operators still remain to be overloaded.

You can have a peek at it at http://bitbucket.org/agnit/wholenumber/ . It is hosted on bitbucket.org as a public mercurial repository.

You'll need to have mercurial installed on your system to create a local clone of the repository.

Currently, the project consists of 2main files:

WholeNumber.h

WholeNumber.cpp

and a test program.

Tuesday, August 25, 2009

A Steganography Tool

Check my cute little creation ;)

Stegosaurus 1.0 is a tool to perform steganography on 24-bit BMP files.

Use this to hide and recover any type of file to and from a selected BMP image, without altering the original size of the image

For details of the steganography process used visit

http://www.garykessler.net/library/steganography.html