Syndicate: [full] [short]
3 of 3 articles
Gtk and Rails: a strange meeting
10 Oct 05    [print link all ]

Well, I woke up this morning with a strange idea in my head. I was thinking about how cool Rails is, and how sad it is that so few people get to know it right now. I then remembered another nice library called Gtk, the Gnu version of a portable GUI toolkit, and I remembered the Ruby binding for it. Then I thought, what if you wrote something in rails that provided a Gtk-like interface. So that you could run ruby Gtk programs under a rails web application. It would have to dynamically generate the html that would best approximate the Gtk calls that have been issued. An hour and a half later, rtk was born: Download rtk.tar.gz source Here is the Two Buttons Ruby-Gnome example that this is based on. And here is the controller file where the GtkRails code is embedded:

class MulController < ApplicationController
  private
  def zputs(*args)
    args.each { |i|
      Gtk::Window.getMessageConsole.addmsg(i)
    }
  end
  def greeting(num)
      zputs "This is button #{num}"
  end
  public
  def ui
#    @w = @session['w']
    evt = @params['event']
    id = @params['id']
    Gtk::Signallable.send_signal(id, evt) if evt && id
    rt()
    render :action=>'rt'
  end
  def rt
    unless @w = Gtk::Window.getTopWindow
    # Build the GUI
    window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)
    hbox   = Gtk::HBox.new(false,0)

    button1 = Gtk::Button.new("button 1")
    button2 = Gtk::Button.new("button 2")
    but3 = Gtk::Button.new("but3")

    hbox.pack_start button1, true, true, 0
    hbox.pack_start button2, true, true, 0

    window.add hbox
    window.add but3

    # Callbacks and configuration.

    window.set_title    "Two buttons"
    window.border_width 10
    window.signal_connect('delete_event') { false }
    window.signal_connect('destroy') { Gtk.main_quit }

    button1.signal_connect('clicked') { greeting(1) }
    button2.signal_connect('clicked') { greeting(2) }
    but3.signal_connect('clicked') { zputs "You pressed button 3!" }

    # All done.
    window.show_all
    Gtk.main

    @w = Gtk::Window.getTopWindow
    end
  end
end
Katrina Hurricane Relief with Rails
08 Sep 05    [print link all ]

I have been involved in a new Wiki to work together to assist the relief effort for Hurricane Katrina. We have been coordinating among all the various organizations, people, and communication networks to try to help people. We have gotten a lot of press from CNN, AP, BusinessWeek, NPR, and others. And we are getting about 300,000 hits a day at last check. Have a look at our website at http://katrinahelp.info/ (or http://katrina.internet2.edu/ if that name above doesn't work) We have a massive dual processor system for this project to take heavy loads. We have gotten an army of volunteer typists transcribing missing person records into a database. About a dozen people have written scripts to grab data off other sites and convert them to this XML/RSS format called PFIF, the PeopleFinder Interchange Format. The major importance of this format is that it is made for sharing info from the ground up instead of hording all missing person info in one central database. I have been doing a little Ruby scripting myself to convert to this. The problem now is one of final integration and front end work; I am not that good at XML yet but given we have more than 100,000 records already collected it would be a shame if it is only PHP and Java that works out. Are any of the Ruby masters available for saving the world? If so please check out our status on the website and see if you might enjoy saving people's live and helping them be happy during a very hard time. We can also promote Ruby a lot with this press and show how good Ruby is for this kind of thing just for Ruby. I would also like to have just a 1-screen dirt simple Rails app going and wonder if there is any wider interest in the community. I hope to see some of you on the website soon.

WIPO, me, and you
11 Jun 05    [print link all ]

I'm not sure how many have noticed, but this year is very exciting not just for Ruby. And not just for Rails. Things are taking off in all sorts of directions now that blogging seems to have tipped off a sort of digital renaissance of writing, interaction, and understanding across all types of boundaries. Now I am going to try something a bit new, and suggest that some of the cohesion we have developed over the years in the Ruby community may be put to good use. It involves WIPO, the international treaty on intellectual property rights. And science, medecine, the nature of politics and capitalism, and many more strange and surprising things are in the mix.

It happens that politics are not always aligned with science, and sometimes the discrepancy can be severe. This fact is nowhere more obvious to me than my own personal experience trying to cure a potentially fatal degenerative liver condition that I have suffered my entire life. It is called hepatitis C, and it kills many more people in USA and Japan than AIDS does. For several reasons, research regarding this disease has been drastically underfunded, to the tune of about 100 times less money per death than HIV. Unfortunately, due to the nature of hepatitis C (HCV), it often goes undiagnosed for decades before causing serious liver problems, loss of ability to work, and death. Another problem is the lack of political capital in the affected groups, primarily jail prisoners and injection drug users in the United States. As these groups have essentially zero political power at this moment in time, they have been given near zero funding over the course of the last 15 years as this disease has come out into the public eye. In practical terms, this matters to me because I received HCV from a tainted blood transfusion at birth and my liver has been slowly degrading all my life. I understand that in Canada and the UK, there is government compensation for the HCV-tainted blood victims. I understand in USA there is over 100 thousand dollars per case compensation for HIV tainted blood victims.
here are some funding statistics
How come USA has not yet even acknowledged officially that there was a problem with infecting thousands of people like me with HCV from a tainted blood supply? I can tell that in not many more years I will be unable to work without medical advances. Which is why I am asking any of you now who might be touched by this story to look a little further and consider putting your name on the following petition for more funding from anywhere:
http://www.thepetitionsite.com/signatures/703119152?page=1

Don't get too hung up on the bad spelling etc on the petition. I didn't make it. I think we need many concurrent efforts to really drive this home. The reason I post this to the Ruby blog is because I understand that Japan also shares with USA a unique problem with HCV, and indeed Japan has been a leading HCV research center worldwide. Some communities in Japan have HCV rates in excess of 20%. I expect that there are more than a few people across the ocean in the Ruby community that have been touched in some way by HCV, that may have something to say about this, and may even be moved by my story. If this could be you please consider adding to the commentary at
http://www.wipo.int/roller/comments/ipisforum/Weblog/theme_seven_how_is_intellectual
where I sketch out a personalized (real-life) story of how intellectual property law affected my life, and what I think needs to be done to fix it. If you're moved by this consider also adding to the Wiki at
http://hcvaction.org/
Also, I think it's important as open-source and serious Ruby programmers for us to defend our intellectual turf from takeover from the noncreatives. Finally, for the value proposition, I submit my work in progress at
http://complearn.org/
which is a handy C library for data mining that also has a Ruby binding. So even in purely economic terms, perhaps it makes sense to fund HCV research a bit more. Let's please have this discussion. And have it in more than a few online forums because it's really important to many people right now. And some of these people are people you know. Due to the stigma associated with HCV, most likely you have not yet heard about them unless it is very close family or friends.

If you think this issue deserves more attention, or you just want me to continue to be a productive member of the Ruby community for many years to come, then please consider signing the petition above, adding to comments at the WIPO forum, or reposting this or similar information anywhere you can think of to improve visibility to get this desperately needed funding. Usenet, message boards, relevant email lists, anywhere. I cannot tell you how much I would appreciate it if you guys manage to get some real money allocated on this issue from any source. But I will be able to show you, over time.

To a better tomorrow,

Rudi