Tuesday, March 22, 2011

Which browser?

With the new release of Firefox 4 (RC2 presently and the final releasing today), I thought I will just type this in...

I use all three browsers - IE, Chrome and Firefox regularly, on Windows as well as Linux (obv. no IE there) and on all kinds of Internet speeds. The thing that's got me completely back into FF4 is its blazing speed - it's just suddenly gotten so much faster than itself and more than the other competitors too! I hated installing the Addons, as they used to hog m resources, but with FF4, it's just no longer an issue.

IE - just don't understand why it exists, besides that it comes pre-installed with Windows. Micro-so-soft release IE9 finally, but they make it uninstallable on my XP (and probably the first general use software to do so) - definitely not my choice if I have to stick to a browser. With Newer technology on the Web upcoming, I'd stick with FF or Chrome, but somehow, as a regular user as well as a Web addict and a techie, FF gives me a perspective that is independent of the web and the OS and that become very important.

I use Chrome very often, but the way it handles my privacy scares me. I don't mind the world knowing that I exist and knowing what I do, but I am scared of it using that information to come up with conclusions on "who" I am. I would rather have my picture drawn by me in front of the world than someone concluding it based on certain rules that they defined. Well, the same - Google intrudes with my custom likes and choices by deciding things on itself. Chrome has a nice New Tab interface, but FF has substantial add-ons to do that for me. The new FF interface is just as clean.

