Modeling GitHub Repositories and NuGet Packages

I’m planning to do some research and statistics on NuGet packages usage in GitHub repositories.Here’s some sample questions I would like to answer: I’ve shown in my previous post how to retrieve the list of packages used byspecific GitHub repository. And in a different post, I’ve shown how to retrieve the information of a NuGet … Read more

Getting NuGet package details

In my previous post I’ve shown how to get the list of NuGet packages used by a GitHub repository. Let’s see how we can retrieve some additional information for each package. The NuGet Gallery provides an OData feed, which can be used to easily query and search its database. It’s base URL is https://packages.nuget.org/v1/FeedService.svc. I’ll not go over … Read more

Playing with GitHub API – Octokit.Net

For a small project I’m working on, I needed access to GitHub, to investigate some repositories via code. Luckily, GitHub have an extremely extensive API. Furthermore, they even provide a .Net library (via a NuGet package) named Octokit.Net, to easily access that API: Let’s see some samples. We’ll start by creating a new GitHubClient object: … Read more

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

Error while using HttpClient’s AutomaticDecompression in Portable Libraries

Adding automatic decompression support to an HttpClient is quite easy: This works even in Portable Libraries. However, if you try to call this from a different project, you might encounter the strange exception below: Method not found: void System.Net.Http.HttpClientHandler.set_AutomaticDecompression(System.Net.DecompressionMethods). This doesn’t give too much information – for some reason, the setter of the AutomaticDecompression property … Read more

Sending rich emails using RazorEngine – advanced templates

In my previous post, I’ve shown how to use the RazorEngine template engine in order to generate EmailMessages in an MVC-like pattern. However, when compared to real MVC, we have the ability to create more complex views, using utility classes/methods, such as @Html and @Url. In this article we’ll see how we can simulate that … Read more

Sending rich emails using RazorEngine

RazorEngine is a templating engine based on Microsoft’s Razor parsing engine. One of its most common uses it to generate HTML for emails. This post shows how to use the RazorEngine in a simple and elegant fashion. Let’s start with some basic code to create our MailMessage, which we will expand and build throughout this … 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:

Bloomberg’s Billionaires – Part 2: General data and stats

In my previous post, I’ve mentioned Bloomberg’s Billionaires website, which displays detailed information about the Top 100 world billionaires. Today, let’s take a look at the data used by the website. Using Fiddler, we can browse to (http://www.bloomberg.com/billionaires/) and follow the AJAX requests performed by the page. The first interesting piece of information is a … Read more

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