Windows DreamScene is nice

Although of not much real use, but at times I do like to play around with my desktop background, while checking the windows updates I came across Windows DreamScene , which was listed as one of the optional updates, curious about what it is, I did some googling and came across a detailed page explaining that DreamScene allows you to use alternate multimedia like Video’s as your desktop background, I ended up installing the optional software, and once enabled got a waterfall video showing up as my desktop background, very nice and relaxing for my nerves, but unfortunately this feature is only available with Windows Vista Ultimate (Installed at home PC), and I have business addition at office, otherwise it would have been nice to setup a nerve calming video as my office desktop backgroud, so that each time I minimize my applications I can see the video of my last summer holiday :)

Video background using DreamScene

Video background using DreamScene

Install an Assembly into the Global Assembly Cache

On Windoze one can install assembles into Global assembly cache to make assembly accessible from everywhere on the machine, there are four main ways to install assembly into global assembly cache , but the one that I found to be the easiest and available by default on windows is the Assembly Cache Viewer (Shfusion.dll) , using this method one can use windows explorer to drag the assembly file into the global cache folder at windows\assembly however this method requires that the assembly is strongly typed, in order to do that one has to sign the assembly, In Visual studio this can be done by click on the class library project properties and select Signing tab and then selecting Sign the assembly.

Enabling Sharepoint Intellisense in Visual Studio 2008

Styling Sharepoint sites depends heavily on creating and editing XML files that need to follow sharepoint schema.

the first thing to note is if WSS (Windows Sharepoint Services) are installed on the same machine as you Visual Studio on not, Microsoft suggests to develop Sharepoint application on a windows server 2003, so that debugging and testing is facilitated.

If Visual Studio is on the WSS machine then all you need to do is create a xml file e.g sharepoint.xml in the folder Program Files\Microsoft Visual Studio 9.0\Xml\Schemas

Place the following code in it

[code]

<SchemaCatalog xmlns=”http://schemas.microsoft.com/xsd/catalog”>
<Schema href=”%CommonProgramFiles%/Microsoft Shared/web server extensions/12/TEMPLATE/XML/wss.xsd” targetNamespace=”http://schemas.microsoft.com/sharepoint/” />
</SchemaCatalog>

[code]

Restart Visual Studio and add the following line to your top most element xmlns=”http://schemas.microsoft.com/sharepoint/” in your XML file this should enable intellisense in your XML file.

For Environments where WSS is not installed on the same machine, wss.xsd file can be copied to the development machine and the above code altered to point to the xsd file location.

Comet, Reverse Ajax or Ajax Push

Comet is a web framework in which the server sends data to the client using long held connections. As soon as the client receives the message it opens a connection to the server until a complete message is read. This Architecture enables the server to push data to the client rather then the other way around.
The Architecture depends on Ajax to receive message from server and continue receiving contents from the server in the background while the user is using other features on the page.

A similar architecture is proposed in HTML 5 called server-sent events, which adds new html element event-source and a new data format called DOM event stream.

I believe with the improvement of this architecture lot of barriers for web based applications will be lifted and the difference between web based clients and desktop clients will reduce.

The main applications that will benefit from this architecture will be browser based chat applications, Web Ads delivery, email clients etc

References:

http://en.wikipedia.org/wiki/Comet_(programming)

http://cometdaily.com/

http://ajaxpatterns.org/HTTP_Streaming

http://www.codeplex.com/comet

http://cometdaily.com/2008/06/03/various-comet-projects-hosted-at-sourceforge/

Asp.net AJAX stops working on upgrade from asp.net 2.0 to 3.5

Issue:

I upgraded my existing project developed in asp.net and .net extensions 1.0 to Ajax extensions that come bundled with asp.net 3.5 using Visual Studio 2008. After the upgrade I got compiler errors saying that the required assembly could not be found.

Reason:

It turns out that on conversion Visual studio does not remove the reference to the AJAX extension for version 1.06 and hence the error.

Solution:

In order to sort out this issue you need to go into project properties -> Reference tab and remove the reference System.Web.Extensions and create a new reference to the System.Web.Extension for the .net 3.5 dll located at \Program Files\Reference Assemblies\Microsoft\Framework\v3.5

