Skip to content

Instantly share code, notes, and snippets.

private void addCrossHatch( Graphics graphics, int width, int height, int x, int y ) {
graphics.setColor( Color.BLACK );
graphics.drawLine( x, y, x + width, y + height );
graphics.drawLine( x + ( width / 2 ), y, x + width, y + ( height / 2 ) );
graphics.drawLine( x, y + ( height / 2 ), x + ( width / 2 ), y + height );
graphics.drawLine( x, y + (int) ( height * .6 ), x + (int) ( width * .6 ), y );
graphics.drawLine( x + (int) ( width * .4 ), y + height, x + width, y + (int) ( height * .4 ) );
graphics.drawRect( x, y, width, height );
}
function genericErrorHandling() {
alert('do generic error handling here');
}
Ajax.Base.prototype.initialize = Ajax.Base.prototype.initialize.wrap(function(p, options) {
p(options);
this.options.onFailure = this.options.onFailure || genericErrorHandling;
});
new Ajax.Request('somepage', {
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="router" class="your.domain.routing.FirstAvailableMatchRouter">
<property name="routes">
<list>
<bean