Skip to content

Instantly share code, notes, and snippets.

<?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
#MaxHotkeysPerInterval 9000
WheelUp::
Send {WheelDown}
Return
WheelDown::
Send {WheelUp}
Return
require 'csv'
require 'time'
drunk_tweets = []
CSV.new(File.new('tweets.csv'), headers: true, header_converters: :symbol).to_a.map(&:to_hash).each do |row|
tweet_hour = Time.parse(row[:timestamp]).hour
drunk_tweets << row if tweet_hour > 22 || tweet_hour < 5
end
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', {
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 );
}
Math.calculateViewerLength = function(start, end, xPixelRatio, yPixelRatio, minimumX, minimumY) {
var x1 = (start.x * xPixelRatio) + minimumX
var y1 = (start.y * yPixelRatio) + minimumY
var x2 = (end.x * xPixelRatio) + minimumX
var y2 = (end.y * yPixelRatio) + minimumY
var majorAxis = 6378137
var minorAxis = 6356752.3142
//Determines the true angle of the point with respect to the earth
private void parseWebPage() {
String line = "";
String url = "";
String proto[] = { "http://", "https://" };
try {
RandomAccessFile f = new RandomAccessFile(getAction(), "r");
while ((line = f.readLine()) != null) {
for (int protocounter = 0; protocounter < proto.length; protocounter++)
if (line.contains(proto[protocounter])) {
try {
git checkout master
git pull
if test -z "`git tag -l last-build`" -o -n "`git diff last-build HEAD`"; then
mvn --batch-mode release:prepare release:perform
git tag -f last-build
else
echo "no changes since last build, skipping release"
fi
/**
* @noinspection ConfusingMainMethod
*/
public static int main( String[] args, ClassWorld classWorld )
{
// ----------------------------------------------------------------------
// Setup the command line parser
// ----------------------------------------------------------------------
CLIManager cliManager = new CLIManager();
+ Error stacktraces are turned on.
Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
Java version: 1.6.0_15
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6" arch: "x86_64" Family: "mac"
[DEBUG] Building Maven user-level plugin registry from: '/Users/dholst/.m2/plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from: '/usr/local/maven/conf/plugin-registry.xml'
[INFO] Scanning for projects...
[DEBUG] cuke4duke-maven-plugin: resolved to version 0.1.2 from local repository