alternately after removing the reference you can copy System.Web.Extensions.dll from from the 3.5 version to the bin directory of your project to sort out the issue.

Please note that if your project has any reference to the old System.Web.Extensions it will complain that there are two reference to System.Web.Extensions, in this case you can either remove older version of extensions from your system and deleted all temporary files in Windows temp and restart Visual Studio 2008, alternately make sure that all references to System.Web.Extensions to the older version are removed from your project.

For more details of how to upgrade project from .net 2 to .net 3.5 check out this post

Visual Web Developer blog

Happy Coding :)

NTLM Authentication for Java http clients

I was working to provide NTLM authentication to a RSS aggregator plugin http://confluence.atlassian.com/display/CONFEXT/RSS+aggregator+macro+plugin , in our implementation the rssaggregator needed to access rss feed from an IIS installed application within an AD intergrated setup, so our http request needed to go through NTLM authentication.

What I found out during this exercise is that if one is on the same AD domain as the server hosting the secure contents then JDK 1.5 and 1.6 does a transparent authentication at the backend, automatically transferring the login details from the http client to the server , however if the request is being made from a client outside the domain then the login details have to be provided using the username and password for the client accessing the protected resource, for that I found the Jave Authenticator class to be the best option, since you do not have to alter your existing code and just call the Authenticator before the http request and populate the authentication credentials in it. Worked really well for me.

References
Two exhaustive definitions of how ntlm works, and the interactions

http://www.innovation.ch/personal/ronald/ntlm.html
http://davenport.sourceforge.net/ntlm.html
Useful link to valid Java Implementation
http://oaklandsoftware.com/papers/ntlm.html

Do I care about being green?

Today I had a heated debate about being concerned for being green and environmentally friendly, I was very straight forward in saying that I did not care much about it specially when it comes to spending money or give away money for being green. After paying so much taxes in the form of income tax, sales tax and what not at such a high rate, government and other organizations are still inclined to take more money from our pockets based on some new fancy reason. Their attitude of give me everything you have completely annoys me, coming from a third world country where the tax rate was very low and I was able to do much more saving it seems to me an organized theft the way government and organizations convince people to give away money.

I am not saying that global warming or pollution is not an issue, it is an issue and people who feel strong about it should empty their pockets for it, but the issue is about being forced by law to contribute for a cause that in your view is not a priority.  All my life my family in Pakistan bought water of water tankers since we did not use to get water through water supply lines, so I have developed a habit of conserving water, and that hasn’t changed even after coming to London, same is the case with electricity , we used to get 1 hour of load shedding  each day in summer (For the more fortunate ones who don’t know what load shedding is, its not getting electricity in the house when you turn on the lights, cause the national Grid cannot generate enough electricity, and powerful countries have stopped you from setting up nuclear plants to generate energy)  and since then I have a habbit of turning off unused lights in the house. So if you ask me I do my bit for the environment.

Coming from a third world country where there is a huge majority of people specially children who are malnourished and do not have clothes to wear or place to live is a much bigger issue for me then being green, if I have to support a cause with money then I would support the cause to save the people who are currently alive and later think about what our children will do because of global warming. The money that we decide to give for causes like carbon offset for a flight (I was told proudly by a colleagues sometime ago that he paid some big airline 35 pounds for his carbon footprint to travel to malasia) is a  joke to me, the same money can be donated to UNICEF http://www.unicef.org/  to fund food for a child that can last him few weeks. Giving 5 pounds a week to save a Dog is great for some, but after seeing 6 , 7 year old children half clad with no slippers in December finding food in the garbage cans, my heart does not feel at all inclined to give money to save an animal, I would rather give money to save a human being.

It seems to me after talking to people here in London, that they have got no clue as to how people are living in the under developed countries, when people are not certain if they will be able to feed themselves and their families in the next 24 hours or not then how can they be bothered about things like climate change, these are fancy things to consider by developed countries who created the mess with their industrial revolution in the first place.

I am bitter about this yes, and I am angry at myself as well, because I did not do what I could when I used to drive to work in Islamabad and used to pass by the Afghan Refugee Camp,  Afghan Women and Children were forced to leave their country after American invasion and come for refuge in Pakistan , with most families with no males to protect and earn, I saw women and children collecting paper and plastic from garbage dumps to sell to small companies for recycling, generally being paid not enough to even get one full meal for the family.  Those images are engraved on my heart the misery and pain of humanity.

