Posts

Showing posts from August, 2007

Now my car roars with 110db twintone horn

Image
About 2 years ago, I had an auto accident (luckily no one was seriously injured) and damaged my front bumper and the horn was also replaced. But after I got my car back from the workshop, I realized that they gave me an cheap horn that is soft and squeak like a little kitten, far worse that the stock horn. I have been wanting to change it for some time and recently, there was a few occasion when some reckless drivers dangerously cuts in front of me, forcing me to slam the brakes and also horn, but what came out was a mere little kitten squeak. So yesterday, I finally decided I had enough of the ineffective horn. As I am sorta the DIY guy and also I been wanting to learn more about fixing my car,I decided to fix it myself. I could learn more about car wiring and save some money. First, I took a spanner to remove the horn, took it back into my room and experimented with it. I found that electric horn connection terminal are not polarized, so we can connect +12V and GND from my power supp...

Hosting WCF in WPF app

In an application that I am developing, I have encountered a problem when the WPF GUI freezes when a client access the services in the server. Both client and server are WPF applications and the service operations typically takes several seconds to complete. So, the server GUI became unresponsive when the client performs service operation calls to the server. After some investigation, I found that the default behavior for WCF is to use the default synchronization context for the current AppDomain for synchronizing client access. Thus, when it is hosted in a GUI application, it locks the UI thread too. To disable this behavior, I have disable the UseSynchonizationContext switch in the ServiceBehavior attribute of the service implementation class. [ServiceContract] public interface IMyService { [OperationContract] void DoSomething(); } [ServiceBehavior( UseSynchonizationContext = false)] public class MyServiceImpl : IMyService { public void DoSomething() { ... } } Unfortunately,...