Archive for the 'Programming' Category

Back from Guadec

Somewhat back to normal routines after a week in beautiful Istanbul. As people reading Planet GNOME have seen from others, it was a great Guadec this year.

I found the schedule to be a bit uninspiring but that left more time for discussions and hacking. Among the sessions I went to I really enjoyed going to Alp’s session about Webkit and Blizzards on Mozilla. Some really interesting things coming from these projects.

Kris did a great job wrapping up the current state in GTK+ during his now traditional ‘GTK+ State of the Union’ talk and happy to see that the discussion around future GTK+ is getting started throughout the community. I spent a lot of time this year talking and listening to peoples feedback on the proposed plans. Realized that some things have been a bit left out from the discussions after the hackfest and that we need to do a better job at communicating what we plan to work on besides the cleanups and enabling of future development.

Finally a warm welcome to Stormy as executive director of the GNOME Foundation Board.

Removing a remote branch in Git

This is something I’ve had to checkup a few times so I figured it would be useful both for myself and for others to keep around in a blog post.

To remove a remote branch you created in Git just push to it like:

$ git push origin :name-of-branch

AsyncRunner for Ruby/GLib

Was playing around a bit with a synchronous network library that I wanted to use from a GTK+ frontend. Obviously this wouldn’t work too well as the UI would be blocked while waiting for the library to return from it’s network calls. So I wanted to run the network operations in the background using a thread but still get the callbacks in the main thread to be able to update the UI from there.

I ended up writing a small class I called AsyncRunner which is a small proxy to call methods in a various thread and get the callback in the main thread. It’s using the GLib Mainloop so it would only be useful in the cases where you actually have one.

require 'thread-sync'
class MySyncClass
  def foo_method(arg)
  end

  def bar_method(arg1, arg2)
  end
end

sync = MySyncClass.new

# In order to get the methods of MySyncClass asynchronous it is wrapped in an AsyncRunner.
async = AsyncRunner.new(sync)

async.foo_method('test') do
  ui_update()
end

main_loop = GLib::MainLoop.new
main_loop.run

Next Page »

Close
E-mail It