Await in the Land of iOS - Collisions in Chipmunk
The old way!
If you're using the Chipmunk bindings, the correct way to handle collisions between shapes is to register 4 (FOUR!) handlers for the different steps: begin, preSolve, postSolve and separate. Your collision handling logic is then spread in 4 different functions. All of that for the same collision.bool Begin (Arbiter arb)
{
Console.WriteLine ("began");
return true;
}
bool PreSolve (Arbiter arb)
{
Console.WriteLine ("presolved");
return true;
}
void PostSolve (Arbiter arb)
{
Console.WriteLine ("postsolved");
}
void Separate (Arbiter arb)
{
Console.WriteLine ("separated");
}
It would be great, for the sake of simplicity, if we could group the logic altogether.
await to the rescue
C# 5 (in .NET 4.5) allows just that. Procedural code in the form of:await began;
Console.WriteLine ("BEGAN");
await presolved;
Console.WriteLine ("PRESOLVE");
await postsolved;
Console.WriteLine ("POSTSOLVE");
await separated;
Console.WriteLine ("SEPARATED");
All this, ran into an infinite loop:
async void WaitForCollisions ()
{
using (var waiter = new AsyncCollisionWaiter (space, WALL, CHARACTER)) {
for(;;) {
var began = waiter.GetBeginAsync ();
var presolved = waiter.GetPreSolveAsync ();
var postsolved = waiter.GetPostSolveAsync ();
var separated = waiter.GetSeparateAsync ();
await began;
Console.WriteLine ("BEGAN");
await presolved;
Console.WriteLine ("PRESOLVE");
await postsolved;
Console.WriteLine ("POSTSOLVE");
await separated;
Console.WriteLine ("SEPARATED");
}
}
}
The magic lies in the AsyncCollisionWaiter. Here's a quick implementation for itCaveats
So what ?
Have fun experimenting with await in your own mobile application too.
Geeko Pumping Iron Session - openSUSE ARM Hackathon 08-12Apr
openSUSE 12.3 is out, with OpenStack love
Have you heard about it? openSUSE 12.3 is out!
I did an upgrade earlier today on my main laptop (with a simple zypper dup after having updated the repos configuration, which went surprisingly fast), and this release looks great! But the best part: it comes with OpenStack love!
Enjoy Folsom!
For the first time, an openSUSE release provides a fully working set of OpenStack packages. We had some OpenStack packages in the previous release, but they were not in such a great shape and some components were even missing (although we fixed that later on with packages in the build service).
With 12.3, you can finally enjoy OpenStack with the Folsom release in a very straight-forward way, and therefore you can easily deploy your own cloud. The packages that we provide are built from the stable/folsom branch, and there's an online update coming soon so you can enjoy the stable/folsom code as of end of last week.
To help people who might not want to learn everything needed to properly deploy OpenStack, we also have a small openstack-quickstart package, that comes with a script that can be used to deploy everything locally. It is obviously not recommended to run this on your main computer (I usually run this in a virtual machine), but it gets you quickly to the point where you can play with OpenStack.

