Get that content fast… libcURL!

Use it correctly, it can make your wire hot:

Now, a few things though, if, like me, you need to grab a lot of urls, you’ll hit a bottleneck which is DNS resolution. You can install a local DNS cache, but by default, libcurl use blocking dns queries.

You can rebuild it using c-ares to use non blocking dns queries:

A python binding is available here:

Read More

Queue in Python

Solid queue library in python:

Written in C++ it’s very fast. Its brokerless design make it very scalable. It supports several message patterns: request/reply, publish/subscribe and pipeline, which can be useful in parallel task management.

Note: it’s not a broker, it’s a library, so you’ll need to implement concept like durability and guaranteed delivery on top of it.

If like me you want to use it with python, here’s the binding:

Read More

DependencyProperty value change notification

In order to get notified when a dependency property value changes, you can use the DependencyPropertyDescriptor.AddValueChanged function to register your own listener.

A simple example that displays the width of the window in a label:

[sourcecode language=”csharp”]

public Window1()

DependencyPropertyDescriptor widthDesc = DependencyPropertyDescriptor.FromProperty(Window.WidthProperty, typeof(Window));

if (widthDesc != null)
widthDesc.AddValueChanged(this, this.OnValueChanged);

private void OnValueChanged(object sender, EventArgs args)
txtLabel.Text = this.Width.ToString();

Read More