how to set CPU affinity of a particular pthread?

I’d like to specify the cpu-affinity of a particular pthread. All the references I’ve found so far deal with setting the cpu-affinity of a process (pid_t) not a thread (pthread_t). I tried some experiments passing pthread_t’s around and as expected they fail. Am I trying to do something impossible? If not, can you send a … Read more

How do I convert a C string into a Rust string and back via FFI?

I’m trying to get a C string returned by a C library and convert it to a Rust string via FFI. mylib.c const char* hello(){ return “Hello World!”; } main.rs #![feature(link_args)] extern crate libc; use libc::c_char; #[link_args = “-L . -I . -lmylib”] extern { fn hello() -> *c_char; } fn main() { //how do … Read more

What approaches are available to dummy design-time data in WPF?

I am working without expression blend and just using the XAML editor in vs2010. The wisdom of this aside, I am increasingly seeing a need for design-time data binding. For simple cases, the FallbackValue property works very nicely (Textboxes and TextBlocks, etc). But especially when dealing with ItemsControl and the like, one really needs sample … Read more

Show control hierarchy in the WinForms designer

One of our clients has an old WinForms application that contains forms with a lot of controls on them. Some of those controls have a deep hierarchy and that makes it to hard to select them in the designer. I need to understand this hierarchy to make modifications to the application to correct some bugs. … Read more

Designer Added then removed by Visual Studio on load/unload

Anyone see this before? I have a large Visual Studio project that keeps adding [Subtype]Designer[/Subtype] to my .vcproj then removing it on the next open and close of the project. There is only one class defined in StoredImageControl.cs. Anyone know how to shut this off as it is really messing up my revision control. This … Read more

Affinity Designer: How to maintain the colour of the intersected object

I have a rectangle and a circle (fig1). I would like to apply an intersection to these two objects. For this, I duplicate the rectangle and then select the duplicated rectangle and the circle and apply an intersection. After the intersection, the part of the circle overlapping the rectangle becomes of the colour of the … Read more