Dashboard of an OpenStack cloud running on openSUSE 12.3
Play today with Grizzly!
Of course, Folsom is relatively old at this point and the new version, Grizzly, is to be released in three weeks. But don't be sad! We've been working on Grizzly packages for some time now: you can grab them from the Cloud:OpenStack:Master project in the build service (hey, look, it's even building packages for SLE and openSUSE 12.2! the build service is a rather convenient tool!). I guess we'll properly move them to Cloud:OpenStack:Grizzly once Grizzly is officially released.
Develop with DevStack!
I mentioned a few months ago that I had finished porting DevStack to openSUSE 12.2, and I wrote some small documentation on how to use it. It's really a neat tool, both for playing with OpenStack and for developing for it.
However, I realized earlier this week that I had never double-checked everything was still okay for 12.3. It turns out there's a small issue that completely breaks it, oops ;-) But once the fix is checked in, DevStack will be usable on the latest openSUSE. I'll do some more tests before marking this version of openSUSE as supported in DevStack, but that shouldn't block anyone from using DevStack on 12.3.
Join us!
We're pretty open about how we develop OpenStack in openSUSE. Andreas wrote a post about all this a few days ago. We've opened up (or rather, revived) a mailing list dedicated to the cloud recently, which developers, packagers and users can all use to discuss OpenStack. And unsurprisingly, we also have an #opensuse-cloud channel on Freenode. But most importantly, we've worked on making public the infrastructure we use to build OpenStack for openSUSE.
I think the important bit on this is that everybody is able, and welcome, to join this effort. It's not just about being able to say "see, we have OpenStack"; it's about building a rock-solid experience for OpenStack, and enjoying doing that!
Now, let's celebrate the release: party time! :-)
One that got away – 12.3 Networking
Well openSUSE 12.3 is about to go live and we are all pretty excited. It is, as far as I can tell a rock solid release and we have outdone ourselves. Considering the short release cycle makes this even more impressive.
One can only thank everyone in the community for pulling together, getting a lot of stuff done and delivering a great release.
Yet, there’s one sprinkle that rains on our parade. While we completed the switch to systemd we somewhere along the lines forgot to check the status of NetworkManager on an installed system. Thus, when you upgrade from a previous release and NetworkManager is disabled, it will be enabled and running after the upgrade is complete, sorry. If you happen to be running a network bridge your bridge will not be working and you’ll end up in some weird network state where ifconfig will tell you that both your bridge and your Ethernet card have an IP address. Your routing table will also be messed up. Addressing the issue is easy.
Login as root, which you will have to do at the login manager if you happen to run NIS, disable NetworkManager, stop the NetworkManager service, and restart your network. You are now back to your original configuration, no sweat
. Below is a list of commands you want to run as the root user to make this happen:
# systemctl –force disable NetworkManager.service
# systemctl stop NetworkManager.service
# rcnetwork restart
Welcome to the Indian Reservation, Ubuntu GNOMEs!
I read today that Ubuntu-Gnome is now an official flavour of Ubuntu! Great work, you’ve achieved the same level of recognition as KDE has. Establishing Kubuntu, and other flavours of Ubuntu, was a very canny move on Canonical’s part to control and contain dissent within the Ubuntu big tent. The Kum-ba-ya, lets-all-make-a-circle-in-our-vests hype that Ubuntu generated in 2005 was so strong that it sucked in KDE users as well as users of GNOME, then the anointed Ubuntu desktop. Pretty soon they formed an unofficial forum, in Germany (where else) and started talking about a KDE Fork. The answer from Canonical was to throw them Kubuntu, with “infrastructure and support benefits“, hiring the Debian KDE maintainer, and to pour blandishments into the credulous ears of the KDE leadership of that time, who were mighty unsettled by the acquisition of their then-darling distribution by Novell and its earlier Ximian purchase. This sackful of glass beads and liquor was sufficient to prevent ornery KDE users roaming all over the place doing what they liked, and especially not over the border to other distributions, and in doing so increase Ubuntu’s momentum.
Now fast forward to 2013 and we’re seeing the same happen to GNOME. No longer the standard desktop, but still with significant suction among Ubuntu users, GNOME is neatly herded on to the reservation and congratulated on its wise decision. Now look to your Kubuntu colleagues to see how that is going to work out for you down the road. PS: If Mark promises to install GNOME Ubuntu, don’t believe him for a second. He has an office by now full of desktop computers representing official flavours that he never turns on. Sound familiar?
openSUSE 12.3 Image available for ARM64 (AArch64)
Howdy,
the openSUSE on ARM team was quite busy the last few weeks with getting openSUSE 12.3 for AArch64 (ARM64, also called ARMv8) ready. At the time of this post, we have finished around 4100 packages (out of ~ 6000) of openSUSE 12.3 built for AArch64, the ARM 64bit platform. With those successfully built packages, we’re also able to build a regular openSUSE image for you to try and run in the ARMv8 System emulator (ARMv8 Foundation Model).
This is a huge achievement and milestone for us, thanks to lots of helpful hands within openSUSE. Just to put this into perspective: This is not a minimal system with a couple of toolchain packages. It is also not an embedded variant of a Linux environment. No, this is the full featured, standard openSUSE distribution as you’re used to, ported to AArch64, up and running. We have built it based on (slightly newer versions of) standard openSUSE 12.3 packages, and the changes are mostly already merged back into openSUSE Factory. For all we know it’s also more successful package builds than any other Linux distribution has on AArch64! If you’d like to see the status yourself, please check out the OBS repository we created for this.
As an open distribution, it is important to make contributions easy and we worked hard to enable others to participate in our effort. We extended OBS to automatically spawn a Foundation Model virtual machine when you want to build for aarch64. This works remotely on the OBS server as well as locally using osc build. More information on this is available on the respective wiki page.
So, dive right into it: Get the image and start with openSUSE on AArch64 by following our wiki page: https://en.opensuse.org/Portal:ARM/AArch64.
Barcelona ruby conference
http://www.baruco.org/speakers
Yukihiro Matsumoto
Aaron Patterson
Avdi Grimm
Bryan Helmkamp
Charles Nutter
Corey Haines
David Chelimsky
Katrina Owen
Matt Wynne
Paolo Perrotta
Reg Braithwaite
Richard Schneeman
Sandi Metz
Want to be in the list? Call for papers is open until 10th March
http://www.baruco.org/call_for_papers
Want to sponsor?
http://www.baruco.org/sponsors
This is one of my recent collection of creations for the project.
This is one of my recent collection of creations for the project. Check it out! Now that many things are about to happen for the community such as the release of openSUSE 12.3, openSUSE Conference in Greece and later on, openSUSE Summit. I hope that some of these images make a change for who participates of the community. I always try to put my best efforts in creating something that reflects the feelings and fun of this community.
Thank you
This is one of my recent collection of creations for the project. Check it out! Now that many things are about to happen for the community such as the release of openSUSE 12.3, openSUSE Conference in Greece and later on, openSUSE Summit. I hope that some of these images make a change for who participates of the community. I always try to put my best efforts in creating something that reflects the feelings and fun of this community.
Thank you
Working around the reverse callback limitation on Xamarin.iOS
But still, having to flag the callback with an attribute and no instance method makes an API hard to use if you don't care that much about the internals of the library you're consuming.
I'm currently polishing the Chipmunk binding for Xamarin.iOS, and the cpSpace has some functions taking callbacks, like cpSpaceEachBody or cpSpaceAddPostStepCallback.
The C# API exposed looks like this (for the PostStep callback):
public class Space { public void AddPostStepCallBack (Action action, Body body);}If we could lift the restrictions, it could take lambdas or anonymous methods. This is how I did it behind the scenes:
public class Space {
delegate void PostStepFunc (IntPtr space, IntPtr obj, IntPtr data);
[MonoTouch.MonoPInvokeCallback (typeof (PostStepFunc))]
static void PostStepForBody (IntPtr space, IntPtr obj, IntPtr data)
{
var handle = GCHandle.FromIntPtr (data);
var action = (Action)handle.Target;
handle.Free ();
action (obj == IntPtr.Zero ? null : new Body (obj));
}
[DllImport ("__Internal")]
extern static void cpSpaceAddPostStepCallback (IntPtr space, PostStepFunc func, IntPtr key, IntPtr data);
public void AddPostStepCallback (Action action, Body obj)Static callback? : Check!
{
var data = GCHandle.ToIntPtr(GCHandle.Alloc (action));
cpSpaceAddPostStepCallback (Handle.Handle, PostStepForBody, obj.Handle.Handle, data);
}
}
Flagged with attribute? : Check!
This is possible because of the free to use data pointer as last argument of the native function call. We don't expose it to the use, and hijack it to pass the GCHandle ptr of the callback provided by the user.
Hope it helps you.
Liked this? Want more? I'm available for contracting, so contact me.

