Simple and quick interactivity in pylab plots

Refer to the api: import pylabfig = pylab.figure()pylab.plot(pylab.rand(10), pylab.rand(10))def onclick(event):print ‘button=%d, x=%d, y=%d, xdata=%f, ydata=%f’%(event.button, event.x, event.y, event.xdata, event.ydata) cid = fig.canvas.mpl_connect(‘button_press_event’, onclick)

Rails drag and drop with scriptaculous

From here: View: <div id=<%= element_to_drag_id %> class=’mydrop’> Whatevertrue) %>     <div id=<%= element_to_drop_id %> >Whatever else <%= drop_receiving_element(element_to_drop_id, # The id of the receiving element :accept => “mydrop”, # The CSS class of the dropped element :with => “‘dropid=’ + (‘_’).last())”, # The query string parameters :url => {:action=> ‘dropped’} # The action… Read More Rails drag and drop with scriptaculous

rails 2.3.2 to 2.3.5

sudo gem update railssudo gem install rack –version ‘1.0.1’ (rails won’t play with the latest version of rack 1.1.0)sudo gem update bluecloth make sure you haven’t set a particular rails gem version in environment.rb script/about You should be all set

Resilient electronics

Someone spilled water on my cellphone (a prepaid T-mobile phone) at night, and in the morning, I picked it up and the display was blank- just lit with the backlight but no display. The phone would switch on and off by holding down the power button (the vibrate would go off indicating on/off). The person… Read More Resilient electronics