Throttling HttpClient requests

In my previous post, I’ve introduced a TimeSpanSemaphore, that functions as a throttling lock. Let’s see how we can use that semaphore to throttle HttpClient requests. The naïve solution would be to create an instance of the semaphore right next to the HttpClient, and wrap each request with a wait/release call on the semaphore: As … Read more

Time-based throttling of web requests

As part of my work on Cloudsfer, I’m working a lot with REST APIs of various cloud service providers, such as OneDrive, Dropbox and Instagram. Most of these services limit you to a certain number of requests per second/hour/day. This is understood – these services need to protect themselves from DDOS attacks, and other abuses. … Read more

Attaching debugger at runtime in .Net

Whenever you write code that starts a new Process, your debugging experience is rather lacking – you’re stuck outside of the debugger. The following extension method will attach the Visual Studio debugger to your process:

Reactive Extensions goes Open Source

With Reactive Extensions going open-source, as mentioned in Scott Hanselman’s Reactive Extensions (Rx) is now Open Source post, I took a swing at the library, as it solved one of my requirements perfectly. Having the ability to buffer events (or subjects), and process them in chunks, while keeping a time-limit on the delay is extremely … Read more

WinForms: ListView with Multi-lined tool-tips for SubItems

If you’ve worked with ListViews in WinForms before, you might have encountered the discouraging fact that the default ListView does not support multi-lined tool-tips for SubItems. For this to work, you have to create a custom control that inherits from ListView, and make some nasty calls to P/Invoke. Here’s how this can be achieved: As … Read more

Windsor: Loading installers from the execution folder

When using Windsor, it is necessary to load the various IWindowsInstallers into the container. One standard way of doing this is using a code similar to the below: The above code will load all the Installers that are located in the execution folder. However, in certain cases, when your code is running in different contexts, … Read more

Windsor Factories and Obfuscation

I love Windsor – it’s simplicity yet versatility amazes me every time I use it. In my last project, I’ve used it, along with the TypedFactoryFacility in order to late-resolve some objects. The resolved object required some parameters to be passed to the CTOR – nothing too complex – you just create an anonymous type … Read more

IRibbonExtensibility needs to be ComVisible

When developing an Outlook add-in using VSTO 4, if you are implementing the IRibbonExtensibility interface (for customizing a Ribbon, for example) you might encounter cases where your Ribbon or menu items don’t appear in Outlook’s UI. In those cases, you should check the following things first: Your XML is valid – invalid Ribbon XML will … Read more