Monday, 14 June 2010
Everyday Enterprise Architecture - The book - full download
Note: though the page might say its a preview edition, its actually the full book.
Monday, 10 May 2010
Review - Book - CLR via C# 3rd Edition by Jeffrey Richter
Tuesday, 23 March 2010
Setting Physical Memory Limit for a .NET application
The straightforward way appeared to use Process.GetCurrentProcess().MaxWorkingSet. Strangely, no matter what we tried, this never worked. Yet to figure out why it does not work - if anyone has a clue, please ping.
Anyways, looking at options we came across job objects in Windows that allow setting the max working set. So the approach that finally worked was this:
1.) Create a Job object using CreateJobObject() Win32 call
2.) Setup the memory limits against this job using
SetInformationJobObject()
3.) Assign our process to this job using AssignProcessToJob().
Now, when we look at the task manager, the physical memory assigned to this process never goes over the specified limit. All good.
Note that this is applicable only for the physical memory and not for the virtual memory - no limits can be set for this [?]. The physical memory limit is affected when the application is paged-in from the page file into the memory.
Thursday, 18 March 2010
Exploiting ObjectFromLresult() to get the IHTMLDocument2 from a window handle
This is interesting as with just a window handle, it was relatively unknown on how that can be mapped to an object.
What you need to do is this:
1.) Register the windows message WM_HTML_GETOBJECT
2.) Send this message to the window handle we have in hand using a SendMessageTimeOut(). The out parameter in the lpdwResult returns you an UIntPtr to the object after the call.
3.) Next, use this out parameter as part of the ObjectFromLresult() call:
ObjectFromLresult(result from sendmessagetimeout, IHtmlDocument, 0)
4.) Cast the result from ObjectFromLresult() to IHTMLDocument2.
5.) Use the all property to get the HTML elements.
The powerfull function here definitely is the ObjectFromLResult() which effectively returns you an object that is 'accessible'. Accessible in terms of the user accessibility factor.
A framework worth checking out in this regard is the UIA framework that allows manipulating individual entities on the screen be it winforms, browser controls...
Wednesday, 24 February 2010
Azure Computing Usage, Metering etc and how MS gets richer
Quickly calculate Azure ROI/TCO
Interested in quickly calculating the ROI/TCO for your application once it is deployed in Azure? Check out these two:
1.) http://www.microsoft.com/windowsazure/tco/
2.) http://neudesic.cloudapp.net/azureroi.aspx
View/Query tables/data in Azure Dev Storage
When deploying application on the development fabric, you would usually need to actually view the dev storage - say check out the tables, write a couple of SQLs against it etc. OOB, there isn’t any support in VS2010/tools from MS. Note that development fabric is different from the Azure Storage in the cloud. Development fabric, dev storage resides on your local machine.
A very good tool you could use to access the dev storage for free (in addition to the azure store if you are a registered user) is Cloud Storage Studio from Cerebrata. Check more here:
http://www.cerebrata.com/Products/CloudStorageStudio/Default.aspx
Do let know if you come across any more free/thin/sleek/nifty tool that works.