Same is the case for Africa, since there are not much Oil resources in Africa so the power hungry nations are not bothered about them, and since they are not bothered and they control the media so they are more concerned about things that affect them rather then people dying in other parts of the world which just makes heading once a month or when some great disaster happens and then goes in the background.

But all is not lost here, there are wonderful organizations that are doing a lot, and are making a change, If I am man enough to do anything then I would do for such great causes and when these issues are sorted I will think about working or spending money for less urgent causes like climate change. For me the priority is to save a hungry child now rather then saving a dog or saving the planet, for now I will leave the saving the world thing to the supermen or superwomen of the world, the least I can do is to pray and donate my money to a child in need.

What’s wrong with these service providers?

I am generally not that cynical, but after quite a few experiences with service provides here in the UK I have grown angry and frustrated with the way they handle customers.

The latest shock for me was to realize that I have been charged the full broadband fee by Toucan after two months of disconnection and transferring my account to Sky broadband, I had been with Toucan for more then two years but when I switched to Sky and called for MAC code from Toucan they told me that I was entered into a new Contract since I changed my broadband package from 2MB to 8MB 10 months ago, and I could not transfer until the contract expired, that’s just great!  Specially when this was not even mentioned to me when I switched from 2BM to 8MB. However being a good customer I kept on paying two more months to both Toucan and Sky and once the contract expired got the MAC code from Toucan and supplied to Sky and got the connection switched, my Toucan online account said that the account was marked for disconnection. The Direct Debit was also cleared from my bank account. Now after two months while going through my emails I realise that I am still being billed by toucan and on checking my Direct Debit setup I realised that Toucan had again setup the Direct Debit and were charging me L .

In my anger I could not sleep the whole night and called toucan customer services first thing in the morning and gave them my peace of mind, their argument was that Sky had not informed them about the MAC code being activated by them, the general excuse like always, place the blame on someone else L  and hide your incompetency. Toucan have said that they will return my money, but still all of this had left me with a very bitter feeling about Toucan and their services, the broadband speed itself was horrible.

The moral of all this post is not to trust in anything these service providers say and bug them until you get what you want otherwise they will find ways to stitch you up, and bring grief to you. Had the same experience when I switch from npower to Scottish Power Last year for my Electricity and Gas supply and they not only made me lose money but kept me in limbo for 3 months or so L , so my suggestion is to adopt a no trust policy when working with any service providers, and keep yourself alert and informed of all their rules and regulations.

Anybody else like to share their experience and anguish is most welcome :) , suggestions to avoid such situation will be great.

installing PEAR on windows XP with php 5.2.x

I had some rough time getting pear run on windows when it was such an easy task :)

Pear comes bundles with php 5.2.x and while installing php make sure that you customize the install to include pear and if you are installing any extensions you have the correct path setup for their libs otherwise you will get dll errors when you run php from command prompt. e.g in my install I selected all extensions however most of the extensions depended on other software on your machine and its lib’s to be included in the path, so unless you are going to use it don’t include it :)

Once php gets installed go to the php install folder which by default is at c:\program files\php (although I installed it at c:\php5 ) and run the command go-pear, this will ask you a set of questions, I accepted the default values which installed pear on my system. the pear executable is placed in the same folder as php.

Once pear was installed I also ran the registry file created by pear install to setup environment variables.

Once done I installed my required packages by using the command

pear install <package name>

the list of packages can be found at http://pear.php.net/packages.php

the name will be the name of individual package, e.g HTML_Form

pear install HTML_Form

this will download the package from the online repository and install it on your machine.

You might have to restart the web server to get it running.

That is it, if you have any questions then please do comment on this post or email me at imran@tb2.net

Happy coding :)

disable windows vista magnifier on startup

This took me sometime to find out, and finally found this at a forum.

Go to All Programs — Go to Accessories — Go to Ease of Access — Go to Ease of Access Center — Click the blue link titled Make computer easier to see — UNCHECK turn on Magnifier — Click Apply and then exit… Restart computer and make sure that magnifier does not start upon startup.

Ease of Access Screen 1

Ease of Access Screen 1

 

Ease of Access Screen 2

Ease of Access Screen 2