If callbacks aren't placed on an event queue, multiple threads begin to share access to someObj.
Object someObj = ...;
Runnable callback = new Runnable(){ someObj.doSomething(); };
executor.submit(new Runnable() {
public void run() {
#!/usr/bin/env ruby | |
# This Ruby script will extract data from a Basecamp "backup" XML file and import | |
# it into Redmine. | |
# | |
# You must install the Nokogiri gem, which is an XML parser: sudo gem install nokogiri | |
# | |
# This script is a "code generator", in that it writes a new Ruby script to STDOUT. | |
# This script contains invocations of Redmine's ActiveRecord models. The resulting | |
# "import script" can be edited before being executed, if desired. |
If callbacks aren't placed on an event queue, multiple threads begin to share access to someObj.
Object someObj = ...;
Runnable callback = new Runnable(){ someObj.doSomething(); };
executor.submit(new Runnable() {
public void run() {
var someObject = { | |
method: function() { | |
console.log("Original method"); | |
} | |
} | |
var oldMethod = someObject.method; | |
someObject.method = function() { | |
oldMethod.apply(this, arguments); |
package com.tantaman.cometd.embed.example; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; | |
import java.util.concurrent.TimeUnit; | |
import org.cometd.bayeux.server.BayeuxServer; | |
import org.cometd.bayeux.server.ConfigurableServerChannel; |
This is from mtkopone
at: http://stackoverflow.com/questions/2200494/jquery-trigger-event-when-an-element-is-removed-from-the-dom/10172676#10172676
Added to my gists for quick reference.
(function($) {
jQuery.event.special.destroyed = {
remove: function(o) {
if (o.handler)
o.handler();
var Express = require("express"); | |
var webServ = Express.createServer(); | |
webServ.use(Express.static('../workspace')); | |
webServ.listen(8080); | |
console.log("Web server listening on port: 8080"); |
in action: http://www.vimeo.com/6639381
javascript:
var pp = "/images/test/images_";
var images_p1 = [ pp + '1.jpg', pp + '2.jpg', pp + '3.jpg', pp + '4.jpg', pp + '5.jpg' ];
var images_p2 = [ pp + '6.jpg', pp + '7.jpg', pp + '8.jpg', pp + '9.jpg', pp + '10.jpg' ];
$('.preview').slideview(function(e) { return e.id == "p1" ? images_p1 : images_p2; }, { size: 75 });
// Backbone.js 0.9.0 | |
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. | |
// Backbone may be freely distributed under the MIT license. | |
// For all details and documentation: | |
// http://backbonejs.org | |
define(function() { | |
var obj = {}; | |
obj._ = window._; | |
obj.jQuery = window.jQuery; | |
(function(){ |
<!doctype html> | |
<html> | |
<head> | |
<title>Three.js : WebGL Canvas Texture Text Example</title> | |
<style type="text/css"> | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
body { |