So now that it's my choice to go with Firefox, what would I like more:
- Integrated new tab with the FF base itself as a setting - add-ons have some issues all the time.
- the Awesomebar needs more work - I love the Prospector add-ons from Mozilla labs (mozillalabs.com) though.
- the skinning and theming is cool, but need an easy control of menu and toolbar, and their font sizes.
- Pinning (App tabs) is the best, but someone needs to work on utilizing it better - like unread mails from GMail or other websites could become their favicons. (GMail labs has something that half works and there's some add-on, but someone needs to work on that)

I hope the world gets rid of FLASH! Or Adobe gets its head running wrt the crazy crashes that Flash keeps having all the time :(

Rest I will wait for. I will keep "using Chrome" and "avoiding IE" as much as I need and can, but with MS ruling OSes and Google, the internet, I like to have someone else interfacing the two.

Tuesday, February 15, 2011

My Friend

A change from the usual. Trying to be Creative... nope not the influence of the V-day. This was due for a while since a chat with my sister got me writing the first paragraph...


My Friend


I went with the beats and the harmony of nature,
Trying to bestow their play on my soothing friend.
Whose head lay in my arms, the body rested against me,
Singing her melody, which was much more than just an errand.

I played the play on the strings that flowed in concert from her head,
My fingers caressing through them, dancing their rhythm.
As she intoned the tones that I craved to hear,
Her divinity collared my collar, chinning my chin as a pelham.

The music that reverberated was not so facile,
To the untrained perception that might've been quotidian,
But to those that possessed the knowledge and understanding,
The feeling that it moulded in the depth was incontrovertibly tempean.

No words were uttered and although in fragments it seemed a mayhem,
Yet its entirety, brought forth calmness that made it all so serene.
It palpated my deepest thoughts and feelings beyond my own understanding,
But somehow I felt I'd been craving for them, yet I never before had been so keen.

My stunned gaze was awestruck at her, while she rested as if quiescent,
And yet just under her breath, she spoke in a matter than none ever could.
A contrivance she was of the heavens, a deviance from any ordinary,
From her crown to her base she was more to me than anything ever would.

Time lingered and seemed not to progress forth, whilst lost I was
In the transcendent beauty of hers that had all attention as she posed,
I would do anything to stupefy those moments that were,
The memory so precious, that it'd stay abreast with my soul, forever I hoped.

And then it happened, once again, in my arms fragile as the same before.
She craved to be pampered, so I did, which brought forth her beauty within.
I played on her strings along her tenement, reliving my old memories.
Humming along with my dancing finger, she was the true friend - my beloved violin.

Thursday, May 13, 2010

Screen Grabbing with OpenCV

Note: this uses only the highgui.h header, since I'm not using any OpenCV functions.

Code

#define WIN32_LEAN_AND_MEAN
#include
#include
#include

#include


class ScreenShot
{
protected:
HWND hDesktopWnd;
HDC hDesktopDC, hCaptureDC;
BITMAPINFO bmInfo;

public:
int nScreenWidth, nScreenHeight;
HBITMAP hCaptureBitmap;

void init ()
{

nScreenWidth = GetSystemMetrics(SM_CXSCREEN);
nScreenHeight = GetSystemMetrics(SM_CYSCREEN);

hDesktopWnd = GetDesktopWindow();
hDesktopDC = GetDC(hDesktopWnd);

int padding = 0;
while ( (nScreenWidth*3 + padding)%4 != 0)
padding++;

bmInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmInfo.bmiHeader.biWidth = nScreenWidth;
bmInfo.bmiHeader.biHeight = nScreenHeight;
bmInfo.bmiHeader.biPlanes = 1;
bmInfo.bmiHeader.biBitCount = 24;
bmInfo.bmiHeader.biCompression = 0;
bmInfo.bmiHeader.biSizeImage = nScreenHeight * (nScreenWidth * 3 + padding);
bmInfo.bmiHeader.biXPelsPerMeter = 0;
bmInfo.bmiHeader.biYPelsPerMeter = 0;
bmInfo.bmiHeader.biClrUsed = 0;
bmInfo.bmiHeader.biClrImportant = 0;


}

void captureScreen()
{

hCaptureDC = CreateCompatibleDC(hDesktopDC);
hCaptureBitmap = CreateCompatibleBitmap(hDesktopDC, nScreenWidth, nScreenHeight);
SelectObject(hCaptureDC, hCaptureBitmap);
BitBlt(hCaptureDC, 0, 0, nScreenWidth, nScreenHeight, hDesktopDC, 0, 0, SRCCOPY);

}

void hBitMap2IplImage (IplImage *img)
{

GetDIBits(hCaptureDC, hCaptureBitmap, 0, nScreenHeight, img->imageData, &bmInfo, DIB_RGB_COLORS);

}

void close ()
{

ReleaseDC(hDesktopWnd, hDesktopDC);
DeleteDC(hCaptureDC);
DeleteObject(hCaptureBitmap);

}

};


I noticed that I had to close and init for each frame grad while using this code.
I'm new to Windows programming and not really keen to learn it, but I'd welcome if anyone can tell me how to optimize this code, especially how to avoid closing and initializing all the variables.

Wednesday, October 28, 2009

Cloud Computing in a nutshell - a brief

Here I am not trying to delve deep or to make anyone understand everything about cloud computing, but for those who are just lost about what this means (just as I was).

I atteded a briefing organized by Sun and Intel on Cloud Computing and, although it was intended for marketing purposes than teaching, the good part was that I got to really understand what the industry really means/desires by cloud computing. It's just like SOA (Services Oriented Architecture) - a jargon for a lot of things that have been going on, but have not yet been standardized. Everyone you meet will have a different perspective of cloud, but all of them are right and none of them are complete (they cannot, since one of you might do something that fits into this concept and call it under this umbrella). But the most important idea is sharing of resources.

Today, we have hundreds of servers for, say a huge system with several individual applications interacting with each other (e.g. SOA world), then their backup and load sharing ones. Through cloud, the most important achievement currently is that all these servers will now have virtual containers, instead of real ones. So the whole cluster of servers act as one server with several OS instances, several application instances, common storage, etc. Load balancing, storage issues, etc are avoided. This would be an example of something known as a private cloud. It is heavily used by mordern companies like Yahoo, google, IBM, etc. But client solutions haven't really been with IBM as much as Sun, Yahoo, Amazon or Google.

Another advantage and something that might really benefit the startups is the public cloud. In public clouds, users may simply register for usage of a cloud and is charged basically for the usage. So, a startup can simply put their piece of code into a public cloud and pay oly for the usage, which will be small initially and might grow with the base. The benefit is that scalability is the cheapest and with high resiliency in such systems (even with 5% failures, downtimes are not more than a few seconds and usually the failures are a lot less with good code reducing downtimes further) there is no way a small company could have afforded such a luxury.

Then there are other things like security levels, programming standards, cloud interactions, Power consumption, Energy Efficiencynetc. But those are out of basics that I wanted to share.

The most common example given is that of Amazon's EC2 (Elastic Computing Cloud) (http://aws.amazon.com/ec2/) and that of Google. Others like GoGrid (http://sn.im/srz30 [www_gogrid_com]) offer other kinds of solutions. Then there are solutions that are provided for clouds by companies which don't own clouds - closer to consultancy. There are other benefits for clouds e.g. a movie being released usually peaks it's website usage only near it's release dates, why spend on hardware for just that time - use a cloud. Clouds are not just about hardware consolidation. Grid Computing is also a part of cloud computing. Th`e term is very generically coined to incorporate any kind of resource sharing. Part clouds like webhosting on clouds and business logic with the private servers will probably benefit in IT industries. Again several consultancy jobs are awaiting in this domain. The technology and methodology is not new and has been in for a decade, but like SOA, which came up as a useful standard (with companies still not agreeing on some parts of it) because of the ability to plug-in solutions from various vendors, this will take over for the cost benefits and the other reasons that I have mention (and not mentioned).

For Future: protocols for inter-cloud communication, standards, part function-outsourcing (like report generation load on cloud, etc.), cloud architects, consultancy for clouds and experts in this area will be coming up. There will be better frameworks and Java (and other web) languages will adapt to include this. It's imminent. All the infrastructure has been under development for years, it's finally stable with things working together a lot better. So in a few years, like SOA, this will be in-demand. But then unlike SOA, this seems to be to large for people to be able to really come up with a unified solution, so probably as more clouds are created there will be a framework and an architecture and the definition of the "cloud offerings" will change.

So, let's call this subset as OnDemand-computing. :D

Saturday, January 28, 2006

Virtual Reality

Recenlty I have started my work on a Virtual Reality System. The task is kind of funny as well as serious. I'll try to make it as simple for the reader as I can...
Objective: To design and implement a system to transmit Stereoscopic data wirelessly for immersive environments to a Head Mounted Display(HMD).
Catch:
1) There is no hardware design labs accesible to me(not that I could gaurantee the job if I had one!)
2) This would be the 1st system of its kind in the world!!! (without labs???) Atleast I have not found any stereo-HMDs online that are wireless. Even if there exist some, I can bet that the price would be atleast $100,000 for the other specifications that we have to work with.
Now let's get to some serious and techie discussions...

The Problem:To design a wireless system for Head Mounted Displays to be used for the purpose of Immersive Environments. The parts of the HMD as analyzed are as follows:

Motion Tracking Sensors: A Motion tracking sensor is used in HMDs for head tracking. Head tracking provides a scope for implementing immersive and interactive environments. The data from these sensors are refreshed at rates of about 100-150Hz. At these rates, the information generated is not large, so usually RS-232 serial interface is sufficient for the data transfer. Most of the systems have sensor connected by wires, but there are a few implementations of wireless motion tracking also. RS-232 interface has a maximum bandwidth of 115,200 Kbps, which can be easily transmitted wirelessly.
Display: A Head/Helmet Mounted Display (HMD) usually consists of two screens with atleast 800x600 resolution of 16-bit color depth, each. The pixel data is hence:
800*600*2*16 = 15 Mpixels

At 30 Hz refresh rate, the data rate comes to about:
15*30 = 230 Mbits/sec!!!

Since such high data rates would be achievable only at short distances and only over wireless systems using ultra wideband to transmit data, the complexity of the defined problem increases.
Other Sensors: There are other sensors, like respiratory sensors, pinch gloves, etc., that are used for specific applications. These sensors have similar specifications as the motion tracker, but the required data rates are much less and hence the signals maybe clubbed with the motion tracking sensor signals.

Current work:
There have been developments in compression technologies that can restrict the data to much less bandwidth. But real-time compression and decompression requires high speed image processing and causes delays, which are not acceptable in interactive or immersive environments. By interactive systems

Wireless USB (WUSB) technology allows raw data rates up to 480Mbps. But it has not been put to much use in the market.

There are various wireless display transmission technologies available. For instance, markets have wireless projectors and displays. There are also adapters available to connect projectors or displays wirelessly. Such systems use the IEEE 802.11b/g WiFi to transmit the data. At 802.11g the data rates are 54 Mbps and with its turbo mode, one can get upto 108Mbps!!! Yet, these are insufficient for raw transmissions. Remember for Immersive systems, the slightest of the delay doubles itself and the Reality part of VR is compromised.

Hi speed wirelessly can be obtained by implementing protocols like IEEE 802.17 Resilient Packet Ring(RPR), but as I mentioned before, no hardwware labs available to design the system.

Developments:

11/01/2006 - Purchase of DLink DPG-2000W wireless presentation gateway- This is an adapter that can be used for giving wireless presentations. We procured and tested it, but found it to be transmitting at slow frame ratees and video was too jerky even with low refresh rates and low quality images. It uses 802.11g protocol to transmit signals.

28/01/2006(uptil) - We have got a stock of devices now in our arsonal:
1) A non-stereoscopic HMD
2) All kinds of cables and connector to put the system together
3) A WiFi adapter, as the system could not be connected at 802.11g, but only at 802.11b(11Mbps), that was too slow.
4) OpenGL programming learning process has begun as I have to also find out how to make stereo images from the visualisations by initially designing a 2 viewpoint mode in 2 windows, then, later making it compatible with various stereo methods.

29/01/2006 - Eureka! First step: The HMD and all cables and connectors connected and watched a walk-through of Fatehpur Sikri (an Indian Monument).

31/01/2006 - Last 2 days, I've been trying to pick up more of OpenGL and have somehow reached the 7th lesson on nehe.gamedev.net. The link has been given on my Links Blog. I have started understanding the OpenGL a little. Let's see what comes up...

Tuesday, December 07, 2004

Image Processing

My web searches have give me some good sites and material to read. They will be in the Links post.
I'd recommend the following readings:

... Digital Image processing by William Pratt
It's an excellent bok for those trying to get into the subject, but looking for a entry. Gives all the basic background one needs, from the Psychophysical Visual properties of an image to Shape and Image analysis, segmentation, feature extraction. It's a kind of protal into the subject and gives a pretty good overview of the subject and its mathematical aspects.

What am I upto these days...

- Virtual Reality with OpenGL and Wireless systems for VR
- Touring Montreal and Canada
- LabVIEW and Virtual Instrmentation
- Image processing
- Novels, books, hobbies, TV, food, etc...